Recommendation: Changes Requested
The core design, wire compatibility, HTTP decoding, prefix-cache salting, steady-state packing, and Kani/TLA+ verification are sound with 0 blockers, and match the generic contract mechanism requested in #404. Two verified issues should be addressed before relying on the path: eliminate the latent unsalted-admission trap on RequestScheduler (by holding declared core parameters on the scheduler instead of hand-threading them), and record the unrun GPU export/serving qualification in docs/TODO.txt with matching qualification scope in user-facing docs per AGENTS.md.
Blockers
None.
Should Fix
-
Hold declared
core_parametersonRequestSchedulerso parameterlessadmit/plan_admissioncannot silently build unsalted plans on declaring cores- Evidence:
RequestScheduler::admitandRequestScheduler::plan_admission(helios/src/scheduler.rs:1519-1528) delegate toplan_admission_with_core_parameters(spec, &[], &Default::default()). Becausevalidate_resolved_core_parameters(&[], &Default::default())(helios/src/model/contract.rs:484-498) returnsOk(()), calling either public method on a scheduler built for a declaring core succeeds with an unsaltedPrefixHistoryand an emptycore_parametersmap (helios/src/scheduler.rs:1566-1579). The defect only surfaces later at pack time as"core-parameter admission plan is incomplete"(helios/src/model/packing.rs:588-592), contradicting Design Review Principle 2 (docs/design-review.md:38-39: admission rejects unsupported inputs explicitly). - Scope & extra plumbing: All production server paths currently call
plan_admission_with_core_parameters(helios/src/server/runtime.rs:2755, 2781, 2806), whileadmit/plan_admissionare called in test suites — so this is a latent API trap rather than a live serving bug. Because the scheduler does not hold the declarations,helios/src/server/runtime.rsalso hand-threadscore_parameter_defs: &[crate::model::contract::CoreParameter]throughbegin_pool_lookup,admit_with_checkpoint_accounting, andadmit_with_host_store(helios/src/server/runtime.rs:2741, 2777, 2796, 2858-2887), anddocs/prefix-cache-offload.md:717-720still describesplan_admission(&spec)/admit(spec)as the worker's two-step interface. - Fix: Carry
pub core_parameters: Vec<crate::model::contract::CoreParameter>onSchedulerCapabilities(helios/src/scheduler.rs:96-110, populated bymodel::scheduler_capabilitiesathelios/src/model.rs:308-341, defaulting to empty for tests) and validate againstself.core_parametersinsideRequestScheduler. Thenplan_admission(&spec)/admit(spec)automatically reject declaring cores at admission time (or collapse into a singleplan_admission(&spec, &CoreParameters)), and the threecore_parameter_defsparameters inhelios/src/server/runtime.rscan be deleted. Updatedocs/prefix-cache-offload.md:717-720if the worker entry point signature changes.
- Evidence:
-
Record the unrun GPU qualification in
docs/TODO.txtand state qualification scope in user-facing docs- Evidence:
AGENTS.md:55-58requires: "State support as present qualification: what is implemented, the hardware and configurations on which it is qualified, and what is not qualified. Record unresolved defects, unrun checks, and pending measurements indocs/TODO.txt, not in design documents." The PR description honestly discloses that no in-repo recipe declares a core parameter and that live GPU export and serving of a declaring core were not run on this commit (and backward-compatibility evidence is limited to a wire decode unit test ofb"\x08\x03"inhelios/src/runtime_core/protobuf.rs:963-966, rather than loading and serving a previously exported core perdocs/design-review.md:123). However,docs/TODO.txthas no entry for core-parameter GPU qualification, anddocs/api.md:749-765anddocs/direct-execution.md:84-88, 154-159present the capability without noting its qualification status. - Fix: Add an entry in
docs/TODO.txttracking live GPU export and serving of a declaring core (including mixed-parameter batches) plus load/serve verification of a pre-existing core, and add a brief qualification sentence indocs/api.md(anddocs/direct-execution.md) stating that the runtime path is CPU/formally verified while GPU export and serving with a declaring recipe remain pending qualification. Keep unrun-check tracking out ofhelios/model-contract.mdperAGENTS.md:57-58.
- Evidence:
Subtract / Simplify
- Deduplicate
_wire_fp32/_FP32_MAXin Pythonignition/direct/scheduler.py:50-65re-implements the exact FP32 narrowing/validation helper already defined inignition/preparation/contract.py:12-27(usingnp.float32instead ofstruct.packand dropping thelabelparameter). Becauseignition/direct/scheduler.py:43already imports fromignition.preparation, export one shared helper fromignition/preparation/contract.pyand delete the duplicate_FP32_MAXand_wire_fp32inignition/direct/scheduler.py.
Nits
- Clarify clamping vs. rejection phrasing in
helios/model-contract.md:128-132: Writing "clamps finite FP32 request values to declared inclusive ranges ... and rejects unknown names or out-of-range numeric encodings" puts "out-of-range" right next to "declared inclusive ranges", which is easily misread as rejecting values outside[min, max]. Reword to "rejects unknown names and values outside the finite FP32 range (non-finite numbers, magnitude abovef32::MAX, or nonzero values underflowing to FP32 zero)" to matchdocs/api.md:754-759. is_text_forward_graphduplicatesGraphKind::samples():helios/src/model/contract.rs:424-435matches the exact same 7GraphKindvariants asGraphKind::samples()(helios/src/execution/manifest.rs:89-100) and has only 2 call sites (contract.rs:665,packing.rs:140). Either callkind.samples()directly or placeGraphKind::is_text_forward()besidesamples()if the two concepts may diverge. (The two ~25-line test setup helpers inhelios/src/model/tests.rs:59-84andhelios/src/server/runtime/phase_tests.rs:6629-6661could also share one builder inhelios/src/model/testing.rs(not opened).)- Dead parameter on
Scheduler._cache_key:tokens=Noneinignition/direct/scheduler.py:881-885is never passed by either caller (:608,:891). - Overloaded
validate_core_parametersnaming:helios_core::runtime_core::validate_core_parameters(helios/src/runtime_core/mod.rs:46-48) validates wire declarations, whilePreparedContract::validate_core_parameters(helios/src/model/contract.rs:534-536) validates resolved request values (andcontract.rs:473usesvalidate_core_parameter_declarations). Renaming the wire entry point tovalidate_core_parameter_declarationsavoids ambiguity.
Verified passes
- Prefix-cache identity and backward compatibility (
helios/src/cache/hash.rs:36-65,helios/src/scheduler.rs:1560-1567):PrefixHistory::newdelegates towith_core_parameterswith an empty iterator, keeping the exactflare-prefix-root-v1\0 || identityroot digest for cores without declarations. Declaring cores hash each declared parameter in declaration order with length-prefixed name and canonical little-endian FP32 bits (-0.0canonicalized to+0.0). - Wire format compatibility (
helios/proto/runtime_core.proto:265-284,helios/src/model/contract.rs:110-111,helios/src/runtime_core/protobuf.rs:82-88, 963-966):ModelContract.versionstays3, new fields are additive with#[serde(default)], and existing cores decode with emptycore_parameters. - HTTP decoding across all four protocols (
helios/src/server/protocol/decode.rs:49-75, 614-615): Single shared decode path rejecting non-objects, empty/unknown names, booleans, non-numbers, non-finite numbers,|x| > f32::MAX, and nonzero underflow to FP32 zero, with-0.0 -> +0.0canonicalization. - Steady-state packing and bit-equality guard (
helios/src/model/packing.rs:286-309, 533-618, 927-969):Inputs::core_parametershas capacity0when noSubmissionRowcore-parameter binding exists (zero overhead for non-declaring cores) and pre-allocatesrequest_capacity()otherwise for zero steady-state allocation;pack_stepverifiesvalue.to_bits() == planned.to_bits()against the scheduler'sLiveRequestbefore uploading and guards offsets/extents with checked arithmetic. - Formal verification (
helios/src/model/contract/kani_proofs.rs:85-142): Two Kani harnesses verify finite ordered declaration validation and canonical range-clamped resolution over arbitraryf32values. - Charter & architecture fit (
docs/design-review.md:16-61): GenericModelContractdata with zero per-model branches, capability flags, or new graph kinds.
Dropped on verification
- Candidate SF2 (
is_text_forward_graphvsGraphKind::samples()) — demoted to Nit: exact 7-variant overlap (contract.rs:424-435vsmanifest.rs:89-100) with only 2 production call sites is a minor cleanup, not a bug or contract defect. - Candidate SF3 (
CoreParameterRangevsSamplingFloatRange, "four divergent bounded-float implementations") — dropped: false comparison between load-time default validation (helios/src/model.rs:197, which rejects defaults outside bounds just likeCoreParameter::validateatcontract.rs:445) and request-time clamping (contract.rs:458-460, which matches sampling clamping indocs/api.md:737-740); keepingCoreParameterRangedistinct fromSamplingFloatRangeinruntime_core.proto:281vs:561preserves intentional decoupling from sampling. - Candidate SF4 (
_wire_fp32overflow-warning risk) — demoted to Subtract / Simplify:abs(wide) > _FP32_MAXatignition/direct/scheduler.py:60already guardsnp.float32(wide)at:62from overflowing, leaving only clean Python deduplication. - Candidate SF5 (Heliopause export validates declarations but not bindings) — dropped: the PR description explicitly distinguishes export-time declaration validation from load-time binding validation, and
heliopause/src/export/binding.rs:932invokesserving_metadata(&mut Default::default(), server)pre-capture (before any manifest buffers exist) and never validatesGraphContract.inputsfor any of the 42 existingValueSourcevariants. - Candidate SF7 (
helios/model-contract.md:128-132"out-of-range numeric encodings") — demoted to Nit: technically refers to FP32 encoding range (matchingdecode.rs:67anddocs/api.md:754-759), just ambiguously phrased next to declared inclusive ranges. - Candidate SUB1 (Delete
ignition/direct/scheduler.pycore-parameter validation + tests) — dropped: the "already validated at load/export" premise is false because--directprepares in-process from the checkpoint with no core (docs/direct-execution.md:23-24) and never runs Helios or Heliopause export;Layout.__post_init__(scheduler.py:121-185) is the only contract guard on that path (deadtokens=Nonearg on_cache_keykept as Nit). - Candidate SUB2 (Delete pack-time validation in
packing.rs:139-146, 236-239, 540) — dropped: removingCoreParameterfrom:236-239without altering:240-245would break dtype validation, and:540bounds-checks allSubmissionRowbindings againstframe.configpassed topack_step;:139-145is a 6-line defense-in-depth arm. - Candidate SUB3 (Remove
Inputs::core_parametersstaging vector inpacking.rs) — dropped: unlikeSamplingParameters(which skipsSubmissionRowinactive-row padding atpacking.rs:546, 930),CoreParameterSubmissionRowbindings must zero-pad inactive rows in one contiguous upload without steady-state allocation, and sizing frommaximumwould waste megabytes on non-declaring cores. - Candidate SUB4 (
/v1/modelsemits"range": null) — dropped:protobuf.rs:87strips top-level nulls only for internalServingContractdeserialization;/v1/modelsalready serializes absentOption<SamplingRange<_>>bounds asnullunderflare.sampling_ranges(models.rs:122,model.rs:179-187,docs/api.md:44), and native (models.rs:86) and direct (direct/server.py:137) match. - Candidate N1 (
packing.rs:167&contract.rs:495error messages) — dropped:packing.rs:162-168is unreachable forCoreParameterbecausecontract.rs:714already rejects nonzerovalue_offsetduringconfig.contract.validate(manifest)atpacking.rs:67, and"requires an integer value source"is accurate for float sources;contract.rs:495is an internal post-resolution check.