Key findings
The direction of PR #505 is sanctioned and the wire surface is minimal: ModelContract.core_parameters, ValueSource::CORE_PARAMETER = 43 and ValueBinding.parameter are the smallest protobuf change that offers recipe-declared FP32 inputs, and Luke Alonso's comment on #404 ("implement this not as a hardcoded steering_scale parameter, but as a generic system by which model cores can expose scalar arguments") is the maintainer request the charter requires for a new captured-graph op contract. The recipe-facing helpers in ignition/preparation/contract.py (core_parameter, binding(parameter=), model_contract(core_parameters=)) are also irreducible.
What is not minimal is the validation and the number of copies of the same resolved value. The change implements the same contracts four times (Rust load-time, Rust export-time, Python ignition/preparation, Python ignition/direct) and keeps two clones of the resolved parameter map plus a runtime guard comparing them. Both are removable without losing anything: the value is produced once at the HTTP boundary and never mutated afterwards, and ignition/direct serves the same already-validated prepared model that helios validates on load.
- Change size: 32 files, +2393/−261. About +1,530 of that is Rust and Python product code, +760 tests, +45 docs.
- Could remove: about 150–330 lines, in 6 places. The largest single saving is
ignition/direct/scheduler.py:121-185(~90 product lines plus ~110 lines of tests that only exercise the duplicated rejections). - Nothing was found that the change makes dead:
PrefixHistory::newdelegating towith_core_parameters(hash.rs:37-39) is what preserves the old root hash for declaration-free cores;AdmissionPlan.core_parameterssurvivingrefresh_admission_plan(scheduler.rs:1584-1590) is required by retry/preemption;Inputs::core_parameterspre-allocation (packing.rs:286-307, 544-545) is the claimed zero-steady-state-allocation behaviour. - No recipe in this repository binds a core parameter and the GPU path was never run on this head (PR description, "Unrun checks / limitations"), so all of the duplicated validation is currently exercised only by tests.
Verdict: make it smaller first.
Findings, ranked by lines saved
1. Should fix — ignition/direct re-implements the whole core-parameter contract validation in Python (~90 lines, plus ~110 test lines)
ignition/direct/scheduler.py:121-185 (Layout.__post_init__) validates, for every loaded run:
- distinct nonempty names (:131-134)
- finite default via
_wire_fp32(:136-139) - range key set
{"min","max"}, finite bounds,min <= default <= max(:140-152) CORE_PARAMETERbindings only on text forward graphs, every text forward graph binding every declared parameter, at least one text forward graph (:155-184)- indexing ∈
{SUBMISSION_ROW, REQUEST_ROW, ACTIVE_ROW}, zerovalue_offset, zeropadding, emptytensor(:171-174) - FP32 dtype, row count ≥ capacity, row contiguity of the destination buffer (:175-178)
Every one of those rules already exists in helios/src/model/contract.rs:473-482 and :665-728 and runs when the core is loaded (serving_contract → PreparedContract::validate, contract.rs:551) and when it is exported (heliopause/src/export/binding.rs, runtime_core::validate_core_parameters). ignition/direct consumes the same prepared model object (ignition/preparation/model.py:24-36 (not opened) copies the already-validated contract into server_config), and ignition/preparation/graphs.py:125-181 (_validate_resources) already asserts buffer contiguity for every registered buffer.
What the direct path genuinely needs is only the packing case at ignition/direct/packing.py:84 and the request-side resolution at scheduler.py:227-249. What goes with the block:
Layout.buffer_contiguityfield and its materialization inLayout.of(scheduler.py:117-118,:213-216)_row_contiguous(scheduler.py:68-74) and_core_parameter_rows(scheduler.py:77-81), which have no other caller- the dense private bookkeeping at
:155-160,:163,:180-184
Tests that go with it: tests/direct/test_scheduler.py — the _core_parameter_layout rejection knobs (:726-800 region) and the layout-invalidation cases around :840-847, :910-940.
Lines saved: ~90 product + ~110 test. Loss: none for a core that helios accepts; the direct path is documented as diagnostic-only (docs/direct-execution.md banner: "not production serving").
Caveat to state plainly: if maintainers want the Python path independently defensible against a core produced by another exporter, this stays. That is the only argument for keeping it, and it is not currently written down anywhere in the PR.
2. Should fix — two copies of the same resolved map, plus a guard comparing them (~36-55 lines)
Admission.core_parameters (helios/src/model/admission.rs:62) is a second clone of exactly the map LiveRequest.core_parameters holds:
admission.rs:118—core_parameters: prompt.core_parameters.clone()helios/src/scheduler.rs:1578—core_parameters: core_parameters.clone(), thenscheduler.rs:1827stores the plan's copy onLiveRequest(accessor at:272-273)- both descend from
incoming.prompt.core_parameters(server/runtime.rs:1459,:1477,:2758,:2809)
What goes:
Admission.core_parametersandconfig.contract.validate_core_parameters(&self.core_parameters)?(admission.rs:62,:74-76). The value was resolved and range-checked byPreparedContract::resolve_core_parametersat the HTTP boundary (server/request.rs:333-335) before thePromptexisted, and is checked again inplan_admission_with_core_parameters(scheduler.rs:1548-1552). Same for thevalidate_promptcopy atadmission.rs:137-139.PreparedContract::validate_core_parameters(contract.rs:534-536), a one-line wrapper overvalidate_resolved_core_parameterswhose only callers are those two lines.- The bit-equality cross-check at
helios/src/model/packing.rs:588-597(planned+to_bits() != to_bits()+"packed core parameter differs from its prefix-history value"). It compares two clones of an immutable map. - The 15 one-line
core_parameters: Default::default(),fixture fills added acrosshelios/src/model/tests.rs(:544, :689, :1005, :1163, :1377, :1592, :1811, :2050, :2152, :2415),model/packed_round_tests.rs:124,server/runtime.rs(:3030, :3286, :3621),server/runtime/phase_tests.rs:215,server/runtime/prompt_tests.rs:53.
Smaller version at packing.rs:582-587:
if binding.source == ValueSource::CoreParameter {
let value = live
.core_parameters()
.get(&binding.parameter)
.copied()
.ok_or("core-parameter admission is incomplete")?;
Nothing is lost: the map is immutable after admission and the prefix hash already used the same bits (scheduler.rs:1560-1566).
3. Should fix — is_text_forward_graph duplicates GraphKind::samples() (~14 lines, +12 in tests)
helios/src/model/contract.rs:424-435 adds a private helper matching Prefill | TerminalPrefill | ScoredPrefill | Resume | Decode | Speculative | Mixed. helios/src/execution/manifest.rs:89-100 already has GraphKind::samples() with exactly that set, and it is already the shared vocabulary for "this graph runs a forward" (manifest.rs:940, transport.rs:1537 (not opened), :1552, server/runtime.rs:2969, model/testing.rs:171).
Replace the two call sites (contract.rs:665, packing.rs:139-145) with descriptor.kind.samples() / graph.kind.samples() and delete the helper. Also drop the duplicated seven-kind matches! in the new test helpers helios/src/model/tests.rs:59-77 and server/runtime/phase_tests.rs:6637-6652 in favour of kind.samples(). Second list to keep in sync disappears.
4. Should fix — the same FP32 wire validator written four times, plus a -0.0 invariant nothing needs (~20-40 lines)
The identical number check appears as:
ignition/preparation/contract.py:12-28—_FP32_MAX+_wire_fp32(value, label)ignition/direct/scheduler.py:50-65—_FP32_MAX+_wire_fp32(value), same body modulo the label andnp.float32vsstructhelios/src/server/protocol/decode.rs:49-75—core_parameter_map, the same bool/type/finite/f32::MAX/underflow narrowinghelios/src/model/contract.rs:453-462—resolve_value, the finite check again
Smaller version: ignition/direct/scheduler.py imports _wire_fp32 from ignition.preparation.contract, and the Rust decode map narrows through one shared helper so resolve_value is the only place range clamping happens (it already is on the load path).
Separately, canonical_core_parameter (contract.rs:420-422, if value == 0. { 0. } else { value }) is threaded through five call sites — cache/hash.rs:49, server/models.rs:79-85, server/protocol/decode.rs:71, contract.rs:461, plus tests — plus the validate_value bit check (contract.rs:466) and the equivalent 0.0 if narrowed == 0.0 else narrowed lines in both Python copies (contract.py:27, scheduler.py:65, scheduler.py:248). All of it exists to make -0.0 and +0.0 hash differently as prefix roots, which they should not: the model computes identically for both, so the canonicalization only fragments the cache for a value nobody can distinguish. Dropping it removes the helper, its five call sites, the bit check, the /v1/models re-canonicalization, the -0.0 assertion in server/models.rs:369-374, and the Python null-coalescing lines. The PR's own "canonicalizes -0.0 to +0.0" claim is a self-imposed invariant, not a charter or API requirement.
5. Should fix — packing.rs re-validates what contract.rs already rejected at load (~12 lines)
helios/src/model/packing.rs duplicates at pack time checks that PreparedContract::validate already enforced on the same manifest (it runs first, packing.rs:67, and again via catalog.rs:31 → contract.rs:551):
packing.rs:139-145— theCoreParameter => is_text_forward_graph(..) && matches!(indexing, SubmissionRow|RequestRow|ActiveRow)arm.contract.rs:697-719already rejects any other kind or indexing; the existing fallback arm atpacking.rs:146states exactly the same indexing rule.packing.rs:236-239—CoreParameterin theFloat32dtype group.contract.rs:704already requires Float32 for core-parameter bindings.packing.rs:598-603— thedestination + 1 > input.elementsextent check.contract.rs:706already requiresbuffer.shape[0] >= manifest.request_capacity().
Smaller version: delete the arm at :139-145 (falls through to _ => matches!(indexing, SubmissionRow | RequestRow | ActiveRow)) and drop CoreParameter from the dtype group at :236-239, restoring SamplingParameters | ImageTensor | PageTable as it was. An unloadable core never reaches Inputs::new.
6. Nit — pass-through wrappers, six error strings for one condition, docs that repeat each other (~25 lines)
helios/src/runtime_core/mod.rs:46-48pub fn validate_core_parametersis a pass-through toprotobuf::validate_core_parameterswith one external caller (heliopause/src/export/binding.rs:1045); it exists only because theprotobufmodule is private (3 lines).contract.rs:508-512PreparedContract::core_parameter(name)is a 5-line linear search with two callers (:520,:703) that could each hold the same iterator inline (3 lines).packing.rsgains nine new error strings, six of them the same "checked arithmetic overflowed / out of range" condition with different text (:568,:576, three"packed values exceed prepared input storage"variants at:602,:608,:929-adjacent,"packed input byte offset overflow"). One message covers all (~6 lines).docs/api.md:749-765(17 lines) andhelios/model-contract.md:110-131restate the sameCORE_PARAMETERshape/indexing/default/clamping rules almost verbatim. The contract reference keeps the detail;api.mdneeds only the HTTP-facing sentence (~8 lines).
Explicitly checked and found justified (no subtraction)
PrefixHistory::newdelegating towith_core_parameterswith an empty iterator (cache/hash.rs:37-39,:41-65) keeps the exact old root hashflare-prefix-root-v1\0 || identityfor declaration-free cores — required by the charter's "existing data, artifacts, and exported cores still load" rule.AdmissionPlan.core_parameterssurvivingrefresh_admission_plan(scheduler.rs:1584-1590) — needed for the pool-lookup retry / preemption path to keep the same salted history.Inputs::core_parameterspre-allocation (packing.rs:286-307,:544-545,:929) — that is the stated zero-steady-state-allocation claim.plan_admissionremaining as a thin delegate toplan_admission_with_core_parameters(scheduler.rs:1526-1528) — preserves the existing API for the ~15 existing callers, costs two lines.- The protobuf additions and the
ModelContract.versionstaying at 3 — minimum wire surface, and the reason declaration-free cores re-export nothing.
Open questions
- Does any maintainer want
ignition/directto validate independently ofhelios(finding 1)? No such requirement is written in the PR, the charter,docs/direct-execution.md, orhelios/model-contract.md, which is why I read the block as duplicative — but it is the one finding whose answer could be "keep it." - The PR is already merged and no checks ran on the head commit, so these are follow-up-sized removals rather than review-blocking ones for this head.
What could not be checked
- Live GPU export/serving of a declaring core was never run (PR description), so I could not observe whether the packing-time dtype/indexing/extent checks in finding 5 can ever fire in practice — the load-time validator makes that unreachable for any core
heliosaccepts. - Line counts are from the diff and file reads at commit ef94d62; the regenerated
runtime_core_pb2.py(+231/−182ofignition/preparation) was not reviewed line by line since it is protoc output.