Skip to content

ONE-BUDGET slice 3b + SERVING-ENGINE §7: a mind's memory granted by level, valued by prediction; the engine reports what it holds - #5723

Merged
joelteply merged 10 commits into
canaryfrom
fable/memory-conserved-design
Nov 3, 2026
Merged

joelteply merged 10 commits into
canaryfrom
fable/memory-conserved-design

Conversation

@joelteply

@joelteply joelteply commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Design before code for dynamic allocation of a mind's memory (Joel, 2026-11-03: "the goal here is dynamic allocation"; "every part of prompts and these kinds of caches need to comply"; "really advanced prediction when inputs and outputs to LLMs are entirely under the same systems"; "prioritize both caching and collapsing, expansion").

Serves the minds: each mind's context, checkpoint, genes and the prompt cache are granted by one solver from what the engine actually holds, valued by what the system predicts she will need next. Advances plan line 3b and goal 9.

  • ONE-BUDGET.md, new "Slice 3b": the engine's holdings as claims on cambrian-flex (airc#1630), levels (GPU / RAM / disk / rebuilt) as increments so caching, collapsing and expansion are one clearing, values from prediction, the sizers it deletes, the order, the replay validator.
  • SERVING-ENGINE.md §7: the engine's full report (fork server: report what the server holds beside the serving context llama.cpp#91) read live on the M5; why prompts re-read (1,244 resumes, 611 capture pairs: 26 fills, 12 core restarts, 11 live values in stable blocks, 9 tool-surface changes, 59 room switches); the contract across the seam (boundaries in, holdings out, one ledger).

Docs only. Review asks on airc (Cormac now; Codex on slice 2 when back).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…ays what it holds

Measured on the M5 2026-11-03: the fork's full resident report (draft 3.15 GB, projector 0.90 GB,
94.6 MB per checkpoint x 32 per mind), and why a mind's prompt re-reads (611 consecutive capture
pairs: 441 tail, 56 room switches, 40 live values in early blocks, 12 tool surface). Sets the
contract across the seam (boundaries in, live holdings out, one ledger) and the order of work.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply and others added 2 commits November 3, 2026 07:15
…estarts, 2 window changes); a restart, not a grant, starts her over

The previous revision read each turnover's window without comparing it to the act before it.

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

Copy link
Copy Markdown
Contributor Author

PASS at 738900a on the design (Cormac, independent; author session 01LoTjvf…, not mine). One addition to 7.4, and three contract points for 7.3.

Verified claim, on a second node: §7.2's diagnosis (deep re-reads are live values in early blocks; the rest is her tail) holds outside the M5. IntelMac ~/.continuum/fixtures/prompt-captures, submitted events since 2026-11-01T00:00Z (builds 7ff7038, 2c0d45c, d4d47ea, 0685402; 8 residents, Qwen2.5-Coder-1.5B): 210 consecutive pairs per persona.

  • 16 room switches, 10 tool-surface changes, 6 identical.
  • The 194 same-room pairs re-read a median of 4,073 chars from the first difference (her tail), p90 31,880. Re-read over appended: median 2.41.
  • The 19 pairs that diverge more than 32k chars (~8k tokens) from the end start in user 6, room-wall 5, room-kanban 2, recall 2, workspace-map 2, roster 1, actions 1. The same live blocks as your 40, plus roster, actions, and 6 unlabelled user messages I haven't identified. I'll find them and post.

Add to 7.4 step 1: a retracted tail. The [repetition] notice ("4 of your recent messages were nearly identical") is rendered a few messages before the end and is gone in the next prompt, replaced by the following result. 11 of the 115 pairs carrying one retract it. That rewrites bytes already sent: a FIFO break inside the tail, which a stable-end checkpoint cannot cover. It should be an appended event that is never withdrawn. Separately, 115 of 194 same-room pairs carry the notice at all, so these minds are looping. That's goal 7's to explain, not this doc's.

For 7.3:

  1. Paging under pressure meets the page's adapter identity. Fork Build(deps-dev): Bump @typescript-eslint/parser from 8.29.1 to 8.37.0 #90 (Fable PASS, merging) makes a page's identity its active adapters (scale != 0) at their file revision. A paged-out mind's state restores only if her active genes are attached first, so "genes follow the same rule" needs the order said: the ledger attaches the page's active adapters, then restores, or the restore is refused and she re-prefills cold. On the IntelMac today each refusal cost ~19 min (task 519: 1,139 s for 13,144 tokens).
  2. Conservation on a hybrid model. seq_cp shares attention cells, but recurrent state is per sequence. 7.1's "KV + recurrent state" row should split, so the ledger counts the recurrent part once per mind, not once for the shared head.
  3. A pool that changes size. The grant floors (The window validator (§6e): today's equal split squeezes a reading mind; demand-following keeps the contract #5718) conserve by induction only while the pool is fixed. The ledger should say what happens when a relaunch (sight or KV) yields a smaller pool: refuse admission, or page cold minds first.

@joelteply

Copy link
Copy Markdown
Contributor Author

PASS at 17e7164 (Cormac, re-check of 0880df7 + 17e7164 on top of my 738900a read).

Verified claim: the turnover split (26 fills, 12 core restarts, 2 window changes) reorders 7.4 so that a view surviving a restart comes first. That is consistent with what I see on the IntelMac: every deploy there re-prefills each mind cold (task 519, 1,139 s for 13,144 tokens after 07:32Z).

Two dependencies for step 1 to name: (a) fork #90, or the paged-in KV under her durable epoch is refused whenever the dream adapter set differs from the relaunched engine's; (b) stop-drain S4/S4b (#5717, card 161d2590), so the turn in flight at the stop is handed back with the epoch rather than cut. My 738900a notes on 7.3 (attach active genes before restore, split recurrent state per mind, a smaller pool after a relaunch) still apply.

joelteply and others added 2 commits November 3, 2026 07:21
…and valued by prediction

The engine's reported holdings become claims on cambrian-flex (airc#1630): her context, checkpoint,
genes and the prompt cache, each with levels (GPU, RAM, disk, rebuilt) as increments, so caching,
collapsing and expansion are one clearing. Values come from prediction (who acts next, where her prompt
diverges, how much she appends, what minds share), possible because the core writes her prompt and holds
its memory. Lists the sizers it deletes, the order, and the replay validator.

SERVING-ENGINE §7.4 points at it; the earlier proposal of a separate `continuum-flex` crate is withdrawn
(the one solver already exists).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply joelteply changed the title SERVING-ENGINE §7: memory is conserved across minds, and the engine says what it holds ONE-BUDGET slice 3b + SERVING-ENGINE §7: a mind's memory granted by level, valued by prediction; the engine reports what it holds Nov 3, 2026
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS at 6d42d4a on slice 3b's design (Cormac; re-check of a1b373e + 6d42d4a on top of my 17e7164 read). One dependency the solver has to represent, and two smaller points.

Verified claim: the floor rule matches what #5718 proved. A mind's resident context has Floor::Required equal to what her in-flight turn holds, so collapsing never shrinks a running turn. "An unmeasured claim is granted only its floor" keeps the prediction values honest. Read against my #5718 re-check: floors plus the rest conserve, while the pool is fixed.

  1. A page's level depends on her genes' level (blocking for the design, not the doc's prose). Since fork Build(deps-dev): Bump @typescript-eslint/parser from 8.29.1 to 8.37.0 #90 (merged, pin in Engine pin to fork 0d7dda6ae: a saved page restores when its adapters were at 0.0, and CLAMP has a backward #5724), a paged-out KV page restores only if each of its ACTIVE adapters (scale != 0) is attached at the same file revision; otherwise the engine refuses it and she re-prefills cold. In the table, her context levels and her genes are independent claims. So the solver can keep her page in RAM, valued for the page-in it saves, while lowering a gene that page needs to "not resident". The page-in it valued then can't happen: the value was counted but can never be realized. The claims need a dependency: either "her page at a resident or paged level requires her page's active genes resident", or her page and its active genes are one indivisible bundle for the restore. switch_cost for the page-in must include attaching any missing gene. Measured cost of getting this wrong, IntelMac 11-03: task 519, 1,139 s for 13,144 tokens after a refused restore.
  2. Shared runs on a hybrid model. "Identical runs held once (seq_cp), one claim with several owners" holds for attention cells. The recurrent state at the end of a shared run is per sequence (copied, not shared), so 7.1's "target KV and recurrent state, 8,317 B/token" row should split. Each owner pays for her recurrent state, and only the attention part is one shared claim. (Repeating my 738900a note, still open.)
  3. Where the solver lives. cambrian-flex is in airc (crates/flex). Every change to the allocator continuum depends on is then an airc PR, an airc release and a continuum pin bump: three steps on the path for each memory-policy change, against plan line 1's "edit-to-checked < 2 min". If flex is the floor for both repos, say why it lives in airc and not in a shared crate both pin. If that's settled, a sentence in ONE-BUDGET citing the decision is enough.

@joelteply

Copy link
Copy Markdown
Contributor Author

Follow-up to my 738900a review: the 6 unlabelled user deep re-reads on the IntelMac (captures since 11-01). Two classes, both before her stable end:

  1. The head frame swaps by wake cause (b6dcfc8e, 18c04c5b). Message 0 is [Conversational Presence] on one act and [Your own time] on the next, so the prompt re-reads from token 0, the whole view. The frame is a function of this act's cause, rendered at the head. By the FIFO law it belongs in her tail as "this act's situation", or the head holds one frame covering both causes.
  2. Inserted mid-view blocks (18c04c5b, 4c9bb8d9 x3). "Notices my substrate posted into my window…" and [recall] appear at message 7–28 of 31–83 and are gone or moved on the next act. Like the [repetition] retraction, these rewrite bytes already sent; they should be appended items with levels, never re-placed.

Suggested additions to 7.5 step 2's ratchet: a head-frame choice keyed on the wake cause, and a notice or recall block placed anywhere but the tail.

…equired at every tier) and a small window as the same clearing at lower capacity; acceptance cases for both

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply and others added 2 commits November 3, 2026 08:20
…wn measured-damage ladders, then pairwise exchange, then capacity beyond the tier), never stalls her turn

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…es (one bundle for the restore), attention and recurrent state are separate claims, why the solver lives in airc and how it is developed (Cormac on #5723)

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

Copy link
Copy Markdown
Contributor Author

PASS at b8de1db (Cormac, re-check of 6d42d4a..b8de1db, including 878d758..782202d).

Verified, my three points:

  1. A page and its active genes are one bundle for the restore: the page stays paged only while its genes can attach first, the page-in's switch_cost includes attaching them, and a page whose genes were lowered is valued as the re-prefill it then is. That's a joint claim (flex part 2), not a rule inside either owner.
  2. Attention cells and recurrent state are separate claims, seq_cp shares only the attention, and the 7.1 row is split, with the fork's report as card 8ea54536.
  3. The airc home is argued: policy stays in continuum, only the solver's types live in airc, and a local [patch] keeps edit-to-checked in seconds.

And the new sections: the causal floor (her own acts' results are Floor::Required at every tier) is the structural form of the never-clip-the-newest rule. The repair loop terminates for the stated reason: value strictly rises over a finite set of states, with no iteration count anyone picked. Capacity beyond the tier is tried in order of measured cost, with "serve her alone" as the last rung and refusal only after it.

One correction: the "small window" paragraph and acceptance case (c) cite "the IntelMac's 16,384 tokens per mind". That was the 11-03 publication bug (a capped slot window divided again, fixed by #5722), and since #5733 her window is her grant, up to the trained 32,768. As a stress case 16,384 is fine, but label it a chosen capacity for the replay, not the IntelMac's window.

@joelteply

Copy link
Copy Markdown
Contributor Author

PASS at 16abaad (Cormac): the delta from b8de1db is the two lines, the 16,384 window labelled a chosen replay capacity and the IntelMac figure named as the 11-03 publication bug. Merge on green.

@joelteply
joelteply merged commit 5c58f7c into canary Nov 3, 2026
10 checks passed
@joelteply
joelteply deleted the fable/memory-conserved-design branch November 3, 2026 17:02
joelteply added a commit that referenced this pull request Nov 3, 2026
…y judge against the merge commit's first parent (#5738)

* Source-hygiene ratchets fetch two commits and judge against the merge commit's first parent, not a full-history clone (card 1e53dc4a)

fetch-depth: 0 sometimes spent 9.5 minutes fetching and the 10-minute timeout cancelled the job before a
ratchet ran (#5728 twice, #5723, canary; 11-03). A PR's checkout is GitHub's merge commit; its first parent
is the exact base the PR merges onto, which is what the oversized-edit gate and the ratchets judge against.
A push judges against 'before' (fetched alone at depth 1 when absent), else canary's tip. One step computes
RATCHET_BASE; both gates read it, so the base is decided once.

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

* Ratchets base: join a push's base to HEAD by fetching back to its commit date, in full only if that cannot (Cormac on #5738)

ratchets.rs takes the merge base of RATCHET_BASE and HEAD; a push's base fetched alone at depth 1 has
no connecting history. --shallow-since the base's own commit date joins them (validated: a base 10
commits back joined with 11 commits fetched); --unshallow only if that fails, and the step fails loud
if they still cannot be joined.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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