Decision
Treat the whole chunk as the transaction—not each kernel, layer, or token-shaped buffer.
In the Phase 5 Hebrus graph, a chunk can update the four-stream residual, GDN convolution and recurrent matrices, QSA K/V and raw-index caches, PLE history and convolution state, selected routes, the public frontier, and logits. These values form one logical state image. Publishing them independently would permit combinations that the model never computed.
Why local rollback is insufficient
A stage can fail after earlier stages have produced valid private results. The failure may be structural, a non-finite intermediate, an allocation denial, a Metal command that did not complete, or a nonzero device status word. Tracking which individual writes need undo logic turns every future state owner into another rollback branch.
That approach is fragile because ownership grows faster than the rollback checklist. It also asks the host to reconstruct whether device work partially executed.
The publication model
Hebrus keeps two complete state banks:
- one bank is the only public state;
- the other becomes the transaction-private working image;
- every graph stage mutates only the private image;
- output remains caller-private while work is fallible;
- finite checks, command completion, and status words must all pass;
- one bank-index flip publishes the new frontier, state, and logits together.
Failure therefore discards an unpublished image. It does not attempt to reverse history.
Evidence that matters
The useful test is not merely “a successful token produces expected logits.” Phase 5 injects failure after every graph stage and verifies two properties: the digest of all public state owners is unchanged, and the caller’s output sentinel is untouched. Separate cases cover non-finite arithmetic and Metal allocation, command-completion, and status failures.
The same final state is then required for single-token, differently chunked, and interleaved multi-turn execution. Chunk size is a scheduling choice; it must not change model history.
Reusable rule
When an inference operation updates more than one persistent owner, define one publication point before adding optimization. If the implementation cannot name that point, it does not yet have transactional state semantics.
Failure boundary
This milestone uses a tiny deterministic correctness graph. It establishes the transaction seam, not production quality or speed. Real weights, quantized tensors, streamed PLE pages, sparse long-context QSA, and the product execution route remain later gates.