Skip to content

Replay as realistic as live (identity=resident); refused decodes say what the engine held; the Core refuses an oversized prompt at the door - #6209

Merged
joelteply merged 5 commits into
fable/run-to-endfrom
fable/realistic-replay
Nov 21, 2026
Merged

joelteply merged 5 commits into
fable/run-to-endfrom
fable/realistic-replay

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Replay runs as realistically as live, and the engine refuses at the door a prompt its stream can't hold. This serves the minds in two ways. Policy changes can now be tested on their real turns (warm cache, her own identity) without touching their history or learning. And an oversized turn is refused with the numbers instead of costing 31 s of prefill and then failing.

Changes (base: fable/run-to-end, #6208)

  • cognition/replay-request takes identity. isolated (the default, unchanged) is a fresh mind: a cold turn. resident is the source persona's own mind, so her parked blocks are reused exactly as her next live turn would reuse them.
    • The capture is always owned by a fresh replay identity, so a replay never enters her history or her learning.
    • The description now states what resident mode does change: her native KV, and the checkpoint a stop saves from it.
    • identity is a defaulted field, not an Option.
  • persona.engine.decode_refused (persona-llama UnifiedTier): a refused decode records the step, the context geometry and every stream's occupant and highest position.
    • This is how tonight's "no KV slot" failure was diagnosed as a geometry overflow: step end 24,671 against n_ctx_seq 24,576, with the peer stream empty.
  • StreamCapacity (new, persona_scheduler/admission.rs): the Core admits a prompt only with room for one generated token. Otherwise it returns Infeasible { prompt_tokens, capacity }, tells the caller, and records persona.engine.infeasible.

Measured (M5, deployed 6d1b666356)

  • The replay that prefilled for about 31 s and then failed on e61b5cffe1 is now refused in 3 s: "her prompt is 26633 tokens and one stream holds 24320".
  • Live deliberation already fits prompts to the published n_ctx_seq (delib.turn.demand context_window=24576), with zero live refusals since 07:13. The new check guards callers that don't fit their own prompts: replays and external drivers.

Open, owned

  • The engine's context shrank from 102k to 112k to about 48k to 49k at every start since 06:14. Budget attribution is Codex's.
  • Infeasible should feed back: the capacity owner requests growth, or returns its geometry to the prompt fitter so the caller recomposes before dispatch (Codex's design note). Next.
  • The realistic two-build replay reruns once the engine starts at full size.

Checks

persona_scheduler tests 15 pass (the admission validator added). request_replay tests pass. Check of engine, cognition and core test targets: 0. Ratchets vs origin/fable/run-to-end: 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

joelteply and others added 4 commits November 21, 2026 00:10
…ically as her live turn (Joel, 2026-11-21: "Replay should be as realistic as regular mode")

cognition/replay-request gave every replay a fresh persona id, so the engine served it as a stranger
with nothing cached: every replayed turn was a cold prefill, unlike live turns that reuse 71-98%
of their prompt (the M5 windows of 2026-11-21).

- `identity`: `isolated` (the default, unchanged: a fresh mind, cold) or `resident` (the source
  persona's own mind, so her parked blocks are reused exactly as her next live turn would reuse them).
- The engine's identity and the capture's owner are now separate: the capture is always owned by a
  fresh replay identity, so a replay never enters her prompt history or her learning, whichever
  mind served it.
- The result names the identity it was served as.
- A resident replay interleaving with her live loop is safe (one serial queue per mind; reuse is
  checked against the actual prompt) but spoils a measurement, so a measuring run holds and
  despawns her first. No cross-layer hosting check (cognition must not import mind).

The validator (request_replay tests) extends the isolation test: a resident replay is served as her
own mind and its capture is still owned by a separate replay identity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…efaulted field, not an Option

- persona.engine.decode_refused (continuum-persona-llama unified_tier): when llama_decode refuses a
  step, the probe records the step (from, tokens), the context geometry (n_ctx, n_ctx_seq,
  n_seq_max, n_batch, n_ubatch) and every execution stream's occupant and highest position. The M5,
  2026-11-21: cold 26-36k resident replays were refused "no KV slot" (llama_decode returned 1)
  about 31 s into prefill, and the source alone cannot tell other streams' cells, full-batch
  chunks or fragmentation apart (Codex's request: measure before inferring a cause). Its first
  dependency on continuum-base (the floor) and tracing.
- ReplayRequestParams::identity is `ReplayIdentity` with a serde default (absent = isolated) instead of
  `Option` + unwrap_or_default at two sites (the unwrap ratchet).

check -p continuum-persona-llama -p continuum-engine -p continuum-cognition --tests 0; request_replay
tests pass; persona-llama builds with metal; ratchets vs origin/fable/run-to-end 0.

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

The M5, 2026-11-21 (persona.engine.decode_refused, e61b5cf): a 26,633-token resident replay was
admitted to a 24,576-token stream (n_ctx 49,152 / n_seq_max 2), prefilled for ~31 s, and refused by
the engine at the chunk that crossed the end (from 22,623 + 2,048 tokens). The engine spent the work
and then failed; the object model's Core answers Infeasible when a need exceeds its cap.

- admission.rs (new): `StreamCapacity` (the applied geometry's n_ctx_seq) admits a prompt only with
  room for one generated token, else `Infeasible { prompt_tokens, capacity }` (typed, with Display).
- The driver holds its `StreamCapacity` from the geometry it applied, checks every turn at `admit`,
  tells the caller with the numbers, and records persona.engine.infeasible keyed by the request id.
  A refused turn was never admitted, so it has no other transition.
- Live deliberation already fits prompts to the published n_ctx_seq (delib.turn.demand
  context_window=24576 tonight); this guards every caller that does not fit its own: replays, and
  external drivers.

persona_scheduler tests 15 pass (the admission validator added); check engine + core tests 0;
ratchets vs origin/fable/run-to-end 0; driver.rs 953 lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 162fbe5 into fable/run-to-end Nov 21, 2026
47 checks passed
@joelteply
joelteply deleted the fable/realistic-replay branch November 21, 2026 08:15
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