Skip to content

fix(helios): align proposal_confidence manifest messages with submission-row layout - #688

Open
jcartu wants to merge 1 commit into
NVIDIA:mainfrom
jcartu:fix/confidence-manifest-messages
Open

jcartu wants to merge 1 commit into
NVIDIA:mainfrom
jcartu:fix/confidence-manifest-messages

Conversation

@jcartu

@jcartu jcartu commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #440

Why

ExecutionManifest::validate (helios/src/execution/manifest.rs) validates proposal_confidence and graph confidence_width against shape [2, request_capacity(), draft_capacity], where request_capacity() is Execution.max_active.next_power_of_two() and draft_capacity is in draft depth 1..=completion_token_capacity - 1. Transport readback (helios/src/execution/transport.rs), runtime completion (helios/src/server/runtime.rs), and direct-execution producers index proposal_confidence by submission row (0..batch_capacity, padded to request_capacity()), not by physical request slot. The two validation error messages in manifest.rs misstated this contract as "indexed by request slot" and [2, request_slots, draft_capacity], and the Helios and top-level design docs also named the row extent request_slots or omitted the submission-row layout.

What changed

  • helios/src/execution/manifest.rs:
    • Before: buffer validation returned "proposal confidence requires two float32 frames indexed by request slot and draft prefix", and graph confidence validation returned "confidence output requires [2, request_slots, draft_capacity] float32 frames".
    • After: buffer validation returns "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", and graph confidence validation returns "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".
  • helios/manifest.md, helios/model-contract.md, helios/README.md, docs/core-design.md, docs/runtime-core-design.md, and docs/scheduling-runtime-design.md: aligned all six specifications on [2, request_capacity, draft_capacity] contiguous FP32/float32 storage 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 (with helios/manifest.md using its locally defined token capacity T).
  • helios/src/execution/tests.rs: added proposal_confidence_validation_describes_submission_row_layout covering max_active = 3 (request_capacity() == 4), valid [2, 4, 5] manifests, rejected buffer shapes/dtypes ([2, 3, 5], [1, 4, 5], [2, 4, 16], Int32), and rejected graph confidence configurations (confidence_width exceeding buffer extent, mismatching draft_tokens, and non-speculative graphs), asserting both updated error messages and checking that neither "request slot" nor "request_slots" appears in either error.

No accepted shapes, wire formats, or core compatibility rules changed.

Expected result

Manifest diagnostics and repository specifications accurately describe the [2, request_capacity, draft_capacity] submission-row layout enforced for proposal_confidence while preserving full compatibility with existing prepared cores.

Evidence and limitations

Ran cargo test --locked --release on Linux with prepared chat templates (FLARE_TEST_TEMPLATE_DIR) and a 512 MiB locked-memory limit across helios, flare, and flare-cli:

  • helios (--features runtime-core,server): 1879 passed (1817 unit tests + 62 integration tests), 0 failed, 84 ignored. Specifically verified execution::tests::proposal_confidence_validation_describes_submission_row_layout, execution::tests::eight_token_completions_accept_shorter_proposal_confidence, and model::tests::confidence_output_requires_two_frames_and_covers_declared_prefixes.
  • flare: 254 passed, 0 failed, 4 ignored.
  • flare-cli: 245 passed, 0 failed, 3 ignored.
  • Limitations: tests requiring CUDA hardware, model checkpoint snapshots, or exported cores were skipped (ignored); no GPU execution was run because validation predicates and runtime execution paths did not change.

Discord: jcartu

@flare-autobot

Copy link
Copy Markdown
Collaborator

A case file has been opened for 688.
Case File Intake Report

Future reviews will auto-run 90 minutes after code updates are pushed.

  • Re-review sooner: Call @flare-autobot after push.
  • Opt-out: Include #autobot:ignore in the PR or any comment.

@flare-autobot flare-autobot added the triage:review Proposed change needs code review; this does not imply merge readiness. label Dec 2, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Changes Requested

This PR accurately aligns the two proposal_confidence validation error messages and the three helios/ docs with the actual submission-row runtime layout ([2, request_capacity, draft_capacity]), without touching any validation predicate, wire format, or prepared core compatibility. Two clarity/completeness gaps remain: three top-level docs/ specs still document the stale layout, and both rewritten error strings plus two updated docs use bare T without defining it.

  • Blockers: 0 · Should fix: 2 · Subtract/Simplify: 0 · Nits: 2
Walkthrough
  • helios/src/execution/manifest.rs:830, :871: Reworded the proposal_confidence buffer-layout error and graph confidence_width error to describe [2, request_capacity, draft_capacity] float32 submission-row frames sized to max_active.next_power_of_two() and draft depth 1..=T-1 instead of "indexed by request slot" / [2, request_slots, draft_capacity]. Predicates unchanged.
  • helios/manifest.md:164-169: Specified proposal_confidence as contiguous float32 [2, request_capacity, draft_capacity] indexed by completion frame, submission row (request_capacity = max_active.next_power_of_two()), and draft depth 1..=T−1.
  • helios/model-contract.md:227-233 and helios/README.md:301-304: Replaced [2, request_slots, draft_capacity] with [2, request_capacity, draft_capacity], max_active.next_power_of_two(), and draft depth 1..=T−1.
  • helios/src/execution/tests.rs:1334-1396: Added proposal_confidence_validation_describes_submission_row_layout covering max_active = 3 (request_capacity() == 4), valid [2, 4, 5] layout, four rejected buffer variants ([2, 3, 5], [1, 4, 5], [2, 4, 16], Int32), and three rejected graph confidence variants (width_exceeds, width_mismatch, non_speculative), asserting on the updated error text.
Merge Risk: Low · up to 7503941
  • Executable changes are strictly two Err(...) string literals on already-failing branches of ExecutionManifest::validate (helios/src/execution/manifest.rs:830, :871); both validation predicates (:827-829, :861-870) are byte-for-byte unchanged, so accepted shapes, ABI/wire layouts, and existing prepared cores are untouched.
  • Zero runtime/hot-path impact: validate() runs only at core load time, no downstream code parses the old error strings, and there are no concurrency, contention, allocation, or failure-propagation changes.
  • The added unit test (helios/src/execution/tests.rs:1334-1396) constructs an isolated in-memory ExecutionManifest via manifest(), exercises the real validate() path directly, and touches no global state.
Pre-merge checks: ✅ 3 passed · ⚠️ 1 warnings

Have your agent review the Full Review for complete verified findings, file:line citations, and suggested changes.

To opt out, include #autobot:ignore in your post or comment.

…ion-row layout

ExecutionManifest::validate in helios/src/execution/manifest.rs checks
proposal_confidence and graph confidence_width against shape
[2, request_capacity(), draft_capacity], where request_capacity() is
Execution.max_active.next_power_of_two() and draft_capacity is in
1..=completion_token_capacity - 1. Both transport decoding
(helios/src/execution/transport.rs) and runtime completion
(helios/src/server/runtime.rs) index proposal_confidence by submission row
(0..batch_capacity, padded to request_capacity()), not by physical request slot.
The two manifest validation error strings contradicted this layout by stating
"indexed by request slot" and naming the row extent "request_slots", and the
Helios and top-level design documents also referred to the row extent as
"request_slots" or omitted the submission-row layout.

Updated the two validation error strings in helios/src/execution/manifest.rs,
aligned the Helios and top-level design documentation, and added unit coverage
in helios/src/execution/tests.rs:
- Before: the buffer check returned "proposal confidence requires two float32
  frames indexed by request slot and draft prefix"; the graph confidence check
  returned "confidence output requires [2, request_slots, draft_capacity]
  float32 frames"; helios/manifest.md and docs/runtime-core-design.md omitted
  the submission-row shape; and helios/model-contract.md, helios/README.md,
  docs/core-design.md, docs/runtime-core-design.md, and
  docs/scheduling-runtime-design.md wrote "[2, request_slots, draft_capacity]".
- After: the buffer check states "[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"; the graph confidence
  check states "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"; and helios/manifest.md,
  helios/model-contract.md, helios/README.md, docs/core-design.md,
  docs/runtime-core-design.md, and docs/scheduling-runtime-design.md all
  document "[2, request_capacity, draft_capacity]" indexed by completion frame,
  submission row (sized to Execution.max_active.next_power_of_two()), and draft
  depth 1..=completion_token_capacity - 1 (with helios/manifest.md using the
  locally defined token capacity T).
- Added proposal_confidence_validation_describes_submission_row_layout in
  helios/src/execution/tests.rs exercising max_active = 3 (request_capacity = 4)
  across accepted and rejected buffer shapes, dtypes, and graph confidence
  configurations, verifying the updated layout wording and asserting that
  neither "request slot" nor "request_slots" appears in either error.
Accepted manifest shapes, buffer layouts, wire formats, and core compatibility
are unchanged.

Manifest validation diagnostics and repository specifications now accurately
describe the [2, request_capacity, draft_capacity] submission-row layout
enforced for proposal_confidence while preserving full compatibility with
existing prepared cores.

Ran cargo test --locked --release on Linux with prepared chat templates and a
512 MiB locked-memory limit across all affected crates:
- helios (--features runtime-core,server): 1879 passed (1817 unit tests
  including proposal_confidence_validation_describes_submission_row_layout,
  eight_token_completions_accept_shorter_proposal_confidence, and
  confidence_output_requires_two_frames_and_covers_declared_prefixes, plus 62
  integration tests), 0 failed, 84 GPU/snapshot/core-gated tests ignored.
- flare: 254 passed, 0 failed, 4 ignored.
- flare-cli: 245 passed, 0 failed, 3 ignored.
GPU, model-checkpoint snapshot, and exported-core tests were not run because
validation predicates and runtime execution paths are unchanged.

Signed-off-by: Joshua Cartu <jcartu@users.noreply.github.com>
Design-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=2e5b
@jcartu
jcartu force-pushed the fix/confidence-manifest-messages branch from 7503941 to 879dc01 Compare December 2, 2026 21:53
@jcartu

jcartu commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@flare-autobot Addressed every review item in 879dc017:

  • Stale top-level design docs: Updated docs/core-design.md, docs/runtime-core-design.md (both the Execution.completion_token_capacity paragraph and the confidence-output summary), and docs/scheduling-runtime-design.md from [2, request_slots, draft_capacity] to [2, request_capacity, draft_capacity] indexed by completion frame, submission row (request_capacity = Execution.max_active.next_power_of_two()), and draft depth 1..=completion_token_capacity - 1.
  • Undefined bare T: Replaced bare 1..=T-1 / 1..=T−1 with 1..=completion_token_capacity - 1 in helios/src/execution/manifest.rs, helios/model-contract.md, helios/README.md, and the assertions in helios/src/execution/tests.rs. (helios/manifest.md defines T earlier in the same paragraph.)
  • Nits: Qualified max_active as Execution.max_active in helios/model-contract.md, helios/README.md, and helios/manifest.md, and asserted both !error.contains("request slot") and !error.contains("request_slots") in both rejection loops of proposal_confidence_validation_describes_submission_row_layout.

Re-verified with cargo test --locked --release on Linux with prepared chat templates and a 512 MiB locked-memory limit:

  • helios (--features runtime-core,server): 1879 passed, 0 failed, 84 ignored
  • flare: 254 passed, 0 failed, 4 ignored
  • flare-cli: 245 passed, 0 failed, 3 ignored

@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Ready To Merge

All Round 1 review items are resolved at 879dc01: the two proposal_confidence error messages and all six specification files now accurately describe the [2, request_capacity, draft_capacity] submission-row layout without undefined T shorthand, leaving every validation predicate, wire format, and prepared-core compatibility rule untouched. No blockers or regressions remain; only minor optional polish items are noted in the Full Review.

  • Blockers: 0 · Should fix: 0 · Subtract/Simplify: 1 · Nits: 2
Walkthrough
  • helios/src/execution/manifest.rs:830, :871: Reworded the proposal_confidence buffer-validation and graph confidence_width error literals to describe [2, request_capacity, draft_capacity] float32 submission-row frames (max_active.next_power_of_two()) and draft depth 1..=completion_token_capacity - 1 instead of "indexed by request slot" / [2, request_slots, draft_capacity]. Predicates are unchanged, and the wording matches runtime readback (helios/src/execution/transport.rs:375-376, :1331-1348) and scheduler consumption (helios/src/server/runtime.rs:1813-1818).
  • docs/core-design.md:1227-1231, docs/runtime-core-design.md:697-701, :717-721, docs/scheduling-runtime-design.md:81-86: Updated all three top-level design specifications from [2, request_slots, draft_capacity] to [2, request_capacity, draft_capacity] indexed by completion frame, submission row (request_capacity = Execution.max_active.next_power_of_two()), and draft depth 1..=completion_token_capacity - 1. Repo-wide search confirms zero remaining stale [2, request_slots, draft_capacity] references.
  • helios/manifest.md:164-169, helios/model-contract.md:227-233, helios/README.md:301-304: Aligned all three Helios docs on the same [2, request_capacity, draft_capacity] submission-row contract and Execution.max_active.next_power_of_two() sizing (helios/manifest.md:168 uses its locally defined T from :160-161, while the other two use 1..=completion_token_capacity - 1).
  • helios/src/execution/tests.rs:1335-1398: Added proposal_confidence_validation_describes_submission_row_layout covering max_active = 3 (request_capacity() == 4), valid [2, 4, 5] layout, four rejected buffer variants ([2, 3, 5], [1, 4, 5], [2, 4, 16], Int32), and three rejected graph confidence variants (width_exceeds, width_mismatch, non_speculative), asserting the updated wording and verifying neither "request slot" nor "request_slots" appears in either error loop.
Merge Risk: Low · up to 879dc01
  • Executable changes are limited strictly to two static Err(...) string literals on already-failing branches of ExecutionManifest::validate (helios/src/execution/manifest.rs:830, :871). Comparing main against head confirms both validation predicates (:826-832, :861-873) are byte-for-byte unchanged, so accepted shapes, ABI/wire layouts, and existing prepared cores are completely unaffected.
  • Zero hot-path, concurrency, contention, allocation, or failure-propagation impact: validate() runs only at core load time, and a repo-wide search confirms nothing parses the old "proposal confidence requires" or "confidence output requires" strings.
  • The added test (helios/src/execution/tests.rs:1335-1398) constructs an isolated local ExecutionManifest via manifest(), calls the real validate() implementation directly without mocks or global state, and requires no GPU.
Pre-merge checks: ✅ 3 passed · ⚠️ 1 warnings
  • ✅ Security / malicious screen: Diff touches only two static error literals, six markdown docs, and one pure manifest unit test; no unsafe code, injection, or hidden instructions.
  • ✅ Charter & value fit: Directly resolves reproducible diagnostics/docs issue Proposal-confidence checks name request slots but accept only one row count #440 (confirmed wording-only by area owner yatesdr) with minimal footprint, full prepared-core compatibility, and a complete four-part PR description.
  • ✅ Related / duplicate / conflict check: Fixes Proposal-confidence checks name request slots but accept only one row count #440 with no competing PR; touched lines are localized and disjoint from concurrent scheduler/runtime PRs.
  • ⚠️ Tests & verification evidence: All predicates, doc updates, and test assertions verify against 879dc01 and the author transparently states GPU/core-export limitations, but no CI status check or raw cargo test log is attached on 879dc01 to independently corroborate the reported 1879 / 254 / 245 pass counts.

Have your agent review the Full Review for complete verified findings, file:line citations, and suggested changes.

To opt out, include #autobot:ignore in your post or comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage:review Proposed change needs code review; this does not imply merge readiness.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal-confidence checks name request slots but accept only one row count

2 participants