Skip to content

generate/verify: make diagnostic dumps work under --spec for native packs - #169

Closed
samuelishida wants to merge 1 commit into
Niko1221:mainfrom
samuelishida:pr-hip-diagnostics
Closed

samuelishida wants to merge 1 commit into
Niko1221:mainfrom
samuelishida:pr-hip-diagnostics

Conversation

@samuelishida

Copy link
Copy Markdown
Contributor

A native (IQ) pack decodes through verify windows only, so --dump-logits, --dump-layers, and --dump-final-r must emit rows from those windows rather than from the ordinary token loop.

What this PR does:

  • Captures the residual ladder inside the verify-window graph when --dump-layers is set. Rows are the fused-layout residual (layer l's write stays pending inside layer l+1's fused read), which is what the engine actually holds.
  • Writes --dump-logits and --dump-final-r rows for accepted window rows only; rejected drafts are conditioned on tokens the ordinary path never feeds.
  • Rewrites the logits header at close with the real row count so readers see the size the file actually holds.
  • Refuses --dump-halves under --spec cleanly.
  • Decouples the expert-tier residency-table staging from the dump-gate so the table is available both to the token graph and to verify windows, while preserving the original gate for --no-capture / --no-token-graph paths.
  • Provision-gates ple_parity in CMake because its >100 MB fixtures and per-artifact oracle include were never committed; the missing supply chain is documented in tests/python/README.md.

Also documents the native-pack dump semantics in docs/AMD_HIP.md.

… under --spec

A native (IQ) pack decodes through verify windows only, so the three oracle
dumps must emit rows from those windows:

- Capture the residual ladder inside the verify window graph when
  --dump-layers is set; rows are the fused-layout residual (layer l's write
  stays pending inside layer l+1's fused read), which is what the engine holds.
- Write --dump-logits and --dump-final-r rows for accepted window rows only;
  rejected drafts are conditioned on tokens the ordinary path never feeds.
- Rewrite the logits header at close with the real row count so readers see the
  size the file actually holds.
- Refuse --dump-halves under --spec cleanly.
- Decouple the expert-tier residency staging from the dump-gate so the table is
  available both to the token graph and to verify windows, while preserving the
  original gate for --no-capture / --no-token-graph paths.
- Provision-gate ple_parity in CMake (its >100 MB fixtures and per-artifact
  oracle include were never committed); the missing supply chain is documented
  in tests/python/README.md.

Also documents the native-pack dump semantics in docs/AMD_HIP.md.
@Niko1221

Copy link
Copy Markdown
Owner

Thanks @samuelishida, the dump block is now read-only and keeps the verify order, which was our main concern. Still needed for a new PR: the host_res staging condition must stay off for --no-capture / --no-token-graph (it's currently original || (graph_hits && o.spec > 0), which stages under --spec anyway); drop the session-zeroing copy (that part is taken via #167); and the new tests/python/README.md describes a CMake gate and STRATA_PLE_TEST_* options the PR doesn't add. Put the docs in a general doc, not AMD_HIP.md. We're closing PRs that wait on changes so the list stays manageable; this is not a no. Please open a new PR when it's ready and link this one.

@Niko1221 Niko1221 closed this Sep 30, 2026
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.

2 participants