Skip to content

A decided credit's settle runs off the region's tick and is never cut by it (card a4e8756d) - #5547

Merged
joelteply merged 3 commits into
canaryfrom
a4e8756d/a-decided-credit-s-settle-runs-off-the-g
Oct 28, 2026
Merged

joelteply merged 3 commits into
canaryfrom
a4e8756d/a-decided-credit-s-settle-runs-off-the-g

Conversation

@joelteply

@joelteply joelteply commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

How this serves the minds: a persona's reviewed credit reaches her training bucket as soon as its submit completes, with nothing cutting it partway. This advances goal 8 (learning, my lane). It is hardening, not a fix for an observed permanent failure.

Why

CreditAcceptanceRegion (#5531) settled each owed decision inside its tick, under half the governor's region bound (tick_budget).

Windows, 2026-10-28 01:58Z:

  1. A submit for Kimi's 28087ebb outlasted that budget.
  2. It was cancelled after the trigger had already accepted it, but before her acceptance was recorded.
  3. Each later pass cut it again in the same way, until one happened to fit (Codex's receipt: acceptance created 02:04:59.415Z, replayed true, BatchAppended, held by job 598e183c).

So the cut was intermittent, not a livelock; I retracted that claim on airc. It still leaves a decided credit unrecorded for as long as its submits stay slow.

Change (continuum-mind, persona/training_producer/)

  • credit_acceptance_region.rs: the tick reads what is owed (owed_acceptance, a store read) and asks the slots to start each owed decision's settle (retry_decided under its original submission id). It never waits on a settle. The cadence is Slower while anything is owed. Removed: tick_budget, Attempt, and the retry_slow cut.
  • settle_slots.rs (new; Codex's review of 5a2a318): one owner for the settles in flight.
    • Bounded: at most a page (8) per persona, one per decision.
    • Its own deadline (4f67dfb, after CI at 1162e72): a settle past its quantum is cut when its decision comes round (Admit::Cut), even with nothing waiting. A hung submit is retried with backoff, which the old per-tick budget also did, and 1162e72 didn't. Under contention, another overdue settle of hers is cut for the waiting decision.
    • Quantum: the governor's own REGION_TICK_TIMEOUT, doubled each time that decision's settle was cut. A slow submit of duration D completes after about log2(D / 5 s) cuts, where the fixed per-tick cut never let it.
    • Drained before reuse: a cut slot stays counted (draining) until its task has actually ended, one abort at a time, so her settles never exceed the bound. The waiting decision starts on a later pass.
    • Owned: each task's abort handle lives in its slot. Any persona's pass sweeps personas that have left (they may never tick again), and dropping the region aborts the rest; task guards hold a Weak, so a hung task can't keep the slots alive. Aborts run outside the lock, because an aborted task's guard takes it.
    • Safe to abort: a replay under the same submission id is accepted at most once, so an abort never double-writes.

Tests

  • settle_slots (continuum-mind, 3 passed locally):
    • eight_hung_settles_never_starve_a_ninth_healthy_decision: 8 settles that never end hold her page. The ninth waits within their quantum. Past it, one hung settle is aborted and still counted until its task ends; then the ninth starts and settles, and the preempted one runs again when a slot is free.
    • an_overdue_settle_is_cut_and_retried_with_a_doubled_quantum: a hung settle with nothing waiting is cut once past its quantum. It drains, is retried, and its quantum doubles with each cut. A cut task's late end never frees its successor's slot.
    • a_departed_persona_and_a_dropped_region_abort_their_settles.
  • refused_submit.rs (continuum-core): both fixtures now tick and observe the outcome (tick_until, bounded), because a settle runs off the tick. The hanging-decision fixture also proves the hung settle is cut and retried once past its quantum (CI at 1162e72 caught the missing retry).
  • Mind integration fixture (continuum-core, test_env/mind_integration/training_credit/automatic.rs): HangOn adds a slow decision that answers only after 3 s, longer than the old tick budget. The healthy decision is slow, the other hangs, and the slow one is still accepted. CI only on this node.
  • Ratchets: 68/68 against origin/canary. cargo check -p continuum-mind --lib is clean (macOS x86_64).

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

… by it (card a4e8756d)

CreditAcceptanceRegion settled each owed decision inside its tick under half the
governor's region bound. On Windows (2026-10-28 01:58Z) a submit slower than that
was cancelled after the trigger accepted Kimi's 28087ebb but before her acceptance
was recorded, and each pass cut it again until one fit (02:04:59Z). Hardening, not
a fix for a permanent failure: the tick now only reads what is owed and starts one
settle per decision (at most a page per persona in flight); the settle runs to
completion as its own task and a drop guard frees its slot however it ends.

Removed: tick_budget, Attempt, the retry_slow cut. REGION_TICK_TIMEOUT is private
again. The mind-integration fixture gains a settle slower than a tick budget.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
… decision, drained before reuse (Codex on #5547)

At 5a2a318 eight settles that hang forever held every slot of hers, and a ninth,
healthy decision never started; spawned tasks had no owner. SettleSlots (new,
settle_slots.rs) owns them: a page per persona; a settle is aborted only under
contention, when another owed decision waits and it has outrun its quantum (the
governor's REGION_TICK_TIMEOUT, doubled each time that decision was preempted), and
its slot stays held (draining) until its task has ended, one abort at a time. Aborts
run outside the lock. Any pass sweeps personas that left; dropping the region aborts
the rest (guards hold Weak). A replay under the same submission id is accepted at
most once, so an abort writes nothing twice.

Tests (settle_slots): eight hung plus a healthy ninth; a slow settle cut only under
contention with a doubling quantum; a departed persona and a dropped region abort.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@github-actions github-actions Bot added size: L and removed size: M labels Oct 28, 2026
…g; the fixtures observe async settles (Codex on #5547)

CI at 1162e72 failed two existing fixtures (refused_submit.rs), and one exposed a real
gap: with a single owed decision there is no contention, so a hung settle was never cut
and the decision was never retried, which the old per-tick budget did. A settle past its
quantum is now cut when its own decision comes round (Admit::Cut), its next quantum
doubled, so a hung submit is retried with backoff and a slow one completes after about
log2(D / 5 s) cuts; contention still cuts another overdue settle for a waiting decision.
The fixtures tick and then observe the outcome (tick_until, bounded), since a settle now
runs off the tick.

Renamed: Admit::Preempting -> Cut, preempted -> cuts. Test rewritten:
an_overdue_settle_is_cut_and_retried_with_a_doubled_quantum.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@github-actions github-actions Bot added size: XL and removed size: L labels Oct 28, 2026
@joelteply
joelteply merged commit 1cae16d into canary Oct 28, 2026
15 checks passed
@joelteply
joelteply deleted the a4e8756d/a-decided-credit-s-settle-runs-off-the-g branch October 28, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant