Skip to content

fix(substrate): a test binary never writes the operator's records; a boot with no knee for the remembered model takes the last measured one - #4266

Merged
joelteply merged 4 commits into
canaryfrom
fix/a-test-binary-never-writes-the-operators-records
Sep 20, 2026
Merged

joelteply merged 4 commits into
canaryfrom
fix/a-test-binary-never-writes-the-operators-records

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What happened (the M5, 2026-09-20 15:38Z boot)

serving.decode_knee.clamped model=coder-14b knee=17 — a harness fixture name. A local cargo test run of the serving daemon on this box settled its fake lane and save()d "coder-14b" into ~/.continuum/state/served-window.json. The boot remembered that model, found no knee for it, planned 17 lanes unclamped → 8 × 49k with a 12.6 GB cache grant on a box whose 27B knee is 2, swapped 4.6 GB, and drew 13 minds. The re-home law healed the lanes 100 s later; the residency did not (this hour's health line: 13 resident, 8 lanes max, 0 acts).

The fix, two halves

  1. continuum_home() under cfg(test) (no $CONTINUUM_HOME declared) resolves to temp_dir()/continuum-test-home-<pid>. Every store — served-window, decode-knee, resting seats, roster hold, standing config, citizens — resolves through it: one guard, 26 call sites, nothing to remember per test. Pinned by a_test_binary_never_resolves_the_operators_home.
  2. decode_knee::last_measured_knee(): when the remembered model has no curve, the curve this box measured most recently bounds the lanes (probed once per fallback model, serving.decode_knee.fallback). Pure last_measured pinned.

Why both

(1) closes the poisoning; (2) makes a poisoned or foreign record unable to unclamp the roster — the box's own decode evidence rules until a lane reports. Card #4241's boot-knee gap.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…nder test the continuum home is a per-process temp dir; and a boot that remembers a model with no decode curve takes the last measured one

The M5, 2026-09-20 15:38Z boot: serving.decode_knee.clamped model=coder-14b knee=17 — a
HARNESS FIXTURE name. A local cargo test run of the serving daemon on this box settled its
fake lane and save()d coder-14b into ~/.continuum/state/served-window.json; the boot
remembered that model, found no knee for it, planned 17 lanes unclamped → 8 × 49k with a
12.6 GB cache grant on a box whose 27B knee is 2, swapped 4.6 GB, and drew 13 minds. The
re-home law healed the lanes 100 s later; the residency did not.

1. commands::benchmark::continuum_home(): under cfg(test), with no  declared,
   the home is std::env::temp_dir()/continuum-test-home-<pid>. Every store (served-window,
   decode-knee, resting seats, roster hold, standing config, citizens) resolves through it —
   one guard, 26 call sites. Pinned: a_test_binary_never_resolves_the_operators_home.
2. decode_knee::last_measured_knee(): the curve this box measured most recently answers when
   the remembered model has none; the daemon takes it, probed once per fallback model
   (serving.decode_knee.fallback). Pure last_measured pinned.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…the guard's test and the pure lookup

The rest of the fix the first push of this branch was missing: a_test_binary_never_resolves_the_operators_home,
decode_knee::last_measured_knee / last_measured (pinned), and the daemon's fallback probed once per
fallback model (serving.decode_knee.fallback).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@github-actions github-actions Bot added size: M and removed size: S labels Sep 20, 2026
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE with one condition — reviewed at exact head 17742d8 (cargo test running at read time).

The home half is right: one resolver, every store through it, and under cfg(test) with no declared $CONTINUUM_HOME the home is a per-process temp dir — a test cannot reach the operator's records by forgetting, and the pin checks the temp prefix, the process tag, the inequality with ~/.continuum and one-home-per-process. Note, not a condition: cfg(test) is the LIB test build only — a harness in tests/ or another crate links continuum-core without it and resolves the operator's home again. When one such harness exists (the cross-grid integration tests, task #187), the guard wants to ride any(test, feature = "test-fixtures") or the tests/ binaries want to declare a home; today there is none, so the seam is named, not open.

The condition is the knee half. "The last measured curve IS this box's decode ceiling" is not true across models: a knee is a (box, model) fact, and the newest curve on the box may be a 1.5B's (a benchmark lane, an exam, a smaller tier served an hour ago) with a knee of 6 or 8 — the same shape as today's incident (13 minds drawn on 8 lanes) reached through the fallback instead of around it. The evidence THIS box has about a model it has never measured is the most conservative curve it holds, not the newest: take the MINIMUM knee across measured curves (or the knee of the most capable measured model, which is the same number in practice — the biggest model has the lowest knee), name which one answered in the probe, and pin it: curves {27b: knee 2 at t=1000, 1.5b: knee 8 at t=5000}, remembered "coder-14b" → 2, not 8. last_measured can stay as the tie-break among equals. With the newest-wins rule the boot after an exam on a small model plans the 27B past its knee, which is the regression #4241 fixed.

… knee, never its newest — Cormac's condition on #4266

A knee is a (box, model) fact: the newest curve may be a 1.5B exam's with a knee of 8, and
a boot remembering a 27B with no curve would plan past its knee of 2 — today's shape by
another road. decode_knee::conservative(curves, now): the lowest knee across measured
curves, newest breaking ties, named in the probe. Pinned: {27b: knee 2 @ t=1000, 1.5b:
knee 8 @ t=5000} → the 27B's 2.

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

Copy link
Copy Markdown
Contributor Author

Condition taken at 2026697: decode_knee::conservative — the lowest knee across measured curves, newest breaking ties, named in serving.decode_knee.fallback; pinned with {27b: 2 @ t=1000, 1.5b: 8 @ t=5000} → 2. The cfg(test) note is taken as a named seam (the guard rides any(test, feature = "test-fixtures") when a tests/ harness exists). @cormac a fresh word at 2026697, please.

@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE — reviewed at exact head 323873c (lib test and windows check running at read time; the diff since 17742d8 is the condition, nothing else).

The knee condition is taken as asked: conservative picks the LOWEST knee the box holds across every measured curve, newest as the tie-break among equals, names the curve that answered in the probe, and the pin is the scenario I named — the 27B's knee 2 measured earlier and a newer 1.5B at 8 → 2, "the-27b". The test-home half is unchanged and right. Merge on green.

@joelteply
joelteply enabled auto-merge (squash) September 20, 2026 16:57
@joelteply
joelteply merged commit 17b3a83 into canary Sep 20, 2026
6 checks passed
@joelteply
joelteply deleted the fix/a-test-binary-never-writes-the-operators-records branch September 20, 2026 16:59
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