Repository navigation
Admission waits wake on the change that admits them, never on a timer (timer audit H3, H4, H14, H17, H18) - #5991
Conversation
… (timer audit H3, H4, H14, H17, H18) H3 lanes: parked non-directed callers wait on `released` alone. It now fires after every change that can admit (budget permit back, ticket given up or granted, budget grant aging an ambient caller, held-work wait ending, grown pool), and the release's wake fires after its permits return (it ran in the permit's Drop body, before the fields dropped: the missed wake the three 1 s arms hid). Arms deleted. H4 lane_send: a 503/refused POST mid-relaunch resends on the serving daemon's next live publish after the POST, bounded by DEFAULT_SERVING_WAIT; linear backoff and its two constants deleted. H14 training_admission: await_training_change and SERVING_BUSY_RETRY deleted (no production caller since #5925); TrainingWait::Serving carries the typed GateRefusal. H17 embed lease: the retry waits on the LeaseBoard change that makes room, bounded by the authority's own tick, instead of a fixed 2 s sleep. H18 lane memory headroom: re-judged on each MemoryPressureMonitor publish (subscribe_published) instead of a 5 s poll. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Review finding at c240a9c: H17 in embed_lane_memory.rs still advances work on elapsed time. Please make the wait resolve to an explicit owner-published capacity/terminal outcome and retry only on the appropriate result. Closed publisher must be distinguishable from room available; currently The storage page API is now grouped borrowed BinaryPageRequest + borrowed output views, with required NonZeroUsize size. I agree with rule11's contract direction; an explicit transfer of native buffer custody to a detached owner still needs ownership semantics rather than hiding a clone behind a borrowed signature. |
…e ratchets Rule 10/11 text: canary's #5986 wording kept, plus the shape-ratchet section, its baselines and the correction that time_bounds and wall_clock never counted sleeps. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…mer (Codex on #5991) (#5995) * A refused embed lease waits on the authority's own answer: room published or the authority closed, never a timer (Codex on #5991) The H17 wait from #5991 ran the second attempt when one daemon cadence expired, and read the authority's closure as "published". It now resolves to a typed RoomOutcome from the owner: Published { available } (the only outcome a retry runs on) or AuthorityClosed (a terminal refusal). No timeout remains; a silent or still-short authority keeps the wait pending for the caller's own bound to end. Deterministic test covers closure, silence across an hour of paused clock, a short publication, and the publication with room. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The release test waits for the authority's first tick before it leases, so its next publication is the release Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The release test's authority ticks once a day, so no tick answers the waiting lease before the release does Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * A refused embed lease marks the authority's board seen when it subscribes, so only a later publication answers it ResourceDaemon::subscribe hands out a clone of the channel's stored receiver, whose seen version is the channel's start: changed() returned at once and the wait answered StillShort from a board older than the refusal. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Why this matters for residents: every act goes through engine admission. This change gets them through it sooner, which serves path step 1 (median act under 60 s) and order-of-work line 3 (one admission owner). It applies RTOS rule 10 from #5986: stages announce what they deliver and dependents subscribe; a timeout only ends a wait as an error. Audit:
~/.continuum/evidence/timer-flow-2026-11-14/inventory.md, section 1.Converted rows
resource_admission/lanes.rs(the three 1 s arms)released.notified()raced with a fixed 1 s re-check.releasedalone and register before they check. It now fires on every change that can admit a waiter: a budget permit returned (BudgetPermit), a ticket given up (ProgressGuard::physical) or granted (try_budget), a budget grant that ages an ambient caller (ProgressGuard::granted), a held-work wait ending (WorkWaitingdrop), and a pool that grows (set_served_lane_count).lane_send.rs(linear backoff)DEFAULT_SERVING_WAIT, the bound the pre-flight guard already uses for a transition. With no daemon nothing will relaunch the lane, so the 503 is classified at once.LANE_RELAUNCH_CONNECT_RETRIESandLANE_RELAUNCH_RETRY_BASEare deleted. The result is typed asRelaunchWait {Resumed, NoOwner, Lapsed}.training_admission.rs:88SERVING_BUSY_RETRY, 1 s.await_training_changehad no production caller since #5925, which made a memory shortfall end the pass instead of wait. The function, its constant and its test are deleted.TrainingWait::Serving(String)becomesServing(GateRefusal).embed_lane_memory.rs:89sleep(2 s), then retry once.LeaseBoardchange that makes room.available_foris read outside the watch borrow, because the daemon publishes while holding the governor lock. Bounded by the authority's owncadence().single_purpose_lane/memory.rs:116MemoryPressureMonitorpublish. The kernel addsMemoryPressureMonitor::subscribe_published(); every publish happens after the tick has stored level, gate and free bytes. With no monitor the refusal stands at once. The probe fires when the refusal changes instead of on every tick.Root cause the H3 arms were hiding:
ServingLanePermit::dropcallednotify_waiters()in its body, and a Drop body runs before the fields drop. Every release therefore woke parked callers while its permits were still held. On a multi-threaded runtime, a caller woken on another worker found nothing free and parked with no further wake coming, so the 1 s arm moved it. Now:Notifiedbefore checking (acquire_nondirected_as_ambientandacquire_aged_ambientused to register after).Skipped rows (verified against source; already compliant with rule 10)
admission_clock.rs:198-213:waiting_with_probealready resolves on the acquisition through abiasedselect, so the grant is the event. The monitor only setsstalled, which is the error path. The evidence it samples, holder-slot progress, is an HTTP/slotsread with no in-process event. Waking on grants alone removes no probe and changes nothing.llama_server/progress.rs:427-436: same shape. The work finishing wins at any instant (biased). The timer only paces liveness evidence for an external process:/slotsfingerprint plus process CPU, the busy-is-not-dead model in cards 8c06f778 and 6f3218ed. Neither has an event today. The paused-clock tests inturn_admission/tests*andllama_server/tests/progress.rsstay with it.slot print_timingstderr lines theLineWatchalready drains. It needs an answer for adopted engines with no stderr, and for save/restore phases that print nothing. Needs a card and an owner.Tests
Each test has a
// what this catches:line, and there is one test mod per file.resource_admission/tests.rsa_release_wakes_parked_callers_only_after_its_budget_permit_is_back: a recordingWakerreads the free budget permits at the instant of the wake. It reads 0 on the old code and 1 now.resource_admission/tests.rsa_release_grants_the_parked_caller_at_the_same_instant: paused clock. Parked Work, then Ambient, are each granted with zero virtual time elapsed after the release. On the old code the 1 s arm would show up as 1 s.openai_adapter/tests/lane_transport.rsa_relaunch_refusal_resends_on_the_live_publish_and_never_on_a_timer:embed_lane_memory.rsa_refused_embed_lease_is_granted_by_the_release_that_makes_room: paused clock; zero elapsed between the release and the grant.seat/tests.rsnow follows the production shape: wait for the authority to publish room, then make one new seat attempt.Test seam:
lane_send::publish_serving_for_test, acfg(test)thread-local stand-in for the serving daemon's snapshots. Without it, tests would read whichever process-globalSERVING_STATEanother test installed.Lines
RelaunchWaitenum and the test seamDeleted: 5 timer arms or sleeps, 3 constants, 1 dead public function and its test.
Ratchets:
swallowed_errors: the removedlet _ = timeout(...)is not replaced by any new one.unwrap_justification: no new unwrap or expect in production.file_size: every touched file is under 1,000 lines.Verification
Not compiled locally: this machine serves live minds, so CI is the compiler.
Measured
Nothing is measured yet. This needs a deploy, and the receipt below is still owed (card open until posted).
waited_msofadmission.lane.granted(andlane_tally) over 1 h at 4 residents, before vs after. The prediction is that the 1 s-quantized tail disappears; that is a hypothesis.inference.lane_relaunch_retrywaited_msand the count of lane-down act failures.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo