Final review report · NVIDIA/hyperflare-inference #505

Raw Markdown for agents: https://autobot.eidonix.com/p/3d4f8d9e-55dd-42d3-9f29-37770adbfcbb.md

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

  1. Hold declared core_parameters on RequestScheduler so parameterless admit / plan_admission cannot silently build unsalted plans on declaring cores

    • Evidence: RequestScheduler::admit and RequestScheduler::plan_admission (helios/src/scheduler.rs:1519-1528) delegate to plan_admission_with_core_parameters(spec, &[], &Default::default()). Because validate_resolved_core_parameters(&[], &Default::default()) (helios/src/model/contract.rs:484-498) returns Ok(()), calling either public method on a scheduler built for a declaring core succeeds with an unsalted PrefixHistory and an empty core_parameters map (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), while admit / plan_admission are 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.rs also hand-threads core_parameter_defs: &[crate::model::contract::CoreParameter] through begin_pool_lookup, admit_with_checkpoint_accounting, and admit_with_host_store (helios/src/server/runtime.rs:2741, 2777, 2796, 2858-2887), and docs/prefix-cache-offload.md:717-720 still describes plan_admission(&spec) / admit(spec) as the worker's two-step interface.
    • Fix: Carry pub core_parameters: Vec<crate::model::contract::CoreParameter> on SchedulerCapabilities (helios/src/scheduler.rs:96-110, populated by model::scheduler_capabilities at helios/src/model.rs:308-341, defaulting to empty for tests) and validate against self.core_parameters inside RequestScheduler. Then plan_admission(&spec) / admit(spec) automatically reject declaring cores at admission time (or collapse into a single plan_admission(&spec, &CoreParameters)), and the three core_parameter_defs parameters in helios/src/server/runtime.rs can be deleted. Update docs/prefix-cache-offload.md:717-720 if the worker entry point signature changes.
  2. Record the unrun GPU qualification in docs/TODO.txt and state qualification scope in user-facing docs

    • Evidence: AGENTS.md:55-58 requires: "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 in docs/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 of b"\x08\x03" in helios/src/runtime_core/protobuf.rs:963-966, rather than loading and serving a previously exported core per docs/design-review.md:123). However, docs/TODO.txt has no entry for core-parameter GPU qualification, and docs/api.md:749-765 and docs/direct-execution.md:84-88, 154-159 present the capability without noting its qualification status.
    • Fix: Add an entry in docs/TODO.txt tracking 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 in docs/api.md (and docs/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 of helios/model-contract.md per AGENTS.md:57-58.

Subtract / Simplify

  1. Deduplicate _wire_fp32 / _FP32_MAX in Python
    • ignition/direct/scheduler.py:50-65 re-implements the exact FP32 narrowing/validation helper already defined in ignition/preparation/contract.py:12-27 (using np.float32 instead of struct.pack and dropping the label parameter). Because ignition/direct/scheduler.py:43 already imports from ignition.preparation, export one shared helper from ignition/preparation/contract.py and delete the duplicate _FP32_MAX and _wire_fp32 in ignition/direct/scheduler.py.

Nits

  1. 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 above f32::MAX, or nonzero values underflowing to FP32 zero)" to match docs/api.md:754-759.
  2. is_text_forward_graph duplicates GraphKind::samples(): helios/src/model/contract.rs:424-435 matches the exact same 7 GraphKind variants as GraphKind::samples() (helios/src/execution/manifest.rs:89-100) and has only 2 call sites (contract.rs:665, packing.rs:140). Either call kind.samples() directly or place GraphKind::is_text_forward() beside samples() if the two concepts may diverge. (The two ~25-line test setup helpers in helios/src/model/tests.rs:59-84 and helios/src/server/runtime/phase_tests.rs:6629-6661 could also share one builder in helios/src/model/testing.rs (not opened).)
  3. Dead parameter on Scheduler._cache_key: tokens=None in ignition/direct/scheduler.py:881-885 is never passed by either caller (:608, :891).
  4. Overloaded validate_core_parameters naming: helios_core::runtime_core::validate_core_parameters (helios/src/runtime_core/mod.rs:46-48) validates wire declarations, while PreparedContract::validate_core_parameters (helios/src/model/contract.rs:534-536) validates resolved request values (and contract.rs:473 uses validate_core_parameter_declarations). Renaming the wire entry point to validate_core_parameter_declarations avoids ambiguity.

Verified passes

Dropped on verification