verify_graph_key

Function verify_graph_key 

Source
pub fn verify_graph_key(
    pairs: &[(u32, u32)],
    wy_tables_null: bool,
    write_on_accept: bool,
) -> Vec<u32>
Expand description

The batched-verify CUDA-graph cache key for one batch: the (ssm slot, row count) pairs in DISPATCH order, then one sentinel word carrying the wy-tables-present bit and the write-on-accept bit.

Every SSM pointer a capture bakes (h/conv state, rollback intermediates, WY table contents) is a pure function of the pair at that batch position, and the depth-run launch structure is a pure function of the depth sequence — so the key must carry both, in order. All other captured addresses (hidden/logits/scratch/meta) are fixed buffers refreshed pre-replay. The sentinel keeps a table-less capture from ever replaying a table-full step or vice versa.

Pairs arrive in the order verify_batch_order produced, so with canonicalization on the key is a pure function of (slot set, depth multiset, sentinel) — the whole point of this module.

write_on_accept is part of the key because the captured GDN launch differs with it (the K=4 write-on-accept twin against the parent wy4): a graph captured for one request must never replay for the other.