Correctness, Contracts & System-Level Consequences — PR #608
PR: NVIDIA/hyperflare-inference#608 — "helios,ignition,ci: restore catalog validation, CPU Python tests, and script separation" (lukealonso, head 3343f13, merged 2026-11-29, zero reviews, zero comments).
Key findings
- Major — the console-script rename silently breaks the documented CLI contract.
pyproject.toml:15renamesignition→ignition-core, but no markdown file is touched and ~35 documented invocations still call.venv/bin/ignition. No shim, no version bump. - Major (system-level) —
fresh_durationnow globally switches prefix/terminal checkpointing back on for cores whose smallest declaredSnapshotbatch ≠ 1, with no opt-in and no measurement.helios/src/scheduler/cost.rs:264-269; three gating call sites incheckpoints.rs:411,727,788. - Major (metric/pricing span) —
fresh_durationnow quotes the smallest declaredSnapshotbatch while the planner may run a larger batch, so the checkpoint work budget under-prices the copy it authorises.checkpoints.rs:411-416vs.policy_tests.rs:3080-3085. - Major (contract tightening, unpriced) —
catalog.rsper-batch parity is strictly stronger than the previous.any(...)existence checks, andrequired_batchesis inflated by everySpeculativegraph batch (no token/prefill/sampling filter). Previously-loading third-party cores with an extra wide-speculative-only batch now fail to load; the new branch is untested; the core ABI version is unchanged. - Minor —
selection.rsfix is correct and mirrors the retention pass; the residual kind mismatch (speculativevsdecode) is benign today but is a future trap. No admission/metric scope change. - Minor — new CI workflow resolves a moving git dependency (
uv syncwithout--locked), against the charter's "pin everything" rule, and the PR's evidence is againstf7256584/pre-rebase bases, not the merged head; the failing check on head is unexplained.
1. Correctness, Safety & Platform Parity
1.1 Major — fresh_duration no longer means "the batch-1 graph"; every checkpoint gate silently changes meaning
helios/src/scheduler/cost.rs:264-269 (verified in file):
pub fn fresh_duration(&self, kind: GraphKind, tokens: usize) -> Option<u64> {
let batch = self.batches(kind).first().copied()?;
let key = Key { drafts: 0, kind, batch, tokens, prefill: 0, packed: 0 };
self.entry(key).filter(|estimate| estimate.fresh(self.now_ns, self.ttl_ns))
.map(|estimate| estimate.nanos)
}
batches is sorted and deduped per kind in ActionCosts::prepared (cost.rs:179-186), so first() is the smallest declared batch for kind, not batch 1.
The three gates that consume this, all hardcoding tokens = 1 and no batch (helios/src/scheduler/checkpoints.rs, verified):
411 let Some(copy_ns) = self.costs.fresh_duration(GraphKind::Snapshot, 1) else {
412 return (accounting, true, false);
413 };
...
727 if self.costs.fresh_duration(GraphKind::Snapshot, 1).is_none() {
728 return Ok(false);
729 }
...
788 let Some(cost) = self.costs.fresh_duration(GraphKind::Snapshot, 1) else {
789 self.stats.checkpoint_skip_unknown_cost += 1;
790 return Ok(None);
791 };
Impact: on a core whose smallest declared Snapshot batch is not 1, all three gates previously returned the "unknown cost" branch — prefix checkpointing (checkpoint_selection), checkpoint copies (checkpoint_copy_allowed) and terminal snapshots (allocate_terminal_capture) were all silently disabled. After this PR they become active: new snapshot captures on the hot decode path, extra graph replays, more snapshot rows created/retained/evicted per request. That is the intended repair, and it is bandwidth-bounded by allowance(prefill, self.policy.checkpoint_extra_work_fraction) (checkpoints.rs:416, 734-738, 796-804), so it is not unbounded work — but it is a global default behaviour change on upgrade with no flag, no config gate, no served-workload measurement, and no mention of the retention/eviction consequence in the PR body. The PR describes it only as making "checkpoint duration lookups work".
Fix: state the behaviour change explicitly (cores with a non-1 smallest Snapshot batch start capturing checkpoints after upgrade) and gate it behind the existing policy knob or at minimum record it in the checkpoint stats so operators can see captures appearing; ideally add a scheduler-level test that drives checkpoint_selection on a batch-2-only core before/after the change.
1.2 Major — the quoted snapshot cost is taken from a graph shape the plan may not run (metric/rate span shrink)
Same cost.rs:265, consumed at checkpoints.rs:411-416:
411 let Some(copy_ns) = self.costs.fresh_duration(GraphKind::Snapshot, 1) else {
...
416 let available = allowance(prefill, self.policy.checkpoint_extra_work_fraction);
The planner does not necessarily run the smallest Snapshot batch. Verified example in helios/src/scheduler/policy_tests.rs:3064-3089, which keeps only batch_capacity == 2 snapshots and then plans a batch-2 snapshot for a single lane:
3069 graphs.retain(|g| g.kind != GraphKind::Snapshot || g.batch_capacity == 2);
...
3080 assert_eq!(s.costs.duration(GraphKind::Snapshot, 1, 1), None);
3081 assert_eq!(s.costs.duration(GraphKind::Snapshot, 2, 1), Some(nanos));
3082 let plan = s.plan().unwrap();
3083 assert_eq!(plan.kind, GraphKind::Snapshot);
3084 assert_eq!(plan.batch_capacity, 2);
3085 assert_eq!(plan.lanes.len(), 1);
So the price used to decide whether checkpoint work fits in checkpoint_extra_work_fraction of the prefill time is the duration of a row-padded, smallest-batch snapshot graph, while the step the scheduler will actually execute can be a wider batch with a longer copy. On cores that declare several Snapshot batches (the stock Python catalog declares 1,2,4,6,8,12,16,24,32,64 — ignition/components/capacity.py:66-68), copy_ns/cost understate the copy, and the allowance admits slightly more snapshot work than intended. Before the change the lookup matched the batch the plan typically used (1); now the two can diverge in either direction.
Fix: pass the batch the candidate/plan will use into fresh_duration (e.g. the batch of the snapshot step being priced) and keep batches(kind).first() only as the fallback when no plan batch is known. Add a test with two Snapshot batches of different durations asserting the allowance uses the planned one.
1.3 Note — the new cost.rs test only covers the happy path
cost.rs:415-446 (fresh_duration_uses_smallest_declared_batch_when_batch_one_is_absent) declares exactly one Snapshot graph at batch 2, so smallest == only == planned. It proves the ? early-return on an unmeasured table and nothing about the multi-batch under-quote in 1.2, and there is no test at the checkpoints.rs call sites proving the gates actually flip.
1.4 Sound — __deepcopy__ (ignition/direct/scheduler.py:449-459)
The added Request.__deepcopy__ memoizes before recursing (memo[id(self)] = copied) and re-wraps MappingProxyType attributes in a fresh proxy over a deep-copied dict, so the read-only invariant of _core_parameters is preserved while copy.deepcopy stops raising TypeError: cannot pickle 'mappingproxy' object at ignition/bench/runner.py:424,435 and tests/bench/test_runner.py:55,57. It also correctly falls through to object.__new__ + per-attribute copy, which covers subclasses. No cycle hazard beyond the normal memo contract. No issue found.
2. Unintended System-Level Consequences
2.1 Concurrency / contention — sound
Nothing in the diff touches locks, queues, or shared buffers. fresh_duration remains a read-only O(1) HashMap lookup on the scheduler's single-threaded planner path, and catalog::validate / selection::select run once at load. The selection.rs change removes a BTreeSet filter predicate cost (next_power_of_two() per graph) in favour of a precomputed min — marginally cheaper, no new allocation. No head-of-line blocking, no new unbounded buffering, no extra copies. The only memory effect is the one in §1.1 (snapshot retention starts happening on cores that previously retained nothing) and it is bounded by the checkpoint allowance.
2.2 Failure-propagation blast radius — one new failure mode at load time
catalog.rs turns a previously-accepted manifest into a hard load error (§3.1). That failure is fail-fast at validate, before serving, so it cannot poison a live scheduler; the cost is an upgrade regression for third-party cores, not a runtime hazard.
2.3 Optimisation-reverses-invariant check
selection.rs:175-187 fixes exactly such an inversion: the old active.next_power_of_two() filter kept batch-8 speculative graphs under active=5 while the retention pass at selection.rs:282-289 dropped them. Verified in the diff:
- graph.kind == "speculative" && graph.batch_capacity <= active.next_power_of_two() as u64
+ graph.kind == "speculative" && graph.batch_capacity <= speculative_max_batch
with speculative_max_batch = min(batch_capacity) over speculative graphs with batch_capacity >= active, unwrap_or(active) — identical to retention's generation_kind computation. The two passes can no longer disagree. Correct.
3. Architecture, Contracts & Charter Compliance
3.1 Major — catalog.rs per-batch parity is a stronger load contract than before, and one input set is over-broad
helios/src/model/catalog.rs:146-170 (verified in diff) builds generation_batches from all Speculative graphs when speculation is prepared, while the Decode branch applies the full shape filter:
146 let generation_batches: std::collections::BTreeSet<usize> = manifest
147 .graphs
148 .iter()
149 .filter(|graph| {
150 if config.speculative_widths.is_empty() {
151 graph.kind == GraphKind::Decode
...
155 } else {
156 graph.kind == GraphKind::Speculative
157 }
158 })
...
169 let required_batches: std::collections::BTreeSet<usize> =
170 lifecycle_batches.union(&generation_batches).copied().collect();
and the loop at catalog.rs:171-191 then demands Init/Restore/Snapshot/Resume for every batch in the union. Consequences:
- Over-broad set: a
Speculativegraph that exists only at a batch nobody else declares (e.g. a wide speculative graph emitted at a batch the lifecycle graphs do not carry) drags that batch intorequired_batchesand makes the core fail to load with "prepared model lacks … graph for batch N". The stock Python catalog is safe —ignition/components/capacity.py:66-68batch_capacitiesdrivesspeculative_shapes,parallel_speculative_shapesandmixed_shapes, andpacked_speculative_shapesonly narrows within a batch — so no false rejection was found for first-party cores. - Stricter than the shipped contract: previously a manifest with, say, lifecycle graphs for batches 1/2/4 and
Decodeonly at batch 1 loaded and served. It now fails atvalidatewith a per-batch error. That is arguably the intended repair, but it is a load-time contract change on already-delivered artifacts with no migration note and no ABI bump (core ABI staysabi_version = 6,ignition/preparation/execution.py:311), declared in the PR body only as "restores catalog validation". - Untested branch: the only regression test cited,
helios/src/model/packed_round_tests.rs:68-108, is built fromcrate::model::testing::manifest, which emits every kind for batches[1,2,4](helios/src/model/testing.rs:49-59) — the self-consistent case. No test covers a batch declared only by a wideSpeculativegraph, which is the case that decides whether the union rule is right. - Asymmetry worth documenting: a batch declared only by
Mixed/Prefill/Visiongraphs is never required to carry lifecycle/decode graphs (catalog.rs:169-191), so parity is enforced over the lifecycle∪generation set only.
Fix: restrict generation_batches to width-one Speculative graphs (the same shape filter the Decode branch uses) so a wide speculative graph cannot enlarge the required set, and add one test with an extra Speculative-only batch asserting which way the validation should go. Note the ABI/contract implication in the PR body.
3.2 Minor — residual kind mismatch in selection.rs
selection.rs:175-181 filters kind == "speculative" unconditionally, while the retention pass at selection.rs:282-289 uses generation_kind = if enabled { "speculative" } else { "decode" }. With speculation disabled (enabled == false, e.g. mtp_draft_tokens: Some(0)) eligible_widths can be non-empty from speculative graphs that retention will drop. Harmless today because widths are emptied when !enabled (selection.rs:188-193, 206) and fixed is None, but it is a latent trap for anyone editing those guards. Fix: filter on the same generation_kind expression in both places.
3.3 Major — console-script rename is an undeclared public-contract break
pyproject.toml:14-15:
[project.scripts]
ignition-core = "ignition.__main__:main"
was ignition = "ignition.__main__:main". The project name and version are unchanged (name = "ignition", version = "0.1.0", pyproject.toml:6-7), so nothing signals the break, and there is no shim, no deprecation, no wrapper. Every in-repo doc still instructs the old name (no markdown file appears in the diff):
docs/cli-design.md:59(not opened) "then use.venv/bin/ignitionor.venv/bin/python -m ignition", plus:227,228,230,232,236,272,298,312,517,520,563,641,669docs/direct-execution.md:36 (not opened),38,48,50,66,68docs/model-preparation.md:297 (not opened),515,516,525docs/multi-host.md:347 (not opened),349,355docs/roce-ring.md:177 (not opened),180,187,190,193docs/signing.md:45 (not opened),80,103
Impact: in a core-only venv created exactly as docs/cli-design.md:58 (not opened) instructs (uv sync --locked --extra prepare --extra test), .venv/bin/ignition no longer exists, so all of those documented commands fail with "No such file or directory" (python -m ignition still works). Any wrapper, Dockerfile, systemd unit or CI step calling the core ignition entrypoint breaks silently at the same version number. The motivation (local-inference-lab/hyperflare-recipes#20, warm-cache uv sync clobber) is legitimate and the separation is the right call per AGENTS.md (not opened) (no plugin discovery in core) — the problem is that the doc and install contract was not carried along.
Fix: update the ~35 doc lines in this PR (or follow up immediately), and prefer shipping a transitional ignition shim that errors with "use ignition-core / python -m ignition" rather than a bare disappearance; bump the version so downstreams can pin around it.
3.4 Minor — charter pinning tension in the new workflow
.github/workflows/python-cpu.yml:29 (not opened):
run: uv sync --extra prepare --extra test
No --locked, while docs/cli-design.md:58 (not opened) documents uv sync --locked; there is no uv.lock at head and flashinfer-python is pinned to branch = "main". Charter: "Be explicit and pin everything … pin dependencies to exact versions or commits (#215)". Every future PR now resolves a moving git dependency in the required CPU check. Fix: uv sync --locked with a committed lockfile, or pin flashinfer to a commit.
4. Tests & Claim Accuracy
- Deleted coverage cannot be verified here (Minor).
tests/components/test_draft_block_broadcast_cuda.py(−22) andtests/components/test_vocabulary_commit_cuda.py(−244) are deleted, not repaired; the modules they import (tests.components.draft_block_broadcast_support,vocabulary_commit_support,causal_prefix_oracle,test_generation_logprobs_cuda) do not exist at head, so they were uncollectable and deletion is defensible — but the −266 of −304 diff lines are coverage whose replacement lives inlocal-inference-lab/hyperflare-recipes, outside this repository's verification. The PR body says so only implicitly. - Evidence is measured against a pre-final-rebase base (Minor). "Rebased on
f7256584" and "prior to the final docs/Selene rebase (identical code diff)" are the cited bases, not head3343f13; the failing CI check on head is not explained anywhere in the description. Given the merge landed with zero reviews, that is the only remaining guard on the merged tree. - CI blackout is only partly lifted (Minor).
native-serving.ymlgains--recipe minimax_m3(needed byfrontend::jinja::tests::PREPARED_TEMPLATES) but stays disabled (re-enabling workflow ID 390820901 is deferred by the description), so the newpython-cpu.ymlis pytest-only and cannot catch Rust regressions like those from #555/#505. The title's "restore … CI" overstates what runs after merge. - The
selection.rsregression test is sound (positive).selection.rs:1899-1945useshost_wide_round_core, setsmax_active = 8, adds batches 6 and 8 with lifecycle and width-one speculative graphs so the per-batch checks atselection.rs:317-354stay satisfied, places width 8 only on batch 8, and asserts"no captured speculative width fits"formax_concurrency: Some(5)— it genuinely exercises the covering-batch path and fails on the oldnext_power_of_two()code. - Test doubles are consistent with the code they stub (positive).
tests/preparation/test_capture_roce_wait.pyandtest_transient_retention.py:119addcapture_allocation_sizes = ()(plusretire_after_capture,group=None, anall_gather_objectmonkeypatch) matchingcapture.py's reads;tests/preparation/test_core_protection.py:452-453now expects'unknown core publisher'(helios/src/runtime_core/protection.rs:995(not opened)) and:733expects'safetensors data length differs from model core'(archive.rs:134(not opened)). No stale assertion found.
Open questions / could not be found
- What failed in CI on head
3343f13? Not addressed in the description; the stated limitations cover only a stale local.venvbinary and an unrelatedBrokenPipe(#490). - Does the deleted CUDA coverage (draft-block broadcast, vocabulary commit) exist in
local-inference-lab/hyperflare-recipes? Not verifiable from this repository. - Was the over-broad
generation_batches(allSpeculativegraphs, no shape filter) intended, or an artifact of copying theDecodebranch? No test or comment states the intent. - Did anyone intend to update the ~35
.venv/bin/ignitiondoc references in a follow-up? No issue or PR was found. - Is
fresh_duration's smallest-declared-batch quote meant to be a conservative bound for all snapshot batches, or a stand-in for the planned batch? Neither the code nor the test comment says; the two readings differ exactly in the under-quote of §1.2. - Whether #540 (open, adjacent scheduler cost/timing work) assumes the old
batch: 1semantics could not be determined from the available material.