Repository navigation
#567 Opt-in strict tick-abort policy — cancel the rest of the tick on a fatal system exception - #601
Merged
Merged
Conversation
This was referenced Jul 31, 2026
[doc-drift] 10-runtime.md failure-isolation paragraph names wrong SkipReason for the new policy
#605
Closed
Closed
nockawa
added a commit
that referenced
this pull request
Jul 31, 2026
… doc/ [no-ut] [no-doc] (#610) PR #601 added RuntimeOptions.SystemExceptionPolicy but nothing in doc/ moved, leaving four feature-set pages and the runtime overview asserting fault-isolation semantics as unconditional — "one failure doesn't abort the tick", "other DAG branches continue", "it does not abort sibling members". Each fix qualifies the existing statement as the Isolate default rather than replacing it, then states what AbortTickAndStop does instead. All five also carry the two exemptions none of the filed issues mention: engine tracks never observe the abort flag (D3 — the fence runs no matter what), and abort granularity is the system rather than the chunk (D1), so a system already running drains all of it. 10-runtime.md additionally gains OnTickAborted / LastTickOutcome / FatalStop in the §9 hooks list and SystemExceptionPolicy in the RuntimeOptions knobs table, none of which existed in the docs despite being public API since #601.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #567.
RuntimeOptions.SystemExceptionPolicy = AbortTickAndStopmakes the first unhandled system exception cancel the remainder of the tick. Default staysIsolate— today's fault isolation, unchanged.The objective is cancellation, not durability suppression. The issue asked for
WriteTickFenceandUoW.Flush()to be skipped so a failed tick would not become a durability boundary. That was rejected: SingleVersion components are written in place and receive their WAL record at the fence, so skipping it leaves the page mutated, dirty and un-logged for the checkpoint thread to persist later — a durable mutation with no log record behind it, which is exactly AP-01's[fatal][silent]failure mode. Skipping the fence would have created an illegal durability boundary rather than avoiding one. Fence and flush now run on every tick, aborted or not, and that is recorded as new rule TP-01a.What the abort actually does: nothing that hasn't started runs, running systems finish normally, the output phase is suppressed so a failed tick is never published, and the runtime goes terminal.
How cancellation works
Typhon cancels by dispatch-and-drain, never by halting dispatch — a tick terminates when
_systemsRemainingreaches zero, so a system that is never dispatched hangs the tick._systemFailedpropagation was already a cancellation protocol with per-system scope; this adds a tick-scoped latch read at the three gates that already read it.Two design corrections found during implementation, both folded back into the design doc:
FindReadySystem. That reintroduces the very hang it exists to prevent. It must be after the claim succeeds. Verified by negative control: with the gate disabled,AbortTickAndStop_ReadyButUnclaimedRoot_DoesNotRunfails withvictimCount == 1.DrainFailedSystemChunksis used, for systems that have not started. What rule D1 forbids is draining a system that already has.Deviation from the design
The design called for an
OnCriticalOverload-style internal callback bridge for the abort event. Not done, deliberately: that would fire host code on a worker thread mid-tick.OnTickAbortedis raised fromOnTickEndInternalinstead — TickDriver, after the tick drains, so ordering is trivial and "exactly once" falls out for free.Prerequisite fixes (independent of the feature)
catch { flag; return; }sites fixed —OnShouldRun/OnPrepareon both the single-threaded and multi-worker successor paths. All four swallowed the exception with no log, no capture, noSkipReason.CaptureSystemExceptionno longer lazy-allocates; the??=raced across concurrent workers and silently dropped every capture but one.RecordSystemFailurenow funnels log → capture → maybe-latch, replacing 12 hand-rolled call pairs.Public surface
SystemExceptionPolicy,TickOutcome/TickOutcomeReason,SkipReason.TickAborted,TyphonRuntime.LastTickOutcome,TyphonRuntime.OnTickAborted,TyphonRuntime.FatalStop().Performance
Free when off. Six checks, the hottest being one per successor edge; the two chunk-loop gates sit inside a pre-existing
if (chunk == 0)branch, so the per-chunk inner loop pays nothing. The latch is a padded, write-once int — shared-clean in every core's L1, no coherence traffic, and_systemIsEngine[]short-circuits so it is never loaded unless an abort fired.Testing
15 new tests across two fixtures (~2 s). Full suite 4076 passed / 0 failed.
Two ACs are not covered by tests and are flagged as inspection-only in the design doc rather than quietly ticked:
Design doc:
claude/design/Runtime/08-strict-tick-abort.md(Status: Implemented) intyphon-claude, same branch name.🤖 Generated with Claude Code
https://claude.ai/code/session_01Gcg4vW8vJ4QjNyj6NQabHs