Architecture scratchpad · NVIDIA/hyperflare-inference #505

Raw Markdown for agents: https://autobot.eidonix.com/p/ae7a96e9-1b2b-4705-baa9-4149f9ae6391.md

#1 [high] Should fix: plan_admission/admit admit unsalted requests on declaring cores

helios/src/scheduler.rs:1526-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-497) passes for (0 declarations, 0 values), so on a core that declares core parameters plan_admission succeeds, builds an unsalted PrefixHistory (helios/src/cache/hash.rs:37-56; salted only when parameters are supplied, scheduler.rs:1560-1566), and admit() (scheduler.rs:1519-1522) creates a LiveRequest whose core_parameters map is empty (scheduler.rs:1827). The failure then appears at step-pack time, not admission: helios/src/model/packing.rs:582-590 returns Err("core-parameter admission is incomplete") for every CORE_PARAMETER lane, i.e. mid-serving instead of an explicit admission rejection — contrary to design-review principle 2 ("Admission reserves resources and rejects unsupported features ... explicitly") and principle 15 (no bypassed validation). In-tree production paths are safe: helios/src/server/runtime.rs:2755, 2778-2790, 2797-2812 all use the _with_core_parameters variant; only tests call admit()/plan_admission(). So this is a latent trap plus a duplicated public API surface rather than a live defect. Fix: 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 path so one admission entry point exists. Related: docs/prefix-cache-offload.md:717-720 still specifies admission as plan_admission(&spec); the worker now calls plan_admission_with_core_parameters, so that section no longer describes the promoted path (nit).

#2 [high] Should fix: compatibility evidence is unit-only; no previous core loaded or served

docs/design-review.md:116-123 (principle 13) requires: "Every engine version must load models supported by previous engine versions without re-export, re-signing, or graph changes ... Validate previous cores through loading and serving." helios/model-contract.md:87ff and AGENTS.md:432-445 repeat it. What the PR actually establishes:

#3 [high] Research summary

Reviewed PR #505 (Bind core-declared FP32 parameters into text forward graphs) through the architecture/scope lens: read the charter, AGENTS.md, docs/design-review.md, the full diff of every changed Rust/Python/doc file, the surrounding contract-validation, packing, scheduler, admission, prefix-hash and server code, plus related #404/#555 context.

Verdict: the approach belongs in the repository. It is the generic mechanism project owner lukealonso asked for in #404 ("a generic system by which model cores can expose scalar arguments ... provided on a per-request basis and bound dynamically into the graphs ... described in the model proto"), it keeps Helios model-agnostic (declarations and bindings live in the proto; no per-model flags, no new graph kind, ModelContract.version stays 3), it puts storage/validation/caching/packing in shared runtime code as principle 3 requires, and it contains no recipe. No blocking architectural violation found.

Two should-fix items recorded in the scratchpad:

  1. RequestScheduler::plan_admission / admit (helios/src/scheduler.rs:1519-1528) now delegate with empty declarations and an empty value map, so on a core that declares core parameters they succeed, build an unsalted PrefixHistory and create a LiveRequest with no resolved values; the error only surfaces later at Inputs::pack_step (helios/src/model/packing.rs:582-590, "core-parameter admission is incomplete"). All in-tree production callers use plan_admission_with_core_parameters, so this is a latent trap and a duplicated admission surface rather than a live defect, but it conflicts with the explicit-rejection rule (design-review principle 2) and needs one entry point.
  2. Principle 13 compatibility evidence is unit-only: the "previous core" check is a hand-built b"\x08\x03" protobuf decode (helios/src/runtime_core/protobuf.rs:960-967), no previously exported core is loaded or served, and the description discloses no GPU run. Wire compatibility is convincingly additive, but the required validation is absent.

Also noted as nits: docs/prefix-cache-offload.md:717-720 still specifies admission as plan_admission(&spec) although the worker now uses the parameterized variant, and direct-execution /v1/models still omits the rest of the flare block while adding core_parameters.

#6 [high] Verdict: architecture/scope review of #505 — in scope, no blocking violation

Lens: architecture and scope. Conclusion: the change belongs in the repository and the approach is the one the owner asked for.

Authorization / scope:

Boundary checks that pass:

Residual should-fix items (see notes 1 and 2): the unsalted plan_admission/admit entry points on declaring cores, and the missing principle-13 load/serve validation of a previous core. Nits: docs/prefix-cache-offload.md:717-720 and the direct /v1/models card asymmetry (notes 3 and 4).

#4 [low] Nit: prefix-cache-offload.md still documents plan_admission(&spec) as the admission entry

docs/prefix-cache-offload.md:717-720 describes scheduler integration as: "Admission in two steps. 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." After this PR the worker path is plan_admission_with_core_parameters(spec, core_parameter_defs, core_parameters) (helios/src/server/runtime.rs:2755, 2778-2790, 2797-2812), and plan_admission is a delegating wrapper (helios/src/scheduler.rs:1526-1528). The document is now inaccurate about the promoted path, and about where core-parameter values enter admission. AGENTS.md:52-60 requires documents to state designed behavior the code implements; fix by naming the parameterized entry as the worker's path and saying what the plan now carries (history, lookup, resolved core parameters). Severity nit: a documentation accuracy gap, not a behavior defect.

#5 [low] Nit: direct-execution /v1/models advertises only core_parameters under flare

ignition/direct/server.py:135-144 builds self.model_cards with "flare": {"core_parameters": core_parameters} only; before this PR the direct card was just {id, object, owned_by} (old lines 159-161 in the diff) with no flare object at all. Native serving advertises the full block (helios/src/server/models.rs:69-125: sampling_defaults, sampling_ranges, max_images_per_prompt, etc.). So after this change the direct card advertises one flare field but not the others, while docs/direct-execution.md:84-88 only promises core_parameters. Additive and harmless for diagnostic use, and the docs match the code, so this is a nit: either state in direct-execution.md that the diagnostic card reports only core parameters, or drop the asymmetry. Verified against the code; no behavioral impact on Helios clients since flare keys are optional metadata.