#1 [high] Simplicity #1: duplicated covering-batch fold in selection.rs
helios/src/runtime_core/selection.rs — the PR adds a fold at :175-181 and leaves an identical fold at :283-289.
Added (selection.rs:175-181): let speculative_max_batch = execution .graphs .iter() .filter(|g| g.kind == "speculative" && g.batch_capacity >= active as u64) .map(|g| g.batch_capacity) .min() .unwrap_or(active as u64);
Pre-existing (selection.rs:282-289): let generation_kind = if enabled { "speculative" } else { "decode" }; let max_batch = execution .graphs .iter() .filter(|g| g.kind == generation_kind && g.batch_capacity >= active as u64) .map(|g| g.batch_capacity) .min() .unwrap_or(active as u64);
Note: when speculation is enabled, generation_kind == "speculative", so max_batch at :283 is speculative_max_batch recomputed per rank. The two copies disagreeing is exactly what the PR's own description calls out as the original defect (eligible_widths used active.next_power_of_two() while the retention pass used max_batch). Suggestion: one file-level helper, e.g. fn covering_batch(graphs: &[ServingGraph], kind: &str, active: u64) -> u64, called at :175 and at :283. Scopes differ (pre-loop uses cores.first(), :283 is per-rank), so the helper — not a hoisted value — is the safe collapse.
#2 [high] Simplicity #2: Request.deepcopy patches a self-inflicted MappingProxyType
ignition/direct/scheduler.py:449-459 (added by this PR): def deepcopy(self, memo): from copy import deepcopy
copied = object.__new__(type(self))
memo[id(self)] = copied
for key, value in self.__dict__.items():
if isinstance(value, MappingProxyType):
setattr(copied, key, MappingProxyType(deepcopy(dict(value), memo)))
else:
setattr(copied, key, deepcopy(value, memo))
return copied
Root cause is one line in the same file: ignition/direct/scheduler.py:556
request._core_parameters = MappingProxyType(layout.resolve_core_parameters(request.core_parameters))
resolve_core_parameters (scheduler.py:227-249) already returns a fresh dict per request, so the proxy adds no aliasing protection. Its only consumers are read-only: ignition/direct/packing.py:84 (request.core_parameters[binding["parameter"]]) and scheduler.py:253/897/909/923 (identity hashing). The single consumer of the immutability is a test assertion: tests/direct/test_scheduler.py:867-868 with pytest.raises(TypeError): req.core_parameters["alpha"] = 0.0.
Simplification: delete the MappingProxyType wrap at :556 (default deepcopy then works, __deepcopy__ never needed) and change that one test to assert the resolved value only. Net: 12 lines removed, one line simplified, no new copying semantics for the whole class. If immutability is genuinely wanted, the repo's established idiom is __reduce__ + _plain_mappings (ignition/declaration.py:77-84, :130-134) or the pickler hook at ignition/preparation/forward_metadata.py:221-222 — a hand-rolled per-attribute __deepcopy__ is the third pattern for the same problem.
Also style: the from copy import deepcopy inside the method is the only function-local stdlib import in a file whose imports are module-level (scheduler.py:32-45).
#4 [high] Research summary
Subtraction/Simplicity lens done. Diff is mostly additive and warranted (the three Helios fixes each carry a named regression test; the workflow change is +1 line; the CUDA-test deletions remove code). Three high-value simplifications found, all recorded on the scratchpad.
-
helios/src/runtime_core/selection.rs:175-181adds a fold that is a verbatim copy of the pre-existing fold at:283-289(generation_kind == "speculative"when speculation is enabled, somax_batchisspeculative_max_batch). Two copies disagreeing is precisely the defect this PR fixes, so the fix should collapse them into onecovering_batch(graphs, kind, active)helper rather than add a third instance of the pattern. -
ignition/direct/scheduler.py:449-459's 12-lineRequest.__deepcopy__exists only becauseScheduler.validatewraps_core_parametersinMappingProxyTypeat:556, over a dict thatresolve_core_parameters(:227-249) already returns fresh. All readers are read-only (packing.py:84(not opened), identity hashing); the only consumer of the write protection is one test assertion (tests/direct/test_scheduler.py:867-868). Deleting the wrap removes the__deepcopy__entirely — and removes a third, hand-rolled answer to a problem the repo already solves with__reduce__/_plain_mappings(ignition/declaration.py:77-84,130-134). -
helios/src/model/catalog.rs:212-224hand-rolls a width-one speculative existence check thatcatalog::select(:250-271) already implements; the surrounding lifecycle/Decode loop at:171-191usesselectfor exactly this shape. Collapses to one line with only an error-message delta; the wider-width branch at:225-236must stay becauseselectcannot express "anytoken_capacity > 1".
Minor: tests/components/causal_prefix_oracle.py (not opened) still exists at head while two of the three other modules the deleted test_vocabulary_commit_cuda.py imported do not — worth confirming the oracle is not now dead test-support code (I could not confirm remaining references before running out of turns). No convention violations of substance: no per-model branches, no new flags or knobs, no speculative generality; the uv sync-without---locked concern is a policy/pinning matter already covered elsewhere, not a simplicity one.
#6 [high] Simplicity verdict: otherwise lean, plus reviewer framing
Overall verdict for the Subtraction/Simplicity lens: the diff is largely lean and idiomatic. Three concrete simplifications (scratchpad entries 1-3) plus one cleanup question (entry 4). Nothing rises to "must block"; all four are follow-up-scale, and the PR is already merged with zero reviews, so they are best filed as a cleanup issue rather than phrased as review blockers.
Explicitly considered and judged NOT worth flagging (so the report can say so plainly):
helios/src/scheduler/cost.rs:264-269—let batch = self.batches(kind).first().copied()?;is the minimal correct fix;batchesis sorted+deduped at cost.rs:179-186. Nothing to simplify..github/workflows/native-serving.yml:31— one added--recipe minimax_m3; the apt-dependency block at :36 is a verbatim duplicate of python-cpu.yml:24, but deduplicating two CI files is not worth an action..github/workflows/python-cpu.yml(+33) — no speculative generality, no unused knobs; it mirrors native-serving.yml's job shape. (Itsuv syncwithout--lockedis a pinning/policy concern, not simplicity.)- The lifecycle_batches/generation_batches BTreeSet construction at catalog.rs:130-170 looks verbose but every predicate is load-bearing: union-of-kinds + per-batch parity is the entire point of the fix.
- The three updated tests (test_capture_roce_wait.py:27-28,40, test_transient_retention.py:119, test_core_protection.py:452-453,733) add only the stubs/strings the code under test requires — no cleanup opportunity.
- No
AGENTS.mdstructural violations found: no per-model branches, no new flags, no new abstractions; the change is metadata-driven as the charter requires.
Caveat to state: the code these notes critique is at PR head 3343f13, merged 2026-11-29; line numbers are from the PR diff/head files. Suggestions 1 and 3 are in Rust files whose exact post-merge line numbers may have shifted under #613, which touched helios/src/scheduler/checkpoints.rs only (disjoint from catalog.rs/selection.rs).
#3 [medium] Simplicity #3: catalog.rs hand-rolls a check select already implements
helios/src/model/catalog.rs:212-238 (added): if !config.speculative_widths.is_empty() { let has_wider_width = config.speculative_widths.iter().any(|&width| width > 1); for &batch in &required_batches { if !manifest.graphs.iter().any(|graph| { graph.kind == GraphKind::Speculative && graph.batch_capacity == batch && graph.token_capacity == 1 }) { return Err(format!( "prepared model lacks width-one speculative graph for batch {batch}" ) .into()); } ...
select (same file, catalog.rs:250-271) already does exactly this shape match for Speculative:
let mut matching = manifest.graphs.iter().enumerate().filter(|(_, graph)|
graph.kind == kind && graph.batch_capacity == batch && graph.token_capacity == tokens
&& graph.prefill_capacity == prefill && graph.sampling_mode == mode);
So the 12-line .any() block collapses to:
select(config, manifest, GraphKind::Speculative, batch, 1, 0, SamplingMode::General)?;
(the lifecycle/Decode calls 22 lines above at catalog.rs:171-191 use exactly this form). The only change is the message: "prepared model lacks speculative graph for batch {batch}, width 1" (catalog.rs:263) instead of "…width-one speculative graph for batch {batch}"; the old string appears nowhere else in the tree (grep: only catalog.rs:144/234/263/330). The wider-width branch (:225-236) must stay — select cannot express "any token_capacity > 1".
Secondary: the loop re-walks manifest.graphs per batch for the width-one test and again for the wider test; with select the first walk disappears. Also let has_wider_width is invariant and correctly hoisted — keep.
Considered and NOT worth flagging: the lifecycle_batches/generation_batches BTreeSet construction (catalog.rs:130-170) looks verbose but each filter condition is load-bearing (union-of-kinds vs per-batch parity is the whole point of the fix); cost.rs:265 self.batches(kind).first().copied()? and the +1-line workflow changes in native-serving.yml:31 are already minimal; the deleted CUDA tests reduce code rather than add it.
#5 [medium] Simplicity #4: orphaned test-support module after CUDA test deletion
The deleted tests/components/test_vocabulary_commit_cuda.py (244 lines) imported three support modules:
from tests.components.causal_prefix_oracle import allocate
from tests.components.test_generation_logprobs_cuda import _assert_entry
from tests.components.vocabulary_commit_support import ToyCommittedModel
At head (list_files tests/components/*, PR head), tests/components/causal_prefix_oracle.py is STILL PRESENT, while vocabulary_commit_support.py, draft_block_broadcast_support.py and test_generation_logprobs_cuda.py are all absent. So one of the two reasons the file was uncollectable (missing siblings) is gone from the tree while the third module was left behind.
Action for the report: ask whether tests/components/causal_prefix_oracle.py still has any importer; if the removed test_vocabulary_commit_cuda.py was its only consumer it is now dead test-support code that this PR should have removed with the tests (subtraction left behind). Could not confirm remaining references — ran out of turns before grepping causal_prefix_oracle repo-wide. State as an open question, not an assertion.