Repository navigation
Ids are typed UUIDs end to end; rebuildable caches answer to RAM (ShedLru) - #5697
Conversation
|
Review of the ShedLru half at ba6f1f5 (Cormac; it is built to my pattern spec). Source read of memory_pressure/shed_lru.rs, mind_results_reporter.rs and channel_element.rs. The typed-id half is Codex's to review. Holds:
One conservation defect (blocking, in the pattern): every reporter at a priority sheds the WHOLE host overrun.
Two notes for the next step (the embedding cache):
|
…holds, and inserts computed values outside its lock (Cormac on #5697) - PressureSnapshot::share_of_overrun(priority, held): each shedder gives back the overrun past its gate in proportion to what it holds among the registered holders at that priority (Holder, register_holder, held weakly), so one pressure event frees the overrun once, not once per cache. ShedLru and mind_results both register and both use the share: one rule. - shed skips an entry a caller still holds (Arc::strong_count > 1): dropping the cache's copy frees nothing, and counting it would drain the cache while the RAM stays pinned elsewhere. - insert_if_absent: for values computed outside the lock (the embedding cache next); the first insert wins, so one value per key. Tests (M5, serving down 02:20-02:22Z): kernel shed_lru 3 (new: a held entry is never counted as freed; two holders' shares of one overrun add up to it once); cognition channel_element + mind_results 12; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…, a different one is refused before anything registers, and boot fails rather than run as two identities (Codex on #5697) - self_peer::ScopeRegistry (instance-owned; scopes() is the process's): designate(peer) is idempotent for the same peer and returns a typed ScopeConflict{existing, offered} for another, before the peer enters the self set. - AircModule::from_discovery(discovery, scopes) -> Result<Self, ScopeConflict>; boot propagates a conflict as a named io error (the module can never attach as B while the relay and beacon publish as A). Tests and the remote-lane fixture pass a fresh registry, so there is no global-test race. - airc_boot's peer short form uses airc's shown_form, not a .take(8) cut. Tests (M5, serving down 02:23-02:27Z): mind self_peer+chat 54 (new: same peer idempotent, a different one refused, the first stays); core modules::airc+inbound_attach+data_wiring+ remote_lane+grid_capacity 44; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Re-review of the ShedLru half at 6306b4b (Cormac). Diff ba6f1f5..6306b4b read for shed_lru.rs, mind_results_reporter.rs and persona_registry_modules.rs; the monitor's poll read for comparison. IntelMac, All three are fixed:
One remaining item (should-fix): the holder group is a second registry of the reporters the monitor already owns.
|
…ed from it: the second holder registry is gone (Cormac on #5697) - PressureSnapshot.held_by_priority (HeldAtPriority, ts-exported): the monitor's poll sums each live reporter's report().bytes by its priority, read off-lock beside report() (a quarantined reporter contributes nothing and sheds nothing; every monitor counts its own reporters). - MemoryReporter::priority() (cheap; defaults to the budget's), overridden by ShedLru and mind_results so a costly budget() never runs per poll. - share_of_overrun reads snapshot.held_at(priority); Holder, register_holder and the global group are deleted, with their wiring. - poll_interval: PRESSURE_FLOOR/PRESSURE_CEILING were the Interactive and Realtime gates restated; normalization now reads them from the gate table, as the explicit zones its doc describes. Tests (M5, serving down 02:41-02:44Z): kernel memory_pressure 26 (shares of one overrun across a priority's held bytes add up to it once); cognition channel_element + mind_results 12; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
PASS on the ShedLru / memory-pressure half at d317dbd (Cormac). The typed-id and scope half is Codex's; his scope blocker is cleared by his own review. What I verified, and how (I read the diff 6306b4b..d317dbd; I did not rerun the tests at this head):
One latent note, non-blocking: |
…ac's note on #5697) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…holds, and inserts computed values outside its lock (Cormac on #5697) - PressureSnapshot::share_of_overrun(priority, held): each shedder gives back the overrun past its gate in proportion to what it holds among the registered holders at that priority (Holder, register_holder, held weakly), so one pressure event frees the overrun once, not once per cache. ShedLru and mind_results both register and both use the share: one rule. - shed skips an entry a caller still holds (Arc::strong_count > 1): dropping the cache's copy frees nothing, and counting it would drain the cache while the RAM stays pinned elsewhere. - insert_if_absent: for values computed outside the lock (the embedding cache next); the first insert wins, so one value per key. Tests (M5, serving down 02:20-02:22Z): kernel shed_lru 3 (new: a held entry is never counted as freed; two holders' shares of one overrun add up to it once); cognition channel_element + mind_results 12; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…, a different one is refused before anything registers, and boot fails rather than run as two identities (Codex on #5697) - self_peer::ScopeRegistry (instance-owned; scopes() is the process's): designate(peer) is idempotent for the same peer and returns a typed ScopeConflict{existing, offered} for another, before the peer enters the self set. - AircModule::from_discovery(discovery, scopes) -> Result<Self, ScopeConflict>; boot propagates a conflict as a named io error (the module can never attach as B while the relay and beacon publish as A). Tests and the remote-lane fixture pass a fresh registry, so there is no global-test race. - airc_boot's peer short form uses airc's shown_form, not a .take(8) cut. Tests (M5, serving down 02:23-02:27Z): mind self_peer+chat 54 (new: same peer idempotent, a different one refused, the first stays); core modules::airc+inbound_attach+data_wiring+ remote_lane+grid_capacity 44; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
8383f3a to
048d781
Compare
…ed from it: the second holder registry is gone (Cormac on #5697) - PressureSnapshot.held_by_priority (HeldAtPriority, ts-exported): the monitor's poll sums each live reporter's report().bytes by its priority, read off-lock beside report() (a quarantined reporter contributes nothing and sheds nothing; every monitor counts its own reporters). - MemoryReporter::priority() (cheap; defaults to the budget's), overridden by ShedLru and mind_results so a costly budget() never runs per poll. - share_of_overrun reads snapshot.held_at(priority); Holder, register_holder and the global group are deleted, with their wiring. - poll_interval: PRESSURE_FLOOR/PRESSURE_CEILING were the Interactive and Realtime gates restated; normalization now reads them from the gate table, as the explicit zones its doc describes. Tests (M5, serving down 02:41-02:44Z): kernel memory_pressure 26 (shares of one overrun across a priority's held bytes add up to it once); cognition channel_element + mind_results 12; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ac's note on #5697) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…holds, and inserts computed values outside its lock (Cormac on #5697) - PressureSnapshot::share_of_overrun(priority, held): each shedder gives back the overrun past its gate in proportion to what it holds among the registered holders at that priority (Holder, register_holder, held weakly), so one pressure event frees the overrun once, not once per cache. ShedLru and mind_results both register and both use the share: one rule. - shed skips an entry a caller still holds (Arc::strong_count > 1): dropping the cache's copy frees nothing, and counting it would drain the cache while the RAM stays pinned elsewhere. - insert_if_absent: for values computed outside the lock (the embedding cache next); the first insert wins, so one value per key. Tests (M5, serving down 02:20-02:22Z): kernel shed_lru 3 (new: a held entry is never counted as freed; two holders' shares of one overrun add up to it once); cognition channel_element + mind_results 12; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…, a different one is refused before anything registers, and boot fails rather than run as two identities (Codex on #5697) - self_peer::ScopeRegistry (instance-owned; scopes() is the process's): designate(peer) is idempotent for the same peer and returns a typed ScopeConflict{existing, offered} for another, before the peer enters the self set. - AircModule::from_discovery(discovery, scopes) -> Result<Self, ScopeConflict>; boot propagates a conflict as a named io error (the module can never attach as B while the relay and beacon publish as A). Tests and the remote-lane fixture pass a fresh registry, so there is no global-test race. - airc_boot's peer short form uses airc's shown_form, not a .take(8) cut. Tests (M5, serving down 02:23-02:27Z): mind self_peer+chat 54 (new: same peer idempotent, a different one refused, the first stays); core modules::airc+inbound_attach+data_wiring+ remote_lane+grid_capacity 44; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ed from it: the second holder registry is gone (Cormac on #5697) - PressureSnapshot.held_by_priority (HeldAtPriority, ts-exported): the monitor's poll sums each live reporter's report().bytes by its priority, read off-lock beside report() (a quarantined reporter contributes nothing and sheds nothing; every monitor counts its own reporters). - MemoryReporter::priority() (cheap; defaults to the budget's), overridden by ShedLru and mind_results so a costly budget() never runs per poll. - share_of_overrun reads snapshot.held_at(priority); Holder, register_holder and the global group are deleted, with their wiring. - poll_interval: PRESSURE_FLOOR/PRESSURE_CEILING were the Interactive and Realtime gates restated; normalization now reads them from the gate table, as the explicit zones its doc describes. Tests (M5, serving down 02:41-02:44Z): kernel memory_pressure 26 (shares of one overrun across a priority's held bytes add up to it once); cognition channel_element + mind_results 12; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ac's note on #5697) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
048d781 to
6517e67
Compare
… one typed source header, an infallible replay cursor, and ShedLru for rebuildable caches (Joel: "assume we're using the UUIDs"; "consistency enables compression") - AircRealtimeEnvelope: event_id is a Uuid, source_id a PeerId, target_id an Option<PeerId> (ts: string). A non-id source cannot be built. AircReplayCursor, AircReceipt and AircRealtimePublishResult carry Uuid event ids. AircReplayCursor::to_airc is infallible: its parse and error disappear, and so does the daemon replay's .transpose()?. - One header: the dedicated continuum.sender_id header is gone. The claim is continuum.source_id, a peer id: equal to the transport is the author speaking for itself, anything else a claim the gate must prove. - The core's scope peer moves to persona::self_peer (register_scope/scope), the one owner of this process's ids. chat::publication::relay reads it; the grid capacity beacon publishes under it instead of the name "grid-capacity". - Contract verifier: typed event ids and source; the signed payload's text signer is compared as an id at the boundary (its own retype is a separate card). - ShedLru<K, V: ByteSized> (kernel system_resources::memory_pressure): a rebuildable in-RAM cache that registers with the MemoryPressureMonitor, accounts bytes, and sheds least recently used first to the host's overrun past its priority's gate. PressureSnapshot::over_gate is the one copy of that computation (mind_results now calls it). The channel element cache moves onto it: CHANNEL_ELEMENT_CACHE_MAX and with_max are deleted; it registers beside mind_results. - Self-sized constants removed from touched files: the replay page bounds (a page is what the caller asks, bounded by what the store retains), the pubkey hex length (ed25519_dalek's). - Test fixtures converted to typed ids (string event ids to Uuid::from_u128, names to PeerId). Tests (M5, serving down 02:01-02:07Z): kernel shed_lru + airc_realtime 28; cognition channel_element/channel_digest/conversation/mind_results 80; core airc/contracts/grid_capacity 162; mind chat 51; core check --tests clean; ratchets exit 0. Follow-up: the embedding cache (EMBEDDING_CACHE_MAX, continuum-engine) moves onto ShedLru next. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…holds, and inserts computed values outside its lock (Cormac on #5697) - PressureSnapshot::share_of_overrun(priority, held): each shedder gives back the overrun past its gate in proportion to what it holds among the registered holders at that priority (Holder, register_holder, held weakly), so one pressure event frees the overrun once, not once per cache. ShedLru and mind_results both register and both use the share: one rule. - shed skips an entry a caller still holds (Arc::strong_count > 1): dropping the cache's copy frees nothing, and counting it would drain the cache while the RAM stays pinned elsewhere. - insert_if_absent: for values computed outside the lock (the embedding cache next); the first insert wins, so one value per key. Tests (M5, serving down 02:20-02:22Z): kernel shed_lru 3 (new: a held entry is never counted as freed; two holders' shares of one overrun add up to it once); cognition channel_element + mind_results 12; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…, a different one is refused before anything registers, and boot fails rather than run as two identities (Codex on #5697) - self_peer::ScopeRegistry (instance-owned; scopes() is the process's): designate(peer) is idempotent for the same peer and returns a typed ScopeConflict{existing, offered} for another, before the peer enters the self set. - AircModule::from_discovery(discovery, scopes) -> Result<Self, ScopeConflict>; boot propagates a conflict as a named io error (the module can never attach as B while the relay and beacon publish as A). Tests and the remote-lane fixture pass a fresh registry, so there is no global-test race. - airc_boot's peer short form uses airc's shown_form, not a .take(8) cut. Tests (M5, serving down 02:23-02:27Z): mind self_peer+chat 54 (new: same peer idempotent, a different one refused, the first stays); core modules::airc+inbound_attach+data_wiring+ remote_lane+grid_capacity 44; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ed from it: the second holder registry is gone (Cormac on #5697) - PressureSnapshot.held_by_priority (HeldAtPriority, ts-exported): the monitor's poll sums each live reporter's report().bytes by its priority, read off-lock beside report() (a quarantined reporter contributes nothing and sheds nothing; every monitor counts its own reporters). - MemoryReporter::priority() (cheap; defaults to the budget's), overridden by ShedLru and mind_results so a costly budget() never runs per poll. - share_of_overrun reads snapshot.held_at(priority); Holder, register_holder and the global group are deleted, with their wiring. - poll_interval: PRESSURE_FLOOR/PRESSURE_CEILING were the Interactive and Realtime gates restated; normalization now reads them from the gate table, as the explicit zones its doc describes. Tests (M5, serving down 02:41-02:44Z): kernel memory_pressure 26 (shares of one overrun across a priority's held bytes add up to it once); cognition channel_element + mind_results 12; core check --tests clean; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ac's note on #5697) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ebased onto #5696's door) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
6517e67 to
9236b72
Compare
…e dead over_gate wrapper and its duplicate test go (CI on #5697: warnings 13 -> 14, two mind fixtures) Tests (M5, serving down 05:07-05:12Z): mind full lib 1104; cognition mind_results + channel_element 11; ratchets exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Stacked on #5696. How this serves the minds: every id a mind or the grid routes on is a typed UUID, so a forged or malformed id cannot even be built and one header carries the claim (Joel: "assume we're using the UUIDs"; "consistency enables compression"). Rebuildable caches are sized by RAM through the one memory monitor, never a count.
What changed
AircRealtimeEnvelope:event_id: Uuid,source_id: PeerId,target_id: Option<PeerId>. The replay cursor, receipt and publish result carryUuidevent ids.AircReplayCursor::to_aircis infallible, so its parse and error are deleted.continuum.sender_id(added in Perception from the store, P2: proven attribution, a single chat-store door, and relayed lines that survive a restart #5696) folds back into the typedcontinuum.source_id.persona::self_peer::{register_scope, scope}, the one owner of the process's ids. Both the chat relay and the grid capacity beacon use it; the beacon no longer publishes as the namegrid-capacity.ShedLru<K, V: ByteSized>, built to Cormac's spec: a rebuildable cache that registers withMemoryPressureMonitor, accounts bytes, and sheds least recently used first down to the overrun past its priority's gate.PressureSnapshot::over_gateis the one copy of that computation, andmind_resultsnow uses it.CHANNEL_ELEMENT_CACHE_MAXandwith_maxare deleted.ed25519_dalek's).Measured
M5, serving down 02:01–02:11Z, rebased on #5696
a2fb391e8:shed_lruandairc_realtime: 28 pass;mind_results): 80 pass;grid_capacity,data_wiring): 164 pass;Follow-ups
EMBEDDING_CACHE_MAX) moves ontoShedLrunext.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo