diff --git a/CLAIMS.md b/CLAIMS.md index f961e01c..75170a76 100644 --- a/CLAIMS.md +++ b/CLAIMS.md @@ -100,3 +100,4 @@ tracked file, which both scripts resolve (they check that it exists, not what it | `sink-denominator` | One integer attention denominator with a sink logit, on synthetic DeepSeek-style (constant sink) and Inkling-style (per-query sink) profiles: FAIL at a 1,024-key near-underflow bank (issue #263): FAIL, as registered and predicted by hand in the PREREG before any code. Synthetic profiles only. Rule: Q8 logits, maximum over legal keys and the sink, exp table roundHalfUp(65536 exp(-d/256)) with 16 fractional bits (scaled by 2^16), sink weight once in the denominator only, ties-to-even Q12 output, signed 64-bit accumulators. Against a 100-digit decimal oracle (direct weighted mean with an extra zero-valued slot; stable to 1.1e-49 against 50 digits) on 86 synthetic rows, 234 coordinates: 4 coordinates over the 1/1024 bar, all at the 1,024-key bank, both profiles. First failing input: DS, 1,024 keys of value 1 at d = 3017 below a sink at 2048: every key weight rounds to 0, output 0, oracle 0.0077392, error 7.9 times the bar. The 128-key bank row stays under the bar (0.000974), one synthetic row, not evidence that 128 keys stay under it in general. Hand anchors exact (1/2 for a sink tied with one key of value 1, 1/4, 683), denominator always positive, width check passed. Controls, as (all failed checks, failed checks not failed by the rule), DS/INK: dropping the sink (60, 58)/(50, 48); valuing the sink as a real key (65, 63)/(60, 58); a stale per-query sink, Inkling profile (40, 38); in the DS profile the stale sink equals the rule (2, 0) and is NOT counted. Qualifications: fixture F3 departs from its registered description (a key at -1 in row 1 of both profiles; Inkling row 1 sink -1500, not -2048), some handwritten operands and the MIX draw order were fixed in the code commit, not the first commit; the registered runs store the oracle at binary64 precision, and a post-review supplement holds the 50- and 100-digit values losslessly (its check: 234 coordinates, binary64-equal to all five runs). NOT established: any other table precision (none tried), real model logits or sinks, any proof or lookup, DeepSeek compression, native runtime equivalence, a full attention layer | negative, unreplicated | unreplicated | [experiments/20261202-263-sink-denominator/RESULTS.md](experiments/20261202-263-sink-denominator/RESULTS.md), [experiments/20261202-263-sink-denominator/PREREG.md](experiments/20261202-263-sink-denominator/PREREG.md), [experiments/20261202-263-sink-denominator/ENV.json](experiments/20261202-263-sink-denominator/ENV.json), [experiments/20261202-263-sink-denominator/runs/summary.json](experiments/20261202-263-sink-denominator/runs/summary.json), [experiments/20261202-263-sink-denominator/runs/post-review-oracle-precision.json](experiments/20261202-263-sink-denominator/runs/post-review-oracle-precision.json) | #268 | | `inkling-router-input` | Inkling layer-0 router input: two extra bits miss the membership limit on both frozen sets: FAIL against the registered conjunction on both sets. Top-eight disagreements exceed 1%: 26/2426 (24 allowed) and 2/199 (1 allowed). The reproduced baseline had 90 and 3; the candidate introduced 16 and 1 new differing sets, respectively. Both pass the prompt Frobenius bars (0.01/0.05) but miss within-prompt token-error limits. No range events. The first attempt stopped at its fixture before any candidate ran. The coordinator authorised one continuation outside the registration under a dated amendment correcting one expected fixture value (see RESULTS, Deviation). | negative, unreplicated (frozen candidate; five identical processes) | unreplicated | [experiments/20261202-262-inkling-router-input/RESULTS.md](experiments/20261202-262-inkling-router-input/RESULTS.md), [experiments/20261202-262-inkling-router-input/PREREG.md](experiments/20261202-262-inkling-router-input/PREREG.md), [experiments/20261202-262-inkling-router-input/ENV.json](experiments/20261202-262-inkling-router-input/ENV.json), [experiments/20261202-262-inkling-router-input/runs/inputs.json](experiments/20261202-262-inkling-router-input/runs/inputs.json), [experiments/20261202-262-inkling-router-input/runs/baseline.json](experiments/20261202-262-inkling-router-input/runs/baseline.json), [experiments/20261202-262-inkling-router-input/runs/fixtures.json](experiments/20261202-262-inkling-router-input/runs/fixtures.json), [experiments/20261202-262-inkling-router-input/runs/inputs-b.json](experiments/20261202-262-inkling-router-input/runs/inputs-b.json), [experiments/20261202-262-inkling-router-input/runs/fixtures-b.json](experiments/20261202-262-inkling-router-input/runs/fixtures-b.json), [experiments/20261202-262-inkling-router-input/runs/candidate-1.json](experiments/20261202-262-inkling-router-input/runs/candidate-1.json), [experiments/20261202-262-inkling-router-input/runs/candidate-2.json](experiments/20261202-262-inkling-router-input/runs/candidate-2.json), [experiments/20261202-262-inkling-router-input/runs/candidate-3.json](experiments/20261202-262-inkling-router-input/runs/candidate-3.json), [experiments/20261202-262-inkling-router-input/runs/candidate-4.json](experiments/20261202-262-inkling-router-input/runs/candidate-4.json), [experiments/20261202-262-inkling-router-input/runs/candidate-5.json](experiments/20261202-262-inkling-router-input/runs/candidate-5.json) | #267 | | `prefix-index-support` | In a local translation of pinned DeepSeek-V4.1-Flash and GLM-5.3-Flash source with synthetic scores, prefix length fixes sparse attention addresses up to a boundary (#270): In a local address translation, all completed DeepSeek ratio-2 latents and all GLM raw keys matched a score-free arrival ledger at every prefix tested. DeepSeek ratio 1 matched all completed latents only through 512 tokens. At 513, ascending scores omitted ID 0, descending omitted ID 512. The raw DeepSeek window did not change. Wrongly admitting an incomplete pair added latent 2; dropping the GLM tail lost raw key 4. No model logits, attention values, runtime match, proof or savings. | measured, unreplicated | unreplicated | [experiments/20261202-270-prefix-index-support/RESULTS.md](experiments/20261202-270-prefix-index-support/RESULTS.md), [experiments/20261202-270-prefix-index-support/PREREG.md](experiments/20261202-270-prefix-index-support/PREREG.md), [experiments/20261202-270-prefix-index-support/ENV.json](experiments/20261202-270-prefix-index-support/ENV.json), [experiments/20261202-270-prefix-index-support/runs/summary.json](experiments/20261202-270-prefix-index-support/runs/summary.json), [experiments/20261202-270-prefix-index-support/runs/replay-1.json](experiments/20261202-270-prefix-index-support/runs/replay-1.json) | #271 | +| `qwen-rounding-attribution` | Which rounding accounts for the seven Qwen gain-first differences? (#273): FAIL: 5 of 7 historical differences meet the gate-only bar (required 7). At token 314, channel 37, M2 and gate alone give -1435, gain alone and both give -1436; at token 14898, channel 51 either alone gives the wrong output. No joint-only case. Both endpoints reconstructed on all 512 positions. With both factors rounded, the output floor hides 462 coefficient differences. Fixture only; no replacement rule, proof or BF16 fidelity claim. | measured, unreplicated | unreplicated | [experiments/20261202-273-qwen-rounding-attribution/RESULTS.md](experiments/20261202-273-qwen-rounding-attribution/RESULTS.md), [experiments/20261202-273-qwen-rounding-attribution/PREREG.md](experiments/20261202-273-qwen-rounding-attribution/PREREG.md), [experiments/20261202-273-qwen-rounding-attribution/ENV.json](experiments/20261202-273-qwen-rounding-attribution/ENV.json), [experiments/20261202-273-qwen-rounding-attribution/runs/summary.json](experiments/20261202-273-qwen-rounding-attribution/runs/summary.json), [experiments/20261202-273-qwen-rounding-attribution/runs/run-1.json](experiments/20261202-273-qwen-rounding-attribution/runs/run-1.json) | #276 | diff --git a/README.md b/README.md index 8445327f..ff10c245 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ Every number below comes from a file on `main` (the one exception, a reviewer fi | One integer attention denominator with a sink logit, on synthetic DeepSeek-style (constant sink) and Inkling-style (per-query sink) profiles: FAIL at a 1,024-key near-underflow bank (issue #263) | negative, unreplicated | FAIL, as registered and predicted by hand in the PREREG before any code. Synthetic profiles only. Rule: Q8 logits, maximum over legal keys and the sink, exp table roundHalfUp(65536 exp(-d/256)) with 16 fractional bits (scaled by 2^16), sink weight once in the denominator only, ties-to-even Q12 output, signed 64-bit accumulators. Against a 100-digit decimal oracle (direct weighted mean with an extra zero-valued slot; stable to 1.1e-49 against 50 digits) on 86 synthetic rows, 234 coordinates: 4 coordinates over the 1/1024 bar, all at the 1,024-key bank, both profiles. First failing input: DS, 1,024 keys of value 1 at d = 3017 below a sink at 2048: every key weight rounds to 0, output 0, oracle 0.0077392, error 7.9 times the bar. The 128-key bank row stays under the bar (0.000974), one synthetic row, not evidence that 128 keys stay under it in general. Hand anchors exact (1/2 for a sink tied with one key of value 1, 1/4, 683), denominator always positive, width check passed. Controls, as (all failed checks, failed checks not failed by the rule), DS/INK: dropping the sink (60, 58)/(50, 48); valuing the sink as a real key (65, 63)/(60, 58); a stale per-query sink, Inkling profile (40, 38); in the DS profile the stale sink equals the rule (2, 0) and is NOT counted. Qualifications: fixture F3 departs from its registered description (a key at -1 in row 1 of both profiles; Inkling row 1 sink -1500, not -2048), some handwritten operands and the MIX draw order were fixed in the code commit, not the first commit; the registered runs store the oracle at binary64 precision, and a post-review supplement holds the 50- and 100-digit values losslessly (its check: 234 coordinates, binary64-equal to all five runs). NOT established: any other table precision (none tried), real model logits or sinks, any proof or lookup, DeepSeek compression, native runtime equivalence, a full attention layer | CPU only, Python 3.12.3 standard library plus mpmath 1.3.0 for the table only; pinned outside sources read as text only (DeepSeek-V4.1-Flash 314113f8 inference/model.py and kernel.py; transformers 6173a2f6 modeling_inkling2_loop.py), zero weight bytes; PREREG first and alone, amendment A1 with the code before run 1; debug only on a separate seed; five registered runs on cores 0-1 of a shared loaded host, identical record hashes (determinism, not replication) | [experiments/20261202-263-sink-denominator/RESULTS.md](experiments/20261202-263-sink-denominator/RESULTS.md) | | Inkling layer-0 router input: two extra bits miss the membership limit on both frozen sets | negative, unreplicated (frozen candidate; five identical processes) | FAIL against the registered conjunction on both sets. Top-eight disagreements exceed 1%: 26/2426 (24 allowed) and 2/199 (1 allowed). The reproduced baseline had 90 and 3; the candidate introduced 16 and 1 new differing sets, respectively. Both pass the prompt Frobenius bars (0.01/0.05) but miss within-prompt token-error limits. No range events. The first attempt stopped at its fixture before any candidate ran. The coordinator authorised one continuation outside the registration under a dated amendment correcting one expected fixture value (see RESULTS, Deviation). | CPU only, six cores, decoded-weight float64 reference. Both sets previously scored. The first attempt stopped at its fixture before any candidate ran. With baseline figures known, the coordinator authorised one continuation outside the registration under a dated amendment correcting one expected fixture value (see RESULTS, Deviation). Five fresh processes with identical set summaries test determinism, not generalization or independent replication. | [experiments/20261202-262-inkling-router-input/RESULTS.md](experiments/20261202-262-inkling-router-input/RESULTS.md) | | In a local translation of pinned DeepSeek-V4.1-Flash and GLM-5.3-Flash source with synthetic scores, prefix length fixes sparse attention addresses up to a boundary (#270) | measured, unreplicated | In a local address translation, all completed DeepSeek ratio-2 latents and all GLM raw keys matched a score-free arrival ledger at every prefix tested. DeepSeek ratio 1 matched all completed latents only through 512 tokens. At 513, ascending scores omitted ID 0, descending omitted ID 512. The raw DeepSeek window did not change. Wrongly admitting an incomplete pair added latent 2; dropping the GLM tail lost raw key 4. No model logits, attention values, runtime match, proof or savings. | One unpadded request starting at zero, prefixes 1 to 1024, long prefill and continuation, five finite synthetic score orders. Five identical deterministic replays, not replication. Address support only; no claim above 1024. | [experiments/20261202-270-prefix-index-support/RESULTS.md](experiments/20261202-270-prefix-index-support/RESULTS.md) | +| Which rounding accounts for the seven Qwen gain-first differences? (#273) | measured, unreplicated | FAIL: 5 of 7 historical differences meet the gate-only bar (required 7). At token 314, channel 37, M2 and gate alone give -1435, gain alone and both give -1436; at token 14898, channel 51 either alone gives the wrong output. No joint-only case. Both endpoints reconstructed on all 512 positions. With both factors rounded, the output floor hides 462 coefficient differences. Fixture only; no replacement rule, proof or BF16 fidelity claim. | Measured, unreplicated. Pinned stock layer 0, V/QK head 0, F=12, four tokens from sequence start. Five fresh serial CPU processes; deterministic repeats, not independent samples. One registered attribution table, no amended thresholds. | [experiments/20261202-273-qwen-rounding-attribution/RESULTS.md](experiments/20261202-273-qwen-rounding-attribution/RESULTS.md) | _Last regenerated from `research/results.yaml` on 2026-12-02 (UTC), against main `82d0cf81`._ diff --git a/experiments/20261202-273-qwen-rounding-attribution/ENV.json b/experiments/20261202-273-qwen-rounding-attribution/ENV.json new file mode 100644 index 00000000..97a89631 --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/ENV.json @@ -0,0 +1,37 @@ +{ + "utc_start": "2026-12-02T18:18:30.719715+00:00", + "commits": { + "main": "b8c087dbea19c15faf0d98090b71e93d658c23c1", + "prereg": "d6dabcdef0424f31b7ec24096d43fd225ce1f957", + "checkpoint_pin": "37561816e66b5b9153b1b64c10968c18c1e6f4a0" + }, + "model": { + "repository": "Qwen/Qwen3.8-27B", + "resolved_pin": "37561816e66b5b9153b1b64c10968c18c1e6f4a0", + "current_revision": "37561816e66b5b9153b1b64c10968c18c1e6f4a0" + }, + "seeds": [], + "toolchain": { + "python": "3.12.3", + "numpy": "2.4.3 required", + "OPENBLAS_NUM_THREADS": 1, + "OMP_NUM_THREADS": 1, + "cuda": null + }, + "hardware": { + "cpu": "AMD EPYC-Rome", + "host": "shared and loaded", + "affinity": "4-6", + "gpu": false + }, + "sha256": { + "experiments/20261202-264-qwen-gain-first/PREREG.md": "bdbaee722dfb7b21edad42b71d6724208ef89a29cda28096eec24df29c440a79", + "experiments/20261202-264-qwen-gain-first/RESULTS.md": "cacc170ec5c3d253dfbc5bbd919b1eb8b8649a0ae68629c8e4ee88457bc262ba", + "experiments/20261202-264-qwen-gain-first/runs/inputs.json": "190a0d5e8ee26b9a4a2d011f6c327d29396f0a313b19c4e8b2b86521f5ec664e", + "experiments/20261202-264-qwen-gain-first/runs/run-1.json": "7497d6e582e5fef83df288bc3fa89c10b3d9537ca96253750021c8052799b749", + "experiments/20261202-264-qwen-gain-first/compare.py": "f19edefaa588cf9175aed6a1d4ec0f842b92d696722d9aeee0e6907367e0465a", + "experiments/20261202-264-qwen-gain-first/fetch.py": "c8de9c9dd71b24deeb8b3b5d3836336ce529b4cfcf97ae59817fdd2ed2bee57a", + "experiments/20261109-8-qwen-real-weights/real_head.py": "aa49a5042adb1ac92b5a509f9f138b8e2a135eaf4cc02930367c78c707076b6f", + "research/operators/qwen_packed_ref/packed_ref.py": "1111904c7611f1d56dc390fd4f963624ff7f006d2e07c82f83cd7ebfe1a8904a" + } +} diff --git a/experiments/20261202-273-qwen-rounding-attribution/PREREG.md b/experiments/20261202-273-qwen-rounding-attribution/PREREG.md new file mode 100644 index 00000000..52c25c45 --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/PREREG.md @@ -0,0 +1,58 @@ +# PREREG: 20261202-273-qwen-rounding-attribution + +Issue #273, 2026-12-02 UTC. Base `b8c087dbea19c15faf0d98090b71e93d658c23c1`. + +## Hypothesis + +At each of the seven places where the stored and decoded gain-first output from #266 differs from M2, rounding just the gate gives that actual wrong output and rounding just the gain leaves M2's output unchanged. + +## Metric + +**Inputs.** Stock `Qwen/Qwen3.8-27B@37561816e66b5b9153b1b64c10968c18c1e6f4a0`. The complete byte operands, in file order within each range, are the named ranges and SHA-256s in #266 `runs/inputs.json` pinned below. Compare to the shard layouts in `20261109-8-qwen-real-weights/runs/stream-stock.json` and #247 `20261129-240-qwen-packed-trace-ref/runs/inputs.json`. The nine layer-0 BF16 tensors on shard 1 are contiguous from payload offsets 0 through 168847807 inclusive: input_layernorm.weight and linear_attn.{A_log, conv1d.weight, dt_bias, in_proj_a.weight, in_proj_b.weight, in_proj_qkv.weight, in_proj_z.weight, norm.weight}. Shard 3 row starts are 152 + token*10240 with 10240 bytes each. Thus 168847808 + 4*10240 = 168888768 bytes, 13 HTTP 206 responses (no whole shard, no M.i32, no retry). Require all ranges, lengths and digests before comparison. Only pinned bytes; no model code. One external copy, removed even on failure. + +**Frozen comparison.** Decode little-endian BF16 via the pinned #266 `inputs`: exact conversion to binary64, sequence-start zero history and state, tokens [760,6511,314,14898] in that order. `RH.inproj` uses zero-centred input norm, `x/sqrt(mean(x*x)+1e-6)*(1+norm_weight)` then qkv,z,a,b projections; `RH.heads` maps V head 0 to QK head 0, reverses conv tap order, takes the first 128 z channels and the 128 decoded norm gains. `RH.run_int(IntHead(12,12,H=1),...)` is the definition through state, o, and gated norm. Capture its actual gated_norm inputs and returns without changing its arithmetic, including `zi = RNE(4096*z)` and `cg`, `w`; save read-only copies of state,o,y,w,cg,zi,gain **before any diagnostic**. Re-execute the packed trace and #266 candidate separately. Require token alignment, shape, state,o,w, quantized gate input/decoded gain and actual gated-norm coefficients to agree across the executions; compare all anchored arrays by value where available. Hash int arrays little-endian int64 C-order, packed bytes raw limb-major int8. Check #266 run-1's per-token state, o, M2 y, decoded legacy y, decoded gain-first y and stored bytes hashes, legacy mismatch counts [24,2,25,18], maxima [10,3,10,9], gain-first counts [2,1,2,2], maxima [3,2,3,1], first (token,channel,M2,decoded)=(760,113,-3,0). Require no width/recomposition/floor failures. Select the seven sites only from these actual M2 and decoded outputs. + +**Four cells of one table.** At each real site from the frozen operands, in mathematical arithmetic let x=zi/4096, A=4096*x/(1+exp(-x)), B=sqrt(128)*gain, a=RNE(A), G=RNE(256*B), b=G/256. In order (A,B),(a,B),(A,b),(a,b), K=RNE(first*second); for every cell use the SAME frozen w: `(y,r)=divmod(K*w,4096)` in signed exact integers; require `0<=r<4096` and the floor identity. RNE = nearest integer, ties to even. Enclose exp and sqrt by adjacent decimals around a correctly rounded Decimal result at both 80 and 160 significant decimal digits; treat finite decimal endpoints and the exact binary gain as rationals, using interval operations for the remaining products and division. Require both endpoints of each interval to round identically at each precision, and both precisions to agree. Use exact arithmetic for all rational inputs, exact zero factors (and exp(0)=1) and ties of the discrete product. These are certificate precisions for the SAME real cells, not competing fixed-point rules. + +Anchor the unrounded cell's K and y against actual `cg` and y of M2 at all positions, discrete cell's K and y against #266 candidate and its decoded bytes, and a,G against actual `s_gate` and `gain_int`. Stop on first reconstruction failure with token/channel and stage; no attribution. If only a historical digest is available, localize to the first token/array rather than invent a channel. Do not equate mathematically equivalent parenthesizations in binary64: the M2 source actually forms `rint((((4096*gain)*sqrt(128))*(zi/4096))/(1+exp(-(zi/4096))))`. It does NOT compute A and B separately in binary64 and then multiply. The issue's endpoint check therefore matters. This qualification does not change the question. + +After all gates, score all 512 positions in fixture token order, then by channel 0..127. Also score the original seven separately. For outputs AND coefficients count gate-only departure, gain-only departure, both single factors departing ('either alone'), neither single factor departing (joint effect only if the combined endpoint actually differs). Distinguish exact match to the discrete endpoint from mere departure from the unrounded endpoint. Count unequal coefficients hidden by equal outputs, cell by cell vs M2. Give the four integer output labels and equality indicators per original difference; record the first counterexample to the hypothesis in fixture order. Publish no real factors, coefficients or w, only hashes, counts, indices and integer outputs. + +**Hand fixtures (synthetic).** In the same four-cell order, w=4096 makes every y=K and all remainders 0: + +* A=149/100,B=2: a=1,b=2; products 2.98,2,2.98,2 round to (3,2,3,2). Gate alone changes output and reaches the wrong value; gain alone stays at 3. +* A=256,B=1+3/2048: 256B=256+3/8 so G=256,b=1; a=256. Products 256+3/8,256+3/8,256,256 all round to 256. Neither departs, combined unchanged (not a joint effect). +* A=512,same B: a=512,b=1; 512B=512+3/4. Both unrounded-gain cells round to 513; the two rounded-gain cells equal 512. (513,513,512,512), gain alone reaches the wrong value. +* A=B=1,w=-1: a=b=1,K=1 in every cell. Each product = -1 = 4096*(-1)+4095: y=(-1,-1,-1,-1), neither departure, combined unchanged. The wrong answer y=0,r=-1 for this product MUST be rejected by the floor checker. +* Signed tie fixtures: A=1,3,-1,-3 in that order, B=1/2,w=4096. All A integral, G=128,b=1/2, hence every cell ties. Each tuple constant with K=y respectively 0,2,0,-2 (even member of {0,1},{1,2},{-1,0},{-2,-1}); remainder always 0, no departure. Coefficient departure categories on each hand fixture are the output categories, including the negative-w case where the common K is 1, not -1. + +## Acceptance threshold + +HOLDS (PASS) iff all gates pass and on **all seven** y(a,B)=actual decoded #266 y AND y(A,b)=actual M2 y. Otherwise FAIL on a completed, deterministic comparison: one intermediate wrong value, gain-only, either-alone or joint counterexample suffices. No rule selection or threshold change. The 512 denominator follows from layout, not evidence of accuracy. **What could make this fail, and on which observable that does not depend on the code under test?** A discarded gain fraction may cross an integer rounding boundary, or the two discarded fractions together may be needed to cross the final output floor. The targets are #266's historical M2/decoded output hashes and the separately frozen/literally decoded values checked against them, plus the hand answers above, not a comparison of our diagnostic against itself. + +## Kill criterion + +On input/provenance, signed-control (including an accepted wrong answer), baseline, endpoint, certificate, determinism, resource or other harness fault: STOP, preserve the first receipt, no attribution verdict, no self-retry. No rule for resumption. Hard wall deadline 20:39:58 UTC including gate waits. A fresh comparison has 120 seconds from admission. CPU only, up to three cores, tree RSS strictly below 4 GB, available disk at least 10000 MB, external footprint below 200 MB, payload cap below 175000000 bytes. A STOP is not rejection of the hypothesis. + +## Runs + +Five fresh serial processes, no RNG or seeds, warmup, exclusions, debug runs or precision tuning. Each freezes its M2 run, replays legacy and gain-first, checks the hand arithmetic and both real endpoints before classification. Identical hashes of the substantive records across repeats, and median, sample SD and min/max of counts across repeats. Five repeats test determinism, not replication. Identical arithmetic rejection does not terminate the repeats. + +## Prior art + +SHA-256 pins at the base above, under `experiments/20261202-264-qwen-gain-first/`: + +``` +bdbaee722dfb7b21edad42b71d6724208ef89a29cda28096eec24df29c440a79 PREREG.md +cacc170ec5c3d253dfbc5bbd919b1eb8b8649a0ae68629c8e4ee88457bc262ba RESULTS.md +190a0d5e8ee26b9a4a2d011f6c327d29396f0a313b19c4e8b2b86521f5ec664e runs/inputs.json +7497d6e582e5fef83df288bc3fa89c10b3d9537ca96253750021c8052799b749 runs/run-1.json +f19edefaa588cf9175aed6a1d4ec0f842b92d696722d9aeee0e6907367e0465a compare.py +c8de9c9dd71b24deeb8b3b5d3836336ce529b4cfcf97ae59817fdd2ed2bee57a fetch.py +``` + +Unchanged `experiments/20261109-8-qwen-real-weights/real_head.py`: `aa49a5042adb1ac92b5a509f9f138b8e2a135eaf4cc02930367c78c707076b6f`. Unchanged `research/operators/qwen_packed_ref/packed_ref.py`: `1111904c7611f1d56dc390fd4f963624ff7f006d2e07c82f83cd7ebfe1a8904a`. The projections and recurrence are shared upstream code, not independently replicated. The [#266 review](https://github.com/wakesync/flashprove/pull/266#issuecomment-7346259001) reported 43 equal coefficients out of 512, not a measurement in that PR's run files or an acceptance bar here. #245 (`20261129-237-qwen-wf-head-table/RESULTS.md`) puts its WF range check on a separate digit-table commitment and does not tie it to the old table or trace. #234 (`20261129-214-fold-constants/RESULTS.md`) derives CPU weight_sums norm/query folds, not this gated norm coefficient; CUDA admission unchanged. Neither provides an input or a proof for this experiment. + +This step is not a new coefficient or lookup rule, proof, range or commitment check, BF16 fidelity test, M3 handoff, GPU result or generalization to any other sequence, head, layer or checkpoint. + +## Amendments diff --git a/experiments/20261202-273-qwen-rounding-attribution/README.md b/experiments/20261202-273-qwen-rounding-attribution/README.md new file mode 100644 index 00000000..757cd055 --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/README.md @@ -0,0 +1,23 @@ +# Which rounding changes the output? + +[Results](RESULTS.md) and [registration](PREREG.md). The comparison reconstructs both historical coefficient/output endpoints before it assigns a cause to any output difference. It proves nothing cryptographically: there is no verifier. The CPU runner checks hashes and recomputes the signed-byte decode, integer floors and interval-certified rounding decisions. Its M2 and packed paths share upstream projection code. It does not test another head or BF16 accuracy. + +## Reproduction + +Use a full checkout at this PR head, Python 3.12.3, NumPy 2.4.3, standard library; no model package. From the repository root, choose fresh external `CACHE` and `OUT` paths (`CACHE` must not exist, `OUT/runs` and `OUT/ENV.json` must not exist). Do not use the committed `runs/` as an output directory. Set single-threaded BLAS and OMP. Example Bash commands (the trap removes only the newly created cache): + +```bash +E=experiments/20261202-273-qwen-rounding-attribution +OUT=$(mktemp -d) +CACHE="$OUT/weights" +export OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 PYTHONDONTWRITEBYTECODE=1 +trap 'rm -rf -- "$CACHE"' EXIT +set -e +taskset -c 4-6 python3 "$E/prepare.py" "$CACHE" "$OUT/runs" +for i in 1 2 3 4 5; do + taskset -c 4-6 python3 "$E/measure.py" "$CACHE" "$OUT/runs/run-$i.json" +done +taskset -c 4-6 python3 "$E/summary.py" "$OUT/runs" +``` + +Allow the registered transfer only once; stop on first provenance or harness fault. `FAIL` with a completed fixture is a scientific outcome, not a harness fault. For the reported measurements each comparison went through the shared CPU job gate; it caps its own address space and runtime. Metadata queries select revision ids only; every weight URL names the pinned commit. `prepare.py` uses #266's range plan with a second check against #266's fetch receipt before the first byte. The repository receives hashes, aggregate counts and integer output labels only, not the weight data or real gate, gain, coefficient or normalized-channel values. diff --git a/experiments/20261202-273-qwen-rounding-attribution/RESULTS.md b/experiments/20261202-273-qwen-rounding-attribution/RESULTS.md new file mode 100644 index 00000000..48c05c9f --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/RESULTS.md @@ -0,0 +1,27 @@ +**FAIL: five of the seven differences fit the registered gate-only explanation; the bar was all seven.** The first counterexample is token 314, channel 37: M2 gives −1435, rounding the gate alone still gives −1435, and rounding the gain alone gives the actual wrong output, −1436. At token 14898, channel 51, either rounding alone gives the actual wrong output. Measured, unreplicated, on the stock layer-0, head-0 fixture only. [Seven sites, exact output labels and first counterexample](runs/run-1.json); [five-run summary](runs/summary.json); [registration](PREREG.md). + +### Registered items + +- **Input provenance: PASS.** [Fetch receipt](runs/inputs.json) records 13 verified ranges totaling 168,888,768 bytes. [Environment](ENV.json) records the resolved pin, current revision from refs metadata and source digests. Both revisions agreed. No weight file on the default branch was accessed. +- **Baseline: PASS.** [`historical_replay`](runs/run-1.json) matches #266's historical state, pre-norm, M2 output, decoded legacy output, stored gain-first bytes and decoded gain-first hashes at every token. Legacy counts `[24,2,25,18]`, maxima `[10,3,10,9]`; gain-first counts `[2,1,2,2]`, maxima `[3,2,3,1]`; first `(760,113,-3,0)`. These replay the same upstream projection and recurrence. They are not independent weight projections. +- **Hand checks: PASS.** [`controls`](runs/run-1.json) contains the gate-only, no-change and gain-only examples, negative floor, signed ties, and rejection of the truncated quotient with negative remainder. Synthetic control values are not real weights or intermediates. +- **Endpoint reconstruction: PASS.** At all 512 coordinates both precision enclosures decided the same integer factors and coefficients. The rounded factors equalled the trace inputs. Unrounded and doubly rounded coefficient/output pairs equalled respectively actual M2 and actual #266, including the latter's signed-byte decode. The comparison uses the same read-only M2 `w` throughout. [`table.all.positions` and `array_sha256`](runs/run-1.json) are emitted only after these gates pass ([measure.py](measure.py)). This reconciles the two groupings on this fixture, not as a binary64 identity. +- **Attribution: FAIL.** Rounding only the gate reaches the actual wrong output at six of the seven. Rounding only the gain preserves M2 at five, and reaches the actual wrong value at the other two. Five satisfy **both** conditions. No single-factor departure on the original seven landed at an intermediate output distinct from both endpoints. Source for this and the table: [`table.sites`, `table.seven`, `table.all`](runs/run-1.json). + +| Token | Channel | M2 | Gate rounded | Gain rounded | Both rounded (#266) | Which alone changes output? | Which alone changes coefficient? | +|---:|---:|---:|---:|---:|---:|---|---| +|760|113|−3|0|−3|0|gate|gate| +|760|118|−51|−50|−51|−50|gate|either| +|6511|113|−22|−20|−22|−20|gate|gate| +|314|37|−1435|−1435|−1436|−1436|gain|either| +|314|113|−6|−9|−6|−9|gate|gate| +|14898|51|−293|−294|−294|−294|either|either| +|14898|113|−64|−63|−64|−63|gate|gate| + +**All positions, including where both endpoints agree.** In [`table.all`](runs/run-1.json), the single-factor output departure counts are gate only 5, gain only 3, either alone 1, neither alone 503. Of the 503, none changes only when both factors round. For **coefficients**, the corresponding counts are 178, 34, 275, 25; of those 25, eight change only with both factors rounded. Among the original seven sites the corresponding coefficient counts are 4, 0, 3, 0. A changed coefficient need not change the final integer. With both factors rounded the coefficient matches M2 at just 43/512, but the output matches at 505/512: the final floor hides 462 coefficient differences. These are measurements from this lane. The [#266 reviewer's earlier 43/512](https://github.com/wakesync/flashprove/pull/266#issuecomment-7346259001) was a PR-comment observation, not a committed #266 measurement or an acceptance bar. + +**Determinism: PASS.** Five fresh processes returned identical substantive hashes. Satisfying sites per run: median 5/7, sample SD 0, min/max 5/5. Every other classification count is summarised with the same statistics in [summary.json](runs/summary.json), computed from [run 1](runs/run-1.json), [2](runs/run-2.json), [3](runs/run-3.json), [4](runs/run-4.json), [5](runs/run-5.json). No warmup, exclusions, debug runs, amendments, interruptions or retries. + +### NOT established + +No general cause across other inputs, no independent replication, no replacement coefficient rule, no exact M3 handoff, no model-output or BF16 fidelity claim, no commitment, range proof, verifier or GPU result. The seven sites were selected by replayed historical endpoint disagreement, not by whether a diagnostic predicted them. diff --git a/experiments/20261202-273-qwen-rounding-attribution/cells.py b/experiments/20261202-273-qwen-rounding-attribution/cells.py new file mode 100644 index 00000000..d3ebcdf7 --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/cells.py @@ -0,0 +1,73 @@ +"""One fixed four-cell diagnostic. No binary floating arithmetic on the factors.""" +from decimal import Decimal, localcontext, ROUND_HALF_EVEN +from fractions import Fraction as Q +from itertools import product + + +def point(x): + return Q(x), Q(x) + + +def enclose(d): + # Decimal.exp and Decimal.sqrt are correctly rounded in ROUND_HALF_EVEN. + return Q(d.next_minus()), Q(d.next_plus()) + + +def mul(x, y): + p = [a*b for a,b in product(x,y)] + return min(p), max(p) + + +def rne(x): + l,h = map(round,x) + if l != h: + raise ValueError('interval straddles decision') + return l + + +def factors(zi, gain, digits): + with localcontext() as ctx: + ctx.prec, ctx.rounding = digits, ROUND_HALF_EVEN + # zi is int64, denominator 4096 is dyadic; exact at both precisions. + t = -Decimal(zi)/4096 + e_lo,e_hi = enclose(t.exp()) if zi else point(1) + A = mul(point(zi), (1/(1+e_hi), 1/(1+e_lo))) + B = mul(enclose(Decimal(128).sqrt()), point(gain)) + return A,B + + +def valid_floor(product, y, r): + return product == 4096*y+r and 0 <= r < 4096 + + +def cells(A, B, w): + a, G = rne(A), rne(mul(B,point(256))) + b = point(Q(G,256)) + K = tuple(rne(mul(u,v)) for u,v in ((A,B),(point(a),B),(A,b),(point(a),b))) + yr = tuple(divmod(k*w,4096) for k in K) + if not all(valid_floor(k*w,y,r) for k,(y,r) in zip(K,yr,strict=True)): + raise ArithmeticError('invalid signed floor') + return (a,G), K, tuple(y for y,r in yr), tuple(r for y,r in yr) + + +CATEGORIES = ('neither','gate_only','gain_only','either_alone') + + +def category(v): + return CATEGORIES[int(v[1]!=v[0])+2*int(v[2]!=v[0])] + + +def controls(): + fixtures = [(Q(149,100),2,4096,(3,2,3,2),'gate_only'), + (256,1+Q(3,2048),4096,(256,)*4,'neither'), + (512,1+Q(3,2048),4096,(513,513,512,512),'gain_only'), + (1,1,-1,(-1,)*4,'neither')] + fixtures += [(A,Q(1,2),4096,(want,)*4,'neither') for A,want in [(1,0),(3,2),(-1,0),(-3,-2)]] + for A,B,w,expected,label in fixtures: + _,K,Y,R = cells(point(A),point(B),w) + ok = (Y==expected and K==((1,)*4 if w==-1 else expected) and + R==((4095 if w==-1 else 0),)*4 and category(Y)==category(K)==label) + yield dict(A=str(A), B=str(B), w=w, expected_y=expected, actual_K=K, actual_y=Y, + actual_remainders=R, output_category=category(Y), coefficient_category=category(K), ok=ok) + accepted = valid_floor(-1,0,-1) + yield dict(control='negative product truncated to zero', accepted=accepted, ok=not accepted) diff --git a/experiments/20261202-273-qwen-rounding-attribution/measure.py b/experiments/20261202-273-qwen-rounding-attribution/measure.py new file mode 100644 index 00000000..a146fa4b --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/measure.py @@ -0,0 +1,200 @@ +"""Fresh-process replay and attribution. Receipts contain no real factors or w.""" +import contextlib +import hashlib +import json +from pathlib import Path +import resource +import signal +import sys + +from prepare import OLD, HERE, pins, utc, save +from cells import cells, category, controls, factors, CATEGORIES + +TOKENS = [760,6511,314,14898] +ARGS = ('xq','xk','xv','ar','br','z','Wc','A','dtb','gain') +CELLS = ('A_B','a_B','A_b','a_b') + + +class Stop(Exception): + pass + + +def require(cond,msg): + if not cond: + raise Stop(msg) + + +def freeze(a): + b = a.copy() + b.flags.writeable = False + return b + + +@contextlib.contextmanager +def capture(fn): + """Observe actual calls/returns; never replace the norm or recompute its result.""" + seen = [] + def observer(frame,event,ret): + if frame.f_code is fn.__code__ and event=='return' and ret is not None: + y,w,extra = ret + seen.append({k:freeze(v) for k,v in dict(zi=frame.f_locals['z_int'][0], + gain=frame.f_locals['gain'], o=frame.f_locals['o'][0], y=y[0], w=w[0], cg=extra['cg'][0]).items()}) + prior = sys.getprofile() + sys.setprofile(observer) + try: + yield seen + finally: + sys.setprofile(prior) + + +def canonical_hash(obj): + return hashlib.sha256(json.dumps(obj,sort_keys=True,separators=(',',':')).encode()).hexdigest() + + +def same(x,y,label,ctx,np): + require(x.shape==y.shape,label+' shape') + bad = np.argwhere(x!=y) + if len(bad): + ctx['index'] = list(map(int,bad[0])) + raise Stop(label) + + +def replay(cache,rec,ctx,np,old): + hist = json.loads((OLD/'runs/run-1.json').read_text()) + require(old.WIDTH==4 and old.packed.F==12 and old.packed.TOKENS==TOKENS,'fixture layout') + inp = old.inputs(cache) + rh = old.RH + with capture(rh.IntHead.gated_norm) as norm: + frozen = [(freeze(S[0]),freeze(o[0]),freeze(y[0])) for S,o,y in + rh.run_int(rh.IntHead(12,12,H=1),*(inp[k] for k in ARGS),{})] + require(len(frozen)==len(norm)==4,'oracle token count') + with capture(rh.IntHead.gated_norm) as packed_norm: + trace,checks = old.packed.trace(inp) + # trace computes a run_int reference first, then its own token loop. + require(len(trace)==len(checks)==4 and len(packed_norm)==8,'packed token count') + data = [] + rec['historical_replay'] = [] + for t,tok in enumerate(TOKENS): + ctx.update(stage='historical replay',token=tok) + S,o,y = frozen[t] + vals = trace[t][0] + require(checks[t]['token']==t and hist['baseline'][t]['token']==hist['candidate'][t]['token']==tok,'token alignment') + require((S.shape,o.shape,y.shape)==((128,128),(128,),(128,)),'oracle shape') + same(S,vals['S'],'state',ctx,np) + same(o,vals['o'],'pre norm',ctx,np) + same(o,norm[t]['o'],'norm input',ctx,np) + same(y,norm[t]['y'],'norm return',ctx,np) + same(norm[t]['w'],vals['w'],'packed w',ctx,np) + for k,arr in norm[t].items(): + require(arr.shape==(128,),'norm shape '+k) + for i in (t,t+4): + same(arr,packed_norm[i][k],'norm trace '+k,ctx,np) + raw,hi = old.storage(vals['y']) + legacy = old.decode(raw) + same(legacy,vals['y'],'legacy storage',ctx,np) + require(not hi.any(),'legacy width') + c,p,q,r,raw,high = old.candidate(vals['s_gate'],inp['gain_int'],vals['w']) + actual = old.decode(raw) + require(old.valid(p,q,r,high,raw).all(),'gain-first decode/floor') + row = dict(token=tok,state_sha256=old.sha(S),pre_norm_sha256=old.sha(o),oracle_y_sha256=old.sha(y), + legacy_y_sha256=old.sha(legacy),decoded_y_sha256=old.sha(actual),stored_bytes_sha256=hashlib.sha256(raw).hexdigest(), + legacy_count=int(np.count_nonzero(legacy!=y)),legacy_max=int(np.abs(legacy-y).max()), + count=int(np.count_nonzero(actual!=y)),max_abs=int(np.abs(actual-y).max())) + rec['historical_replay'].append(row) + for k in ('state_sha256','pre_norm_sha256','oracle_y_sha256','legacy_y_sha256'): + require(row[k]==hist['baseline'][t][k],k) + for k in ('decoded_y_sha256','stored_bytes_sha256'): + require(row[k]==hist['candidate'][t][k],k) + require((row['legacy_count'],row['legacy_max'],row['count'],row['max_abs'])== + ([24,2,25,18][t],[10,3,10,9][t],[2,1,2,2][t],[3,2,3,1][t]),'historical counts and maxima') + data.append((norm[t],vals['s_gate'],inp['gain_int'],freeze(c),freeze(actual))) + witnessed = [(t,j,int(norm[t]['y'][j]),int(data[t][-1][j])) for t in range(4) for j in range(128) + if norm[t]['y'][j]!=data[t][-1][j]] + require(len(witnessed)==7 and witnessed[0]==(0,113,-3,0),'historical first witness') + rec['first_baseline_difference'] = [760,113,-3,0] + return data,{(t,j) for t,j,_,_ in witnessed} + + +def counts(rows): + out = {'positions':len(rows)} + for index,name in ((2,'coefficient'),(3,'output')): + arr = [row[index] for row in rows] + out[name] = dict(categories={c:sum(category(v)==c for v in arr) for c in CATEGORIES}, + joint_only=sum(category(v)=='neither' and v[0]!=v[3] for v in arr), + equal_to_M2={s:sum(v[i]==v[0] for v in arr) for i,s in enumerate(CELLS)}, + equal_to_gain_first={s:sum(v[i]==v[3] for v in arr) for i,s in enumerate(CELLS)}) + out['unequal_K_equal_y_vs_M2'] = {s:sum(k[i]!=k[0] and y[i]==y[0] for _,_,k,y in rows) for i,s in enumerate(CELLS)} + return out + + +def experiment(cache,rec,ctx): + pins() + sys.path.insert(0,str(OLD)) + import compare as old + import numpy as np + require(np.__version__=='2.4.3','numpy version') + data,targets = replay(cache,rec,ctx,np,old) + ctx.clear() + ctx['stage'] = 'signed controls' + rec['controls'] = [] + for result in controls(): + rec['controls'].append(result) + require(result['ok'],'hand arithmetic or false floor accepted') + rows = [] + for t,(oracle,s,G,c,actual_y) in enumerate(data): + for j in range(128): + ctx.update(stage='endpoint certification',token=TOKENS[t],channel=j) + all_digits = [cells(*factors(int(oracle['zi'][j]), float(oracle['gain'][j]), precision), + int(oracle['w'][j])) for precision in (80,160)] + require(all_digits[0]==all_digits[1],'cross-precision decision') + (a,g),K,Y,_ = all_digits[0] + for observed,target,label in ((a,s[j],'rounded gate'),(g,G[j],'rounded gain'),(K[0],oracle['cg'][j],'M2 K'), + (Y[0],oracle['y'][j],'M2 y'),(K[3],c[j],'gain-first K'),(Y[3],actual_y[j],'decoded gain-first y')): + require(observed==int(target),label) + rows.append((t,j,K,Y)) + ctx.clear() + ctx['stage'] = 'classification' + original = [row for row in rows if row[:2] in targets] + seven = [dict(token=TOKENS[t],channel=j,outputs=Y,output_category=category(Y),coefficient_category=category(K), + K_equal_M2=[v==K[0] for v in K],K_equal_gain_first=[v==K[3] for v in K], + gate_reaches_wrong=Y[1]==Y[3],gain_reaches_wrong=Y[2]==Y[3],gain_stays_M2=Y[2]==Y[0]) for t,j,K,Y in original] + counterexamples = [v for v in seven if not (v['gate_reaches_wrong'] and v['gain_stays_M2'])] + rec['table'] = dict(order=CELLS,all=counts(rows),seven=counts(original),sites=seven, + array_sha256={s:{key:old.sha([r[ix][i] for r in rows]) for ix,key in ((2,'K'),(3,'y'))} for i,s in enumerate(CELLS)}, + satisfying_sites=7-len(counterexamples),first_counterexample=next(iter(counterexamples),None)) + rec['fixture_outcome'] = 'FAIL' if counterexamples else 'PASS' + + +def main(cache,out): + rec = dict(utc_start=utc(), source_sha256={p.name:hashlib.sha256(p.read_bytes()).hexdigest() for p in (HERE/'measure.py',HERE/'cells.py',HERE/'prepare.py')}) + ctx = dict(stage='setup') + with out.open('x') as f: + try: + # This process does not fork. An address-space cap bounds its RSS as well. + resource.setrlimit(resource.RLIMIT_AS,(3750000000,3750000000)) + def timeout(signum,frame): + raise Stop('comparison wall limit') + signal.signal(signal.SIGALRM,timeout) + signal.alarm(120) + experiment(cache,rec,ctx) + payload = {k:v for k,v in rec.items() if k!='utc_start'} + rec['substantive_sha256'] = canonical_hash(payload) + if out.name!='run-1.json': + ref = json.loads(out.with_name('run-1.json').read_text()) + require(rec['substantive_sha256']==ref['substantive_sha256'],'determinism') + except BaseException as e: + rec.pop('table',None) + rec.pop('fixture_outcome',None) + rec.update(status='STOP', location=ctx, error_type=type(e).__name__) + if isinstance(e,Stop): + rec['reason']=str(e) + raise + finally: + signal.alarm(0) + json.dump(rec,f,indent=2,allow_nan=False) + f.write('\n') + print(rec['fixture_outcome'],rec['substantive_sha256']) + + +if __name__=='__main__': + main(*map(Path,sys.argv[1:])) diff --git a/experiments/20261202-273-qwen-rounding-attribution/prepare.py b/experiments/20261202-273-qwen-rounding-attribution/prepare.py new file mode 100644 index 00000000..d090095d --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/prepare.py @@ -0,0 +1,118 @@ +"""Check pins, record revision metadata, then fetch exactly the authorized ranges.""" +import datetime as dt +import hashlib +import json +import os +import subprocess +from pathlib import Path +import platform +import re +import shutil +import sys +from urllib.request import Request, urlopen + +HERE = Path(__file__).resolve().parent +OLD = HERE.parent / '20261202-264-qwen-gain-first' +BASE = 'b8c087dbea19c15faf0d98090b71e93d658c23c1' +REG = 'd6dabcdef0424f31b7ec24096d43fd225ce1f957' +REPO = 'Qwen/Qwen3.8-27B' +REV = '37561816e66b5b9153b1b64c10968c18c1e6f4a0' + + +def utc(): + return dt.datetime.now(dt.timezone.utc).isoformat() + + +def save(path, obj): + with path.open('x') as out: + json.dump(obj, out, indent=2, allow_nan=False) + out.write('\n') + + +def pins(): + text = (HERE / 'PREREG.md').read_text() + pairs = [(OLD / name, h) for h, name in re.findall(r'^([0-9a-f]{64}) (\S+)$', text, re.M)] + pairs += [(HERE.parents[1] / name, h) for name, h in re.findall(r'`((?:experiments|research)/[^`]+\.py)`: `([0-9a-f]{64})`', text)] + if len(pairs) != 8 or any(hashlib.sha256(p.read_bytes()).hexdigest() != h for p, h in pairs): + raise ValueError('registration source pin mismatch') + return {str(p.relative_to(HERE.parents[1])): h for p,h in pairs} + + +def disk_gate(stage, location): + report = subprocess.check_output(['df','-BM',location],text=True).splitlines()[-1].split()[3] + if state := os.getenv('PROGRESS_LOG'): + stamp = subprocess.check_output(['date','-u','+%Y-%m-%dT%H:%M:%SZ'],text=True).strip() + with open(state,'a') as f: + print(stamp, report, 'available before', stage, file=f) + if int(report[:-1]) < 10000: + raise ValueError('disk gate') + + +def prepare(cache, outdir): + if cache.exists() or cache.resolve().is_relative_to(HERE.parents[1]) or outdir.exists(): + raise ValueError('need fresh external cache and receipt directory') + outdir.mkdir(parents=True) + env = dict(utc_start=utc(), commits=dict(main=BASE, prereg=REG, checkpoint_pin=REV), + model=dict(repository=REPO), seeds=[], toolchain=dict(python=platform.python_version(), + numpy='2.4.3 required', OPENBLAS_NUM_THREADS=1, OMP_NUM_THREADS=1, cuda=None), + hardware=dict(cpu='AMD EPYC-Rome', host='shared and loaded', affinity='4-6', gpu=False)) + rec = dict(utc_start=utc(), payload_bytes_read=0, verified=[]) + try: + env['sha256'] = pins() + sys.path.insert(0, str(OLD)) + import fetch as prev + rec['stage'] = 'revision metadata' + api = f'https://huggingface.co/api/models/{REPO}' + # Read revision identifiers only. No file on the default branch is accessed. + disk_gate('revision query',cache.parent) + with urlopen(f'{api}/revision/{REV}', timeout=45) as r: + env['model']['resolved_pin'] = json.load(r)['sha'] + disk_gate('refs query',cache.parent) + with urlopen(f'{api}/refs', timeout=45) as r: + branches = json.load(r)['branches'] + env['model']['current_revision'] = next(b['targetCommit'] for b in branches if b['name'] == 'main') + if env['model']['resolved_pin'] != REV: + raise ValueError('wrong revision') + rec['stage'] = 'authorized range plan' + historical = json.loads((OLD / 'runs/inputs.json').read_text()) + ranges = prev.plan() + expected = [dict(file=n, content_range=f'bytes {lo}-{hi}/{size}', sha256=h) for n,_,lo,hi,size,h in ranges] + if expected != historical['verified'] or sum(hi-lo+1 for _,_,lo,hi,_,_ in ranges) != 168888768: + raise ValueError('range plan does not match historical receipt') + cache.mkdir(mode=0o700) + for (name, shard, lo, hi, size, h), row in zip(ranges, expected, strict=True): + rec['stage'] = name + disk_gate(name,cache) + req = Request(f'https://huggingface.co/{REPO}/resolve/{REV}/{shard}?range={lo}-{hi}', + headers={'Range':f'bytes={lo}-{hi}', 'Accept-Encoding':'identity'}) + with urlopen(req, timeout=90) as r: + rem = hi-lo+1 + if (r.status != 206 or r.headers.get('Content-Range') != row['content_range'] or + int(r.headers.get('Content-Length',rem)) != rem or r.headers.get('Content-Encoding','identity') != 'identity'): + raise ValueError('range response') + sha = hashlib.sha256() + with (cache/name).open('xb') as f: + while rem: + chunk = r.read(min(rem,2**20)) + if not chunk: + raise ValueError('short response') + sha.update(chunk) + f.write(chunk) + rem -= len(chunk) + rec['payload_bytes_read'] += len(chunk) + if r.read(1) or sha.hexdigest() != h: + raise ValueError('length or digest') + rec['verified'].append(row) + rec['status'] = 'PASS' + except BaseException as e: + rec.update(status='STOP', error_type=type(e).__name__, http_status=getattr(e,'code',None)) + if cache.exists(): + shutil.rmtree(cache) + raise + finally: + save(outdir/'inputs.json',rec) + save(outdir.parent/'ENV.json',env) + + +if __name__ == '__main__': + prepare(*map(Path,sys.argv[1:])) diff --git a/experiments/20261202-273-qwen-rounding-attribution/runs/inputs.json b/experiments/20261202-273-qwen-rounding-attribution/runs/inputs.json new file mode 100644 index 00000000..e3ba3901 --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/runs/inputs.json @@ -0,0 +1,73 @@ +{ + "utc_start": "2026-12-02T18:18:30.719966+00:00", + "payload_bytes_read": 168888768, + "verified": [ + { + "file": "model.language_model.layers.0.linear_attn.A_log.bin", + "content_range": "bytes 55640-55735/3966730552", + "sha256": "429d53cd15ec0ea1a2d638100c3bbdf8d53505e69110fb17ee09d055c1fdbd34" + }, + { + "file": "model.language_model.layers.0.linear_attn.conv1d.weight.bin", + "content_range": "bytes 55736-137655/3966730552", + "sha256": "803a2591c4f5e7b1c2a7bdbbad78bbd0b68acdd0deab9552933ee7c337489dad" + }, + { + "file": "model.language_model.layers.0.linear_attn.dt_bias.bin", + "content_range": "bytes 137656-137751/3966730552", + "sha256": "969ce6b2149d20f0c365373fd89613167e373905c15f0e1cf5af62adf52228de" + }, + { + "file": "model.language_model.layers.0.linear_attn.in_proj_a.weight.bin", + "content_range": "bytes 137752-629271/3966730552", + "sha256": "ff9e6d0a05fc85c2a61e5f73200d6778c84d76df3df2ce6c80e1e9a4c99c0ce1" + }, + { + "file": "model.language_model.layers.0.linear_attn.in_proj_b.weight.bin", + "content_range": "bytes 629272-1120791/3966730552", + "sha256": "9694f11c0393c563dcbc8c1ba120c2eaebc36b200d6d19bf8761034acde4ac33" + }, + { + "file": "model.language_model.layers.0.linear_attn.in_proj_qkv.weight.bin", + "content_range": "bytes 1120792-105978391/3966730552", + "sha256": "2417986b44e8f6cd23a1ae5230515a9d5d1ed074aaf573f2ee308c1d9d41c9e2" + }, + { + "file": "model.language_model.layers.0.linear_attn.in_proj_z.weight.bin", + "content_range": "bytes 105978392-168892951/3966730552", + "sha256": "2b98edf85caa94f5bf81b46865b24202d4fc80117c406a3a814f83adbda56b53" + }, + { + "file": "model.language_model.layers.0.linear_attn.norm.weight.bin", + "content_range": "bytes 168892952-168893207/3966730552", + "sha256": "70d11f294923a94aac97bedd27e596dbf496746c6b9e3b2b7c38798a0d2522cc" + }, + { + "file": "model.language_model.layers.0.input_layernorm.weight.bin", + "content_range": "bytes 45400-55639/3966730552", + "sha256": "853b5989bfb677b1761540ee97c09bbf8d90fd825c9ae6ca74ef5853cba3c075" + }, + { + "file": "embed_row_760.bin", + "content_range": "bytes 7782552-7792791/2542796952", + "sha256": "69f7c987fa3baa37a4e7586b5be51aa1e6b028d58e1c3a20a685da82364b716a" + }, + { + "file": "embed_row_6511.bin", + "content_range": "bytes 66672792-66683031/2542796952", + "sha256": "a0c791763798ec8b916f0a216e7961ffb251578188520bf6860d92335b004229" + }, + { + "file": "embed_row_314.bin", + "content_range": "bytes 3215512-3225751/2542796952", + "sha256": "78b25fa83df9bc46f3c34b4a636d075f89144e0705336fa204c508072ff2cd18" + }, + { + "file": "embed_row_14898.bin", + "content_range": "bytes 152555672-152565911/2542796952", + "sha256": "93c568d0a4882fb159024909cc1fd15ccc37e428b27b8d011cea25dd9084e161" + } + ], + "stage": "embed_row_14898.bin", + "status": "PASS" +} diff --git a/experiments/20261202-273-qwen-rounding-attribution/runs/run-1.json b/experiments/20261202-273-qwen-rounding-attribution/runs/run-1.json new file mode 100644 index 00000000..9e1ea6c5 --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/runs/run-1.json @@ -0,0 +1,680 @@ +{ + "utc_start": "2026-12-02T18:20:49.451261+00:00", + "source_sha256": { + "measure.py": "d1689ad9cdb28a7a384bfd314fd23731e87c5fc4f4d45dff7c3befacbd832b17", + "cells.py": "8870700251b47942c95c84d611fb75b1d6e9f78347201422fc6724eb6fd4dd6f", + "prepare.py": "d7e43aaa297415802c3efbbce0dc0c8bf3cb4069e18de208949c871a18325cb4" + }, + "historical_replay": [ + { + "token": 760, + "state_sha256": "c9cd6ef720c8144921a2aa9582b48eb7729f9a9a62929bfad814e403dd911198", + "pre_norm_sha256": "e9ad89bed5f036f272509c107bb1ddd20ebfd887906aa72a2ddeec9bad178d2f", + "oracle_y_sha256": "558dd17a1cd63049293c4f8d700a0171059c747c078ca1462821254e8a300592", + "legacy_y_sha256": "ab2b53fd5d310db228591a3b15f308d0f348651c1fdcf7cee8b0ec6a372a4c21", + "decoded_y_sha256": "142599ee5dfbd2a7f7dd24b50f949b7f47bd7c68651ec33d3b00522ec4e41086", + "stored_bytes_sha256": "e1372f60bcece49e959e0f83aa885a2612bee3ae97f29f1647b2e1317db6cb8c", + "legacy_count": 24, + "legacy_max": 10, + "count": 2, + "max_abs": 3 + }, + { + "token": 6511, + "state_sha256": "f06d311d32cb5ae793a5796abc87eddfd7de8b84a5d639ffa191407bdc44e2a5", + "pre_norm_sha256": "2ac38529eeb5fe4e6a826e8aed6c11897fb237550bfd1b0b53f97fc87b66c59b", + "oracle_y_sha256": "f9e8758dbf31fdc1c94daf13b19385c97bf6936634099d6bc0517fba08e21727", + "legacy_y_sha256": "862bb6c3369892b6ca4ab654c4035576d4870e759455080408976a68afae1637", + "decoded_y_sha256": "c2410076fb62751f407e6ba2dccd7a3fb38aa94ee9735441147add79bdf4fb86", + "stored_bytes_sha256": "61ec6d33adaa0df6ade9369a7850812b909009628a470f48152d672978a7d847", + "legacy_count": 2, + "legacy_max": 3, + "count": 1, + "max_abs": 2 + }, + { + "token": 314, + "state_sha256": "a2474e227e1b82a8e85293d5a0698ebf1c004a95a4ce5186f6386cb7132bf190", + "pre_norm_sha256": "8000cc038660cfff936ebcd5a027d21b816504e42aa07076a3b862250b1dfa8a", + "oracle_y_sha256": "ddd69fc7b1657944a2e6ccdbfbcb50a8c1c0c127d1495ca14a765b858f39fcff", + "legacy_y_sha256": "00c6322def4a3e41ac58e260d3d860583768172ba5cbd44e94f9fc2b9d4ffd31", + "decoded_y_sha256": "9397b5ab6a1b4639fe3db05ab93b7a9bb5b0bf9e21994f184b7554fcb78f1acd", + "stored_bytes_sha256": "1168c9f42a0879e5ae084956f5cb001c2e74a4cce1250665a593fd2c5405a618", + "legacy_count": 25, + "legacy_max": 10, + "count": 2, + "max_abs": 3 + }, + { + "token": 14898, + "state_sha256": "2fc955ee0d45e4dc7f2534ffdef269650562bbdeac277d928e0ae9e1b0784cba", + "pre_norm_sha256": "02622126cfce37b97a05efe81a579cdb9f60b9554d0f8aa8de14316fc0c0b73e", + "oracle_y_sha256": "4e91ba653e77652c7a08e33b32ed6434d4bb037079b38849a1592de93cfcc1c8", + "legacy_y_sha256": "753e135b4b5317c91e8e9c04be075ca3bc0ddd900b43de42e24f3b48db869fa7", + "decoded_y_sha256": "8eaccf9c411efe5879ec8fb85e7413b953d7c3245cfcd314facee9a3ad262bad", + "stored_bytes_sha256": "a8bf18dae3135faa49bcf19e617531e8738f073e3c4a203f6b4073b44b4049c6", + "legacy_count": 18, + "legacy_max": 9, + "count": 2, + "max_abs": 1 + } + ], + "first_baseline_difference": [ + 760, + 113, + -3, + 0 + ], + "controls": [ + { + "A": "149/100", + "B": "2", + "w": 4096, + "expected_y": [ + 3, + 2, + 3, + 2 + ], + "actual_K": [ + 3, + 2, + 3, + 2 + ], + "actual_y": [ + 3, + 2, + 3, + 2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "ok": true + }, + { + "A": "256", + "B": "2051/2048", + "w": 4096, + "expected_y": [ + 256, + 256, + 256, + 256 + ], + "actual_K": [ + 256, + 256, + 256, + 256 + ], + "actual_y": [ + 256, + 256, + 256, + 256 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "512", + "B": "2051/2048", + "w": 4096, + "expected_y": [ + 513, + 513, + 512, + 512 + ], + "actual_K": [ + 513, + 513, + 512, + 512 + ], + "actual_y": [ + 513, + 513, + 512, + 512 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "gain_only", + "coefficient_category": "gain_only", + "ok": true + }, + { + "A": "1", + "B": "1", + "w": -1, + "expected_y": [ + -1, + -1, + -1, + -1 + ], + "actual_K": [ + 1, + 1, + 1, + 1 + ], + "actual_y": [ + -1, + -1, + -1, + -1 + ], + "actual_remainders": [ + 4095, + 4095, + 4095, + 4095 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "1", + "B": "1/2", + "w": 4096, + "expected_y": [ + 0, + 0, + 0, + 0 + ], + "actual_K": [ + 0, + 0, + 0, + 0 + ], + "actual_y": [ + 0, + 0, + 0, + 0 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "3", + "B": "1/2", + "w": 4096, + "expected_y": [ + 2, + 2, + 2, + 2 + ], + "actual_K": [ + 2, + 2, + 2, + 2 + ], + "actual_y": [ + 2, + 2, + 2, + 2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "-1", + "B": "1/2", + "w": 4096, + "expected_y": [ + 0, + 0, + 0, + 0 + ], + "actual_K": [ + 0, + 0, + 0, + 0 + ], + "actual_y": [ + 0, + 0, + 0, + 0 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "-3", + "B": "1/2", + "w": 4096, + "expected_y": [ + -2, + -2, + -2, + -2 + ], + "actual_K": [ + -2, + -2, + -2, + -2 + ], + "actual_y": [ + -2, + -2, + -2, + -2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "control": "negative product truncated to zero", + "accepted": false, + "ok": true + } + ], + "table": { + "order": [ + "A_B", + "a_B", + "A_b", + "a_b" + ], + "all": { + "positions": 512, + "coefficient": { + "categories": { + "neither": 25, + "gate_only": 178, + "gain_only": 34, + "either_alone": 275 + }, + "joint_only": 8, + "equal_to_M2": { + "A_B": 512, + "a_B": 59, + "A_b": 203, + "a_b": 43 + }, + "equal_to_gain_first": { + "A_B": 43, + "a_B": 208, + "A_b": 55, + "a_b": 512 + } + }, + "output": { + "categories": { + "neither": 503, + "gate_only": 5, + "gain_only": 3, + "either_alone": 1 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 512, + "a_B": 506, + "A_b": 508, + "a_b": 505 + }, + "equal_to_gain_first": { + "A_B": 505, + "a_B": 511, + "A_b": 505, + "a_b": 512 + } + }, + "unequal_K_equal_y_vs_M2": { + "A_B": 0, + "a_B": 447, + "A_b": 305, + "a_b": 462 + } + }, + "seven": { + "positions": 7, + "coefficient": { + "categories": { + "neither": 0, + "gate_only": 4, + "gain_only": 0, + "either_alone": 3 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 7, + "a_B": 0, + "A_b": 4, + "a_b": 0 + }, + "equal_to_gain_first": { + "A_B": 0, + "a_B": 5, + "A_b": 0, + "a_b": 7 + } + }, + "output": { + "categories": { + "neither": 0, + "gate_only": 5, + "gain_only": 1, + "either_alone": 1 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 7, + "a_B": 1, + "A_b": 5, + "a_b": 0 + }, + "equal_to_gain_first": { + "A_B": 0, + "a_B": 6, + "A_b": 2, + "a_b": 7 + } + }, + "unequal_K_equal_y_vs_M2": { + "A_B": 0, + "a_B": 1, + "A_b": 1, + "a_b": 0 + } + }, + "sites": [ + { + "token": 760, + "channel": 113, + "outputs": [ + -3, + 0, + -3, + 0 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 760, + "channel": 118, + "outputs": [ + -51, + -50, + -51, + -50 + ], + "output_category": "gate_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 6511, + "channel": 113, + "outputs": [ + -22, + -20, + -22, + -20 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 314, + "channel": 37, + "outputs": [ + -1435, + -1435, + -1436, + -1436 + ], + "output_category": "gain_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": false, + "gain_reaches_wrong": true, + "gain_stays_M2": false + }, + { + "token": 314, + "channel": 113, + "outputs": [ + -6, + -9, + -6, + -9 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 14898, + "channel": 51, + "outputs": [ + -293, + -294, + -294, + -294 + ], + "output_category": "either_alone", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": true, + "gain_stays_M2": false + }, + { + "token": 14898, + "channel": 113, + "outputs": [ + -64, + -63, + -64, + -63 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + } + ], + "array_sha256": { + "A_B": { + "K": "7c7fb293c7ff7a56c350131f439d0481bfa328db79e7a115084c1afd38baa250", + "y": "d581d535bd9ff96d20408edc02675f9b3b5eedd7287950d755d4fc82aff1c8a5" + }, + "a_B": { + "K": "7066d1550d3eaa8e79b1f49ae3bcaf8ef9be28886b921d5e8958f7e53ad94cb0", + "y": "ff7c31df020d03fbfd4fc3d5acd06b76ea73d1959d92a22ae5754a7643a70d8c" + }, + "A_b": { + "K": "738e3ee38695a3ff88351e13e3c7ccfa82502c4928c8363f593a428807fd2564", + "y": "0657aedd6d99f9c02d601869cf96fb9e1ac170f74036e18f6694a20b2a0ac278" + }, + "a_b": { + "K": "436bc9cfe2f38346aace7ee2b45b8f354f414ceaf9d99519015620bf307a8656", + "y": "2d8c5a1cc5044563de73e53139a19521eed145ef2c09855edaf075078b0d6ada" + } + }, + "satisfying_sites": 5, + "first_counterexample": { + "token": 314, + "channel": 37, + "outputs": [ + -1435, + -1435, + -1436, + -1436 + ], + "output_category": "gain_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": false, + "gain_reaches_wrong": true, + "gain_stays_M2": false + } + }, + "fixture_outcome": "FAIL", + "substantive_sha256": "51aa740e293b39bb220f3a28f116cdbf56e8fb5da3a198fe2bd4e15cd8f39a71" +} diff --git a/experiments/20261202-273-qwen-rounding-attribution/runs/run-2.json b/experiments/20261202-273-qwen-rounding-attribution/runs/run-2.json new file mode 100644 index 00000000..7e14dc73 --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/runs/run-2.json @@ -0,0 +1,680 @@ +{ + "utc_start": "2026-12-02T18:21:08.616315+00:00", + "source_sha256": { + "measure.py": "d1689ad9cdb28a7a384bfd314fd23731e87c5fc4f4d45dff7c3befacbd832b17", + "cells.py": "8870700251b47942c95c84d611fb75b1d6e9f78347201422fc6724eb6fd4dd6f", + "prepare.py": "d7e43aaa297415802c3efbbce0dc0c8bf3cb4069e18de208949c871a18325cb4" + }, + "historical_replay": [ + { + "token": 760, + "state_sha256": "c9cd6ef720c8144921a2aa9582b48eb7729f9a9a62929bfad814e403dd911198", + "pre_norm_sha256": "e9ad89bed5f036f272509c107bb1ddd20ebfd887906aa72a2ddeec9bad178d2f", + "oracle_y_sha256": "558dd17a1cd63049293c4f8d700a0171059c747c078ca1462821254e8a300592", + "legacy_y_sha256": "ab2b53fd5d310db228591a3b15f308d0f348651c1fdcf7cee8b0ec6a372a4c21", + "decoded_y_sha256": "142599ee5dfbd2a7f7dd24b50f949b7f47bd7c68651ec33d3b00522ec4e41086", + "stored_bytes_sha256": "e1372f60bcece49e959e0f83aa885a2612bee3ae97f29f1647b2e1317db6cb8c", + "legacy_count": 24, + "legacy_max": 10, + "count": 2, + "max_abs": 3 + }, + { + "token": 6511, + "state_sha256": "f06d311d32cb5ae793a5796abc87eddfd7de8b84a5d639ffa191407bdc44e2a5", + "pre_norm_sha256": "2ac38529eeb5fe4e6a826e8aed6c11897fb237550bfd1b0b53f97fc87b66c59b", + "oracle_y_sha256": "f9e8758dbf31fdc1c94daf13b19385c97bf6936634099d6bc0517fba08e21727", + "legacy_y_sha256": "862bb6c3369892b6ca4ab654c4035576d4870e759455080408976a68afae1637", + "decoded_y_sha256": "c2410076fb62751f407e6ba2dccd7a3fb38aa94ee9735441147add79bdf4fb86", + "stored_bytes_sha256": "61ec6d33adaa0df6ade9369a7850812b909009628a470f48152d672978a7d847", + "legacy_count": 2, + "legacy_max": 3, + "count": 1, + "max_abs": 2 + }, + { + "token": 314, + "state_sha256": "a2474e227e1b82a8e85293d5a0698ebf1c004a95a4ce5186f6386cb7132bf190", + "pre_norm_sha256": "8000cc038660cfff936ebcd5a027d21b816504e42aa07076a3b862250b1dfa8a", + "oracle_y_sha256": "ddd69fc7b1657944a2e6ccdbfbcb50a8c1c0c127d1495ca14a765b858f39fcff", + "legacy_y_sha256": "00c6322def4a3e41ac58e260d3d860583768172ba5cbd44e94f9fc2b9d4ffd31", + "decoded_y_sha256": "9397b5ab6a1b4639fe3db05ab93b7a9bb5b0bf9e21994f184b7554fcb78f1acd", + "stored_bytes_sha256": "1168c9f42a0879e5ae084956f5cb001c2e74a4cce1250665a593fd2c5405a618", + "legacy_count": 25, + "legacy_max": 10, + "count": 2, + "max_abs": 3 + }, + { + "token": 14898, + "state_sha256": "2fc955ee0d45e4dc7f2534ffdef269650562bbdeac277d928e0ae9e1b0784cba", + "pre_norm_sha256": "02622126cfce37b97a05efe81a579cdb9f60b9554d0f8aa8de14316fc0c0b73e", + "oracle_y_sha256": "4e91ba653e77652c7a08e33b32ed6434d4bb037079b38849a1592de93cfcc1c8", + "legacy_y_sha256": "753e135b4b5317c91e8e9c04be075ca3bc0ddd900b43de42e24f3b48db869fa7", + "decoded_y_sha256": "8eaccf9c411efe5879ec8fb85e7413b953d7c3245cfcd314facee9a3ad262bad", + "stored_bytes_sha256": "a8bf18dae3135faa49bcf19e617531e8738f073e3c4a203f6b4073b44b4049c6", + "legacy_count": 18, + "legacy_max": 9, + "count": 2, + "max_abs": 1 + } + ], + "first_baseline_difference": [ + 760, + 113, + -3, + 0 + ], + "controls": [ + { + "A": "149/100", + "B": "2", + "w": 4096, + "expected_y": [ + 3, + 2, + 3, + 2 + ], + "actual_K": [ + 3, + 2, + 3, + 2 + ], + "actual_y": [ + 3, + 2, + 3, + 2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "ok": true + }, + { + "A": "256", + "B": "2051/2048", + "w": 4096, + "expected_y": [ + 256, + 256, + 256, + 256 + ], + "actual_K": [ + 256, + 256, + 256, + 256 + ], + "actual_y": [ + 256, + 256, + 256, + 256 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "512", + "B": "2051/2048", + "w": 4096, + "expected_y": [ + 513, + 513, + 512, + 512 + ], + "actual_K": [ + 513, + 513, + 512, + 512 + ], + "actual_y": [ + 513, + 513, + 512, + 512 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "gain_only", + "coefficient_category": "gain_only", + "ok": true + }, + { + "A": "1", + "B": "1", + "w": -1, + "expected_y": [ + -1, + -1, + -1, + -1 + ], + "actual_K": [ + 1, + 1, + 1, + 1 + ], + "actual_y": [ + -1, + -1, + -1, + -1 + ], + "actual_remainders": [ + 4095, + 4095, + 4095, + 4095 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "1", + "B": "1/2", + "w": 4096, + "expected_y": [ + 0, + 0, + 0, + 0 + ], + "actual_K": [ + 0, + 0, + 0, + 0 + ], + "actual_y": [ + 0, + 0, + 0, + 0 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "3", + "B": "1/2", + "w": 4096, + "expected_y": [ + 2, + 2, + 2, + 2 + ], + "actual_K": [ + 2, + 2, + 2, + 2 + ], + "actual_y": [ + 2, + 2, + 2, + 2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "-1", + "B": "1/2", + "w": 4096, + "expected_y": [ + 0, + 0, + 0, + 0 + ], + "actual_K": [ + 0, + 0, + 0, + 0 + ], + "actual_y": [ + 0, + 0, + 0, + 0 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "-3", + "B": "1/2", + "w": 4096, + "expected_y": [ + -2, + -2, + -2, + -2 + ], + "actual_K": [ + -2, + -2, + -2, + -2 + ], + "actual_y": [ + -2, + -2, + -2, + -2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "control": "negative product truncated to zero", + "accepted": false, + "ok": true + } + ], + "table": { + "order": [ + "A_B", + "a_B", + "A_b", + "a_b" + ], + "all": { + "positions": 512, + "coefficient": { + "categories": { + "neither": 25, + "gate_only": 178, + "gain_only": 34, + "either_alone": 275 + }, + "joint_only": 8, + "equal_to_M2": { + "A_B": 512, + "a_B": 59, + "A_b": 203, + "a_b": 43 + }, + "equal_to_gain_first": { + "A_B": 43, + "a_B": 208, + "A_b": 55, + "a_b": 512 + } + }, + "output": { + "categories": { + "neither": 503, + "gate_only": 5, + "gain_only": 3, + "either_alone": 1 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 512, + "a_B": 506, + "A_b": 508, + "a_b": 505 + }, + "equal_to_gain_first": { + "A_B": 505, + "a_B": 511, + "A_b": 505, + "a_b": 512 + } + }, + "unequal_K_equal_y_vs_M2": { + "A_B": 0, + "a_B": 447, + "A_b": 305, + "a_b": 462 + } + }, + "seven": { + "positions": 7, + "coefficient": { + "categories": { + "neither": 0, + "gate_only": 4, + "gain_only": 0, + "either_alone": 3 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 7, + "a_B": 0, + "A_b": 4, + "a_b": 0 + }, + "equal_to_gain_first": { + "A_B": 0, + "a_B": 5, + "A_b": 0, + "a_b": 7 + } + }, + "output": { + "categories": { + "neither": 0, + "gate_only": 5, + "gain_only": 1, + "either_alone": 1 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 7, + "a_B": 1, + "A_b": 5, + "a_b": 0 + }, + "equal_to_gain_first": { + "A_B": 0, + "a_B": 6, + "A_b": 2, + "a_b": 7 + } + }, + "unequal_K_equal_y_vs_M2": { + "A_B": 0, + "a_B": 1, + "A_b": 1, + "a_b": 0 + } + }, + "sites": [ + { + "token": 760, + "channel": 113, + "outputs": [ + -3, + 0, + -3, + 0 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 760, + "channel": 118, + "outputs": [ + -51, + -50, + -51, + -50 + ], + "output_category": "gate_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 6511, + "channel": 113, + "outputs": [ + -22, + -20, + -22, + -20 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 314, + "channel": 37, + "outputs": [ + -1435, + -1435, + -1436, + -1436 + ], + "output_category": "gain_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": false, + "gain_reaches_wrong": true, + "gain_stays_M2": false + }, + { + "token": 314, + "channel": 113, + "outputs": [ + -6, + -9, + -6, + -9 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 14898, + "channel": 51, + "outputs": [ + -293, + -294, + -294, + -294 + ], + "output_category": "either_alone", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": true, + "gain_stays_M2": false + }, + { + "token": 14898, + "channel": 113, + "outputs": [ + -64, + -63, + -64, + -63 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + } + ], + "array_sha256": { + "A_B": { + "K": "7c7fb293c7ff7a56c350131f439d0481bfa328db79e7a115084c1afd38baa250", + "y": "d581d535bd9ff96d20408edc02675f9b3b5eedd7287950d755d4fc82aff1c8a5" + }, + "a_B": { + "K": "7066d1550d3eaa8e79b1f49ae3bcaf8ef9be28886b921d5e8958f7e53ad94cb0", + "y": "ff7c31df020d03fbfd4fc3d5acd06b76ea73d1959d92a22ae5754a7643a70d8c" + }, + "A_b": { + "K": "738e3ee38695a3ff88351e13e3c7ccfa82502c4928c8363f593a428807fd2564", + "y": "0657aedd6d99f9c02d601869cf96fb9e1ac170f74036e18f6694a20b2a0ac278" + }, + "a_b": { + "K": "436bc9cfe2f38346aace7ee2b45b8f354f414ceaf9d99519015620bf307a8656", + "y": "2d8c5a1cc5044563de73e53139a19521eed145ef2c09855edaf075078b0d6ada" + } + }, + "satisfying_sites": 5, + "first_counterexample": { + "token": 314, + "channel": 37, + "outputs": [ + -1435, + -1435, + -1436, + -1436 + ], + "output_category": "gain_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": false, + "gain_reaches_wrong": true, + "gain_stays_M2": false + } + }, + "fixture_outcome": "FAIL", + "substantive_sha256": "51aa740e293b39bb220f3a28f116cdbf56e8fb5da3a198fe2bd4e15cd8f39a71" +} diff --git a/experiments/20261202-273-qwen-rounding-attribution/runs/run-3.json b/experiments/20261202-273-qwen-rounding-attribution/runs/run-3.json new file mode 100644 index 00000000..603e6eb8 --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/runs/run-3.json @@ -0,0 +1,680 @@ +{ + "utc_start": "2026-12-02T18:21:30.608114+00:00", + "source_sha256": { + "measure.py": "d1689ad9cdb28a7a384bfd314fd23731e87c5fc4f4d45dff7c3befacbd832b17", + "cells.py": "8870700251b47942c95c84d611fb75b1d6e9f78347201422fc6724eb6fd4dd6f", + "prepare.py": "d7e43aaa297415802c3efbbce0dc0c8bf3cb4069e18de208949c871a18325cb4" + }, + "historical_replay": [ + { + "token": 760, + "state_sha256": "c9cd6ef720c8144921a2aa9582b48eb7729f9a9a62929bfad814e403dd911198", + "pre_norm_sha256": "e9ad89bed5f036f272509c107bb1ddd20ebfd887906aa72a2ddeec9bad178d2f", + "oracle_y_sha256": "558dd17a1cd63049293c4f8d700a0171059c747c078ca1462821254e8a300592", + "legacy_y_sha256": "ab2b53fd5d310db228591a3b15f308d0f348651c1fdcf7cee8b0ec6a372a4c21", + "decoded_y_sha256": "142599ee5dfbd2a7f7dd24b50f949b7f47bd7c68651ec33d3b00522ec4e41086", + "stored_bytes_sha256": "e1372f60bcece49e959e0f83aa885a2612bee3ae97f29f1647b2e1317db6cb8c", + "legacy_count": 24, + "legacy_max": 10, + "count": 2, + "max_abs": 3 + }, + { + "token": 6511, + "state_sha256": "f06d311d32cb5ae793a5796abc87eddfd7de8b84a5d639ffa191407bdc44e2a5", + "pre_norm_sha256": "2ac38529eeb5fe4e6a826e8aed6c11897fb237550bfd1b0b53f97fc87b66c59b", + "oracle_y_sha256": "f9e8758dbf31fdc1c94daf13b19385c97bf6936634099d6bc0517fba08e21727", + "legacy_y_sha256": "862bb6c3369892b6ca4ab654c4035576d4870e759455080408976a68afae1637", + "decoded_y_sha256": "c2410076fb62751f407e6ba2dccd7a3fb38aa94ee9735441147add79bdf4fb86", + "stored_bytes_sha256": "61ec6d33adaa0df6ade9369a7850812b909009628a470f48152d672978a7d847", + "legacy_count": 2, + "legacy_max": 3, + "count": 1, + "max_abs": 2 + }, + { + "token": 314, + "state_sha256": "a2474e227e1b82a8e85293d5a0698ebf1c004a95a4ce5186f6386cb7132bf190", + "pre_norm_sha256": "8000cc038660cfff936ebcd5a027d21b816504e42aa07076a3b862250b1dfa8a", + "oracle_y_sha256": "ddd69fc7b1657944a2e6ccdbfbcb50a8c1c0c127d1495ca14a765b858f39fcff", + "legacy_y_sha256": "00c6322def4a3e41ac58e260d3d860583768172ba5cbd44e94f9fc2b9d4ffd31", + "decoded_y_sha256": "9397b5ab6a1b4639fe3db05ab93b7a9bb5b0bf9e21994f184b7554fcb78f1acd", + "stored_bytes_sha256": "1168c9f42a0879e5ae084956f5cb001c2e74a4cce1250665a593fd2c5405a618", + "legacy_count": 25, + "legacy_max": 10, + "count": 2, + "max_abs": 3 + }, + { + "token": 14898, + "state_sha256": "2fc955ee0d45e4dc7f2534ffdef269650562bbdeac277d928e0ae9e1b0784cba", + "pre_norm_sha256": "02622126cfce37b97a05efe81a579cdb9f60b9554d0f8aa8de14316fc0c0b73e", + "oracle_y_sha256": "4e91ba653e77652c7a08e33b32ed6434d4bb037079b38849a1592de93cfcc1c8", + "legacy_y_sha256": "753e135b4b5317c91e8e9c04be075ca3bc0ddd900b43de42e24f3b48db869fa7", + "decoded_y_sha256": "8eaccf9c411efe5879ec8fb85e7413b953d7c3245cfcd314facee9a3ad262bad", + "stored_bytes_sha256": "a8bf18dae3135faa49bcf19e617531e8738f073e3c4a203f6b4073b44b4049c6", + "legacy_count": 18, + "legacy_max": 9, + "count": 2, + "max_abs": 1 + } + ], + "first_baseline_difference": [ + 760, + 113, + -3, + 0 + ], + "controls": [ + { + "A": "149/100", + "B": "2", + "w": 4096, + "expected_y": [ + 3, + 2, + 3, + 2 + ], + "actual_K": [ + 3, + 2, + 3, + 2 + ], + "actual_y": [ + 3, + 2, + 3, + 2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "ok": true + }, + { + "A": "256", + "B": "2051/2048", + "w": 4096, + "expected_y": [ + 256, + 256, + 256, + 256 + ], + "actual_K": [ + 256, + 256, + 256, + 256 + ], + "actual_y": [ + 256, + 256, + 256, + 256 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "512", + "B": "2051/2048", + "w": 4096, + "expected_y": [ + 513, + 513, + 512, + 512 + ], + "actual_K": [ + 513, + 513, + 512, + 512 + ], + "actual_y": [ + 513, + 513, + 512, + 512 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "gain_only", + "coefficient_category": "gain_only", + "ok": true + }, + { + "A": "1", + "B": "1", + "w": -1, + "expected_y": [ + -1, + -1, + -1, + -1 + ], + "actual_K": [ + 1, + 1, + 1, + 1 + ], + "actual_y": [ + -1, + -1, + -1, + -1 + ], + "actual_remainders": [ + 4095, + 4095, + 4095, + 4095 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "1", + "B": "1/2", + "w": 4096, + "expected_y": [ + 0, + 0, + 0, + 0 + ], + "actual_K": [ + 0, + 0, + 0, + 0 + ], + "actual_y": [ + 0, + 0, + 0, + 0 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "3", + "B": "1/2", + "w": 4096, + "expected_y": [ + 2, + 2, + 2, + 2 + ], + "actual_K": [ + 2, + 2, + 2, + 2 + ], + "actual_y": [ + 2, + 2, + 2, + 2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "-1", + "B": "1/2", + "w": 4096, + "expected_y": [ + 0, + 0, + 0, + 0 + ], + "actual_K": [ + 0, + 0, + 0, + 0 + ], + "actual_y": [ + 0, + 0, + 0, + 0 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "-3", + "B": "1/2", + "w": 4096, + "expected_y": [ + -2, + -2, + -2, + -2 + ], + "actual_K": [ + -2, + -2, + -2, + -2 + ], + "actual_y": [ + -2, + -2, + -2, + -2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "control": "negative product truncated to zero", + "accepted": false, + "ok": true + } + ], + "table": { + "order": [ + "A_B", + "a_B", + "A_b", + "a_b" + ], + "all": { + "positions": 512, + "coefficient": { + "categories": { + "neither": 25, + "gate_only": 178, + "gain_only": 34, + "either_alone": 275 + }, + "joint_only": 8, + "equal_to_M2": { + "A_B": 512, + "a_B": 59, + "A_b": 203, + "a_b": 43 + }, + "equal_to_gain_first": { + "A_B": 43, + "a_B": 208, + "A_b": 55, + "a_b": 512 + } + }, + "output": { + "categories": { + "neither": 503, + "gate_only": 5, + "gain_only": 3, + "either_alone": 1 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 512, + "a_B": 506, + "A_b": 508, + "a_b": 505 + }, + "equal_to_gain_first": { + "A_B": 505, + "a_B": 511, + "A_b": 505, + "a_b": 512 + } + }, + "unequal_K_equal_y_vs_M2": { + "A_B": 0, + "a_B": 447, + "A_b": 305, + "a_b": 462 + } + }, + "seven": { + "positions": 7, + "coefficient": { + "categories": { + "neither": 0, + "gate_only": 4, + "gain_only": 0, + "either_alone": 3 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 7, + "a_B": 0, + "A_b": 4, + "a_b": 0 + }, + "equal_to_gain_first": { + "A_B": 0, + "a_B": 5, + "A_b": 0, + "a_b": 7 + } + }, + "output": { + "categories": { + "neither": 0, + "gate_only": 5, + "gain_only": 1, + "either_alone": 1 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 7, + "a_B": 1, + "A_b": 5, + "a_b": 0 + }, + "equal_to_gain_first": { + "A_B": 0, + "a_B": 6, + "A_b": 2, + "a_b": 7 + } + }, + "unequal_K_equal_y_vs_M2": { + "A_B": 0, + "a_B": 1, + "A_b": 1, + "a_b": 0 + } + }, + "sites": [ + { + "token": 760, + "channel": 113, + "outputs": [ + -3, + 0, + -3, + 0 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 760, + "channel": 118, + "outputs": [ + -51, + -50, + -51, + -50 + ], + "output_category": "gate_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 6511, + "channel": 113, + "outputs": [ + -22, + -20, + -22, + -20 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 314, + "channel": 37, + "outputs": [ + -1435, + -1435, + -1436, + -1436 + ], + "output_category": "gain_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": false, + "gain_reaches_wrong": true, + "gain_stays_M2": false + }, + { + "token": 314, + "channel": 113, + "outputs": [ + -6, + -9, + -6, + -9 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 14898, + "channel": 51, + "outputs": [ + -293, + -294, + -294, + -294 + ], + "output_category": "either_alone", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": true, + "gain_stays_M2": false + }, + { + "token": 14898, + "channel": 113, + "outputs": [ + -64, + -63, + -64, + -63 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + } + ], + "array_sha256": { + "A_B": { + "K": "7c7fb293c7ff7a56c350131f439d0481bfa328db79e7a115084c1afd38baa250", + "y": "d581d535bd9ff96d20408edc02675f9b3b5eedd7287950d755d4fc82aff1c8a5" + }, + "a_B": { + "K": "7066d1550d3eaa8e79b1f49ae3bcaf8ef9be28886b921d5e8958f7e53ad94cb0", + "y": "ff7c31df020d03fbfd4fc3d5acd06b76ea73d1959d92a22ae5754a7643a70d8c" + }, + "A_b": { + "K": "738e3ee38695a3ff88351e13e3c7ccfa82502c4928c8363f593a428807fd2564", + "y": "0657aedd6d99f9c02d601869cf96fb9e1ac170f74036e18f6694a20b2a0ac278" + }, + "a_b": { + "K": "436bc9cfe2f38346aace7ee2b45b8f354f414ceaf9d99519015620bf307a8656", + "y": "2d8c5a1cc5044563de73e53139a19521eed145ef2c09855edaf075078b0d6ada" + } + }, + "satisfying_sites": 5, + "first_counterexample": { + "token": 314, + "channel": 37, + "outputs": [ + -1435, + -1435, + -1436, + -1436 + ], + "output_category": "gain_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": false, + "gain_reaches_wrong": true, + "gain_stays_M2": false + } + }, + "fixture_outcome": "FAIL", + "substantive_sha256": "51aa740e293b39bb220f3a28f116cdbf56e8fb5da3a198fe2bd4e15cd8f39a71" +} diff --git a/experiments/20261202-273-qwen-rounding-attribution/runs/run-4.json b/experiments/20261202-273-qwen-rounding-attribution/runs/run-4.json new file mode 100644 index 00000000..812aa524 --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/runs/run-4.json @@ -0,0 +1,680 @@ +{ + "utc_start": "2026-12-02T18:21:56.060975+00:00", + "source_sha256": { + "measure.py": "d1689ad9cdb28a7a384bfd314fd23731e87c5fc4f4d45dff7c3befacbd832b17", + "cells.py": "8870700251b47942c95c84d611fb75b1d6e9f78347201422fc6724eb6fd4dd6f", + "prepare.py": "d7e43aaa297415802c3efbbce0dc0c8bf3cb4069e18de208949c871a18325cb4" + }, + "historical_replay": [ + { + "token": 760, + "state_sha256": "c9cd6ef720c8144921a2aa9582b48eb7729f9a9a62929bfad814e403dd911198", + "pre_norm_sha256": "e9ad89bed5f036f272509c107bb1ddd20ebfd887906aa72a2ddeec9bad178d2f", + "oracle_y_sha256": "558dd17a1cd63049293c4f8d700a0171059c747c078ca1462821254e8a300592", + "legacy_y_sha256": "ab2b53fd5d310db228591a3b15f308d0f348651c1fdcf7cee8b0ec6a372a4c21", + "decoded_y_sha256": "142599ee5dfbd2a7f7dd24b50f949b7f47bd7c68651ec33d3b00522ec4e41086", + "stored_bytes_sha256": "e1372f60bcece49e959e0f83aa885a2612bee3ae97f29f1647b2e1317db6cb8c", + "legacy_count": 24, + "legacy_max": 10, + "count": 2, + "max_abs": 3 + }, + { + "token": 6511, + "state_sha256": "f06d311d32cb5ae793a5796abc87eddfd7de8b84a5d639ffa191407bdc44e2a5", + "pre_norm_sha256": "2ac38529eeb5fe4e6a826e8aed6c11897fb237550bfd1b0b53f97fc87b66c59b", + "oracle_y_sha256": "f9e8758dbf31fdc1c94daf13b19385c97bf6936634099d6bc0517fba08e21727", + "legacy_y_sha256": "862bb6c3369892b6ca4ab654c4035576d4870e759455080408976a68afae1637", + "decoded_y_sha256": "c2410076fb62751f407e6ba2dccd7a3fb38aa94ee9735441147add79bdf4fb86", + "stored_bytes_sha256": "61ec6d33adaa0df6ade9369a7850812b909009628a470f48152d672978a7d847", + "legacy_count": 2, + "legacy_max": 3, + "count": 1, + "max_abs": 2 + }, + { + "token": 314, + "state_sha256": "a2474e227e1b82a8e85293d5a0698ebf1c004a95a4ce5186f6386cb7132bf190", + "pre_norm_sha256": "8000cc038660cfff936ebcd5a027d21b816504e42aa07076a3b862250b1dfa8a", + "oracle_y_sha256": "ddd69fc7b1657944a2e6ccdbfbcb50a8c1c0c127d1495ca14a765b858f39fcff", + "legacy_y_sha256": "00c6322def4a3e41ac58e260d3d860583768172ba5cbd44e94f9fc2b9d4ffd31", + "decoded_y_sha256": "9397b5ab6a1b4639fe3db05ab93b7a9bb5b0bf9e21994f184b7554fcb78f1acd", + "stored_bytes_sha256": "1168c9f42a0879e5ae084956f5cb001c2e74a4cce1250665a593fd2c5405a618", + "legacy_count": 25, + "legacy_max": 10, + "count": 2, + "max_abs": 3 + }, + { + "token": 14898, + "state_sha256": "2fc955ee0d45e4dc7f2534ffdef269650562bbdeac277d928e0ae9e1b0784cba", + "pre_norm_sha256": "02622126cfce37b97a05efe81a579cdb9f60b9554d0f8aa8de14316fc0c0b73e", + "oracle_y_sha256": "4e91ba653e77652c7a08e33b32ed6434d4bb037079b38849a1592de93cfcc1c8", + "legacy_y_sha256": "753e135b4b5317c91e8e9c04be075ca3bc0ddd900b43de42e24f3b48db869fa7", + "decoded_y_sha256": "8eaccf9c411efe5879ec8fb85e7413b953d7c3245cfcd314facee9a3ad262bad", + "stored_bytes_sha256": "a8bf18dae3135faa49bcf19e617531e8738f073e3c4a203f6b4073b44b4049c6", + "legacy_count": 18, + "legacy_max": 9, + "count": 2, + "max_abs": 1 + } + ], + "first_baseline_difference": [ + 760, + 113, + -3, + 0 + ], + "controls": [ + { + "A": "149/100", + "B": "2", + "w": 4096, + "expected_y": [ + 3, + 2, + 3, + 2 + ], + "actual_K": [ + 3, + 2, + 3, + 2 + ], + "actual_y": [ + 3, + 2, + 3, + 2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "ok": true + }, + { + "A": "256", + "B": "2051/2048", + "w": 4096, + "expected_y": [ + 256, + 256, + 256, + 256 + ], + "actual_K": [ + 256, + 256, + 256, + 256 + ], + "actual_y": [ + 256, + 256, + 256, + 256 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "512", + "B": "2051/2048", + "w": 4096, + "expected_y": [ + 513, + 513, + 512, + 512 + ], + "actual_K": [ + 513, + 513, + 512, + 512 + ], + "actual_y": [ + 513, + 513, + 512, + 512 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "gain_only", + "coefficient_category": "gain_only", + "ok": true + }, + { + "A": "1", + "B": "1", + "w": -1, + "expected_y": [ + -1, + -1, + -1, + -1 + ], + "actual_K": [ + 1, + 1, + 1, + 1 + ], + "actual_y": [ + -1, + -1, + -1, + -1 + ], + "actual_remainders": [ + 4095, + 4095, + 4095, + 4095 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "1", + "B": "1/2", + "w": 4096, + "expected_y": [ + 0, + 0, + 0, + 0 + ], + "actual_K": [ + 0, + 0, + 0, + 0 + ], + "actual_y": [ + 0, + 0, + 0, + 0 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "3", + "B": "1/2", + "w": 4096, + "expected_y": [ + 2, + 2, + 2, + 2 + ], + "actual_K": [ + 2, + 2, + 2, + 2 + ], + "actual_y": [ + 2, + 2, + 2, + 2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "-1", + "B": "1/2", + "w": 4096, + "expected_y": [ + 0, + 0, + 0, + 0 + ], + "actual_K": [ + 0, + 0, + 0, + 0 + ], + "actual_y": [ + 0, + 0, + 0, + 0 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "-3", + "B": "1/2", + "w": 4096, + "expected_y": [ + -2, + -2, + -2, + -2 + ], + "actual_K": [ + -2, + -2, + -2, + -2 + ], + "actual_y": [ + -2, + -2, + -2, + -2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "control": "negative product truncated to zero", + "accepted": false, + "ok": true + } + ], + "table": { + "order": [ + "A_B", + "a_B", + "A_b", + "a_b" + ], + "all": { + "positions": 512, + "coefficient": { + "categories": { + "neither": 25, + "gate_only": 178, + "gain_only": 34, + "either_alone": 275 + }, + "joint_only": 8, + "equal_to_M2": { + "A_B": 512, + "a_B": 59, + "A_b": 203, + "a_b": 43 + }, + "equal_to_gain_first": { + "A_B": 43, + "a_B": 208, + "A_b": 55, + "a_b": 512 + } + }, + "output": { + "categories": { + "neither": 503, + "gate_only": 5, + "gain_only": 3, + "either_alone": 1 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 512, + "a_B": 506, + "A_b": 508, + "a_b": 505 + }, + "equal_to_gain_first": { + "A_B": 505, + "a_B": 511, + "A_b": 505, + "a_b": 512 + } + }, + "unequal_K_equal_y_vs_M2": { + "A_B": 0, + "a_B": 447, + "A_b": 305, + "a_b": 462 + } + }, + "seven": { + "positions": 7, + "coefficient": { + "categories": { + "neither": 0, + "gate_only": 4, + "gain_only": 0, + "either_alone": 3 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 7, + "a_B": 0, + "A_b": 4, + "a_b": 0 + }, + "equal_to_gain_first": { + "A_B": 0, + "a_B": 5, + "A_b": 0, + "a_b": 7 + } + }, + "output": { + "categories": { + "neither": 0, + "gate_only": 5, + "gain_only": 1, + "either_alone": 1 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 7, + "a_B": 1, + "A_b": 5, + "a_b": 0 + }, + "equal_to_gain_first": { + "A_B": 0, + "a_B": 6, + "A_b": 2, + "a_b": 7 + } + }, + "unequal_K_equal_y_vs_M2": { + "A_B": 0, + "a_B": 1, + "A_b": 1, + "a_b": 0 + } + }, + "sites": [ + { + "token": 760, + "channel": 113, + "outputs": [ + -3, + 0, + -3, + 0 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 760, + "channel": 118, + "outputs": [ + -51, + -50, + -51, + -50 + ], + "output_category": "gate_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 6511, + "channel": 113, + "outputs": [ + -22, + -20, + -22, + -20 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 314, + "channel": 37, + "outputs": [ + -1435, + -1435, + -1436, + -1436 + ], + "output_category": "gain_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": false, + "gain_reaches_wrong": true, + "gain_stays_M2": false + }, + { + "token": 314, + "channel": 113, + "outputs": [ + -6, + -9, + -6, + -9 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 14898, + "channel": 51, + "outputs": [ + -293, + -294, + -294, + -294 + ], + "output_category": "either_alone", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": true, + "gain_stays_M2": false + }, + { + "token": 14898, + "channel": 113, + "outputs": [ + -64, + -63, + -64, + -63 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + } + ], + "array_sha256": { + "A_B": { + "K": "7c7fb293c7ff7a56c350131f439d0481bfa328db79e7a115084c1afd38baa250", + "y": "d581d535bd9ff96d20408edc02675f9b3b5eedd7287950d755d4fc82aff1c8a5" + }, + "a_B": { + "K": "7066d1550d3eaa8e79b1f49ae3bcaf8ef9be28886b921d5e8958f7e53ad94cb0", + "y": "ff7c31df020d03fbfd4fc3d5acd06b76ea73d1959d92a22ae5754a7643a70d8c" + }, + "A_b": { + "K": "738e3ee38695a3ff88351e13e3c7ccfa82502c4928c8363f593a428807fd2564", + "y": "0657aedd6d99f9c02d601869cf96fb9e1ac170f74036e18f6694a20b2a0ac278" + }, + "a_b": { + "K": "436bc9cfe2f38346aace7ee2b45b8f354f414ceaf9d99519015620bf307a8656", + "y": "2d8c5a1cc5044563de73e53139a19521eed145ef2c09855edaf075078b0d6ada" + } + }, + "satisfying_sites": 5, + "first_counterexample": { + "token": 314, + "channel": 37, + "outputs": [ + -1435, + -1435, + -1436, + -1436 + ], + "output_category": "gain_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": false, + "gain_reaches_wrong": true, + "gain_stays_M2": false + } + }, + "fixture_outcome": "FAIL", + "substantive_sha256": "51aa740e293b39bb220f3a28f116cdbf56e8fb5da3a198fe2bd4e15cd8f39a71" +} diff --git a/experiments/20261202-273-qwen-rounding-attribution/runs/run-5.json b/experiments/20261202-273-qwen-rounding-attribution/runs/run-5.json new file mode 100644 index 00000000..07d6e43e --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/runs/run-5.json @@ -0,0 +1,680 @@ +{ + "utc_start": "2026-12-02T18:22:14.869468+00:00", + "source_sha256": { + "measure.py": "d1689ad9cdb28a7a384bfd314fd23731e87c5fc4f4d45dff7c3befacbd832b17", + "cells.py": "8870700251b47942c95c84d611fb75b1d6e9f78347201422fc6724eb6fd4dd6f", + "prepare.py": "d7e43aaa297415802c3efbbce0dc0c8bf3cb4069e18de208949c871a18325cb4" + }, + "historical_replay": [ + { + "token": 760, + "state_sha256": "c9cd6ef720c8144921a2aa9582b48eb7729f9a9a62929bfad814e403dd911198", + "pre_norm_sha256": "e9ad89bed5f036f272509c107bb1ddd20ebfd887906aa72a2ddeec9bad178d2f", + "oracle_y_sha256": "558dd17a1cd63049293c4f8d700a0171059c747c078ca1462821254e8a300592", + "legacy_y_sha256": "ab2b53fd5d310db228591a3b15f308d0f348651c1fdcf7cee8b0ec6a372a4c21", + "decoded_y_sha256": "142599ee5dfbd2a7f7dd24b50f949b7f47bd7c68651ec33d3b00522ec4e41086", + "stored_bytes_sha256": "e1372f60bcece49e959e0f83aa885a2612bee3ae97f29f1647b2e1317db6cb8c", + "legacy_count": 24, + "legacy_max": 10, + "count": 2, + "max_abs": 3 + }, + { + "token": 6511, + "state_sha256": "f06d311d32cb5ae793a5796abc87eddfd7de8b84a5d639ffa191407bdc44e2a5", + "pre_norm_sha256": "2ac38529eeb5fe4e6a826e8aed6c11897fb237550bfd1b0b53f97fc87b66c59b", + "oracle_y_sha256": "f9e8758dbf31fdc1c94daf13b19385c97bf6936634099d6bc0517fba08e21727", + "legacy_y_sha256": "862bb6c3369892b6ca4ab654c4035576d4870e759455080408976a68afae1637", + "decoded_y_sha256": "c2410076fb62751f407e6ba2dccd7a3fb38aa94ee9735441147add79bdf4fb86", + "stored_bytes_sha256": "61ec6d33adaa0df6ade9369a7850812b909009628a470f48152d672978a7d847", + "legacy_count": 2, + "legacy_max": 3, + "count": 1, + "max_abs": 2 + }, + { + "token": 314, + "state_sha256": "a2474e227e1b82a8e85293d5a0698ebf1c004a95a4ce5186f6386cb7132bf190", + "pre_norm_sha256": "8000cc038660cfff936ebcd5a027d21b816504e42aa07076a3b862250b1dfa8a", + "oracle_y_sha256": "ddd69fc7b1657944a2e6ccdbfbcb50a8c1c0c127d1495ca14a765b858f39fcff", + "legacy_y_sha256": "00c6322def4a3e41ac58e260d3d860583768172ba5cbd44e94f9fc2b9d4ffd31", + "decoded_y_sha256": "9397b5ab6a1b4639fe3db05ab93b7a9bb5b0bf9e21994f184b7554fcb78f1acd", + "stored_bytes_sha256": "1168c9f42a0879e5ae084956f5cb001c2e74a4cce1250665a593fd2c5405a618", + "legacy_count": 25, + "legacy_max": 10, + "count": 2, + "max_abs": 3 + }, + { + "token": 14898, + "state_sha256": "2fc955ee0d45e4dc7f2534ffdef269650562bbdeac277d928e0ae9e1b0784cba", + "pre_norm_sha256": "02622126cfce37b97a05efe81a579cdb9f60b9554d0f8aa8de14316fc0c0b73e", + "oracle_y_sha256": "4e91ba653e77652c7a08e33b32ed6434d4bb037079b38849a1592de93cfcc1c8", + "legacy_y_sha256": "753e135b4b5317c91e8e9c04be075ca3bc0ddd900b43de42e24f3b48db869fa7", + "decoded_y_sha256": "8eaccf9c411efe5879ec8fb85e7413b953d7c3245cfcd314facee9a3ad262bad", + "stored_bytes_sha256": "a8bf18dae3135faa49bcf19e617531e8738f073e3c4a203f6b4073b44b4049c6", + "legacy_count": 18, + "legacy_max": 9, + "count": 2, + "max_abs": 1 + } + ], + "first_baseline_difference": [ + 760, + 113, + -3, + 0 + ], + "controls": [ + { + "A": "149/100", + "B": "2", + "w": 4096, + "expected_y": [ + 3, + 2, + 3, + 2 + ], + "actual_K": [ + 3, + 2, + 3, + 2 + ], + "actual_y": [ + 3, + 2, + 3, + 2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "ok": true + }, + { + "A": "256", + "B": "2051/2048", + "w": 4096, + "expected_y": [ + 256, + 256, + 256, + 256 + ], + "actual_K": [ + 256, + 256, + 256, + 256 + ], + "actual_y": [ + 256, + 256, + 256, + 256 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "512", + "B": "2051/2048", + "w": 4096, + "expected_y": [ + 513, + 513, + 512, + 512 + ], + "actual_K": [ + 513, + 513, + 512, + 512 + ], + "actual_y": [ + 513, + 513, + 512, + 512 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "gain_only", + "coefficient_category": "gain_only", + "ok": true + }, + { + "A": "1", + "B": "1", + "w": -1, + "expected_y": [ + -1, + -1, + -1, + -1 + ], + "actual_K": [ + 1, + 1, + 1, + 1 + ], + "actual_y": [ + -1, + -1, + -1, + -1 + ], + "actual_remainders": [ + 4095, + 4095, + 4095, + 4095 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "1", + "B": "1/2", + "w": 4096, + "expected_y": [ + 0, + 0, + 0, + 0 + ], + "actual_K": [ + 0, + 0, + 0, + 0 + ], + "actual_y": [ + 0, + 0, + 0, + 0 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "3", + "B": "1/2", + "w": 4096, + "expected_y": [ + 2, + 2, + 2, + 2 + ], + "actual_K": [ + 2, + 2, + 2, + 2 + ], + "actual_y": [ + 2, + 2, + 2, + 2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "-1", + "B": "1/2", + "w": 4096, + "expected_y": [ + 0, + 0, + 0, + 0 + ], + "actual_K": [ + 0, + 0, + 0, + 0 + ], + "actual_y": [ + 0, + 0, + 0, + 0 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "A": "-3", + "B": "1/2", + "w": 4096, + "expected_y": [ + -2, + -2, + -2, + -2 + ], + "actual_K": [ + -2, + -2, + -2, + -2 + ], + "actual_y": [ + -2, + -2, + -2, + -2 + ], + "actual_remainders": [ + 0, + 0, + 0, + 0 + ], + "output_category": "neither", + "coefficient_category": "neither", + "ok": true + }, + { + "control": "negative product truncated to zero", + "accepted": false, + "ok": true + } + ], + "table": { + "order": [ + "A_B", + "a_B", + "A_b", + "a_b" + ], + "all": { + "positions": 512, + "coefficient": { + "categories": { + "neither": 25, + "gate_only": 178, + "gain_only": 34, + "either_alone": 275 + }, + "joint_only": 8, + "equal_to_M2": { + "A_B": 512, + "a_B": 59, + "A_b": 203, + "a_b": 43 + }, + "equal_to_gain_first": { + "A_B": 43, + "a_B": 208, + "A_b": 55, + "a_b": 512 + } + }, + "output": { + "categories": { + "neither": 503, + "gate_only": 5, + "gain_only": 3, + "either_alone": 1 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 512, + "a_B": 506, + "A_b": 508, + "a_b": 505 + }, + "equal_to_gain_first": { + "A_B": 505, + "a_B": 511, + "A_b": 505, + "a_b": 512 + } + }, + "unequal_K_equal_y_vs_M2": { + "A_B": 0, + "a_B": 447, + "A_b": 305, + "a_b": 462 + } + }, + "seven": { + "positions": 7, + "coefficient": { + "categories": { + "neither": 0, + "gate_only": 4, + "gain_only": 0, + "either_alone": 3 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 7, + "a_B": 0, + "A_b": 4, + "a_b": 0 + }, + "equal_to_gain_first": { + "A_B": 0, + "a_B": 5, + "A_b": 0, + "a_b": 7 + } + }, + "output": { + "categories": { + "neither": 0, + "gate_only": 5, + "gain_only": 1, + "either_alone": 1 + }, + "joint_only": 0, + "equal_to_M2": { + "A_B": 7, + "a_B": 1, + "A_b": 5, + "a_b": 0 + }, + "equal_to_gain_first": { + "A_B": 0, + "a_B": 6, + "A_b": 2, + "a_b": 7 + } + }, + "unequal_K_equal_y_vs_M2": { + "A_B": 0, + "a_B": 1, + "A_b": 1, + "a_b": 0 + } + }, + "sites": [ + { + "token": 760, + "channel": 113, + "outputs": [ + -3, + 0, + -3, + 0 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 760, + "channel": 118, + "outputs": [ + -51, + -50, + -51, + -50 + ], + "output_category": "gate_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 6511, + "channel": 113, + "outputs": [ + -22, + -20, + -22, + -20 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 314, + "channel": 37, + "outputs": [ + -1435, + -1435, + -1436, + -1436 + ], + "output_category": "gain_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": false, + "gain_reaches_wrong": true, + "gain_stays_M2": false + }, + { + "token": 314, + "channel": 113, + "outputs": [ + -6, + -9, + -6, + -9 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + }, + { + "token": 14898, + "channel": 51, + "outputs": [ + -293, + -294, + -294, + -294 + ], + "output_category": "either_alone", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": true, + "gain_stays_M2": false + }, + { + "token": 14898, + "channel": 113, + "outputs": [ + -64, + -63, + -64, + -63 + ], + "output_category": "gate_only", + "coefficient_category": "gate_only", + "K_equal_M2": [ + true, + false, + true, + false + ], + "K_equal_gain_first": [ + false, + true, + false, + true + ], + "gate_reaches_wrong": true, + "gain_reaches_wrong": false, + "gain_stays_M2": true + } + ], + "array_sha256": { + "A_B": { + "K": "7c7fb293c7ff7a56c350131f439d0481bfa328db79e7a115084c1afd38baa250", + "y": "d581d535bd9ff96d20408edc02675f9b3b5eedd7287950d755d4fc82aff1c8a5" + }, + "a_B": { + "K": "7066d1550d3eaa8e79b1f49ae3bcaf8ef9be28886b921d5e8958f7e53ad94cb0", + "y": "ff7c31df020d03fbfd4fc3d5acd06b76ea73d1959d92a22ae5754a7643a70d8c" + }, + "A_b": { + "K": "738e3ee38695a3ff88351e13e3c7ccfa82502c4928c8363f593a428807fd2564", + "y": "0657aedd6d99f9c02d601869cf96fb9e1ac170f74036e18f6694a20b2a0ac278" + }, + "a_b": { + "K": "436bc9cfe2f38346aace7ee2b45b8f354f414ceaf9d99519015620bf307a8656", + "y": "2d8c5a1cc5044563de73e53139a19521eed145ef2c09855edaf075078b0d6ada" + } + }, + "satisfying_sites": 5, + "first_counterexample": { + "token": 314, + "channel": 37, + "outputs": [ + -1435, + -1435, + -1436, + -1436 + ], + "output_category": "gain_only", + "coefficient_category": "either_alone", + "K_equal_M2": [ + true, + false, + false, + false + ], + "K_equal_gain_first": [ + false, + false, + false, + true + ], + "gate_reaches_wrong": false, + "gain_reaches_wrong": true, + "gain_stays_M2": false + } + }, + "fixture_outcome": "FAIL", + "substantive_sha256": "51aa740e293b39bb220f3a28f116cdbf56e8fb5da3a198fe2bd4e15cd8f39a71" +} diff --git a/experiments/20261202-273-qwen-rounding-attribution/runs/summary.json b/experiments/20261202-273-qwen-rounding-attribution/runs/summary.json new file mode 100644 index 00000000..7c1abf2c --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/runs/summary.json @@ -0,0 +1,392 @@ +{ + "utc_start": "2026-12-02T18:23:11.594148+00:00", + "verdict": "FAIL", + "n": 5, + "substantive_sha256": [ + "51aa740e293b39bb220f3a28f116cdbf56e8fb5da3a198fe2bd4e15cd8f39a71", + "51aa740e293b39bb220f3a28f116cdbf56e8fb5da3a198fe2bd4e15cd8f39a71", + "51aa740e293b39bb220f3a28f116cdbf56e8fb5da3a198fe2bd4e15cd8f39a71", + "51aa740e293b39bb220f3a28f116cdbf56e8fb5da3a198fe2bd4e15cd8f39a71", + "51aa740e293b39bb220f3a28f116cdbf56e8fb5da3a198fe2bd4e15cd8f39a71" + ], + "counts": { + "all.positions": { + "median": 512, + "sample_sd": 0.0, + "min": 512, + "max": 512 + }, + "all.coefficient.categories.neither": { + "median": 25, + "sample_sd": 0.0, + "min": 25, + "max": 25 + }, + "all.coefficient.categories.gate_only": { + "median": 178, + "sample_sd": 0.0, + "min": 178, + "max": 178 + }, + "all.coefficient.categories.gain_only": { + "median": 34, + "sample_sd": 0.0, + "min": 34, + "max": 34 + }, + "all.coefficient.categories.either_alone": { + "median": 275, + "sample_sd": 0.0, + "min": 275, + "max": 275 + }, + "all.coefficient.joint_only": { + "median": 8, + "sample_sd": 0.0, + "min": 8, + "max": 8 + }, + "all.coefficient.equal_to_M2.A_B": { + "median": 512, + "sample_sd": 0.0, + "min": 512, + "max": 512 + }, + "all.coefficient.equal_to_M2.a_B": { + "median": 59, + "sample_sd": 0.0, + "min": 59, + "max": 59 + }, + "all.coefficient.equal_to_M2.A_b": { + "median": 203, + "sample_sd": 0.0, + "min": 203, + "max": 203 + }, + "all.coefficient.equal_to_M2.a_b": { + "median": 43, + "sample_sd": 0.0, + "min": 43, + "max": 43 + }, + "all.coefficient.equal_to_gain_first.A_B": { + "median": 43, + "sample_sd": 0.0, + "min": 43, + "max": 43 + }, + "all.coefficient.equal_to_gain_first.a_B": { + "median": 208, + "sample_sd": 0.0, + "min": 208, + "max": 208 + }, + "all.coefficient.equal_to_gain_first.A_b": { + "median": 55, + "sample_sd": 0.0, + "min": 55, + "max": 55 + }, + "all.coefficient.equal_to_gain_first.a_b": { + "median": 512, + "sample_sd": 0.0, + "min": 512, + "max": 512 + }, + "all.output.categories.neither": { + "median": 503, + "sample_sd": 0.0, + "min": 503, + "max": 503 + }, + "all.output.categories.gate_only": { + "median": 5, + "sample_sd": 0.0, + "min": 5, + "max": 5 + }, + "all.output.categories.gain_only": { + "median": 3, + "sample_sd": 0.0, + "min": 3, + "max": 3 + }, + "all.output.categories.either_alone": { + "median": 1, + "sample_sd": 0.0, + "min": 1, + "max": 1 + }, + "all.output.joint_only": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "all.output.equal_to_M2.A_B": { + "median": 512, + "sample_sd": 0.0, + "min": 512, + "max": 512 + }, + "all.output.equal_to_M2.a_B": { + "median": 506, + "sample_sd": 0.0, + "min": 506, + "max": 506 + }, + "all.output.equal_to_M2.A_b": { + "median": 508, + "sample_sd": 0.0, + "min": 508, + "max": 508 + }, + "all.output.equal_to_M2.a_b": { + "median": 505, + "sample_sd": 0.0, + "min": 505, + "max": 505 + }, + "all.output.equal_to_gain_first.A_B": { + "median": 505, + "sample_sd": 0.0, + "min": 505, + "max": 505 + }, + "all.output.equal_to_gain_first.a_B": { + "median": 511, + "sample_sd": 0.0, + "min": 511, + "max": 511 + }, + "all.output.equal_to_gain_first.A_b": { + "median": 505, + "sample_sd": 0.0, + "min": 505, + "max": 505 + }, + "all.output.equal_to_gain_first.a_b": { + "median": 512, + "sample_sd": 0.0, + "min": 512, + "max": 512 + }, + "all.unequal_K_equal_y_vs_M2.A_B": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "all.unequal_K_equal_y_vs_M2.a_B": { + "median": 447, + "sample_sd": 0.0, + "min": 447, + "max": 447 + }, + "all.unequal_K_equal_y_vs_M2.A_b": { + "median": 305, + "sample_sd": 0.0, + "min": 305, + "max": 305 + }, + "all.unequal_K_equal_y_vs_M2.a_b": { + "median": 462, + "sample_sd": 0.0, + "min": 462, + "max": 462 + }, + "seven.positions": { + "median": 7, + "sample_sd": 0.0, + "min": 7, + "max": 7 + }, + "seven.coefficient.categories.neither": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.coefficient.categories.gate_only": { + "median": 4, + "sample_sd": 0.0, + "min": 4, + "max": 4 + }, + "seven.coefficient.categories.gain_only": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.coefficient.categories.either_alone": { + "median": 3, + "sample_sd": 0.0, + "min": 3, + "max": 3 + }, + "seven.coefficient.joint_only": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.coefficient.equal_to_M2.A_B": { + "median": 7, + "sample_sd": 0.0, + "min": 7, + "max": 7 + }, + "seven.coefficient.equal_to_M2.a_B": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.coefficient.equal_to_M2.A_b": { + "median": 4, + "sample_sd": 0.0, + "min": 4, + "max": 4 + }, + "seven.coefficient.equal_to_M2.a_b": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.coefficient.equal_to_gain_first.A_B": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.coefficient.equal_to_gain_first.a_B": { + "median": 5, + "sample_sd": 0.0, + "min": 5, + "max": 5 + }, + "seven.coefficient.equal_to_gain_first.A_b": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.coefficient.equal_to_gain_first.a_b": { + "median": 7, + "sample_sd": 0.0, + "min": 7, + "max": 7 + }, + "seven.output.categories.neither": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.output.categories.gate_only": { + "median": 5, + "sample_sd": 0.0, + "min": 5, + "max": 5 + }, + "seven.output.categories.gain_only": { + "median": 1, + "sample_sd": 0.0, + "min": 1, + "max": 1 + }, + "seven.output.categories.either_alone": { + "median": 1, + "sample_sd": 0.0, + "min": 1, + "max": 1 + }, + "seven.output.joint_only": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.output.equal_to_M2.A_B": { + "median": 7, + "sample_sd": 0.0, + "min": 7, + "max": 7 + }, + "seven.output.equal_to_M2.a_B": { + "median": 1, + "sample_sd": 0.0, + "min": 1, + "max": 1 + }, + "seven.output.equal_to_M2.A_b": { + "median": 5, + "sample_sd": 0.0, + "min": 5, + "max": 5 + }, + "seven.output.equal_to_M2.a_b": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.output.equal_to_gain_first.A_B": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.output.equal_to_gain_first.a_B": { + "median": 6, + "sample_sd": 0.0, + "min": 6, + "max": 6 + }, + "seven.output.equal_to_gain_first.A_b": { + "median": 2, + "sample_sd": 0.0, + "min": 2, + "max": 2 + }, + "seven.output.equal_to_gain_first.a_b": { + "median": 7, + "sample_sd": 0.0, + "min": 7, + "max": 7 + }, + "seven.unequal_K_equal_y_vs_M2.A_B": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "seven.unequal_K_equal_y_vs_M2.a_B": { + "median": 1, + "sample_sd": 0.0, + "min": 1, + "max": 1 + }, + "seven.unequal_K_equal_y_vs_M2.A_b": { + "median": 1, + "sample_sd": 0.0, + "min": 1, + "max": 1 + }, + "seven.unequal_K_equal_y_vs_M2.a_b": { + "median": 0, + "sample_sd": 0.0, + "min": 0, + "max": 0 + }, + "satisfying_sites": { + "median": 5, + "sample_sd": 0.0, + "min": 5, + "max": 5 + } + } +} diff --git a/experiments/20261202-273-qwen-rounding-attribution/summary.py b/experiments/20261202-273-qwen-rounding-attribution/summary.py new file mode 100644 index 00000000..6aced86c --- /dev/null +++ b/experiments/20261202-273-qwen-rounding-attribution/summary.py @@ -0,0 +1,40 @@ +"""Summarize five existing receipts, without touching the model or any run file.""" +import hashlib +import json +from pathlib import Path +import statistics +import sys +from prepare import save, utc + + +def flatten(value, prefix=''): + if isinstance(value,dict): + for k,v in value.items(): + yield from flatten(v, (prefix+'.'+k).lstrip('.')) + elif type(value) is int: + yield prefix,value + + +def main(folder): + result = dict(utc_start=utc()) + docs = [json.loads((folder/f'run-{i}.json').read_text()) for i in range(1,6)] + hashes = [] + counts = [] + for doc in docs: + obj = {k:v for k,v in doc.items() if k not in ('utc_start','substantive_sha256')} + hashes.append(hashlib.sha256(json.dumps(obj,sort_keys=True,separators=(',',':')).encode()).hexdigest()) + if hashes[-1]!=doc['substantive_sha256'] or hashes[-1]!=hashes[0]: + result.update(status='STOP', reason='substantive records disagree',run=len(hashes)) + save(folder/'summary.json',result) + raise ValueError('determinism') + tab=doc['table'] + counts.append(dict(flatten({key:tab[key] for key in ('all','seven','satisfying_sites')}))) + result.update(verdict=docs[0]['fixture_outcome'], n=len(counts),substantive_sha256=hashes, + counts={k:dict(median=statistics.median(v),sample_sd=statistics.stdev(v),min=min(v),max=max(v)) + for k in counts[0] for v in [[c[k] for c in counts]]}) + save(folder/'summary.json', result) + print(result['verdict'],result['counts']['satisfying_sites']) + + +if __name__=='__main__': + main(Path(sys.argv[1])) diff --git a/research/results.yaml b/research/results.yaml index 6bb692ef..53860230 100644 --- a/research/results.yaml +++ b/research/results.yaml @@ -2325,3 +2325,15 @@ results: - {"name": "prefix_support_exact_outside_rows", "stat": "count", "value": 4096, "unit": "count", "n": 40960, "spread": null, "hardware": "cpu-epyc-rome-kvm-16", "date": "2026-12-02", "commit": "5db9a1b29fbba9eddbc537608cb9878622d2cc00", "source": "experiments/20261202-270-prefix-index-support/runs/summary.json", "note": "Over-budget ratio-1 rows checked against explicit ascending or descending membership; not positive-domain comparisons.", "total": 40960} - {"name": "prefix_support_mismatching_rows", "stat": "count", "value": 0, "unit": "count", "n": 40960, "spread": {"min": 0, "max": 0, "sd": 0}, "hardware": "cpu-epyc-rome-kvm-16", "date": "2026-12-02", "commit": "5db9a1b29fbba9eddbc537608cb9878622d2cc00", "source": "experiments/20261202-270-prefix-index-support/runs/summary.json", "note": "Zero sweep mismatches per replay. Of all rows, 6144 over-budget rows checked only invariants. Median, min, max and sample SD of mismatch counts across five deterministic replays all zero.", "total": 40960} - {"name": "prefix_support_wrong_address_controls", "stat": "count", "value": 2, "unit": "count", "n": 2, "spread": null, "hardware": "cpu-epyc-rome-kvm-16", "date": "2026-12-02", "commit": "5db9a1b29fbba9eddbc537608cb9878622d2cc00", "source": "experiments/20261202-270-prefix-index-support/runs/replay-1.json", "note": "Both deliberate errors changed actual addresses by exactly the predicted ID in each replay: extra latent 2 and missing raw key 4.", "total": 2} + + - id: qwen-rounding-attribution + title: "Which rounding accounts for the seven Qwen gain-first differences? (#273)" + status: "measured" + replication: "unreplicated" + pr: 276 + summary: "FAIL: 5 of 7 historical differences meet the gate-only bar (required 7). At token 314, channel 37, M2 and gate alone give -1435, gain alone and both give -1436; at token 14898, channel 51 either alone gives the wrong output. No joint-only case. Both endpoints reconstructed on all 512 positions. With both factors rounded, the output floor hides 462 coefficient differences. Fixture only; no replacement rule, proof or BF16 fidelity claim." + conditions: "Measured, unreplicated. Pinned stock layer 0, V/QK head 0, F=12, four tokens from sequence start. Five fresh serial CPU processes; deterministic repeats, not independent samples. One registered attribution table, no amended thresholds." + evidence: ["experiments/20261202-273-qwen-rounding-attribution/RESULTS.md", "experiments/20261202-273-qwen-rounding-attribution/PREREG.md", "experiments/20261202-273-qwen-rounding-attribution/ENV.json", "experiments/20261202-273-qwen-rounding-attribution/runs/summary.json", "experiments/20261202-273-qwen-rounding-attribution/runs/run-1.json"] + metrics: + - {"name": "qwen_attribution_sites_meeting_gate_only_bar", "stat": "median", "value": 5, "total": 7, "unit": "count", "n": 5, "spread": {"sd": 0.0, "min": 5, "max": 5}, "hardware": "cpu-epyc-rome-kvm-16", "date": "2026-12-02", "commit": "5f12e5bacc1d11a91a06e8822da7d5272cb73006", "source": "experiments/20261202-273-qwen-rounding-attribution/runs/summary.json", "note": "Measured, unreplicated. Among the seven historical differences, gate alone equals the decoded gain-first output and gain alone equals M2. Required: all seven."} + - {"name": "qwen_attribution_hidden_coefficient_differences", "stat": "median", "value": 462, "total": 512, "unit": "count", "n": 5, "spread": {"sd": 0.0, "min": 462, "max": 462}, "hardware": "cpu-epyc-rome-kvm-16", "date": "2026-12-02", "commit": "5f12e5bacc1d11a91a06e8822da7d5272cb73006", "source": "experiments/20261202-273-qwen-rounding-attribution/runs/summary.json", "note": "Measured, unreplicated. Both factors rounded vs M2: different integer coefficients and identical integer outputs on this fixture."}