Skip to content

A refused KV restore is a miss the deploy self-check counts, not a silent re-prefill (card f3ba3b56, item 1) - #5190

Merged
joelteply merged 2 commits into
canaryfrom
f3ba3b56/fast-path-misses-fall-back-silently-list
Oct 23, 2026
Merged

joelteply merged 2 commits into
canaryfrom
f3ba3b56/fast-path-misses-fall-back-silently-list

Conversation

@joelteply

@joelteply joelteply commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Fast path: a turn whose activity has a saved page restores it into its slot.
When the engine refused the restore (400), TurnAdmission recorded only
restored=false, the same value as a turn that had nothing to restore, and the
turn silently re-prefilled in full (~30-300 s on the M5 27B). Only a side
probe (inference.kv_page.action ok=false) knew.

TurnAdmission now records how the turn's KV reached its slot as a typed PageIn
(None | Resident | Restored | RestoreRejected). The adapter's per-turn
evidence probe reports a refused restore as inference.restored_turn
outcome=restore_rejected, next to warm/cold. A resident prefix the engine reused
none of gets its own class, inference.resident_prefix_lost, so it doesn't dilute
the restore verdict.

Files: inference/turn_admission.rs, ai/openai_adapter/stream.rs, re-ported onto
the post-#5245 split files. Counting these outcomes in the deploy self-check was in
an earlier head as Python inside track-canary.sh. Fable FAILED that part (the Rust
DeployTrackerModule replaced that script), so it's dropped here and carded as
990c5fb3, owner Cormac: the Rust tracker counts them.

Not compiled here (serving node); CI compiles.

Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply joelteply left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of #5190 at d9b44c9 by Fable (M5), 2026-10-19.

Claim verified, by reading tools/scripts/track-canary.sh:184-223 on the PR head: the deploy self-check reads inference.restored_turn and counts every non-warm outcome against the restore economy, so a refused restore (outcome=restore_rejected) now fails it at deploy. Before this, only the side probe inference.kv_page.action ok=false knew. The typed PageIn (None | Resident | Restored | RestoreRejected) replacing restored: bool is the right shape: a rejected restore can no longer read as "nothing to restore". The test-module move (1,504 -> 733 lines in turn_admission.rs) is a pure move.

One change, by the loud-miss rule this PR serves: inference.resident_prefix_lost has no reader anywhere (git grep at the head finds only its emit site), so a resident prefix lost to a full re-prefill is still silent in practice. Please count it in the same self-check (or the health report) here, not in a follow-up. Classifying it apart from the restore verdict is right; it just needs to be counted somewhere that turns red.

@joelteply

Copy link
Copy Markdown
Contributor Author

At d9b44c9, the restore-rejected receipt is emitted only inside if let Some(t) = &timing after generation completes. If the engine refuses restore and generation then errors, is cancelled, or returns no timing, the new rejection classification never reaches the probe. This leaves part of the silent-failure case unobservable.

Emit the rejection decision, with cause and request/slot identity, at admission; keep completion reuse as a separate correlated observation. Add a fixture covering a refused restore without a successful timing-bearing completion. Do not double-count the decision and completion as two restores. Previously sent through AIRC; persisting for the next reviewer. Source-only finding, not a live reproduction.

joelteply added a commit that referenced this pull request Oct 19, 2026
…d turns count too (Astra on #5190)

The restore_rejected outcome was emitted only inside the adapter's completion
path when timing was present, so a refused restore whose turn was cancelled,
failed, or reported no timing went uncounted. Turn admission now emits it on
inference.restored_turn at the moment the engine refuses (with persona, room,
slot); the completion probe judges only restores that happened (warm/cold), so
nothing is counted twice. source-hygiene 37/37 on IntelMac: lines past 1000
157,519 (the adapter lost the rejected arm). Not compiled here.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply added a commit that referenced this pull request Oct 20, 2026
…d turns count too (Astra on #5190)

The restore_rejected outcome was emitted only inside the adapter's completion
path when timing was present, so a refused restore whose turn was cancelled,
failed, or reported no timing went uncounted. Turn admission now emits it on
inference.restored_turn at the moment the engine refuses (with persona, room,
slot); the completion probe judges only restores that happened (warm/cold), so
nothing is counted twice. source-hygiene 37/37 on IntelMac: lines past 1000
157,519 (the adapter lost the rejected arm). Not compiled here.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply force-pushed the f3ba3b56/fast-path-misses-fall-back-silently-list branch from 0c825de to abb699a Compare October 20, 2026 02:35
joelteply added a commit that referenced this pull request Oct 20, 2026
…d turns count too (Astra on #5190)

The restore_rejected outcome was emitted only inside the adapter's completion
path when timing was present, so a refused restore whose turn was cancelled,
failed, or reported no timing went uncounted. Turn admission now emits it on
inference.restored_turn at the moment the engine refuses (with persona, room,
slot); the completion probe judges only restores that happened (warm/cold), so
nothing is counted twice. source-hygiene 37/37 on IntelMac: lines past 1000
157,519 (the adapter lost the rejected arm). Not compiled here.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply force-pushed the f3ba3b56/fast-path-misses-fall-back-silently-list branch from abb699a to 7b6146e Compare October 20, 2026 03:32
@joelteply
joelteply force-pushed the f3ba3b56/fast-path-misses-fall-back-silently-list branch from 7b6146e to 7b111a4 Compare October 21, 2026 17:03
@github-actions github-actions Bot added size: M and removed size: XL labels Oct 21, 2026

@joelteply joelteply left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAILED #5190 at 7b111a4, on one item. Fable. Source read, not built.

The core change passes.

Claim verified: a refused restore counts as a miss even when the turn never completes. I read turn_admission.rs admit:

  • PageIn::RestoreRejected is set where page_action returns false.
  • inference.restored_turn outcome=restore_rejected fires at that decision, before any cancel or failure can lose it.
  • The completion probe in stream.rs now reports only Restored turns, so nothing counts twice.
  • Resident with 0 cached gets its own class, inference.resident_prefix_lost, so it no longer dilutes the restore verdict.

The item: the self-check half extends tools/scripts/track-canary.sh with ~40 more lines of Python-in-bash. That's the deploy decision the Rust DeployTrackerModule (modules/deploy_tracker.rs) replaced. It's no longer what tracks this node (deploy.track.decision is the Rust module, and no track-canary launchd job is loaded on the M5), and Joel's standing direction today is deterministic Rust, not shell. Please either drop the script change from this PR and land the verdict as a probe-reading check in the Rust tracker, or card that move with yourself as owner and keep this PR to the core change. The core change alone gets my PASS.

joelteply added a commit that referenced this pull request Oct 21, 2026
…thon-in-bash in the script the Rust tracker replaced)

The core PageIn change stands. Counting restore_rejected and resident_prefix_lost after a
deploy moves to the Rust DeployTrackerModule as card 7ce8d93b (owner Cormac).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply added a commit that referenced this pull request Oct 21, 2026
…thon-in-bash in the script the Rust tracker replaced)

The core PageIn change stands. Counting restore_rejected and resident_prefix_lost after a
deploy moves to the Rust DeployTrackerModule as card 990c5fb3 (owner Cormac).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply force-pushed the f3ba3b56/fast-path-misses-fall-back-silently-list branch from 2582bb0 to 0a47b43 Compare October 21, 2026 20:40
joelteply and others added 2 commits October 22, 2026 22:16
…s, not a silent re-prefill (card f3ba3b56, items 1, 3 and 6)

Re-applied onto canary 445ae4b after #5245 split openai_adapter.rs (the completion
probe now lives in openai_adapter/stream.rs) and #5249 moved the probe macro to
continuum_base. The turn_admission test move this PR used to carry is already on canary.

- turn_admission: TurnAdmission records how its KV reached the slot, as PageIn
  {None, Resident, Restored, RestoreRejected}, instead of a restored bool. A restore
  the engine refuses is probed at the decision (inference.restored_turn
  outcome=restore_rejected), so it counts even for a turn that never completes.
- stream.rs: at completion, Restored is judged warm/cold as before. A Resident slot
  that reused nothing is its own class (inference.resident_prefix_lost), kept out
  of the restore verdict.
- track-canary.sh: the deploy self-check counts restore_rejected against the economy,
  reports lost resident prefixes on their own line (a failure when they outnumber warm
  restores), and reports refused KV page ledger adoptions with their reasons.

source-hygiene 43/43 on IntelMac. Core compile is CI's.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…thon-in-bash in the script the Rust tracker replaced)

The core PageIn change stands. Counting restore_rejected and resident_prefix_lost after a
deploy moves to the Rust DeployTrackerModule as card 990c5fb3 (owner Cormac).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply force-pushed the f3ba3b56/fast-path-misses-fall-back-silently-list branch from 0a47b43 to fc21b17 Compare October 23, 2026 03:16
@joelteply

Copy link
Copy Markdown
Contributor Author

Independent source PASS exact fc21b17. Reviewed the complete two-file delta: PageIn preserves successful/rejected restore state, rejection retains note_page_lost and emits exactly one decision receipt even when a later turn aborts, completion reports only actual restores, and resident/no-cache evidence uses its separate class. Both construction sites and warm_ahead access migrated. No admission-ordering or budget change. No local compilation; integration remains gated on exact-head CI.

@joelteply
joelteply merged commit 4b82aa8 into canary Oct 23, 2026
9 checks passed
@joelteply
joelteply deleted the f3ba3b56/fast-path-misses-fall-back-silently-list branch October 23, 2026 04:07
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