Subtraction, Simplicity & Conventions review — PR #688 (fix(helios): align proposal_confidence manifest messages with submission-row layout)
Key findings
- The diff contains no logic to delete. The only executable change is two
Err(...)string literals (helios/src/execution/manifest.rs:830,:871); both predicates are byte-for-byte unchanged (:827-829,:861-870). No flags, config knobs, wrappers, fallback branches, speculative generality or dead code were added. The accepted shape set, wire format and ABI are untouched. - Convention break (highest value): the two rewritten messages are the only layout diagnostics in
ExecutionManifest::validatethat do not print the offending dtype/shape viaformat!. The PR made them longer (229 and 262 characters) while making them less diagnostic — a reader cannot tell which of the eight predicate clauses failed. Every neighbouring layout error uses the expected/got form (manifest.rs:632-641,:643-652,:801-817). - Duplication: the same normative sentence (
[2, request_capacity, draft_capacity],request_capacity = max_active.next_power_of_two(), submission rows, draft depth1..=T−1) now appears in five places —manifest.rs:830,manifest.rs:871,helios/manifest.md:164-169,helios/model-contract.md:227-233,helios/README.md:301-304. Two identifiers (T,draft_capacity) are used without definition in two of those documents. - Test scaffolding: the new 64-line test (
tests.rs:1334-1396) rebuilds a manifest that already exists verbatim ineight_token_completions_accept_shorter_proposal_confidence(tests.rs:1311-1332) and re-derives graph-arm rejections already present attests.rs:1161-1168. Its unique value is roughly five lines of message assertions; the negative assertions are asymmetric and do not catch the regression they claim to guard. - Below the lens but required by repo convention: three non-Helios design docs still print the old contract (
docs/core-design.md:1228,docs/runtime-core-design.md:715,docs/scheduling-runtime-design.md:82), so the description's "aligned all three specifications" holds forhelios/*only. PR #542 was blocked in review for exactly this class of incomplete doc sweep.
Verdict: the code change is already lean — there is nothing to subtract from behaviour. What should be replaced is the added prose and the added test scaffolding, as detailed below.
1. Convention break: two layout errors depart from the module's expected/got diagnostic form, and the PR made them longer while less informative
Every other buffer-layout failure in the same function reports the expected layout and the actual dtype/shape:
helios/src/execution/manifest.rs:632-641
return Err(Error::execution(
ExecutionError::Manifest,
format!(
"completion_logprobs: expected Int32 shape {expected:?} with \
even last extent {}..={LOGPROB_FIELDS}; got {:?} shape {:?}",
LOGPROB_PAIR_FIELDS * 2,
output.dtype,
output.shape,
),
));
helios/src/execution/manifest.rs:643-652
if flags.dtype != Dtype::Int32 || flags.shape != [self.request_capacity()] {
return Err(Error::execution(
ExecutionError::Manifest,
format!(
"logprob_requested: expected Int32 shape {:?}; got {:?} shape {:?}",
[self.request_capacity()],
flags.dtype,
flags.shape,
),
));
}
and the required-buffer table at manifest.rs:801-817 uses format!("invalid required buffer layout: {name}").
The two literals this PR rewrote do neither:
helios/src/execution/manifest.rs:830
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..=T-1".into());
helios/src/execution/manifest.rs:871
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..=T-1".into());
Guarding predicates (unchanged by this PR): manifest.rs:827-829 — Float32, rank 3, shape[0] == 2, shape[1] == self.request_capacity(), (1..completion_token_capacity).contains(shape[2]); and manifest.rs:861-870 — kind == Speculative, confidence_width == draft_tokens, dtype/shape as above, shape[2] >= confidence_width, shape[2] <= T-1.
Concretely, replace both literals with the module's own expected/got form, which removes the prose restatement of the layout and the next_power_of_two() formula from the error path (that formula is already defined at manifest.rs:583-585 and stated in helios/manifest.md:211-213) while adding the diagnosis the message currently lacks:
// :830
return Err(format!(
"proposal_confidence: expected Float32 shape [2, {}, 1..{}]; got {:?} shape {:?}",
2, self.request_capacity(), self.completion_token_capacity - 1,
buffer.dtype, buffer.shape,
).into());
and the graph arm (:871) in the same form, prefixed with the graph name so the failing graph is identified (graph.name, iterated at manifest.rs:850), e.g. "{name} confidence output: expected ... got ...". This shortens both strings, removes the "submission row"/"submission-row" prose pair, and brings the diagnostics back under the convention that AGENTS.md:188-193 frames as "Reject unsupported abstractions and churn" (comment/prose expansion that does not carry behaviour) and AGENTS.md:122-128 ("Resolve references where they are needed") frames in the other direction — prose that introduces identifiers must resolve them.
Note the internal spelling inconsistency the PR introduces and does not explain: manifest.rs:830 says "submission row", manifest.rs:871 says "submission-row". The test asserts the hyphenated spelling for one arm and the spaced spelling for the other (tests.rs:1367, :1392), so the inconsistency is now locked in by test.
2. Duplication: the same contract sentence is now normative in five places, two of them undefined in context
The same statement of the layout now exists in:
helios/src/execution/manifest.rs:830(buffer arm, verbatim quoted above)helios/src/execution/manifest.rs:871(graph arm, verbatim quoted above)helios/manifest.md:164-169
survival outputs have T−1 positions. Proposal-confidence buffers
(`proposal_confidence`) are contiguous `float32` storage with shape
`[2, request_capacity, draft_capacity]`, indexed by completion frame, submission
row (sized to `request_capacity = max_active.next_power_of_two()`), and draft
depth `1..=T−1`, covering each graph’s confidence width. Cores
helios/model-contract.md:227-233
A program producing confidence declares `confidence_width`, equal to its actual
D. `proposal_confidence` is contiguous FP32 storage with shape
`[2, request_capacity, draft_capacity]`, where
`request_capacity = max_active.next_power_of_two()` and `draft_capacity` is in
draft depth `1..=T−1` covering every declared output width. Frame index selects
the completion frame, and submitted rows retain their lane order. There is no
unframed confidence layout.
helios/README.md:301-304
A produced confidence sidecar declares `confidence_width` and uses two FP32
frames shaped `[2, request_capacity, draft_capacity]` indexed by submission row
(sized to `max_active.next_power_of_two()`) and draft depth `1..=T−1`. Host
dependencies are derived
helios/manifest.md is the execution-manifest specification and already defines the quantity at helios/manifest.md:205-213 ("Request storage capacity is max_active.next_power_of_two(). … while SchedulerLimits.request_slots remains the captured transport capacity"). Concretely: keep the full normative statement in helios/manifest.md only; reduce model-contract.md:227-233 and README.md:301-304 to the shape plus a reference to the manifest specification, and reduce the two error strings to the expected/got form in finding 1. That removes three copies of the formula and is the version that survives the next contract change.
Two identifier defects the new text introduces (repo-prose skill .agents/skills/repo-prose/SKILL.md:20-25, "Explain concepts before identifiers … On first reference, give the object's semantic role"):
Tis undefined in two of the three docs. It is introduced only athelios/manifest.md:160-161("An omitted or zero value resolves to eight tokens; a positive value is the token capacity T"), yet used bare athelios/model-contract.md:231andhelios/README.md:303.draft_capacityis defined nowhere in the three docs, and it is not the name the code uses: the predicate is!(1..self.completion_token_capacity).contains(&buffer.shape[2])(manifest.rs:829), i.e. extents1..=T−1.helios/model-contract.md:230-231then names the same axis twice in one sentence —draft_capacity…1..=T−1.
3. Test scaffolding: the new 64-line test duplicates an existing fixture and its rejections; only the message assertions are new
New test: helios/src/execution/tests.rs:1334-1396 (proposal_confidence_validation_describes_submission_row_layout). Setup at tests.rs:1339-1351:
value.graphs[0].kind = GraphKind::Speculative;
value.graphs[0].token_capacity = 6;
value.graphs[0].draft_tokens = 5;
value.graphs[0].packed_token_capacity = 24;
value.graphs[0].confidence_width = 5;
value.buffers.push(BufferDescriptor {
name: "proposal_confidence".into(),
address: 0x20000,
nbytes: 2 * 4 * 5 * 4,
dtype: Dtype::Float32,
shape: vec![2, 4, 5],
strides: vec![20, 5, 1],
});
value.validate().unwrap();
The neighbouring test already builds the identical configuration — tests.rs:1319-1327:
value.graphs[0].kind = GraphKind::Speculative;
value.graphs[0].token_capacity = 6;
value.graphs[0].draft_tokens = 5;
value.graphs[0].packed_token_capacity = 24;
value.graphs[0].confidence_width = 5;
value.buffers.push(BufferDescriptor { name: "proposal_confidence".into(),
address: 0x20000, nbytes: 2 * 4 * 5 * 4, dtype: Dtype::Float32,
shape: vec![2, 4, 5], strides: vec![20, 5, 1] });
value.validate().unwrap();
and the graph-arm rejections the new test re-derives already exist at tests.rs:1161 (width_mismatch, confidence_width = 4) and tests.rs:1163-1168 (buffer too shallow), plus the buffer shape/dtype family at tests.rs:29-53 (optional_speculative_survival_validates_frame_layout).
The unique value is the message assertions only. Concretely: delete the [test] and the four-row (shape, strides, nbytes, dtype) table at tests.rs:1354-1371, and append the assertions to eight_token_completions_accept_shorter_proposal_confidence (tests.rs:1311-1332), which already has the valid manifest and already mutates confidence_width/draft_tokens/token_capacity at :1328-1330 — i.e. width_exceeds (tests.rs:1373-1376) is the same mutation already written there:
value.graphs[0].confidence_width = 6;
value.graphs[0].draft_tokens = 6;
value.graphs[0].token_capacity = 7;
assert!(value.validate().is_err());
The negative assertions are weaker than their length suggests and are asymmetric:
helios/src/execution/tests.rs:1370
assert!(!error.contains("request slot"), "{error}");
helios/src/execution/tests.rs:1394
assert!(!error.contains("request_slots"), "{error}");
"request slot" is not a substring of "request_slots" and vice versa, so the buffer loop cannot catch a regression that reintroduces the graph arm's old wording, and the graph loop cannot catch the buffer arm's old wording. Either use one uniform absence check, or drop the negative assertions and rely on the positive expected/got text from finding 1 (which no old spelling can produce). Note also the convention tension: AGENTS.md:194-199 asks that "Tests must exercise the affected behavior or contract" and warns that text checks cannot establish runtime correctness — asserting on a message prose string is the least durable form of this; asserting the expected shape fields in the message (finding 1's format! form) keeps the test tied to the geometry contract instead of to English.
4. Nothing to subtract from the logic — stated plainly
Confirmed against pr_diff and the head file:
- Predicates unchanged:
manifest.rs:827-829and:861-870. - No new branch, flag, environment read, config field, trait, helper or
pubitem. The diff is two.rsstring literals plus one test, and three.mdfiles (pr_files: +79/−8). request_capacity()is pre-existing (manifest.rs:583-585), not a new wrapper;helios/manifest.md:211-213already documented it before this PR.- No consumer parses the old message text, so removing/replacing the prose is free of downstream risk: the only occurrences of the old wording are the two literals and this PR's own negative assertions (grep for
proposal confidence requires,confidence output requires,request_slotsinhelios/src). Other tests that construct the buffer match onunwrap/is_err(helios/src/model/packed_round_tests.rs:207-211), not on message text. - The adjacent
completion_speculative_survivalbuffer is genuinely slot-indexed and its own error atmanifest.rs:823still says "per request slot" — correctly left alone. Worth noting only because a reader diffing the two adjacent messages (:823vs:830) now sees two index vocabularies with no explanation; if finding 1 is adopted, the asymmetry disappears naturally because both become expected-shape/got-shape.
5. Cross-file doc completion (repo convention, follow-up or blocker — needs a maintainer call)
The three Helios documents are now aligned, but the same contract is still printed with the old row extent outside helios/:
docs/core-design.md:1228— "FP32[2, request_slots, draft_capacity]completion frames."docs/runtime-core-design.md:715— "uses FP32[2, request_slots, draft_capacity]frames."docs/scheduling-runtime-design.md:82— "Its FP32 sidecar has shape[2, request_slots, draft_capacity], covering every"
request_slots is not a rename of request_capacity; it is a different quantity elsewhere (SchedulerLimits.request_slots = captured transport capacity, helios/manifest.md:211-213), so these three sites are substantively wrong, not merely stylistically stale. The closest precedent is PR #542, which was blocked in review ("the batch-capacity specification is false in eleven places") until the author corrected docs/ as well. The description's claim that the PR "aligned all three specifications" is true of helios/* only; it does not mention docs/. Either extend the diff by three lines or state the exclusion in the description.
Open questions / not found
- Whether the three
docs/sites above are in scope for this PR or a follow-up — no maintainer has spoken on #688; #542 is the only precedent and it went the "fix them here" way. - Whether the deliberate vocabulary split with
completion_speculative_survival(slot-indexed,manifest.rs:823) should get an explanatory sentence rather than be left implicit — nothing in #440 or the PR discusses that buffer. - The reported test totals (
helios1879 passed / 84 ignored,flare254,flare-cli245) and the run recipe (FLARE_TEST_TEMPLATE_DIR, 64 MiB locked memory) cannot be corroborated: there are no CI checks and no logs on head7503941. This does not affect the subtraction verdict, since no executable behaviour changed.