Skip to content

fix(seedless): extend the command buffer firewall to strict, lane batch, and add a ratchet - #174

Merged
penta2himajin merged 1 commit into
mainfrom
claude/issue169-firewall-rest
Aug 2, 2026
Merged

fix(seedless): extend the command buffer firewall to strict, lane batch, and add a ratchet#174
penta2himajin merged 1 commit into
mainfrom
claude/issue169-firewall-rest

Conversation

@penta2himajin

Copy link
Copy Markdown
Owner

Refs #169. Fourth and last of the firewall series (#171#172#173 → this).

What was still open after #171

path why it matters
runStrictLayers split CBs strict splits the forward across many command buffers, so one failure gives a partial forward — surviving layers sitting on state the failed CB never wrote. Worse than an all-or-nothing failure because the output looks less obviously broken.
stepArgmaxBatch / forwardRowsBatch a failed batch CB leaves tokensOut holding whatever it held, so every lane takes a token the GPU never produced.

Strict was the urgent one: the error message added in #173 recommends --lossless as the workaround, so strict failing silently would make the advice we hand users actively unsafe.

The ratchet

scripts/check_cb_guard.sh — bare waitUntilCompleted count, currently 89 (down from 94 as sites were converted). Increase fails the gate; decrease prints a reminder to lower the baseline.

Deliberately not a dataflow analysis, and the script says so: it cannot tell a fire-and-forget blit from a decode readback, and it only stops the count from growing. The upgrade path — mark intentional bare waits with // cb-unchecked: <reason> and gate on unmarked ones — is written into the script rather than left as tribal knowledge.

Still open

Gates

RAWTESTS 99/99 · BENCHBATCHTEST PASS · COMPTEST 97/97 · CBGUARD PASS

🤖 Generated with Claude Code

…ch, and add a ratchet (#169)

#171 guarded the two solo decode funnels. The paths it left open matter:

- runStrictLayers splits the forward across many command buffers. A single
  failure there is worse than a whole-CB failure, because the surviving layers
  sit on state the failed CB never wrote — a partial forward, not an obvious
  one. flushCB now records the fault and stepArgmax's .strict case refuses.
  This one is urgent for a specific reason: the error message added in #173
  recommends --lossless as the workaround, so strict failing silently would
  make the advice we hand users actively unsafe.
- stepArgmaxBatch / forwardRowsBatch: a failed batch CB leaves tokensOut
  holding whatever it held, so EVERY lane takes a token the GPU never produced.

scripts/check_cb_guard.sh is a ratchet on bare waitUntilCompleted (89, down
from 94). Deliberately not a dataflow analysis: it cannot tell a
fire-and-forget blit from a decode readback, and it only stops the count from
growing. The upgrade path — marking intentional bare waits with
`// cb-unchecked: <reason>` and gating on unmarked ones — is written into the
script rather than left implicit.

Gates: RAWTESTS 99/99, BENCHBATCHTEST PASS, COMPTEST 97/97, CBGUARD PASS.

Refs #169

Co-Authored-By: Claude <noreply@anthropic.com>
@penta2himajin
penta2himajin merged commit de5f5e9 into main Aug 2, 2026
1 check passed
@penta2himajin
penta2himajin deleted the claude/issue169-firewall-rest branch August 2, 2026 11:53
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