Skip to content

tests: lane-core conformance suite and decode invariant ledger - #4472

Merged
ashhart merged 3 commits into
mainfrom
lead/lanes-conformance
Nov 22, 2026
Merged

ashhart merged 3 commits into
mainfrom
lead/lanes-conformance

Conversation

@ashhart

@ashhart ashhart commented Nov 22, 2026

Copy link
Copy Markdown
Owner

What this changes

Every speed change we land has to keep each output bit. This adds a host conformance suite that pins the decode invariants those changes depend on, and a ledger that says, for each invariant, which tests already pin it and what only a device can check.

  • zig/src/core/lanes/conformance_test.zig (181 lines, five tests on the real lane engine over the fake target, checking the fake's cache against a fresh decode after every step):
    • fresh and resumed serial decode emit the same tokens and hold the same cache every round;
    • tree windows commit the plain decode's tokens, and rejected rows never stay in the cache (chains and trees, fresh and resumed);
    • the same request twice, greedy and keyed, gives the same tokens in the same rounds;
    • EOS and max_new end a drafted reply where the plain decode ends, with its stop reason;
    • a parent at or after its child is refused before any backend round.
  • docs/conformance-ledger.md: seven invariants (C1-C7), the existing tests for each with what they assert, the new rows, and what can't be pinned on the host (non-finite logits through the engine, device bytes, multi-rank agreement).

No engine code changes.

Checks

  • zig fmt --check and zig ast-check pass; the new file is 181 lines.
  • zig build test-shared-lane-regressions-host: rc 0.

…, reproducible, stops and malformed parents

Host tests over the fake target for the gaps in the serial/tree/resume conformance ledger (research rank 0):

- fresh and resumed serial decode: the same tokens and reason, plain and drafted, greedy and keyed, and the cache
  the fresh decode's after every step (one-token rounds: the same digest every step); existing tests pinned tokens;
- tree windows (suffix-match grafts beside the head's chain), fresh and resumed, emit the plain run's tokens with
  branch rows verified, the cache checked every step, so rejected tree rows never stay (rollback_test runs chains);
- the same request twice, plain, chain and tree, greedy and keyed: the same tokens, steps, drafts and cache;
- eos reached part way and max_new end drafted and plain replies with reasons stop and length at the plain length;
- a parent at or after its child is ParentAfterChild at accept.depths and refused by windows.build before any
  backend round; a valid tree builds with its row parents and depth-keyed positions.

No engine code changes. Registered in lanes.zig's test block (test-shared-lane-regressions-host).
…t pin each

C1 fresh = resumed, C2 tree = chain = plain, C3 reproducible greedy and keyed, C4 stops, C5 ties and non-finite
logits, C6 malformed parents refused, C7 off-path state guarded: for each, the existing tests that already pin it
(what each asserts) and the new conformance_test rows, then what the host cannot pin (device arithmetic, a backend's
own non-finite argmax, multi-rank agreement). Later decoding PRs cite its rows.
@ashhart
ashhart merged commit 3a02038 into main Nov 22, 2026
12 of 23 checks passed
@ashhart
ashhart deleted the lead/lanes-conformance branch November 22, 2026 03:46
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