Architecture report · NVIDIA/hyperflare-inference #505

Raw Markdown for agents: https://autobot.eidonix.com/p/1a712554-df2c-411e-876e-298a5ea53f22.md

Architecture & scope review — PR #505 "Bind core-declared FP32 parameters into text forward graphs"

Key findings

Verdict: in scope, no blocking violation; two should-fix items and two nits.

The change belongs in this repository and implements the mechanism the project owner explicitly asked for in #404: a generic way for a model core to declare scalar parameters, supplied per request, bound into captured graphs, described in the model proto. It adds no per-model flags, no new graph kind, no recipe, keeps ModelContract.version == 3, and makes no performance claim. The two should-fix items are (1) a second, unsalted admission entry point that silently admits an incomplete request on a declaring core (the error surfaces mid-serving at pack time instead of at admission), and (2) principle-13 compatibility evidence that is unit-test-only, with no previously exported core loaded or served.

Authorization and scope

Should fix

1. plan_admission / admit silently admit an unsalted request on a core that declares core parameters

helios/src/scheduler.rs:1519-1528

plan_admission(spec) now delegates to plan_admission_with_core_parameters(spec, &[], &Default::default()). validate_resolved_core_parameters (helios/src/model/contract.rs:484-498) only compares counts, so an empty declaration list with an empty value map validates. On a core that does declare parameters, plan_admission therefore succeeds even though the decision should be rejected: it builds an unsalted PrefixHistory (salted only from the supplied iterator, helios/src/scheduler.rs:1560-1566; PrefixHistory::with_core_parameters at helios/src/cache/hash.rs:37-56) and admit() (:1519-1522) creates a LiveRequest whose resolved map is empty (:1827).

The failure then appears at pack time, mid-serving, at helios/src/model/packing.rs:582-597 (Err("core-parameter admission is incomplete") / "core-parameter admission plan is incomplete"). That contradicts principle 2's requirement that "Admission reserves resources and rejects unsupported features and capacities explicitly" (docs/design-review.md:36-39) and the "no bypassed validation" stance of the design review.

Mitigating context (why this is should-fix and not blocking): every in-tree production path uses the parameterized entry — helios/src/server/runtime.rs:2755, 2781, 2806 — and only tests call admit/plan_admission, so it is a latent trap plus duplicated public API surface rather than a live defect.

Fix: either make the parameterless entry points reject (or debug_assert!) when !self.contract.core_parameters.is_empty(), or thread the resolved parameters through admit/plan_admission and delete the unsalted variant so exactly one admission entry point exists.

2. Compatibility evidence for existing cores is unit-only; no previous core is loaded or served

docs/design-review.md:116-123 (principle 13)

Principle 13 requires: "Every engine version must load models supported by previous engine versions without re-export, re-signing, or graph changes … Protobuf additions must preserve existing behavior through compatible defaults … Validate previous cores through loading and serving." helios/model-contract.md and AGENTS.md:432-445 restate it.

What the PR actually establishes is a wire-level unit test: helios/src/runtime_core/protobuf.rs:963-966 decodes the hand-built bytes b"\x08\x03" (version 3, no core_parameters) and asserts validate_core_parameters passes. Nothing in the diff loads an existing exported core, and the description states: "Live GPU export and serving of a core declaring core_parameters were not run on this rebased commit." The same gap was raised by yatesdr on the predecessor change (#404: "Core compatibility is unproven. Principle 13 requires previous cores to be validated by loading and serving them; the PR loads none").

The additive-wire argument is genuinely convincing — version stays 3 (helios/src/runtime_core/protobuf.rs:79-84), core_parameters is proto field 8 with serde(default) (helios/src/model/contract.rs:110-111), ValueBinding.parameter is field 7 defaulting to "" — and the risk is low. But per docs/design-review.md:247-251 a disclosed limitation does not substitute for a runnable check. A CPU-only partial check is cheap and would close most of the gap: load a recorded existing core's ServingContract through serving_contract + PreparedContract::validate. Full closure (serving a previously exported core through flare run) needs a GPU/checkpoint. A test is what would settle it.

Nits

3. docs/prefix-cache-offload.md:717-720 still documents the pre-PR admission entry point

The section describes admission as "plan_admission(&spec) validates the request, builds its history, performs the GPU lookup, and returns an AdmissionPlan … admit(spec) is the composition with no inbound." The worker now calls plan_admission_with_core_parameters (helios/src/server/runtime.rs:2755, 2781, 2806), with plan_admission reduced to a delegating wrapper (helios/src/scheduler.rs:1526-1528). AGENTS.md:52-60 requires documents to describe the behavior the code implements. Fix by naming the parameterized entry point as the worker's path and stating that the plan now also carries resolved core parameters (helios/src/scheduler.rs:601-605).

4. Direct-execution /v1/models advertises only core_parameters under flare

ignition/direct/server.py:135-144 builds the card as "flare": {"core_parameters": core_parameters}; before this PR the direct card had no flare object at all, whereas native serving advertises the full block (helios/src/server/models.rs:69-125: sampling defaults, ranges, max images, …). docs/direct-execution.md:84-88 documents only core_parameters, so code and docs agree and this is additive metadata with no effect on Helios clients. Fix: state in docs/direct-execution.md that the diagnostic card reports only core parameters, or drop the asymmetry.

What I verified as sound (no finding)

Open questions / could not be settled from the code