Skip to content

Commit e9bf3aa

Browse files
committed
lgj-abi: the operand is what makes the differential a test, measured
Follow-up to the file it amends. The disable table ran five arms and all five are red, but one of them settles a claim the previous commit only asserted: that replacing the tautological `LE_I32(500)` operand mattered. Mis-mapping `LGJ_OP_LE_I32` to `Pred::LtI32` in `plan_lower` — one token, and the exact defect class `lowering_convergence.rs` exists to catch — is: operand 300 (shipped): RED `LeI32(300)` = 866, `LtI32(300)` = 865 operand 500 (pre-fix): GREEN both select all 1000 So at the operand the spec originally used, a real mis-map is INVISIBLE: the two arms agree on an answer neither of them computed correctly. Two of the nine opcodes would have shipped untested while the file read as covering all nine. Recorded where the claim lives — in `OPCODE_CASES`'s doc comment, beside the measurement that chose the operand, with an explicit instruction not to move it back under the "the domain doc says 361, so 500 is safely past it" reasoning that put it there. Disable table, all five red: the AND/OR asymmetry (an OR gated on the accumulator); the prefix rewrite (`k := 0`); the one-opcode mis-map above; the fold's OR node (flattened into the enclosing AND); the fold's dead prefix (an OR before the first AND becoming a leaf). 182 lib tests, every integration binary green, clippy `-D warnings` + fmt clean. Board: LATEST_STATE 2026-09-14 (6) amended with the table. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
1 parent 8ad1a1b commit e9bf3aa

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

‎.claude/board/LATEST_STATE.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,25 @@ the fixture is dead:
5252
Both are now `assert_eq!`, measured, with the incident recorded at the
5353
assertion. Zero `TODO`s left in the file.
5454

55+
**And the fixture fix is itself measured, not asserted.** Mis-mapping
56+
`LGJ_OP_LE_I32` to `Pred::LtI32` in `plan_lower` — a one-token change, and
57+
exactly the defect class this file exists to catch — is **RED at operand
58+
300** (`LeI32(300)` = 866, `LtI32(300)` = 865; one row is enough) and
59+
**GREEN at operand 500**, where both readings select all 1000 and the two
60+
arms agree on an answer neither computed correctly. So the operand is the
61+
difference between a test and a decoration, and the pre-fix version of this
62+
file would have shipped blind to a real mis-map on two of its nine opcodes.
63+
64+
**Disable table — five arms, all red:**
65+
66+
| arm | disable |
67+
|---|---|
68+
| the AND/OR asymmetry | `plan_lower` gates an OR on the accumulator |
69+
| the prefix rewrite | `plan_lower` takes `k := 0` always |
70+
| a one-opcode mis-map | `LGJ_OP_LE_I32` -> `Pred::LtI32` |
71+
| the fold's OR node | the fold flattens an OR into the enclosing AND |
72+
| the fold's dead prefix | an OR before the first AND becomes a leaf |
73+
5574
Numbers, from `--nocapture`: per-opcode seeds 65 / 935 / 2 / 998 / 498 /
5675
676 / 866 / 500 / 65; the 28-vector sweep runs 39, 498, 524, 1000 (n=2),
5776
0, 40, 40, 73, 112, 531, 557, 1000 (n=3) — both identical to

‎native/lgj-abi/src/exports/tests/lowering_convergence.rs‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,13 +458,24 @@ fn the_all_rows_shortcut_is_the_same_condition_on_both_sides() {
458458
/// always-true on this lane — so a swapped entry in either mapping table
459459
/// would have passed, which is precisely the defect this file exists to
460460
/// catch. Measured (n = 1000, seed = 33): values span `-150..=361` with
461-
/// median 100, so `LT_I32(200)` selects 676 and `LE_I32(300)` selects 865.
461+
/// median 100, so `LT_I32(200)` selects 676 and `LE_I32(300)` selects 866.
462462
///
463463
/// The four ordered comparisons are also given DISTINCT counts on purpose.
464464
/// This is a differential between two arms, not against ground truth, so a
465465
/// mis-map is visible only when it moves ONE arm's count — and two opcodes
466466
/// that happen to select the same number of rows would hide a swap between
467467
/// exactly those two.
468+
///
469+
/// That is not a theoretical worry; it was MEASURED on this exact file.
470+
/// Mis-mapping `LGJ_OP_LE_I32` to `Pred::LtI32` in `plan_lower` — a
471+
/// one-token change, and the precise defect class this test exists to catch
472+
/// — is RED at operand `300` (`LeI32(300)` selects 866, `LtI32(300)` selects
473+
/// 865: one row of difference is all it takes) and **GREEN at operand
474+
/// `500`**, where both readings select all 1000 and the arms agree on an
475+
/// answer neither of them computed correctly. The operand is what makes this
476+
/// a test rather than a decoration; do not move it back inside the "the
477+
/// domain doc says 361, so 500 is safely past it" reasoning that put it
478+
/// there.
468479
const OPCODE_CASES: [(&str, u32, u32, i64); 9] = [
469480
("EQ_U32", LGJ_OP_EQ_U32, LANE_CLASSES, 7),
470481
("NE_U32", LGJ_OP_NE_U32, LANE_CLASSES, 7),

0 commit comments

Comments
 (0)