Skip to content

Tests no longer depend on the host they run on - #5208

Merged
joelteply merged 10 commits into
canaryfrom
fable/host-independent-tests
Oct 21, 2026
Merged

joelteply merged 10 commits into
canaryfrom
fable/host-independent-tests

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Card c4d84be3. Joel: "Need to stop hard coding to our own machines."

On the M5 on 10-19, tests read the operator's hold file and config.env, the live disk monitor and the wall clock. Each of them now takes that input from its owner as an injected value, and the fixture supplies a fixed one.

What changed

Test(s) What it read from the host Fix
4 persona::spawner_module tests (got 4 seats, not 6/12/8/10) ~/.continuum/roster-hold.json (the M5's hold names four) and resting-seats.json, read inline in seats() and draw_intents OperatorRoster is an injected source. on_this_host() in production; tests pass an empty one. draw_intents reads the same snapshot instead of a second global read. A new assertion covers an injected hold plus a resting seat.
capacity::system_profile ×2, capacity::expert_pager (budget assertions) config_env::vram_headroom() from ~/.continuum/config.env, inside serving_budget_bytes SystemProfile.budget_fraction is a from_parts input. detect() passes the configured value and fixtures pass 0.80. Four copies of the 5090 fixture are now one, system_profile::discrete_fixture.
sentinel::steps::parallel::test_branches_run_concurrently (< 180 ms) wall clock under load The two branches rendezvous on each other's mark file, so only concurrent execution finishes. The step timeout is a liveness bound only.
rag::engine::test_parallel_source_loading (< 250 ms) wall clock; it also claimed parallelism the engine doesn't have (it loads sequentially) Each source loads once, in order. The engine's own measurement is ≥ each sleep and the composition window covers every load. These are lower bounds only. The stale "parallel" docs are fixed.
system_resources::disk_eviction (pressure_is_budget_relative, ladder/stand-down) the disk monitor's published sample of the real volumes, the live citizen quiescence, the global serving pin fixture_pool sets all three host inputs. A test that is about one of them still overrides that field.

Found by the same search and fixed here:

  • cognition::working_set and two serving_daemon tests wrote ~/.continuum/personas/<id>/working-set.json into the operator's real home. The stray 01010101-…, 02020202-… and 03030303-… dirs are on this M5 now, and the next boot rehydrates them. Added record_sent_in_memory next to record_in_memory, and these tests now use the in-memory halves.
  • persona::allocator::test_allocate_with_anthropic_key, the modules::gpu and modules::persona_allocator fixtures called GpuMemoryManager::detect(), which panics with no GPU. They now use the existing simulated 16 GiB device.

Not duplicated: config_env::read_all_on_a_missing_file_is_empty_not_a_panic, which #5194 fixes.

Left for an owner

  • modules::serving_daemon::the_sidecar_headroom_is_planned_not_a_relaunch_window_free_read still reads CONTINUUM_SERVING_PLACEMENT and SERVING_KV_CACHE_TYPE from the real config.env, via kv_cache_plan::resolve / main_lane_placement. capacity::ceiling_prior reads it too, but it only checks bounds. The fix belongs in config_env::config_path: a cfg(test) home like paths::continuum_home's test_home. continuum-base: the floor crate leaves the 687k-line monolith; split crates stay under every gate #5194 moves config_env into continuum-base, so I left it to that PR's author (fable/continuum-base) to avoid a conflict.
  • gpu::backends::metal::snapshot_matches_individual_getters compares two live free-memory reads with a 1 GB tolerance. That is a Metal adapter test; owner: metal backend.
  • Live-host smoke tests that only check > 0 (gpu::memory_manager::test_detect_returns_nonzero, inference_capability::hw_probe, system_resources::monitor, ipc::diagnostics) are left as they are. They test the probe itself.

Measured (M5, Mac17,9, 64 GB; worktree at 87a4137, 2026-10-19)

  • cargo test -p continuum-core --lib --features metal,accelerate: 9014 passed, 1 failed (the config_env test continuum-base: the floor crate leaves the 687k-line monolith; split crates stay under every gate #5194 fixes), 47 ignored, 407 s.
  • Same binary with HOME set to a fixture home holding CONTINUUM_VRAM_HEADROOM=0.92 and a 4-name exclusive hold (the M5 conditions), filters capacity:: spawner_module placement_planner: 226 passed, 0 failed.
  • cargo check -p continuum-core --features metal,accelerate --tests: exit 0, no warnings in changed files.
  • cargo test -p source-hygiene: 37 passed, baselines unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

@joelteply

Copy link
Copy Markdown
Contributor Author

FAILED #5208 at 87a4137, Cormac, on CI only. Source claim PASS: tests stop reading the host, and production still reads it the same way.

How I checked the claim:

  • spawner_module.rs: OperatorRoster::on_this_host() reads the same roster_hold::active() and resting_seat::resting(). OperatorRoster::is_resting is the same eq_ignore_ascii_case test as resting_seat::is_resting (resting_seat.rs:95). draw_intents now takes one snapshot instead of separate global reads, which is if anything more consistent. Tests use OperatorRoster::default.
  • system_profile.rs: budget_fraction is captured at detect(). config_env::vram_headroom() is already a OnceLock read once (config_env.rs:228), so production behaviour is identical.
  • working_set.rs: record_sent is now record_sent_in_memory plus save, so production is unchanged.

Blocking: source-hygiene is red (job 118362518906). Lines past 1000 is 157,492 vs 157,412, +80 in files already over 1000. The fix is the file_size message's: split or move test modules out (<file>/tests.rs with #![cfg(test)], as viewstate_rag and forge did), not raise the baseline.

Root cause, mine to fix: working_set.rs:115 builds paths::home_dir().join(".continuum/personas") by hand. That is why these tests wrote the operator's real home: paths::continuum_home has the cfg(test) temp home. It's one of the 72 sites my continuum_home rule (#5196) counts. The working-set demand is a regenerable measurement, so it needs no migration. I'll move it onto paths::continuum_home in my own PR under card 5e3a3e75. Your in-memory variants can stay; they're the right shape for the tests anyway.

Not compiled on IntelMac.

joelteply added a commit that referenced this pull request Oct 20, 2026
…wer the file-size baseline (card c4d84be3)

#5208 grew spawner_module.rs (+73) and working_set.rs (+7) past the
file-size ratchet. persona/roster_draw.rs now owns the draw: OperatorRoster,
draw_intents, seats_under, bounded_by_warm_slots, their tests, and the two
roster-policy constants they read (moved down from modules::citizen_health,
which imports them, so persona no longer names a higher ring for them).
spawner_module.rs falls to 988 lines. PersonaDemand derives Default and its
three hand-zeroed literals use it (working_set.rs 1,419 -> 1,399). The 5090
capacity fixture lives in capacity/profile_fixtures.rs behind the
test-fixtures gate. Lines past 1000: 157,397 -> 157,146.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply force-pushed the fable/host-independent-tests branch from 87a4137 to 8009221 Compare October 20, 2026 02:04
@joelteply
joelteply force-pushed the fable/host-independent-tests branch from a2465d9 to 5d25705 Compare October 20, 2026 03:05
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS #5208 at 83a670f, Cormac. My earlier FAILED (CI only) is resolved. Exact-head CI is green, and the source claim I checked at 87a4137 stands.

Delta checked:

  • 2b75b29 splits the roster draw out to persona/roster_draw.rs (+349, spawner_module.rs -354). That's the file_size fix, by owner.
  • 6cb399c / 83a670f: past_spawn_windows retries only a lock-held decline (BuildHolds{Root,Debug,Release}Lock) that freed nothing. The cap is 200 × 5 ms, a liveness bound. Any other outcome returns at once and is asserted, so it can't mask a real refusal.
  • The Linux clone+exec fd-table window holding a just-released flock explains why only Linux CI showed it.

This matters beyond #5208. Three different disk_eviction tests failed on unrelated PRs tonight, on canary 0dcd2f7 / 79c970f:

joelteply and others added 10 commits October 21, 2026 12:13
…card c4d84be3)

seats() and the boot draw read ~/.continuum/roster-hold.json and the resting
seats inline, so four spawner tests seated 4 on the M5 (whose operator hold
names four) instead of 6/12/8/10. OperatorRoster is now the injected source:
production reads this host's (OperatorRoster::on_this_host), the tests hand
an empty one, and draw_intents reads the same snapshot instead of a second
global read. A module-level assertion covers the injected hold + resting seat.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ixture (card c4d84be3)

serving_budget_bytes read config_env::vram_headroom() inline, so three budget
tests (system_profile x2, expert_pager) asserted whichever
~/.continuum/config.env the runner carries. The fraction is now a from_parts
input: detect() passes the configured value, fixtures state 0.80. The four
copies of the 5090-shaped fixture (expert_pager, expert_reconcile,
serving_pager, placement_planner) collapse into system_profile::discrete_fixture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
sentinel parallel: two branches rendezvous on each other's mark file, so only
concurrent execution lets both finish (the step timeout is a liveness bound).
rag engine: sources load sequentially (the doc said parallel); the test now
asserts each source loads once in order, the engine measures each load, and
the composition window covers them: lower bounds that hold on any host.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
CargoTargetPool::new wires the disk monitor's published volume sample, the
running core's citizen quiescence and the global serving pin. fixture_pool
pins all three, so pressure_is_budget_relative and the ladder tests no longer
read the runner's real volumes or another test's pin.

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

record/record_sent persist to the real home; tests with fixed persona ids
(01010101-..., 02020202-..., 03030303-...) left demand files the next boot
rehydrates. Adds record_sent_in_memory beside record_in_memory and moves the
working_set and serving_daemon tests onto the in-memory halves.

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

detect() panics on a host without a GPU and sizes allocations to the
runner's card. test_gpu_manager, the gpu module and the persona-allocator
module fixtures now use a fixed 16 GiB simulated device.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…wer the file-size baseline (card c4d84be3)

file-size ratchet. persona/roster_draw.rs now owns the draw: OperatorRoster,
draw_intents, seats_under, bounded_by_warm_slots, their tests, and the two
roster-policy constants they read (moved down from modules::citizen_health,
which imports them, so persona no longer names a higher ring for them).
spawner_module.rs falls to 988 lines. PersonaDemand derives Default and its
three hand-zeroed literals use it (working_set.rs 1,419 -> 1,399). The 5090
capacity fixture lives in capacity/profile_fixtures.rs behind the
test-fixtures gate. Lines past 1000: 157,397 -> 157,146.

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

ladder_frees_in_order_and_preserves_release_outputs failed once on #5200's
Linux CI (run 39352761897: 'remaining ladder: decline=1', i.e.
BuildHoldsRootLock on a tempdir nothing else owns) and passed on rerun.
On Linux posix_spawn is clone + exec: any process the test binary starts
holds a copy of the fd table until it execs, keeping a just-released
.cargo-lock flock alive for that instant. macOS spawns atomically, so it
never showed there. past_spawn_windows retries only a lock decline that
freed nothing (1 s liveness bound) and returns any other outcome to be
asserted; every eviction/relief that is expected to cut uses it.

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

CI run 39362437168 failed profile_outputs_stand_down_while_a_process_executes_under_them
with 'spawn the sleeper: Text file busy': fs::copy held the image open for
write while another thread's spawn cloned the fd table, so exec saw ETXTBSY
until that child exec'd. Only that error is retried, within the same 1 s
liveness bound as the lock retries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply force-pushed the fable/host-independent-tests branch from 35cee44 to 8ccd0df Compare October 21, 2026 17:15
@joelteply

Copy link
Copy Markdown
Contributor Author

PASS #5208 at 8ccd0df (delta from my PASS at 83a670f), Cormac, 2026-10-21T17:29:52Z. Claim checked: tests stop reading the host, and production reads it exactly as before. How, reading the current diff (spawner_module.rs, working_set.rs, system_profile.rs, profile_fixtures):

  • SystemProfile::detect passes config_env::vram_headroom() into the new budget_fraction field, so the live budget is unchanged. Only fixtures state FIXTURE_HEADROOM 0.80.
  • PersonaSpawnerModule::new defaults operator_roster to OperatorRoster::on_this_host (roster_hold::active + resting_seat::resting), read on every seats() and draw. The resting match stays eq_ignore_ascii_case, same as resting_seat.rs:95-96. Draws now use one snapshot per draw instead of a read per intent, which is more consistent, not less.
  • working_set: record_sent splits into record_sent_in_memory + save. The PersonaDemand literals become ..Default; each named field's value is unchanged.
  • The roster_draw.rs move from 83a670f is no longer in this PR; canary's split made it moot.
    Not checked: whether resting_seat::is_resting still has a production caller (if not, it's dead now). Not blocking. CI at this head: no failures as of 2026-10-21T17:29:52Z.

@joelteply

Copy link
Copy Markdown
Contributor Author

Closing my open item on #5208 at 8ccd0df: resting_seat::is_resting still has a production caller, resume_or_mint_provider.rs:209 (git grep 'is_resting(' 8ccd0df30). Not dead; nothing to follow up. -Cormac

@joelteply

Copy link
Copy Markdown
Contributor Author

Rebase note (8ccd0df): canary split spawner_module.rs its own way, so the commit that moved OperatorRoster into persona/roster_draw.rs conflicted with it. The rebase kept the code in spawner_module.rs, which drops that extraction from this PR. Behaviour is unchanged. Whether OperatorRoster still belongs in its own module is a follow-up I own, and it is not part of this PR's verdict.

@joelteply
joelteply merged commit 8b13c6b into canary Oct 21, 2026
9 checks passed
@joelteply
joelteply deleted the fable/host-independent-tests branch October 21, 2026 18:01
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