Correctness and contracts report · NVIDIA/hyperflare-inference #688

Raw Markdown for agents: https://autobot.eidonix.com/p/42bad2a5-9b21-4e8d-b4a0-28ca4912224d.md

Correctness, Contracts & System-Level Consequences — PR #688 @ 879dc01

Key findings

  1. The code change is behaviourally inert and correct. Only two Err(...) literals changed; the predicates around them are byte-identical, proven by the literals sitting at the same line numbers on main and at head (helios/src/execution/manifest.rs:830, :871). No accepted shape, wire format, ABI number, default, or core-compatibility rule moves. The PR-body claim "No accepted shapes, wire formats, or core compatibility rules changed" is accurate.
  2. No system-level consequence. The touched path allocates nothing new and runs once at manifest validation; there is no lock, queue, buffer, retention, cache, or I/O change, and no rate/latency/admission metric's sampling scope changed, so the metric-span check does not apply. No platform surface (Unix/Windows) is touched.
  3. Docs are now fully aligned — seven prose sites use [2, request_capacity, draft_capacity] + Execution.max_active.next_power_of_two(); a repo-wide search for request_slots, draft_capacity returns zero matches, so the base case file's "biggest finding" stays retracted and #542's all-specs bar is met.
  4. Finding 1 (Minor, substantive): the PR leaves two adjacent diagnostics using opposite index vocabulary with no explanation — manifest.rs:823 "per request slot" vs the new :830/:871 "submission row" — recreating, eleven lines apart, exactly the apparent contradiction #440 was filed for.
  5. Finding 2 (Minor): both new strings template 1..=completion_token_capacity - 1, which renders the impossible range "1..=0" for the explicitly supported T = 1 configuration, where the correct action is to omit the buffer.
  6. Finding 3 (Minor): manifest.rs:830 prints max_active unqualified while all seven prose sites say Execution.max_active — the reviewer's qualification nit was not carried through in the one place an operator reads first.
  7. Finding 4 (Minor, editorial): docs/core-design.md:1228-1229 now reads "completion frames indexed by completion frame" — the new wording was grafted onto the old sentence.
  8. Finding 5 (Minor, process): the 1879 / 254 / 245 test totals are self-reported, identical across two heads, with no CI status and no attached log.
  9. Test gaps: the new test is well targeted (each of four buffer cases trips a distinct predicate, both negatives asserted in both loops) but never pins the valid depth boundary [2,4,15] nor the T = 1 omission path, i.e. the degenerate case in Finding 2 is untested.

Area 1 — Correctness, Safety & Platform Parity: sound

1.1 Verified: the predicates were not touched (line-number proof)

The changed file is +2/−2. On main, helios/src/execution/manifest.rs:830 is "proposal confidence requires two float32 frames indexed by request slot and draft prefix" and :871 is "confidence output requires [2, request_slots, draft_capacity] float32 frames"; at head the same lines carry the new text. Identical numbering proves the surrounding logic is unchanged:

// helios/src/execution/manifest.rs:826-832 (head)
        if let Some(buffer) = self.buffers.iter().find(|buffer| buffer.name == "proposal_confidence") {
            if buffer.dtype != Dtype::Float32 || buffer.shape.len() != 3
                || buffer.shape[0] != 2 || buffer.shape[1] != self.request_capacity()
                || !(1..self.completion_token_capacity).contains(&buffer.shape[2]) {
                return Err("proposal confidence requires [2, request_capacity, draft_capacity] float32 frames indexed by submission row (sized to max_active.next_power_of_two()) and draft depth 1..=completion_token_capacity - 1".into());
            }
        }
// helios/src/execution/manifest.rs:861-873 (head)
            if graph.confidence_width > 0 {
                let confidence = self.buffer("proposal_confidence")?;
                if graph.kind != GraphKind::Speculative
                    || graph.confidence_width != graph.draft_tokens
                    || confidence.dtype != Dtype::Float32
                    || confidence.shape.len() != 3
                    || confidence.shape[0] != 2
                    || confidence.shape[1] != self.request_capacity()
                    || confidence.shape[2] < graph.confidence_width
                    || confidence.shape[2] > self.completion_token_capacity - 1 {
                    return Err("confidence output requires a speculative graph whose confidence_width equals draft_tokens and [2, request_capacity, draft_capacity] float32 submission-row frames covering confidence_width within draft depth 1..=completion_token_capacity - 1".into());
                }

request_capacity() is still max_active.next_power_of_two() (manifest.rs:583-585), ABI_VERSION is still 6 and COMPLETION_METADATA_FIELDS still 16 (manifest.rs:11-12). No stale state, reset, race, panic path, or error-handling gap is introduced: the only allocation on the path is the pre-existing Err(... .into()), produced once at load.

1.2 Verified: the row-indexed claim in the new text is factually correct

The new wording asserts submission-row indexing; that matches every consumer I opened:

So the diagnostics now describe the layout the runtime actually enforces. No correctness finding.

1.3 No metric / rate / admission-pricing span change

Nothing in this PR samples time or scope. The metric check asked for by the task (whether a measured span shrank, rank-0 vs all shards, buffered vs O_DIRECT) is not applicable: the diff is two string literals plus Markdown, and docs/scheduling-runtime-design.md:86-89 ("Rank zero's confidence drives host decisions; peer estimates must be valid probabilities but need not agree bitwise") is untouched prose, not a measurement change.


Area 2 — Unintended System-Level Consequences: none


Area 3 — Architecture, Contracts & Charter Compliance: compliant

Finding 1 below is the only contract-adjacent issue, and it is a documentation-vocabulary gap, not a rule change.

Finding 1 — Minor (substantive): adjacent diagnostics use opposite index vocabulary, unexplained

helios/src/execution/manifest.rs:820-825 (unchanged by this PR, seven lines above the changed :830):

        if let Some(buffer) = self.buffers.iter().find(|buffer| buffer.name == "completion_speculative_survival") {
            if buffer.dtype != Dtype::Float32
                || buffer.shape != [2, self.request_capacity(), self.completion_token_capacity - 1] {
                return Err("completion_speculative_survival requires two float32 frames of completion_token_capacity minus one prefixes per request slot".into());
            }
        }

Both statements are true — survival really is physical-slot indexed (helios/manifest.md:347-349: "a contiguous float32[2,capacity,T-1] output indexed by completion frame, physical request slot, and draft-prefix depth"; transport.rs:377 "Verification prefix survival by physical slot").

Impact: after this PR a core author who trips both checks in one session reads "per request slot" at :823 and "by submission row" at :830, with nothing in docs/ or the PR body saying these are different buffers with different index bases. docs/runtime-core-design.md:696-697 says only "Optional survival storage uses one fewer position" — no docs/ page names the slot-vs-row distinction, so a reader of docs/ alone cannot resolve the apparent contradiction and will assume one diagnostic is stale. That is the exact defect class of #440.

Fix: leave the predicate untouched; change :823 to "per physical request slot", and add one clause to helios/model-contract.md:227-233 stating that survival storage is indexed by physical request slot while proposal_confidence is indexed by submission row.

// helios/src/execution/manifest.rs:829-830 (head)
                || !(1..self.completion_token_capacity).contains(&buffer.shape[2]) {
                return Err("proposal confidence requires [2, request_capacity, draft_capacity] float32 frames indexed by submission row (sized to max_active.next_power_of_two()) and draft depth 1..=completion_token_capacity - 1".into());

Same templating in the graph arm at manifest.rs:870-871 ("… within draft depth 1..=completion_token_capacity - 1").

helios/manifest.md:169 and docs/runtime-core-design.md:702 both state "Cores with T=1 omit these zero-depth outputs", so completion_token_capacity == 1 is an explicitly supported configuration. With T = 1 the predicate (1..1) is empty, so any proposal_confidence buffer is rejected and the operator is told the requirement is "1..=0" — an empty range that is not actionable, at precisely the boundary where the layout degenerates. The one correct action (omit the buffer) is never stated.

Fix: special-case the empty range instead of templating completion_token_capacity - 1, e.g. when self.completion_token_capacity == 1 return "cores with completion_token_capacity = 1 must omit proposal_confidence", mirrored in the graph arm.

Finding 3 — Minor: the reviewer's max_active qualification was not carried into the literal

helios/src/execution/manifest.rs:830 reads "(sized to max_active.next_power_of_two())" while all seven prose sites write Execution.max_active: docs/core-design.md:1230, docs/runtime-core-design.md:700 and :720, docs/scheduling-runtime-design.md:84, helios/README.md:303, helios/manifest.md:167, helios/model-contract.md:230. Defensible inside the impl (self.max_active is in scope), but the reader of this message is whoever authors the JSON core and only has the field name Execution.max_active. Fix: one-word edit.

Finding 4 — Minor (editorial): docs/core-design.md:1228-1229 reads "completion frames indexed by completion frame"

// docs/core-design.md:1227-1231 (head)
submitted lane limits. Confidence producers declare `confidence_width` and write
FP32 `[2, request_capacity, draft_capacity]` completion frames indexed by
completion frame, submission row (sized to
`request_capacity = Execution.max_active.next_power_of_two()`), and draft depth
`1..=completion_token_capacity - 1`.

The new "indexed by completion frame, submission row, …" clause was grafted onto a sentence that already said "completion frames", producing a doubled phrase. Harmless, but it is the one site that reads as machine-patched. Fix: "write FP32 [2, request_capacity, draft_capacity] storage indexed by completion frame, submission row (…), and draft depth …".

Charter fit


Area 4 — Tests & Claim Accuracy

The new test is sound and well targeted

helios/src/execution/tests.rs:1334-1398:

    let mut value = manifest();
    value.max_active = 3;
    assert_eq!(value.request_capacity(), 4);

(tests.rs:1336-1338) — max_active = 3 genuinely exercises the power-of-two rounding, so a slot-capacity regression cannot hide behind an already-power-of-two max_active.

Each of the four buffer cases trips a distinct predicate and reaches the buffer arm at manifest.rs:826-830 before graph validation at :861:

Case (tests.rs:1354-1359) Predicate hit
[2, 3, 5] shape[1] != request_capacity() == 4
[1, 4, 5] shape[0] != 2
[2, 4, 16] depth 16 excluded from 1..16 (manifest() sets T = 16)
Int32 dtype

The three graph cases (tests.rs:1374-1397: width_exceeds, width_mismatch, non_speculative) each hit the graph arm, and both negatives are asserted in both loops (tests.rs:1370-1371 and :1395-1396), closing the asymmetric-assertion nit:

        assert!(!error.contains("request slot"), "{error}");
        assert!(!error.contains("request_slots"), "{error}");

The PR body's description of the test is accurate.

Test gaps (Minor)

Finding 5 — Minor (process, not code): the test evidence is self-reported

PR body: "helios (--features runtime-core,server): 1879 passed (1817 unit tests + 62 integration tests), 0 failed, 84 ignored… flare: 254 passed… flare-cli: 245 passed". The identical totals were claimed for the previous head 7503941; there is no CI status on either head, no attached log, and I found no in-repo artifact backing the run. A diagnostics/docs change cannot plausibly move these numbers, so the risk is low — but the claim is unverifiable and is the review bot's single pre-merge warning. Fix: attach the raw cargo test output or land the CI check.


Open questions / could not be found