Skip to content

research: Qwen packed DeltaNet trace CPU reference, one head, layer 0 (#240) - #247

Draft
wakesync wants to merge 7 commits into
mainfrom
research/1129-qwen-packed-trace-ref-240
Draft

wakesync wants to merge 7 commits into
mainfrom
research/1129-qwen-packed-trace-ref-240

Conversation

@wakesync

@wakesync wakesync commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Part of #240

Draft. A CPU reference of the packed DeltaNet trace for one head (layer 0, V head 0, real stock weights, the first 4 tokens of the fixture prompt from sequence start, PR #68 integer head at F = 12), counted against DESIGN 7.3 / count_m3.py (85,861.33 limbs per V head per token, 95,057,841 entries per token). Count and layout only. No proof.

Verdict: PASS on both registered criteria. Measured, unreplicated.

  • Count: 88,703.33 limbs per V head per token. Ratio to the design: 1.0331 (bar 0.9 to 1.1). The design's own arrays come to 85,845.33. Their widths match the design by construction, so the check there is whether the values fit. The extra 3.3% is 2,816 limbs of floor remainders the design leaves out (everything except S's remainder) plus 26 more scalar limbs.
  • Classes: every limb is in its class and every remainder is in its exact class. Every value recomposes exactly, and S', o, y equal the harness at all 4 tokens. The 5 runs are identical.
  • Full model, counted, not built: put the built head into count_m3's formula (overhead 1.27 and dense parts unchanged) and the figure is 97.8M entries per token instead of 95.1M.

Finding: the design gives s = SiLU(z) 2 limbs, which do not hold the pinned SiLU table's image (32,741 > 32,639). s stays in class on this input (max 20,264). It goes out of class on the synthetic debug input. This was recorded in amendment A1 before the registered run.

Files: experiments/20261129-240-qwen-packed-trace-ref/ (PREREG first and alone, RESULTS, ENV, runs), research/operators/qwen_packed_ref/ (new, enforces nothing, listed under excluded in the inventory as qwen_m3 is). No existing file under blocks/, prover/, verifier/ or research/operators/ is changed.

Deviation: PR #231's data has no embedding rows and no input norm. I fetched 51,200 bytes (4 embedding rows and the layer-0 input norm) and checked each against its SHA-256 in the merged manifests. The issue said "no other fetch".

Where the issue text was off (details in RESULTS "Findings" 3): FIXTURE is defined in PR #88's q1_forward.py. The M2 reference it names (reference_m2.py) is synthetic only, so the real-weight head comes from PR #68's real_head.py. The issue's 95,057,841 and 88% are what main's count_m3 produces (checked).

NOT established: any proof, CUDA, relation or the 1.27 factor; other inputs, heads, layers or windows; the M3 arithmetic (the arrays hold M2 harness values, and s, t, y are formed here); the low-rank form; the chunk handoff; accuracy; replication.

Proposed claim: none public. The results.yaml row is qwen-packed-trace-ref-240. Must merge with a merge commit because it adds results.yaml metrics.

Conflicts: research/results.yaml, README.md, CLAIMS.md. results.yaml is main's file plus this PR's own entry (qwen-packed-trace-ref-240), unchanged and appended at the end. README/CLAIMS take main's side here and are regenerated in the following commit after the merge makes the metric commits available in branch history; README stamp is main's verbatim.
…9d2b

scripts/update-results.py after the merge commit (77 results); stamp line kept as main's verbatim. Adds this PR's row for qwen-packed-trace-ref-240 to the README block and CLAIMS.md on top of main's; no other change.
@wakesync

Copy link
Copy Markdown
Owner Author

Main sync: merged main fef9d2b800b49a2d3eefb45dda82c58474cc25d4 into this branch with a merge commit (no rebase, no force-push). New head 72992e8b84940082461d8868b31c4f204b0f5c65 (merge 06177f73, then a regeneration commit). Conflicts were only in research/results.yaml, README.md and CLAIMS.md; research/coverage/inventory.yaml merged cleanly.

Proofs: research/results.yaml minus this PR's entry qwen-packed-trace-ref-240 equals main's file byte for byte (sha256 05338b46...1fa0 on both); that entry is byte-identical to the previous head 2341b411; 77 ids, all unique, this PR's last. README/CLAIMS were regenerated with scripts/update-results.py (stamp line kept as main's) and differ from main by this PR's row only. All 12 files in experiments/20261129-240-qwen-packed-trace-ref/ and the 5 other non-generated paths this PR changes are byte-identical to 2341b411; the other 3,824 experiments/ paths are byte-identical to main. update-results.py --check, check-claims.py, check_inventory.py and the host-path guard all pass on the merged tree.

@wakesync

Copy link
Copy Markdown
Owner Author

REQUEST CHANGES at 72992e8

class A, Opus review, same model family as the author, second family not available; this verdict does not by itself allow a merge

The code does what it says. I reran it and recomputed it myself, and the numbers agree. What needs changing is the wording, on two points. First, the count of 88,703.33 and the ratio of 1.0331 are arithmetic on limb widths written into the PREREG. They do not depend on the values. Criterion 1 could not have failed on any input. Second, the s finding also applies to SiLU q and SiLU k.

What I checked myself

  • History (check 1). 838c388 holds PREREG.md alone (02:48). A1 (3b3a2e3, 02:56:48) only appends 2 lines to the Amendments section. The bar 0.9 to 1.1 and both criteria are word for word in the first commit, and A1 changes no width, class or bar. The registered run starts at 02:57:01 and its source_sha256 ea4d0b5c is the committed packed_ref.py. The timeline has 7 commit events and no force-push. The run files and code are unchanged from df33b06 to the head.
  • Reproduce (check 3). I ran prepare.py in place: every SHA-256 matches the merged manifests, and inputs.json is byte-identical. I reran controls, debug and real into a private directory. Each has 0 field differences from the committed file once utc_start is ignored (my own walker, checked against a known-different pair). compare_runs.py over the 5 committed runs plus my rerun gives all identical.
  • Independent recomputation (check 4). This does not import the PR's scripts, only the merged real_head.py primitives and my own Python-integer limbs. Class edges: 2 limbs -32,896 .. 32,639, 3 limbs -8,421,504 .. 8,355,711. SiLU table v1 row 4,095 (input 7.996) gives 32,741, and rows 4,089 to 4,095 (7 rows, inputs 7.97 and up) are above 32,639. The design total from its own table is 85,861.33, or 85,845.33 without the flat 16. The PREREG's B and C widths alone, with no values, give 88,703.33 (B 42, C 2,816). I recomputed 11 arrays from values: S', rS, conv out v, v, s, M, rM, SiLU q, SiLU k, the k-norm remainder and the delta remainder. Count, min, max, limbs needed and out-of-class count agree with the PR's JSON, with one cosmetic exception (nonblocking 1).
  • Power (check 5), on copies of the real trace. s = 32,640 is caught and 32,639 passes. A t remainder of 4,096 or -1 is caught. A k-norm remainder of 2s is caught. S' = 8,355,712 is caught. The synthetic debug rerun gives s out of class on 16 of 512 values, max 48,986, as stated.
  • Hygiene (check 7). update-results.py --check passes (77 results, 1,222 metrics). check-claims.py, check_inventory.py and check-no-host-paths.sh pass. The scrub gives total_matches=0 on all 20 changed files, the 7 commit messages and the PR body. pr: is 247. Metric values equal runs/real-head0-T4.json. results.yaml is main's file plus this one row appended. README and CLAIMS each add exactly one row.
  • What is in the repo (check 8). inputs.json holds hashes, shapes and byte ranges only. The run files hold counts and per-array min and max of integer intermediates. No weight or embedding values are committed.
  • Sync (check 9). main..head has exactly the 20 PR paths, so every other experiments/ path equals main fef9d2b. The experiment directory, the operator directory and the inventory are identical to 2341b41.
  • Main (check 11). Main is still fef9d2b, so no merge-tree was needed.

Layout against the design (worries a, d)

Every width is a constant in LAYOUT (packed_ref.py lines 73 to 101). No width is derived from values. The values only decide the class checks and min_limbs_needed.

array design reference where the reference width comes from limbs per V head per token
S' 3 3 copied from the DESIGN 7.3 / count_m3 table 49,152
S' remainder 2 2 copied 32,768
conv out v, v, M, delta, o 3 each 3 each copied 384 each
w, s 2 each 2 each copied 256 each
t 3 3 copied 384
y 4 4 copied 512
conv out q, k (/3) 3 each 3 each copied 128 each
SiLU q, SiLU k, q^, k^ (/3) 2 each 2 each copied 85.33 each
scalars (a, beta, 3 norms) flat 16 42 the PREREG B list, set by the lane 42
remainders M, w (2^24) not listed 4 each PREREG C, the width of [0, 2^24) in balanced signed bytes 512 each
remainders delta, o, conv v, t, y, conv q, k not listed 2 each PREREG C, [0, 2^12) or [0, 2^8) 256 each, q/k 85.33
L2 remainders q, k (/3) not listed 5, 3 PREREG C 213.33, 128

All of 88,703.33 is arithmetic on these constants. The synthetic input gives the same 88,703.33. The measurement is criterion 2 only: these real values fit these widths.

On d: each floor does need its remainder checked against its exact class (DESIGN 5.0, 5.1, 5.3, 5.4). count_m3's packed count lists only S's remainder, and its "not committed (a lookup key)" variant is only for S. The design could argue that the other remainders are lookup keys inside the 1.27 factor, which is a Maverick ratio. RESULTS finding 2 says this is a design choice, and that is fair. The 2,816 is a lower count for committed remainders. It is not proof that the design is short.

Must-fix

  1. RESULTS.md lines 5, 9 and 26, the results.yaml summary and the notes on packedref_limbs_per_v_head_per_token and packedref_ratio_to_design (both n: 5), the README and CLAIMS row, the PR body and issue comment 7249860200. Say that 88,703.33 and 1.0331 follow from the registered widths alone: the same on the synthetic input, computable before any run, so criterion 1 could not fail. Say that the only measurement is criterion 2. Today RESULTS says "by construction" only for the 85,845.33 part, and the metric note calls the total "Measured (a layout count)". Also say that 5 identical runs show determinism, not replication: n should be 1, or the note should say so. Also say on each surface that 97.8M is not a memory or fit result. This is settled when each surface carries those sentences.
  2. RESULTS.md line 54 (finding 1), the PR body, the results.yaml summary and the issue comment. SiLU q and SiLU k also have 2 limbs from the same table (packed_ref.py lines 87 and 88), so the same 32,741 > 32,639 defect applies to them. Give the cost for all three: +213.33 limbs per V head per token (+0.25%), about +0.21M entries per token at the design's factor. That replaces "+128, +0.15%", which covers s only. Also say plainly that the criterion 2 PASS for s, SiLU q and SiLU k holds because this input stayed below 32,639 (s max 20,264), not because the design width holds the table.

Nonblocking

  1. packed_ref.py line 210 starts lo_v and hi_v at 0. So min_value is never above 0 and max_value never below 0. In the RESULTS range table, the "0 .." minimum for Rc and the L2 remainder of q is an artefact. The k-norm remainder's true minimum is 26, and the file says 0. min_limbs_needed is only made more conservative.
  2. On the registered input, conv out v reaches 122,142 (29.8 at 2^12), outside table v1's domain [-8, 8). An M3 table SiLU would not produce these v values. "Arrays hold M2 harness values" covers this, but one sentence would help.
  3. The arrays a prover would also commit are not laid out: lookup index cells and index remainders (DESIGN 5.2) and the 36-bit remainder of the M3 q form. So 88,703.33 is not an upper bound on what a prover commits.
  4. An earlier debug run is not disclosed: lane data debug-try1.json, 02:54:28, older code sha 07bd5059. It gives the same numbers and differs only in two array names. It is synthetic and does not touch the registered run, but the PREREG describes one debug run.
  5. The extra fetch of 51,200 bytes: PREREG "Input" names these tensors in the first commit, before any fetch, but calls it a deviation from the issue only in RESULTS. Each byte is SHA-checked against merged manifests (I reran this). Acceptable.
  6. Worry h: the excluded entry follows the inventory's own rule (lines 1001 and 1002) and matches qwen_m3. Its reason says no more than the README.

Main sync needed: no (main fef9d2b)
CI (check-runs API at 72992e8): guard success, claims success.
Skipped checks: none skipped outright. Check 6 covers the surfaces listed in must-fix 1 and 2, and I did not reread the generated CLAIMS row word by word apart from its diff.
A second reviewer should look first at whether the floor remainders (d) belong inside the 1.27 factor, and at must-fix 1.

For the person deciding on a waiver
A merge would put on main a CPU script, a run and a results row. It shows that one honest head (layer 0, V head 0, 4 tokens, M2 harness values with s, t, y formed by the lane) fits the design's limb widths, and that the design's 2-limb SiLU width cannot hold the table's top rows. It would NOT establish that the design's count is right to 3%. That ratio is arithmetic on widths chosen at registration, with no measurement in it. It also establishes no proof, relation, 1.27 factor, memory or fit, and no other input, head or layer. I am least sure about worry d: whether the non-S remainders are really missing from the design, or are meant to live in the 1.27 factor as lookup keys.

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