Repository navigation
The engine chapter, rewritten by concept to describe the code; the substrate gets its own chapter - #6170
Closed
joelteply wants to merge 8 commits into
Closed
The engine chapter, rewritten by concept to describe the code; the substrate gets its own chapter#6170joelteply wants to merge 8 commits into
joelteply wants to merge 8 commits into
Conversation
…e substrate moves to its own chapter CONTINUUM-ENGINE.md was 2,751 lines: dated sections 4.1a-4.10 appended over two months, an embedded plan (section 8), and the whole runtime substrate (sections 2, 3 and 7). Joel, 2026-11-19: docs are modules, refined, never appended. - CONTINUUM-ENGINE.md (about 330 lines) is organized by the engine's objects: what it is and its gates (wall-window vs decode-only rates, Codex), objects and ownership (each row names the file on canary), the frame loop, admission (invariants I1-I5 and policies P3-P6/P4a keep the labels code cites), residency, a mind's context, engine configuration, custody and stop, measurement. Proposed changes are marked inline where they apply. Dated receipts live in their PRs. - A "Former section numbers" table resolves the ~40 code comments that cite the old numbers. - SUBSTRATE.md holds the former sections 2, 3 and 7 unchanged, moved, to be refined next. - The plan (former section 8) is CLAUDE.md's order of work and the cards; #6092's appended 4.11-4.17 are absorbed here (the object map, the grid tier, the gates), so #6092 closes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…at importer is proposed; grid transfer cost links to SHARED-RESOURCES (Codex on 29d7335) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Contributor
Author
|
Superseded: the engine chapter is rewritten by concept on fable/workspace-3b (d32f9c9), built from this PR's structure and brought to today's code (the lane, the block layer, placement). SUBSTRATE.md is not carried forward: its substrate sections are now SAGE.md and STAGE-CONTRACT.md. |
joelteply
added a commit
that referenced
this pull request
Nov 27, 2026
…erseded chapters retired CONTINUUM-ENGINE (2,894 -> 711 lines), built from #6170's rewrite by concept and brought to today's code: - §1 the picture: each RAGE and CBAR system (QueueThread, the GPU frame, the job scheduler, RDG, the streaming system, memory pools, LOD and temporal reuse, background baking, the profiler) mapped to its counterpart here and the one chapter that owns it, and the five rules that follow (the GPU's step the only serial work; nothing waits that need not; nothing refused that could be reshaped; nothing fixed in advance; bytes native, reuse taken). - §2 the efficiency law and its checklist, kept whole without the dated framing. - §3 gates (wall-window vs decode-only), §4 objects (paths verified), §5 the step loop with the lane (frame.rs and continuum-flow gone), §6 the context codec (FIFO law, one codec, levels, "How to add a layer", invariants 1-6, the tail as a source, causality, the render receipt, token history and reuse; each rule marked built or proposed against the code), §7 admission and residency (I1-I5, P3-P6), §8 configuration (EngineGeometry built, EngineConfig and the restore contract proposed), §9 custody, §10 the measured performance model (batching at depth, the fixed part is GPU time, the upstream sync, the targets), §11 measurement and simulation, and a former-section-numbers table for the code that cites 4.1a-4.17 and "section 5". - Corrects "four minds at once = 2 tok/s each": that was not batched decode in one graph. Retired: CONCURRENCY-STYLE-GUIDE (it taught the interval-task/BrainRegion/PressureBroker shape SAGE deletes; its surviving rules are SAGE.md "Rules every part keeps"), FLOW-IMPLEMENTATION-PLAN (its dispatcher no longer exists; the lane and probes own its questions), MIND-DATAFLOW-OVERHAUL (a dated audit snapshot). 75 references repointed; comments that described the old guide now say so; numbered "forbidden move" citations name the rule. CLAUDE.md's STOP section for monitors, brokers and pools points at SAGE.md and SHARED-RESOURCES.md instead of telling agents to build the retired shape, and its engine references use the new section numbers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
added a commit
that referenced
this pull request
Nov 27, 2026
…treamer, and a learned prefetch proven in replay (line 3b) (#6285) * SAGE's placement ledger (slice 3a, first part): one claim across places, prepare/consume/commit/unwind/release, waits that name their shortfall, never-here only past capacity, owner generations; Lease<Q> over typed quantities Two outliers in the tests: bytes on tiers (the 5090's 5.18 MB-free seat now waits, granted on release) and minds awake as slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * place: order per place, retired holdings stay charged until a fenced release, a consume after commit fails, a capacity drop answers waits never-here (Cormac's review of 5ea6e2edbc) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * place: Codex's stale-spend repro and a restart racing a spend, as tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Lessons from inference-optimisation-skill: its method and measured stats as priors, where SAGE learns what it hand-tunes; unified-memory residency in the Placer's budgets Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design 3a: the golden-rules audit of place; three copies of the ledger (kernel ResourceLeaseLedger, ThroughputLeaseRegistry, sage Flow) fold into it before 3a is done Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * place gains the kernel authority's lease terms, partial release, pools and floors (slice 3a, step 2a) What ResourceLeaseLedger has that place lacked, before the kernel ledger moves onto it: - a claim's term: renew(id, until, now), overdue(now); past its term a claim reads nothing and cannot be spent, and stays charged until released (Fable's hold: the remainder reads 0 past until) - shrink(id, place, amount): a committed or retired holding partly given back - back(place, pool): a place that draws on another's physical memory is charged once on it, its room and never-here bound the smaller of its own and its pool's (the M5's unified memory) - floor(owner, place, amount): a guarantee others are granted around and its owner fills without queueing behind anyone (room_for, the one rule for room, in ledger/room.rs) Measured (IntelMac): place:: 15/15; each of the four new tests fails when its mechanism is broken (pool charge dropped, floors ignored, lapse ignored, shrink not credited). Ratchets 135/135 vs 78a11b0eb. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * The placer as a SAGE component (slice 3a): asks in by its teller (lossless, any number of consumers), each owner's whole table out as keyed state (waiting with shortfall, granted with the claim, committed, retired, terminal), each place's shortfall as state; the first wait in line holds its fitting places (Cormac's multi-place starvation) Rebased with Cormac's 2a (9bf241b3b: terms, shrink, pools, floors); floors exempt a need from the hold. An ask whose owner's table cannot be claimed is never prepared. sage 101/101, ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * place: an ask is summed on each physical memory it draws on (Codex on 9bf241b3b) 60 on a place and 60 on the pool of 100 it draws on were each checked alone and granted, 120 prepared. room.rs's short() is now the one test of an ask: each place against its own room, and each physical memory against the sum of the ask's needs on it; fits and short_places read it; past_capacity sums the same way for never-here. Measured (IntelMac): place:: 16/16; the new test fails when the per-memory sum is disabled. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * The kernel authority's leases are claims on place (slice 3a, step 2b, first half) ResourceLeaseLedger keeps its readings (capacity, physical samples, backing, measured footprints, reservations) and tells them to one continuum_sage::place::Ledger<ResourceKind, Bytes> after every change (ledger/told.rs): each kind's budget is its capacity less what is resident beyond our leases proven landed in the accepted reading (Codex's overlap rule), a backed kind draws on its pool, and each reservation is a floor net of its holder's unleased residency. acquire is a claim spent whole and committed, release and shrink return it, and available, available_for and committed read place. place gains free() and floors() (replace every floor at once). Still on the old arithmetic: budget_for_replacing (headroom_after_release); it moves onto place in the second half of 2b, and then remaining_commitment, headroom_after_release and the pool helpers go. Measured (IntelMac): the kernel ledger's oracle, resources::ledger 29/29 unchanged (one caught a withdrawn reservation's floor left on place; fixed by telling floors whole); resources:: 252/252 (disk_eviction skipped: its lock test fails only under parallel contention, passes alone); place 21/21; ratchets 135/135 vs 6e561bde0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * The replace-myself budget reads place too; the kernel ledger's own arithmetic is deleted (slice 3a, step 2b, second half) budget_for_replacing asks place.room_if(owner, kind, freed): what the consumer's release would give back on its kind and its pool (its measured residency leaving the reading, never below what the others measure there; its leases up to that residency) is computed from the readings (ledger/told.rs freed_by_replacing), and place answers the room, repaying an over-budget place first and never past capacity. Deleted from ResourceLeaseLedger: remaining_commitment, headroom_after_release, pool_kinds, not_yet_resident, reserved_headroom_excluding. Every free/committed/room answer now comes from place. Measured (IntelMac): resources::ledger 29/29 unchanged (one, replacing_keeps_pending_peer_grants, caught an over-budget place read as zero before the add-back; room_if now repays it); resources:: 252/252; place 22/22 (room_if's own test added); ratchets 135/135 vs dca119bfd. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * place: a backing change moves what is charged with it (Codex on 7e348e827) A place backed by a pool after its claims were charged released them off the new pool, taking another owner's 40. back() now moves the place's held and prepared charges from the pool it drew on to the new one (or off it, when unbacked), so a release returns what it holds where it was posted. Measured (IntelMac): place 23/23, the new test (Codex's repro) fails without the move; kernel resources::ledger 29/29; ratchets 135/135 vs 7e348e827. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * The authority waits instead of refusing: ask, a ticket its owner keeps, and a grant on release (slice 3a, step 3, the trainer's contract) The 5090 (2026-11-26): a learning seat refused 5.7 GB with 5 MB free, and nothing ever woke it. The authority now has an ask beside acquire (Codex's contract: kernel leases take everything, a seat's ask waits, a kernel release grants it, unasked again): - place gains take(): the foreground's no-wait path, ahead of any wait, never queued (Untaken says why not); prepare and take share admissible(). Acquire uses take, so serving never queues behind a waiting seat; a wait gets what is free after it, and which waits deserve room is the law's. - ResourceLeaseLedger::ask/withdraw/take_granted (ledger/asks.rs): a wait on place; every tell() grants what now fits and turns it into its lease; withdraw releases a grant never taken. - ResourceDaemon::ask -> Ask::Granted(LeaseGuard) | Ask::Waiting { ticket, short } (daemon/ask.rs): AskTicket::granted() takes the lease once; dropping the ticket withdraws (custody). measured_now() is the one 'measure the sources now' step acquire_measured_now and ask share. Measured (IntelMac): resources:: 255/255 (three new: the ledger's ask and withdrawn-ask tests, the daemon's ask-on-release test; the grant and the ticket's withdraw each fail when disabled); ratchets 135/135 vs 3ca894953. Not yet: the trainer asking through it (next commit). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * The authority carves a stage lease from a granted reserve under one lock A seat's granted ask is its reserve; each stage (weights, optimizer, workspace) is carved from it: ResourceLeaseLedger::carve shrinks the reserve and takes exactly those bytes for the stage lease with nothing told in between, so no wait and no other taker has them first; ResourceDaemon::carve does it under one governor lock. Never past the reserve or across kinds. Measured (IntelMac): resources::ledger 32/32 (the carve test fails when place is told between the shrink and the take: the waiting ask takes the bytes); ratchets 135/135 vs 7e62b2bcf. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * Carve is one transition: place.split moves held bytes to the stage's claim (Codex on 66c1fb471) Shrinking the reserve then taking the bytes could fail after the shrink and lose them. place gains split(id, place, amount, owner, generation): a committed claim's holding moves to a new committed claim, every place's and pool's charge unchanged, nothing freed for a wait. The kernel's carve uses it and tells place only after the transition. Measured (IntelMac): place 24/24 (split: charges unchanged on the place and its pool, no wait granted, never past the holding); resources::ledger 32/32 with the carve-vs-wait test; ratchets 135/135 vs 66c1fb471. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * Carve: split takes a Need (contract_shape), the test's expect is justified, and nothing is carved from a lapsed reserve (Codex on 07427e2fe) 07427e2fe was pushed with two ratchets red (a five-parameter split; an unjustified expect in its test): the commit ran after the ratchets with ';' instead of on their exit. split now takes the moved Need. A reserve past its term stays charged for its fenced release: carve refuses it (ExpiredLease) and changes nothing, at and after the term. Measured (IntelMac): resources::ledger 33/33 (the lapsed-reserve test new); place 24/24; ratchets 135/135 vs 66c1fb471, exit 0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * The trainer's seat waits on an ask and seats on stages carved from its grant (Codex's contract, the real trainer) The 5090 (2026-11-26): a seat short of memory was held watching what is free, and while serving held the device nothing ever freed it. Now: - a stage lease short of memory asks the authority for the WHOLE seat of that kind (training_admission::ask_training_memory); granted, it is the bucket's reserve; waiting, the bucket is HeldOff::Asked { ticket } (HeldOff::Memory and its free-watching short() are gone); - the hold check, the release wake (on_free) and a let-go seat's Released take a granted ask into the bucket's reserve and seat it again; - each stage is carved from the reserve (seat::lease_memory_within -> training_admission::try_carve under the serving gate; a gate refusal leaves the reserve whole; a failed carve is SeatRefusal::Uncarved, typed); what is left of the reserve is released once the seat is seated or let go. Measured (IntelMac): training_trigger 77/77, one new: serving holds 600 MiB of 1 GiB, the seat refused its optimizer asks for its whole 501 MiB seat; the release grants it at once (a competing 600 MiB taker is refused), another taker holds everything free beside the reserve, and the seat still loads and seats on carved stages with no second ask, 0 left free and nothing left over. Ignoring the reserve makes it fail. genome learner::seat 9/9; kernel resources:: 257/257 three runs (one earlier run had one failure that did not reproduce; not identified); ratchets 135/135 vs c343b45c7, exit 0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * Fable's follow-ups (1) and (4) on 7d59f5639: a probe when a take passes a wait, and carve keeps place's refusal (1) A foreground take passes waits by design, so a steady stream of them can starve an ask (the 5090 symptom in a new shape). acquire now probes resources.ask.passed with how many asks wait on its kind and the oldest's age: the evidence the aging bound (a decide::Policy) is fitted to. (4) carve's map_err turned every place Refusal into MissingLease. CarveError keeps it: Lease(LeaseError) or Place(Refusal), through the governor, daemon, try_carve and SeatRefusal::Uncarved. Measured (IntelMac): kernel resources:: 257/257, training_trigger 77/77, genome learner::seat 9/9, ratchets 135/135 vs 7d59f5639, exit 0. Follow-ups (2) (the kernel's asks/granted maps onto Placer, owner generations) and (3) (one owner of expiry) are step 3 proper: next. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * Pin the fork at a29e679f7: execution graphs build the mixed-input path only for a mixed batch (Codex) The 5090 (2026-11-26 13:51Z) crashed 41 s into a window on 7d59f5639 with an unspecified CUDA launch failure in mul_mat_q, after serving's embedding graph; no trainer act preceded it. Every execution graph on a mixed-capable arch built the set_rows mixed path even for a pure token batch that supplies no slot indices. a29e679f7 reserves for the mixed batch but builds the path only when the batch is mixed; allow_reuse already keeps pure and mixed graphs apart. Codex's 900 s Qwen3.8-27B replay with it ran without the fault; reviewed (graph reservation vs execution, reuse across the transition) before pinning. Measured (IntelMac, this head on canary 584a0bf4c): place 24/24, kernel resources:: 257/257, training_trigger 77/77, genome learner::seat 9/9, ratchets 135/135 vs origin/canary, exit 0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * The Core says what it holds (slice 3b, first cut): its context's bytes per allocator, by weights, KV, compute and output, held as its residency on the board The 5090 on 2026-11-26 (Codex, 4c3e3eb54): core held 30.7 GB of the card, the board named 633 MB (the embedder) and counted the rest as external; a seat waited 27 times in 900 s with nothing that could free it. llama_context_memory_rows (fork 32e155036, its own file, one line in the header) reports each buffer type's bytes keyed by the buffer type handle; llama::Context::held reads them into a buffer it reuses; the driver's CoreHeld holds exactly that as the Core's residency per pool, re-read at start and after every learning job, the new residency held before the old is let go. A probe, core.held, gives the split the reclaim law (the Core as a Placer consumer) and Fit's ceiling read next. BufferType moves out of learn.rs into safe/held.rs (one concept, its own file). Measured: llama held_rows on qwen2.5-0.5b Metal 1/1 (rows equal llama_context_get_buffer_bytes and weight_allocation per pool; a re-read keeps its capacity); continuum-engine checks clean, no new warnings; source-hygiene 135/135 at this commit (the line's LLAMA_CPP_PIN recorded 7e81db08 while pointing at a29e679f7; it now records 32e155036, which stacks on a29e679f7). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The ceiling: capacity less what nothing can demote and what others hold; Fit sizes a lesson within it, never the whole card The 5090 (2026-11-26, 7d59 window): a lesson sized within the governed capacity asked for 29.5 GB on a card the core held 30.7 GB of, and waited forever (Cormac). A residency now names its fixed part (ResidentFloor.fixed: weights, a writer's window), the ledger keeps it per consumer, the board publishes fixed_bytes per kind, and Free says each kind's ceiling = capacity - fixed - external. The Core's residency fixes its weights only (its KV, workspace and output are what the law may demote); the embed lane fixes its weights; the capture writer its window. fit_beside reads the ceiling. Measured: kernel resources:: 284/284 (the_ceiling_is_capacity_less_fixed_weights_and_what_others_hold, on the 5090's 15:07Z board: a residency let go turns external, never room), training_trigger 77/77, engine/core/capture check clean; KindLedger.ts regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The ceiling on unified memory: a backed kind is bounded by its own fixed bytes and its pool's ceiling, never charged the host's other processes on its own axis (Cormac on 38736c291) The ledger computes the ceiling (it knows the backing) and publishes ceiling_bytes on the board; Free reads it. A pool's ceiling is its capacity less every fixed byte on it and on the kinds backed by it, less what others hold on it. On the 5090 (discrete) unchanged; on the M5 the 2026-11-18 refusal shape (59.5 GB host-wide against the GPU's 55.66 GB) cannot return through the ceiling. Measured: kernel resources:: 285/285 (a_unified_gpus_ceiling_is_its_fixed_bytes_and_the_host_pools_room, on the M5's 2026-11-18 board), training_trigger 77/77, ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: room by priority, memory is a flexbox and only weights are fixed (Joel); join continuum_context::flex and the placer as one solver over any quantity Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: everything memory-related feeds back (Joel): held and used measured, every grant/shrink/wait a replay observation, the law a decide::Policy; Cormac's review settled (one shrink path through reclaim, priority ages, Fit is the seat's share) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * One flexbox over any quantity (Room by priority, step 1): the floor, min and grow passes move into continuum_sage::place::Flexbox; a prompt's flex_allocate is an adapter onto it The algorithm lives once, generic over Quantity (Tokens added beside Bytes and Slots), with the caller's tie order and reused buffers (no allocation past the high-water mark). continuum-context's flex_allocate keeps its API for its callers (string ids, u32 tokens) and holds only that diff; its own passes are deleted (244 -> 126 lines), and the never-read warnings field with them. A place's bytes and a mind's prompt now share by the same solver, which the placer's elastic claims call next. Also fixes the replay example, broken by #6283's Priced::Trial (mine). Measured: continuum-sage 106/106 (the_flexbox_shares_bytes_floors_first_then_by_priority, on the 5090's 15:41Z split), continuum-context 140/140 + replay example, cognition llm_deliberation_faculty prompt epoch tests pass; ratchets 135/135. Seen, pre-existing at the base (fails without this change): cognition an_unsaved_newest_result_is_saved_and_pages_instead_of_refusing (113,923 required vs 110,128); mine to fix next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Room by priority, step 2: elastic holdings and shrink requests on the placer A committed holding may be elastic on a place (Ledger::elastic: a floor and a priority); a wait may carry a priority (Ledger::prioritize). Ledger::shrinks shares each place's budget by the one flexbox among its holdings and its first short, prioritized wait: holdings not elastic keep all they hold, the wait's need is its min (never a floor: floors are granted before priority is weighed), and each elastic holding the sharing leaves smaller is asked to shrink to its share, only when that would let the wait fit. A wait with no priority, below every holding, or past every floor asks no one. The wait is granted only from what the holder releases after its fence (Ledger::shrink). The Placer carries it: Act::Elastic, Act::Prioritize, Act::Shrunk; Status::Shrink { place, to } on the holder's own table. Feedback for the law: place.shrink.asked and place.shrunk probes. Measured: continuum-sage 110/110 (room_by_priority x3 on the 5090's 15:41Z split; the component test a_holder_reads_its_shrink_and_the_seat_its_grant_after_the_fenced_release), ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: never evict, never abort; a shrink is answered by resize, cache out or collapse, each way declared with its measured cost (Joel) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: holders are objects; Resident (Lifecycle's shape) carries feedback up and control down, prioritized by QoS like RAGE's point of view, composing from a part to the grid (Joel) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: the controller is never blind; every holding states its variability (Fixed with why, Elastic with floor and ways, Whole with dependents), unreported is Fixed (Joel) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The Resident: every holder an object whose contract forces its report; control down never waits, feedback up every time, composites share a shrink by QoS continuum_sage::place::Resident<P, Q> (Lifecycle's shape, object safe so a composite holds mixed children): report() is required, one Row per place: held (measured), want (from use), varies, qos, waited. Varies is the holder's own knowledge, typed: Fixed { why }, Elastic { floor, ways }, Whole { dependents, ways }; there is no unreported case (Joel: 'force it to report by its contract'). Ways carry measured costs for resize, cache out (to a named tier) and collapse. shrink and grow answer at once with Given: Done { way, amount, took } | Pending { way } (its fence lands in the next report) | Refused { why } (Cormac on e7b8b9ff9: no future, the placer never awaits, and grow answers too). Sharing shares a shrink a parent received among its children by the one flexbox: Fixed and Whole keep all, elastic children give lowest priority first, priority the law's function (QoS aged by wait), never a constant here. Measured: continuum-sage 111/111 (a_composite_shares_a_shrink_lowest_class_first_and_never_asks_the_fixed: a Core of dyn children on the 5090's split; a Background workspace gives the 512 MiB, the base model's weights and the Interactive turn's KV keep theirs), ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Resident's methods take one params struct and answer one result struct (Joel: the command shape): shrink(ShrinkAsk { place, to, for_qos }) -> Given, grow(GrowGrant { place, to }) -> Given, report -> Report The contract grows without changing any holder's signature, and every exchange is a record the replay log keeps. A shrink names the class of the wait it makes room for, so a holder's answer and the law's feedback say why it was asked. continuum-sage 111/111. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * A report says what each row needs beside it (Joel: 'ask you what other parts you need', the live video and missing-engine examples); a shared shrink keeps it with its row Report::requires(row, place, amount, why): a live call at its level needs the encoder's memory; a paged KV restores only with her genes attached; a mind runs only with her base model. Sharing now takes the report: what a held row requires on the place is charged like a fixed holding, so a shrink never frees a part whose row would then be useless. The contract grew by one entry kind, no method changed. Measured: continuum-sage 112/112 (a_shrink_keeps_what_a_held_row_requires_and_lowers_a_level_instead_of_dropping: 3 GiB found as the Background workspace to its floor, then the call a level lower; its encoder untouched), ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The placer splits: PlacerCore (one ledger and every owner's table, apply then settle, nothing about the bus) and the component, a thin wrapper that says what changed (Cormac's step 3, part 1) The kernel authority can hold the same core for its synchronous door (an acquire cannot await a teller): one ledger either way, locked only around one apply and its settle. The component keeps the rule that an owner's topic is claimed before its first ask is prepared; the core retires a later generation's Shrink entries with its Granted and Committed ones. Measured: continuum-sage 113/113 (the_core_is_driven_synchronously_with_no_bus; every component test passes unchanged through the wrapper), ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Measure what shares the engine thread: learning.job per job (kind, ms) and core.prefill.progress/done (fresh tokens, ms) (Cormac's ask on the 5090's 4c3e window) A cold 162,435-token prefill was unfinished 854 s after admission beside 13 Loads, and nothing said how fast it went or how long each learning job held the thread. learn_next now probes each job's kind and engine-thread time (Job::kind); driver/prefill_rate.rs says a row at each 16,384 fresh tokens and one when the prefill lands. The next window can then say how much of a slow turn was learning. Measured: continuum-engine persona_scheduler 29/29 (metal), ratchets 135/135; driver.rs 998 lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: a long reply learns in tiles sized to the seat's share, never as one graph (the 5090's 64 GB-1.9 TB lessons; Cormac's reading confirmed in the fork) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: tiles walk the reply through the exact walk, never detached (Codex: the whole-reply graph carries a later token's gradient through earlier K/V and recurrent state); the OS and RAGE frame (Joel): the tile is the page, the seat's share the page cache, the exact walk the write-back Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: the exact walk made preemptible on the live reply, one tile per call (forward with checkpoints, reverse last to first, one update, the existing restore); the seat's device tile and host K/V-gradient accumulator as its Resident rows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * SAGE: Resident becomes an intermediate parent at its second instance; a holder declares its rows and its ways, the parent does publishing, teller, fences, replay stamps, aging, prepared claims and composite sharing (Joel) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The Resident parent: Holding does every holder's shared work (receipts, Pending until its fence, publish only on change) and Composite is itself a Resident over any parts (fold, share a shrink lowest first and a grow highest first) (SAGE.md, Joel) A leaf now declares only its rows and the bodies of its ways. Holding<R> answers the law's asks through the leaf, keeps every exchange as a Receipt (the law's feedback), holds a Pending ask until landed() closes it with a Done receipt, and re-reads the leaf's report so its owner publishes only on change (revisioned). Composite<P, Q> folds its parts' reports and shares by the flexbox at the law's Priority function; Sharing gains grow (every part keeps what it holds, elastic parts toward their want, highest first). The tests' hand-written Core is deleted for the library's Composite; a composite's answer reports the way a part actually took, where the copy claimed Resize. Measured: continuum-sage 115/115 (the_parent_keeps_receipts_holds_a_pending_ask_until_its_fence_and_publishes_only_on_change, a_composite_grows_its_parts_toward_their_wants_highest_class_first), ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The Resident parent issues a ticket per exchange and settles a fence by its ticket, once (Codex: landed by place cannot tell a late, duplicate or second ask apart) Holding::shrink and grow answer Answered { ticket, given }; landed(ticket, way, amount, took) settles that ask once (Landing::Settled) and any other ticket is Landing::Unknown, a typed no-op. Every Receipt carries its ticket. Measured: continuum-sage 115/115 (two asks on one place settle by their own fences in either order; a duplicate completion changes nothing), ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Put the fork pointer back at the recorded pin 32e155036: my last commit staged the unreviewed fork branch head (17704d6a7) by accident The tile walk and the named flash-attention slots stay on CambrianTech/llama.cpp fable/context-memory-rows for review; they are pinned only when reviewed, never by an add -A. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The levels between the Resident contract and a leaf: Fixed (no code of its own) and Resizing<W> (the whole contract, its leaf one method: resize(ResizeTo { from, to }) -> Moved) (Joel: multi-level inheritance reduces the burden) Resizing owns a row's facts (place, held, qos, waited), its floor, want and cost, builds its row, checks every ask against floor and want and turns the leaf's answer into the contract's; Fixed reports its bytes Fixed and answers every ask with its reason. The tests' Leaf, which implemented the whole contract, is deleted: the base model is a Fixed, each elastic part a Resizing whose only code is Allocation::resize. Measured: continuum-sage 116/116 (the_resizing_level_keeps_floor_and_want_and_its_leaf_writes_one_method; the composite tests unchanged on the levels), ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * A mind's device storage is asked for before it is reserved: DeviceRoom, granted as her residency on the board or refused, she moves by row copy (the 5090's 2f8bd03a1 crash: lifetime VRAM reservations outside any claim) On CUDA the tier reserved each mind's whole KV storage in device memory for her life, falling back to row copy only if that allocation failed; on Windows WDDM it does not fail, the driver spills it into shared system memory (Codex, 18:22Z: shared usage 23 to 28 GB, free RAM 7 GB to 520 MB, NVML lost the driver, the core aborted), and none of it was on the board (core.held reads the context's buffers). Unified-memory design (a mapped file the OS pages costs nothing parked) applied to a discrete device. Now KvHome::Mapped carries a DeviceRoom (the contract: RoomAsk { persona, bytes } -> Room::Granted(hold) | Refused { why, available }); the hold lives in KvMemory::Device and gives the room back when her storage drops. The Core's room (driver/on_board.rs CoreRoom) grants only what the board has (available_for) and holds it as her residency; refused, she moves by row copy, said by a probe. An example or fixture with no authority passes the named Unmetered. KvHome::Device (never constructed) deleted. Measured: continuum-engine persona_scheduler 29/29 (metal), continuum-persona-llama examples check, ratchets 135/135. The live receipt is the 5090: core.device_room.granted / persona.kv_home.no_device_room beside the shared usage, the next window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The placer records its field and replays it anywhere: every act, and at each commit what the claim spent; a recording reproduces the field's tables, grants and shrink asks in a fresh core (Joel: probing and replay built into the components, to diagnose or simulate) PlacerCore::recording(capacity) keeps a ring of Recorded::{Act, Spent}; replay::<D>(recording) applies and settles each act and spends what the field spent before each commit. A ring that rolled off is Partial, never passed off as the field. Replay showed a gap at once: a consumer spends straight from the claim's atomics, which no act carries, so the first replay committed nothing and diverged; the core now records the claim's spend (Claim::spent) when it commits. PlacerCore::status(ask) reads one ask. Act derives Clone and PartialEq. Measured: continuum-sage 117/117 (a_field_recording_replays_into_the_same_tables_anywhere: the 5090 shape, a workspace asked to shrink for a prioritized seat, replayed into the same shrink ask, the same wait and the same shortfall), ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: a mind's storage is one object (MindStorage, a Resident) with an adapter per memory chosen once from the topology (Unified, Dedicated, RowCopy); the viewable branch and DeviceRoom go (Joel: comprehensive objects, not patches) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The replay harness, first slice: the lane's simulator priced on a Device (Unified, Dedicated), turns that prefill their prompts, and a report of where the lane's time goes; the old slot scheduler, Flow and its simulator deleted (Joel: record, simulate, optimize; good OOP) slice::device: the Device contract (prefill(Prefill { tokens }), bind(Bind { bytes })) with one adapter per memory: Unified (a parked mind is a pointer: bind free) and Dedicated (her KV comes back over the link). Measured constructors carry their receipts: Unified::M5_AT_64K (llama-bench 741b0175b, 304 tok/s at 64k); Dedicated::rtx_5090(link) (Codex's 2f8bd03a1f window, about 379 tok/s cold prefill; the link is measured per node, no default). slice::sim::run takes the device: a mind's turn prefills prompt tokens chunk by chunk at the device's rate, then decodes; a switch costs the lane's own plus the device's bind of her KV. Report gains decoded, prefilled, and the lane's time by prefilling, decoding and switching. What it found at once: on the 5090's day (Kimi's 175,195-token cold prompt, Sahar's 68,583, KV 8,704 MiB each) the lane alternates the two minds through their prefills, and on a discrete card each switch copies 8.7 GB back: 129 s of a 900 s window over 328 switches, against 6 s unified. The lane's switch cost is a constant that does not know the device; the switch decision must price the bind. Deleted (no callers outside their own tests; the lane and the placer own what they did): sim.rs and sim_tests.rs (the slot-scheduler simulator), scheduler.rs (Scheduler, Aging, Ticket), flow.rs (Flow, a future-returning API), their tests in tests.rs, and Qos::rank: about 850 lines. Measured: continuum-sage 101/101 (the_same_day_on_unified_and_dedicated_memory_prices_every_bind; every lane case unchanged, decode-only on the M5's device), ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The device says how it fetches a parked mind: Bind gains ahead (the lane time it had to fetch her), Dedicated gains Fetch::{Synchronous, Prefetch}; the 5090's day replayed both ways The params struct grew one field, no implementer's signature changed. Synchronous (today's fork, no overlapping verb) waits on the whole copy; Prefetch (pinned async DMA started when the lane knows who comes next, THE-LANE-ON-SAGE) waits only for what the running slice did not cover; unified memory has nothing to fetch. The simulator gives each bind the time since the last switch. Simulated on the 5090's day (fixture link 25 GB/s, the measurement asked of Codex): switching 129 s synchronous, 36 s with prefetch, 6 s unified; prefill done 735 s against 827 s. The 36 s left is the wall: the lane's longest slice is wait_bound / ahead - switch, so a costly switch shortens slices below the copy, the prefetch cannot finish under them, and the uncovered rest raises the measured switch again. That law is the next change, proven here first. Measured: continuum-sage 101/101, ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The lane never slices under the next mind's fetch: Event::Fetched teaches it each mind's KV copy, and a slice shorter than that saves her no wait and costs a switch (proven in replay first) The lane's wall (wait_bound / ahead - switch) shrinks slices as switches get costly, so on a discrete card the slice fell below an 8.7 GB copy, the prefetch could not finish under it, and the lane thrashed. A waiting mind waits for her KV either way, so a slice under her fetch only adds switches: the slice is now floored at the next mind's measured fetch (Slicer::fetched, Mind::fetch, next_fetch). The driver reports Fetched(mind, took) when her copy lands; the simulator reports it from the device's whole copy (Device::copy). Replayed on the 5090's day (fixture link 25 GB/s): switching 129 s synchronous, 36 s prefetched, 33 s prefetched with the floor; 76 of the 254 switches still pay the whole copy, the turn-end transitions the lane could not see coming, the next lever (fetch on a turn's predicted end). Every lane case unchanged. Measured: continuum-sage 101/101, ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The simulator gives a prefetch only the time since the lane knew who comes next (the later of the slice's start and her becoming ready), not the whole slice: the replay no longer flatters the design Replayed on the 5090's day: prefetch with the slice floor 33.7 s of switching (was 33.0 s counted from the slice's start). continuum-sage 101/101, ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The fetcher: a SAGE component on its own worker that streams the lane's next minds onto the device, RAGE's streamer beside its renderer (Joel: in a sage component, its own thread) The lane only reads: it says who comes next as state (NEXT, NextUp { minds: [(mind, kv bytes)] } in the order it expects them), and at a switch reads each mind's residency (RESIDENT). The Fetcher watches NEXT and starts each predicted mind's move through its Mover (one method: start(MoveAsk { mind, bytes }) -> Moving::{Started, AlreadyThere, Refused}), one move per link, highest first; a move's fence arrives as Fetch::Landed { mind, took } by its teller, and a parked mind (Fetch::Parked) is fetched again. It says each mind's Row { residency (Resident, Fetching, Parked), fetched: her last measured copy } as state, the lane's Fetched for its slice floor. Unified memory's mover answers AlreadyThere: every predicted mind resident at once, nothing moved. Measured: continuum-sage 103/103 (the_fetcher_streams_the_lanes_next_minds_in_on_its_own_worker, on_unified_memory_every_predicted_mind_is_resident_at_once), ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: a move is one DMA of one contiguous block, never iteration (Joel); the Dedicated adapter holds a mind's storage as one device allocation and her parked copy as one pinned block, park and restore one fenced async copy each; row copy is deleted, not a fallback Today's row copy (llama-kv-cache-persona.cpp:115) is a synchronous ggml_backend_tensor_get per layer into pageable std::vector buffers, of each layer's whole stream tensor. The Mover contract now says it: one transfer of one block by DMA with a completion event, or a pointer on unified memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Cache transfers have one owner: the block layer's Streamer (a SAGE component on its own worker) moves Blocks through Links; the lane's private fetcher and Mover are deleted (Joel: transfer logic is its own object done right, reused; I had written a third abstraction beside the designed one) - link: Link::start answers at once with a Transfer (bytes, started, to, Completion, and the destination Region its tier reserved, for a DMA). Transfer::land gives the block its new region and placement only when the completion fired, so the source stays charged and valid until then; a refused move leaves the block where it was. Mapping is in place and lands when it returns. - tier: TierKind gains Vram and Pinned (the discrete card's two tiers). - streamer: Streamer<K, Links> watches the consumer's Demand (soonest first), holds its Blocks, starts the soonest block not where it is used through its pair's link, one move in flight, lands on Stream::Landed (the device's fence, never a poll on the engine thread), and says Placements (placement, moving, last measured move). - Deleted: continuum-sage/src/slice/fetcher.rs (Mover, Fetcher, Residency), 2 tests replaced by the Streamer's. - Next: the Dma link (pinned <-> VRAM, one async copy and its event) needs the fork's one-block storage per mind. Measured: continuum-blocks 6/6 (the_streamer_moves_demanded_blocks_soonest_first_one_dma_at_a_time), continuum-sage 101/101, engine and persona-llama check clean, ratchets 135/135. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Cargo.lock for continuum-blocks' new dependencies (continuum-sage, continuum-base, tracing; tokio and uuid for its tests) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * When a parked mind's move starts is a learned decision on the decide framework (prefetch use case, linear UCB), priced in the simulator against the device's real room; Device keeps only measured costs (Joel: by a learning algorithm with feedback; use our extensible algorithms) - decide/cases/prefetch.rs: a UseCase and Featured. Situation: her bytes, measured copy, predicted need and its spread, room, bound. Actions: Now, Margin(k) (copy plus k spreads before need), AtNeed. Envelope: nothing to move (unified) forces AtNeed, an unmeasured copy forces Now, no room for her forces AtNeed (the placer makes room, never an eviction here). Outcome both ways: late (the lane waited on her move) and wasted (abandoned in flight, or landed and parked again unused). Registry: baseline, at-need, linear-ucb. - slice/room.rs: the Streamer's law in simulation. The running mind is resident; room is made by parking, or by abandoning a move in flight of, the mind needed latest; one link, one move at a time, destination reserved at start; each parked mind's start is the prefetch decision, closed with what it measured. It ticks after every switch as well as every step, as the live Streamer acts beside the lane. - slice/device.rs: Device is prefill and copy only; Bind, bind() and Fetch are deleted (when to fetch is the decision's, not the device's). - sim.rs: run takes On { device, room, prefetch }; the day tests are rewritten around room. Simulated (fixture link 25 GB/s, the 5090's measured prefill, KV 8,704 MiB a mind, 900 s): - two minds, room for both: switching 6.42 s, identical to unified (every switch a pointer); - two minds, room for one: 129.44 s (a whole copy every switch); - three minds, room for two: at-need 82.9 s, baseline 71.7 s, linear-ucb 68.0 s with the most work done. Measured: continuum-sage 102/102, ratchets 135/135, continuum-engine checks clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * A block under a move travels with its transfer, so a newer hold of its key can never drop the source a device reads; a transfer let go before its fence waits for the device (Codex's review of 15fcba918c) - The Streamer's one move in flight owns its block (InFlight), out of the map. A Hold of the same key while it moves waits beside it; at the fence the landed block is let go if superseded, else returns. Before, the Hold dropped the source mid-DMA and the old destination was installed into the newer block. - Completion gains settle(): Transfer's Drop calls it when unlanded, and InFlight drops its transfer before its block, the Streamer its move before anything else, so neither region returns to its tier under a live copy. - Tests: Codex's sequence (hold A, start, hold B, fence A: B keeps its bytes and gets its own DMA), and a dropped unlanded transfer settles. continuum-blocks 8/8, clippy clean on the crate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: the learner's measure is the tile walk's worst tile (the last, at the full horizon), built as the walk builds it, device and host as two rows from the walk's own formulas; the driver shrinks the tile, never the lesson (Kimi's 1.9 TB; Cormac and Codex's reading of measure_within) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The ratchets #6285 raised, fixed at their shape (CI judged contract_shape +2, state_as_flags +1, unknown_as_value +5 against canary) - A composite's folded answers are one state (Answers: Nothing, Refused, Done, Pending), not three Options matched together; its unread `asked` count is gone. - The prefetch reads her share against the device's whole KV room, a NonZeroU64 (Room's capacity), never `.max(1)`; the simulator's "room for every mind" is NonZeroU64::MAX, a quantity, not a sentinel. - The slicer's next fetch is an Option (nobody next is an absence, not 0 s); a flexbox share narrows to the bound it already keeps (`remaining`, `available`), never to MAX; the Streamer orders by the Option rank. - PlacerCore::apply borrows its act (it only reads it): the replay's clone is gone. prefill_rate::observe takes the turn it reads; simulate takes a Day. - Design: Cormac's three points on the tile measure (shrink by resize first, the walk's host budget is the seat's Ram lease, the 5090 gate of zero measure_defect). Judged: `cargo run -p source-hygiene --bin ratchets -- origin/canary` 135/135. continuum-sage 102/102, continuum-blocks 8/8, continuum-context 140/140, continuum-engine checks with tests. My earlier "135/135" on the PR was a plain `cargo test`, which reports counts without judging them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: a tile that does not fit splits in place (sub-tiles from its own checkpoint, the same exact step), and a shared cache is made impossible at plan selection instead of falling back to the whole-reply graph (Joel: optimize to fit without abandoning or defaulting) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: time divides as well as space; a holder's Ways gain duty (on part of each period, its place given back while off), the lane sets learning's duty from its queue against serving's bound and the placer shares space among what is on; every 'not now' refusal in learning is deleted (Joel: learning is PWM, everything fits under centralized intelligent control) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: learning is a thread on the Core, scheduled by the lane like every mind (runnable while it owes a lesson, Background with aging, a tile per slice, its context paged, its scratch held only while it runs); the PWM width is what the scheduler's choices add up to, not a lever (Joel: this is an RTOS) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: the lane's types need nothing new (Thread { Mind, Learner } as the Slicer's key, learning/owed its Ready and Done); off gives back only the scratch, the shadow is the thread's context; one learning lease resized per period, never per step (Cormac's three points) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: priority is a share the central policy sets (the lane's per-class weights become its decision from feedback, not 1/2/4) and a hard threshold only where the work has one; every slice is bounded and declared, so the tile walk's prefix decode and reverse replay become tile-sized units with yields (Joel: centralized logic, everyone complies; Codex's review at c6d40d7917) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: one objective, time; every way of sharing a resource priced in time (a smaller tile's extra units, the transfer that swaps an occupant, the wait), and rejection is in no controller's actions; learning/owed is a latest-wins snapshot with rows from the engine's measure (Joel; Cormac's refinements) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: the objective is power, useful work over time (Joel: wattage); a transfer is time moving, a rejection time for no work Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: useful work is what lasts (durable updates and saved checkpoints, resident turns within their bound), never units advanced, so splitting a lesson finer can never look like more power (Codex) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Live learning always walks exactly: delete Walk.exact The fork refuses a reply past one ubatch without the exact walk (fork 398bf318d), and within one ubatch the exact and plain walks are the same graph, so the choice had no correct second value. The driver loaded every shadow with Walk::default() (exact = false), so each reply past the Core's n_ubatch (2048 on the M5) learned a plain split: cosine 0.960 / norm 0.944 against the exact step on Qwen3.6-35B-A3B at ubatch 64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: threads on SAGE, one shape for every concern on a shared capacity (for review before code) A holder is a Resident in space (SAGE has it) and a Thread in time (new parent): it says what it owes and how its work can be cut, what a unit of a size needs, and runs exactly one unit per slice; the parent owns state, time fit, fence and split in place. Eight rules (one path per concern, bounded declared units, no refusal for size, only never-here typed at plan selection, context is a Resident, owed is state, useful is what lasts, exactness against itself and one other backend). Instances: Mind, Prefill, Learner, Streamer, checkpoint; the lease types fold into place::Claim. Drawn from this week's receipts (the plain split behind five learn entries, cosine 0.960 on the 35B). Order: SAGE parent, fork learn collapse, Learner, prefill/decode, Streamer, leases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Design: fold THREADS-ON-SAGE into the stage contract's version 2 (the unit is the scheduler's lever) THREADS-ON-SAGE re-derived what SAGE already has: Component (worker, intake, bus State/Stream, Need with Urgency::act_bound as the threshold/share split, Presence, rest), the stage contract (triggers, Cost execution+residency on one authority, run, RunOutcome, ControlRequest and StopReceipt with residency_kept and committed_effects, commit-once acks), Resident, slice, decide. Deleted as a parallel parent. What it added that v1 lacked is kept as STAGE-CONTRACT section 5: a stage's work divides by a Lever, the scheduler chooses each run's unit, the run reports Did { did, lasting }; five rules from this week's receipts; the scheduler is slice + decide + the kernel ResourceDaemon (Cormac), claims per unit size, time fitted from completions (Codex); instances and the order. Also records that v1's control half was never built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Docs: revise the owning chapters in place instead of appending - STAGE-CONTRACT.md rewritten as one current contract: units in the types, control with Codex's and Cormac's points (a request reaches a running unit at its yield point; shrink is a ControlRequest with ShrinkHolder as its adapter; Dispatched through the task owner by run id), the scheduler and the one authority, consumers. Says what is built (types, runner, publication, artifacts; recall its one consumer) and what is not (control, task owner, units, Learn cost). Its stale kernel path and the appended "version 2" section are gone. - IN-PROCESS-LEARNING.md rewritten as the learning chapter it owns: built (Learner, Job::Learn, LearnPort) vs proposed; the exact walk in tiles with its measured results per backend; the one-path fix (398bf318d, dbe8d18d1a); pricing, fitting and the learner on the Core. - UNIFIED-PAGING.md: the ~190 lines of learning design appended there are removed; the block-layer chapter no longer holds learning. - docs/README.md rows for the stage contract and learning say what each chapter now covers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Docs: UNIFIED-PAGING is the block layer only; SHARED-RESOURCES is placement and the one authority UNIFIED-PAGING (1077 -> ~250 lines) rewritten as the block-layer chapter: the rule, what is built (tiers, regions, blocks, Link::start/Transfer/Completion, Mapping, Exchange, the Streamer and its learned start, a mind's KV and recurrent state over her own file, instance leases) vs proposed (Topology, volume tiers, Dma/DirectIo/Staged, MindStorage, the workspace as a block). The three contradictory statements of the placement law (PlacementLaw trait, carry, decide::Policy) are one: a decide::Policy. Dated slice logs, review timestamps and the night's narrative are gone; their receipts stay as one line each. SHARED-RESOURCES rewritten as the placement chapter: rules (flow, price in time, no refusal for pressure, nothing taken, cache by inputs), what is built in continuum_sage::place and the kernel authority, the prepare/consume/commit/release contract with claims per period, holders as Residents (moved here from UNIFIED-PAGING), one authority and one ledger, residency over time, live capacity (from CAPACITY-FABRIC), resource kinds, and the ~25 lease types in core/ with where each folds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Docs: the lane, SAGE and learning chapters revised in place; three superseded chapters retired - THE-LANE-ON-SAGE: the serving contract (from the two scheduling chapters), how the Core works, what is built (decide::cases::lane with linear-ucb as SERVING, its history and learned state; frame.rs gone) vs not (Batch unexecuted, Roles overlap, bench, discrete DMA), the decision and its envelope, the algorithms with their measured results, other decide use cases and the built airc remote adapter, use every core, how a change is judged, the order. Corrects "cost-model is the serving default" (it is linear-ucb). Names slice::{Slicer, Lane, Control, Tuner} as an unwired second lane to delete. The swap's memory objects moved to UNIFIED-PAGING. - SAGE: the substrate only. Pieces table corrected (flow is gone; the slice lane unwired; decide, place, Outbox, Stage listed); principles; "Rules every part keeps" folded from the concurrency style guide (probes, policy not env vars, no lock across await, every mover has its mirror, no parallel managers, contained failure); intermediate parents; ebb and flow with the economy marked proposed (Consumer superseded by Resident); the migration inventory as it stands. The dated measured log is gone. - IN-PROCESS-LEARNING: CUDA's open defect stated as measured (both CUDA updates wrong against CPU, so the backward, not the tiling); branch names out of the prose; the refusal-and-retry suite case named for rewrite. - Retired: CAPACITY-FABRIC-AND-GOVERNOR (live capacity and the simulator now in SHARED-RESOURCES), INFERENCE-SCHEDULING-AND-SCARCITY and INFERENCE-LANES-REALISTIC (their contract, cross-grid adapter and judging rule now in THE-LANE-ON-SAGE). 44 references repointed, code comments only in Rust and the two generated TS files that mirror them; CLAUDE.md's canonical list item 4 now points at the lane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Docs: the engine chapter rewritten around the picture; three more superseded chapters retired CONTINUUM-ENGINE (2,894 -> 711 lines), built from #6170's rewrite by concept and brought to today's code: - §1 the picture: each RAGE and CBAR system (QueueThread, the GPU frame, the job scheduler, RDG, the streaming system, memory pools, LOD and temporal reuse, background baking, the profiler) mapped to its counterpart here and the one chapter that owns it, and the five rules that follow (the GPU's step the only serial work; nothing waits that need not; nothing refused that could be reshaped; nothing fixed in advance; bytes native, reuse taken). - §2 the efficiency law and its checklist, kept whole without the dated framing. - §3 gates (wall-window vs decode-only), §4 objects (paths verified), §5 the step loop with the lane (frame.rs and continuum-flow gone), §6 the context codec (FIFO law, one codec, levels, "How to add a layer", invariants 1-6, the tail as a source, causality, the render receipt, token history and reuse; each rule marked built or proposed against the code), §7 admission and residency (I1-I5, P3-P6), §8 configuration (EngineGeometry built, EngineConfig and the restore contract proposed), §9 custody, §10 the measured performance model (batching at depth, the fixed part is GPU time, the upstream sync, the targets), §11 measurement and simulation, and a former-section-numbers table for the code that cites 4.1a-4.17 and "section 5". - Corrects "four minds at once = 2 tok/s each": that was not batched decode in one graph. Retired: CONCURRENCY-STYLE-GUIDE (it taught the interval-task/BrainRegion/PressureBroker shape SAGE deletes; its surviving rules are SAGE.md "Rules every part keeps"), FLOW-IMPLEMENTATION-PLAN (its dispatcher no longer exists; the lane and probes own its questions), MIND-DATAFLOW-OVERHAUL (a dated audit snapshot). 75 references repointed; comments that described the old guide now say so; numbered "forbidden move" citations name the rule. CLAUDE.md's STOP section for monitors, brokers and pools points at SAGE.md and SHARED-RESOURCES.md instead of telling agents to build the retired shape, and its engine references use the new section numbers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * README: how a mind runs (like a game engine), resources in today's terms, stale facts out - New section "A mind runs like a game engine": her parts (senses, memory, awareness, hands, learning, dreams) each on their own worker meeting through state; attention as the camera, the context at levels of detail and append-only; many minds sharing one GPU switched at the next step by pointer under a one-second wait bound; learning in the gaps; memory making room by priority. States what is built and what is being built, and links to the engine chapter's system-by-system picture. - "A model that doesn't fit can still serve" no longer sells warm serving lanes and a KV-slot economy: one authority, holders that report and give back, blocks moved by pointer/DMA/paging, never refused for pressure; links to the lane, placement and block-layer chapters. - Removed the KV-Slot Economy figure (a retired design) and the 2026-09-20 lanes x window table; the hourly health line is described instead. The Academy link pointed at core/continuum-core/src/genome/, which no longer exists; it points at the academy and genome crates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * README: three forms of learning; minds in many activities; the desktop is one client being rebuilt - "They truly learn" now opens with the three forms, as people learn: continual from her work (learned in place on the serving engine between her turns), the Academy (a college course: teachers and students, lesson, practice, exam, adoption only if earned), and synthetic dreaming (unbounded recombination of experience while she rests). The dreams section describes dreaming as that unbounded form, and the Academy section opens as the course form. - "A society needs more than agents" adds that one mind lives in many activities at once, each a room she joins or starts by choice, a citizen with agency rather than a dispatched worker. - The two UI-centered sections (Positron restated, the screenshot gallery) are removed; "One world" keeps the Positron idea and says the desktop is one client of the headless core, to be rebuilt in a larger form, with older screenshots as earlier generations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * README: the genome is paged in by activity and traded and federated peer to peer Her genome pages in what the activity in front of her needs (her phenotype differs by room), and genes and whole phenotypes are traded and federated across her own machines, other grids and open peers, priced like capacity, trusted by receipts, private state kept inside her trust. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * README: the genome is automatic and many-gened; the bet is everyone's edge hardware against the frontier Her genome works like a person's: many genes active at once, none chosen, paged in and downloaded from peers by what she is thinking and doing. The grid section states the strategy: everyone's edge machines, learning daily from real work and sharing genes peer to peer, compete with a frontier model as a society rather than machine for machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * README: the three forms of learning feed one system that de…
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.
Stacked on #6159 (the chapter describes the objects that PR lands). Supersedes #6092, whose appended sections 4.11-4.17 are absorbed here.
Why
CONTINUUM-ENGINE.md had grown to 2,751 lines by appending: dated sections 4.1a-4.10, an embedded plan (section 8), and the whole runtime substrate (sections 2, 3, 7). Joel, 2026-11-19: docs are organized like code modules, refined in place, never appended.
What
Net: 2,751 lines become 1,298.
Review asks
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo