Skip to content

test(lfm): the assembled epoch verifier executes under the PINNED permutation - #958

Merged
MauroToscano merged 1 commit into
per-table-gpufrom
pt/f1-assembled-verifier-pin
Sep 7, 2026
Merged

test(lfm): the assembled epoch verifier executes under the PINNED permutation#958
MauroToscano merged 1 commit into
per-table-gpufrom
pt/f1-assembled-verifier-pin

Conversation

@MauroToscano

Copy link
Copy Markdown
Contributor

Follow-up F1 from the #953 review, same class: a program built at WrapHash::production() emits Instr::Hash and must run under BLOCK_HASHER. Three sites in epoch_verify_tests.rs passed a literal TestPermutation. Both tests stay non-ignored.

site test
:510 the_assembled_epoch_verifier_runs, the execution
:1049 the_assembled_verifier_rejects_tampered_leg_data, the honest control
:1119 the same test's tamper loop

The control is why this is worth a PR. A wrong socket permutation breaks the honest arm first, and a tamper suite whose control is broken rejects every vector and reports a pass.

Behaviour is unchanged at the current pin, and it is checkable. impl LfmHasher for HasherKind (hash.rs:299) sends HasherKind::Test to TestPermutation for permute, compress_iv, transcript_iv, leaf_iv, compress, compress_out and transcript_out; the one defaulted method, mode_iv, composes three of those. The spellings agree while BLOCK_HASHER is Test and diverge when the pin moves.

No hash_pin_enumeration change. The gate scans for DefaultStarkHash, DefaultStarkTranscript and HasherKind::default(); this file names none, and its one stark::config:: item is Commitment, which is allowed. Blessing it would fire the gate's own stale assertion.

Gate pending on box B: cargo test --release -p lambda-vm-prover --lib -- lfm::epoch_verify_tests::the_assembled_epoch_verifier_runs lfm::epoch_verify_tests::the_assembled_verifier_rejects_tampered_leg_data --nocapture, plus make lint.

…mutation

`epoch_program` builds at `WrapHash::production()`, so by the classification
rule the program emits `Instr::Hash` and must run under `BLOCK_HASHER`. Three
call sites in this file passed a literal `TestPermutation` instead. Both tests
stay non-ignored.

- `the_assembled_epoch_verifier_runs` — the execution.
- `the_assembled_verifier_rejects_tampered_leg_data` — the honest control, and
  the tamper loop.

The middle one is the reason this is worth a PR rather than a tidy-up. The
honest control is what a wrong socket permutation breaks first, and a tamper
suite whose control is broken rejects every vector and reports a pass.

Behaviour is unchanged at the current pin, and that is checkable rather than
assumed: `impl LfmHasher for HasherKind` (hash.rs:299) dispatches
`HasherKind::Test` to `TestPermutation` for `permute`, `compress_iv`,
`transcript_iv`, `leaf_iv`, `compress`, `compress_out` and `transcript_out`,
and the one defaulted method, `mode_iv`, composes three of those. So the two
spellings agree across the whole trait surface while `BLOCK_HASHER` is `Test`,
and diverge exactly when the pin moves — which is the point.

Under a byte pin the naming is inert: `ByteWrapHash` lowers to the KECCAK /
`LFM_BLAKE3` chips and emits no `Instr::Hash`, so the socket is never
consulted. Under an algebraic pin the walks ARE `Instr::Hash`, and a toy
permutation would rebuild roots the host never committed.

No `hash_pin_enumeration` change: the gate scans for `DefaultStarkHash`,
`DefaultStarkTranscript` and `HasherKind::default()`, this file names none of
them, and its one `stark::config::` item is `Commitment`, which is allowed.
Blessing the file would fire the gate's own `stale` assertion.
@MauroToscano
MauroToscano merged commit 41a61b4 into per-table-gpu Sep 7, 2026
10 of 13 checks passed
@MauroToscano
MauroToscano deleted the pt/f1-assembled-verifier-pin branch September 7, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant