Skip to content

Address the six Phase 7.3b WP3 review findings - #55

Merged
perNyfelt merged 20 commits into
mainfrom
review-wp3-findings
Oct 19, 2026
Merged

perNyfelt merged 20 commits into
mainfrom
review-wp3-findings

Conversation

@perNyfelt

Copy link
Copy Markdown
Member

Resolves all six findings from the WP3 code review (all low severity), one commit per finding:

  1. Neutral sentinel lookup (1b8b142) — Qwen3VlPromptTokens.resolve now resolves the four Qwen3-VL sentinels through a new neutral HfTokenizer.tokenId(String) (plain name-to-ID vocabulary lookup, no EOS/special-token role semantics) instead of eosTokenId. New focused tokenizer test.
  2. Config without a video token (a36361a) — resolve now skips the video sentinel vocabulary lookup when the config declares video_token_id = -1 (the record's "no video token" convention), instead of always failing. Test covers both a fixture with the video added token removed and the full fixture.
  3. ropePositionAt contract tightened (f817113) — the method now rejects cachePosition < expandedLength(), matching what its Javadoc already promised; the old negative-result check is provably unreachable and was dropped. Affected tests now assert the rejection.
  4. Golden tests assert coverage (109abb5) — goldenExpansionsAndPositionsMatchThePinnedReference and singleImageCasesReproduceTheWp1ProbeNumbers now assert they exercised exactly 16 and 2 pinned case variants respectively, so an empty or key-renamed golden fails loudly.
  5. Complete video wrapper error (feab8a4) — a START VIDEO END wrapper now reports the "video is not supported" error (via a shared videoError helper, all other messages byte-for-byte unchanged) instead of the less helpful malformed-wrapper message. New test.
  6. Multi-frame rope path noted (95f41e3) — rederive_rope_all in the WP3 Python tool now handles t > 1 faithfully to the pinned 4.57.6 reference (T = base + frame, H/W restart per frame); the pinned WP3 golden is t = 1 only, so the t > 1 path is verified by logic against get_rope_index (exact match on synthetic t = 2/3/5 grids), now noted in the script and findings §6.8.

Verification (local, macOS 26 / Apple Silicon):

  • :jmlx-tokenizer:check green — 206 tests, 0 failures (includes the new tokenId test).
  • :jmlx-models:check green — 372 ordinary + 31 float32Golden + thread probe tests, 0 failures, 0 skipped (native suites ran; CI-execution assertion passed).
  • verifyHfReferenceGoldens green; the WP3 golden re-derives byte-identically under the pinned venv after the t > 1 extension (no golden or provenance changes in this PR).
  • git diff --check clean; spotless/checkstyle green on both touched modules.

No behavior change to the accepted WP3 token contract or the pinned artifact; no native pins, bindings, or fixture changes.

perNyfelt and others added 20 commits October 19, 2026 15:18
The method's Javadoc promised that decoding before prefill finishes has
no valid coordinate, but it only rejected a negative result, so a mid-prompt
cache position returned a meaningless coordinate. Prefill is the only
consumer of per-token prompt coordinates (no production call site passes a
mid-prompt position), so tighten the contract: reject
cachePosition < expandedLength() and drop the now-unreachable negative-result
check (verifyDelta plus the non-negative axes make the result provably
positive once cachePosition >= expandedLength). Update the three affected
test assertions to express the chosen contract.
rederive_rope_all now honors the frame count of the reference get_rope_index
image path: T = base + frame index while H/W restart per frame, and the
cursor advances past the whole t * lh * lw run (modular_qwen3_vl.py:929-944).
The t = 1 output is unchanged. Note in the script and in the phase7-3b
findings (section 6.8) that the pinned WP3 golden is t = 1 only, so the
t > 1 path is verified by logic against the reference, not by golden
coverage. Verified: golden re-derives byte-identically under the pinned
venv, and the extended re-derivation matches Qwen3VLModel.get_rope_index
exactly on synthetic t = 2, 3 and 5 frame grids plus a t = 1 regression.
Add the opt-in qwen3vl_rope_multiframe_check.py, which compares
qwen3vl_wp3_prompt.rederive_rope_all against the pinned 4.57.6
Qwen3VLModel.get_rope_index on synthetic multi-frame image grids
(t = 1, 2, 3 and 5) plus a two-image prompt with a text run between
the images, requiring exact equality of all three position axes and
the mrope delta. It runs under the pinned venv, is never Gradle-
invoked and writes no golden, so nothing changes in goldens/ or
provenance.json; point the findings section 6.8 bullet at it.
@perNyfelt
perNyfelt merged commit bbd14f9 into main Oct 19, 2026
3 checks passed
@perNyfelt
perNyfelt deleted the review-wp3-findings branch October 19, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant