Repository navigation
A grants waiter marks the current grants seen before it waits: an ungranted mind parks until a newer publish, never spins - #5753
Conversation
…ranted mind parks until a NEWER publish, never spins d394694 (#5752) pegged the M5 core at 339% CPU: delib.window.ungranted fired 751 times for Atlas in about a minute. grants_changed() cloned the installed watch receiver, which never marks a value seen, so every clone's changed() resolved at once, and an ungranted mind looped measure -> wake -> ungranted with nothing changed. The same latent spin was in CapacityReadiness::wait's grants arm on any node with grants. Rolled back to 0b28543. - GrantsWaiter::new marks the current grants seen (borrow_and_update); changed() resolves only on a newer publish. grants_waiter() is taken BEFORE each decision (decide_window) and before the readiness check, so a publish between the two is never lost. - decide_window refuses with GrantsUnavailable only when she is ungranted; a decided window needs no watch. - Tests on a LIVE tokio watch: a waiter over unchanged grants is Pending and one send wakes it; an ungranted mind is measured once, parks, and runs at her grant; no watch refuses only an ungranted mind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
PASS at 3d3672e (Cormac; author session 01LoTjvf…, not mine). This time I checked the wake semantics on the real primitive, which is where my #5752 pass failed. Verified:
Per Joel's gate: after merge, its binary goes to the IntelMac FIRST for idle CPU and CPU per act. I'm recording the b03d7c5 baseline now. |
…future (unwired-machinery ratchet) GrantsWaiter was a pub type constructed only in its own file, which the production_reachability ratchet counts as unwired public machinery. Callers only await a newer publish, so grants_waiter() returns that future and the type stays private; it still marks the current grants seen when called (eager), so no publish between the waiter and the decision is lost. decide_window takes any such future. M5 03:36Z: ratchets against canary pass; engine capacity::mind_window 3; cognition workspace::capacity 4; clippy clean on changed lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
PASS at d1ecefa (Cormac). The delta from 3d3672e is visibility only: The one thing that could have broken: |
Fixes the spin that #5752 (d394694) put on the M5, which was rolled back to 0b28543 at 03:18Z. Serves the minds by making a mind without a grant wait quietly for one instead of burning the core.
The defect (measured)
On d394694 the core sat at 339% CPU, and
delib.window.ungrantedfired 751 times for Atlas in about a minute.grants_changed()cloned the installed watch receiver. That receiver never marks a value seen, so every clone'schanged()resolved at once, and an ungranted mind looped measure -> wake -> ungranted with nothing changed. Atlas was ungranted because the pool launched small (49,664). The same latent spin sat inCapacityReadiness::wait's grants arm on any node with grants.The change
GrantsWaiter::newmarks the current grants seen (borrow_and_update);changed()resolves only on a newer publish.decide_windowtakes one before each decision, and the readiness takes one eagerly beforeself.changed(), never lazily inside a later-polled block. A publish in between is never lost.decide_windowrefuses withGrantsUnavailableonly when she's ungranted. A decided window needs no watch.Tests (on a LIVE tokio watch, not a fake future)
a_waiter_parks_on_unchanged_grants_and_wakes_on_a_newer_publish: Pending on unchanged grants, and one send wakes it.an_ungranted_mind_is_measured_parks_then_runs_at_her_grant: measured once, then granted.no_grants_watch_refuses_only_an_ungranted_mind.an_unchanged_capacity_wait_parks_and_never_spins, from One determiner of a mind's window: capacity::mind_window decides it; the turn and its readiness ask it (card de7bb6e8) #5752, still passes.Measured
continuum-enginecapacity::207 passed;continuum-cognitionworkspace + llm_deliberation_faculty 164;continuum-mindplacement_switch 25. Clippy clean on changed lines.delib.window.ungrantedstorm. Then the M5, with an interim read at 1 minute and the same CPU check.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo