Skip to content

Validate scheduler admission against the core parameter declarations - #621

Open
jcartu wants to merge 1 commit into
NVIDIA:mainfrom
jcartu:fix/scheduler-core-parameter-admission
Open

jcartu wants to merge 1 commit into
NVIDIA:mainfrom
jcartu:fix/scheduler-core-parameter-admission

Conversation

@jcartu

@jcartu jcartu commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

After #505, a caller of the parameterless Rust admission API could start a prefix lookup without the values declared by the core in the cache identity. The HTTP server already passed those declarations explicitly; no production cache mix-up was observed.

Change and effect

The scheduler takes its parameter declarations from the core when constructed. Callers provide the request's resolved values, not another list of declarations. On a declaring core, missing values now fail before prefix lookup or slot reservation; declaration-free cores keep their existing prefix keys. HTTP and protobuf formats are unchanged. Rust callers constructing scheduler capabilities or passing declaration slices must update.

Preparation and direct execution now share finite FP32 conversion, including canonicalization of negative zero and rejection of nonzero underflow. Tests distinguish parameterless rejection, a cache miss at a different scale, and a cache hit at the original scale. The docs distinguish native serving of an exported core from direct execution of a checkpoint.

Evidence

On c146d7be plus this patch, Linux x86-64:

  • Locked release suites: Helios 1,799, Heliopause 216, Flare 245, CLI 227 passed; respectively 83, 6, 4 and 3 ignored. Heliopause also compiled with the qualification feature.
  • 13/13 Kani harnesses passed, including core_parameter_validation_enforces_finite_ordered_bounds and core_parameter_resolution_produces_valid_canonical_value. Java 21 TLC and eight Rust lifecycle replay suites checked 593,697 observed transitions.
  • Affected Python direct-execution and preparation tests: 86 passed, 2 CUDA-only skips.
  • On the earlier base 44f59df5, substituting an empty declaration slice made generic_core_parameters_resolve_pack_and_enforce_text_forward_contracts fail at the parameterless-admission assertion. Restoring the declarations restored the pass.

No live GPU export, serving or checkpoint-backed direct execution is claimed. The remaining GPU qualification steps are recorded in docs/TODO.txt. AI-assisted change; no GPU kernels or execution optimizations were modified.

Discord: jcartu

@flare-autobot

Copy link
Copy Markdown
Collaborator

A case file has been opened for 621.
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 area:scheduling Request scheduling, fairness, batching, and speculative-width selection. bug Something isn't working triage:review Proposed change needs code review; this does not imply merge readiness. labels Nov 29, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Changes Requested

Sound, model-agnostic fix that closes the #505 unsalted-admission trap with net code deletion, but head cbb7a4f conflicts with main in helios/src/scheduler/policy_tests.rs and has no CI runs.

  • Blockers: 1 · Should fix: 0 · Subtract/Simplify: 2 · Nits: 3
Walkthrough
  • Scheduler-owned core-parameter declarations: Adds pub core_parameters: Vec<CoreParameter> to SchedulerCapabilities, validates declarations in RequestScheduler::new, populates it in scheduler_capabilities, drops the declaration-slice parameter from plan_admission_with_core_parameters, and removes threaded core_parameter_defs args across begin_pool_lookup, admit_with_checkpoint_accounting, admit_with_host_store and callers (runtime.rs, net +8/−36).
  • Validator naming & graph-kind consolidation: Renames runtime_core::validate_core_parameters → validate_core_parameter_declarations; deletes the duplicated is_text_forward_graph free function in contract.rs in favor of GraphKind::is_text_forward() (with samples() delegating).
  • Unified Python FP32 narrowing & dead-param cleanup: Promotes _wire_fp32 to wire_fp32(value, label="value"), deletes the duplicate _wire_fp32/_FP32_MAX in ignition/direct/scheduler.py and the unused tokens=None param on _cache_key, adds binary32 boundary/type-gate unit tests.
  • Negative admission tests & qualification docs: Tests duplicate-declaration rejection at scheduler construction, parameterless rejection without slot consumption; clarifies FP32 representability vs range clamping and records pending GPU qualification in docs/TODO.txt and user-facing docs.
Merge Risk: Low · up to cbb7a4f
  • Narrow hot-path footprint: plan_admission_with_core_parameters reads &self.capabilities.core_parameters instead of a caller-supplied slice — no per-admission allocation, lock, or I/O; rejection runs before self.free_slot()? and self.cache.lookup(&history)?, leaving slots, pages, snapshots, and cache state untouched.
  • Backward compatibility preserved: Declaration-free and legacy cores initialize core_parameters: vec![] and produce byte-identical prefix root hashes (PrefixHistory::with_core_parameters with an empty iterator matches PrefixHistory::new); no protobuf wire fields or ModelContract.version change.
  • In-tree Rust API break + stale base: A required public field on SchedulerCapabilities and the validate_core_parameters rename break struct-literal and validator callers — safe for external consumers only because the crates are unpublished, but already collides with prefill_catalog_engine added on main.
Pre-merge checks: ✅ 2 passed · ⚠️ 2 warnings
  • ✅ Security / malicious screen: Pure validation hardening and deduplication; no unsafe code, external I/O, dependency changes, or instruction-injection patterns.
  • ✅ Charter & value fit: Model-agnostic root-cause fix aligning with "keep the runtime small and model-agnostic" and "Support strict: true function tools (currently rejected with HTTP 400) #417 don't silently ignore fields"; GPU qualification gap is transparently tracked in docs/TODO.txt:10-16 (no in-repo recipe declares core parameters yet).
  • ⚠️ Related / duplicate / conflict check: Clean follow-up to Bind core-declared FP32 parameters into text forward graphs #505 with no duplicate PR, but conflicts with main in helios/src/scheduler/policy_tests.rs where cold_deepseek_16k_engine was refactored into prefill_catalog_engine (missing core_parameters).
  • ⚠️ Tests & verification evidence: Local test/Kani/lifecycle/mutation results are plausible and match repo gates (all 13 #[kani::proof] harnesses verified in tree; modified tests are isolated), but no GitHub Actions CI checks exist on head cbb7a4f and current main will not compile cleanly without rebase.

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.

@jcartu
jcartu force-pushed the fix/scheduler-core-parameter-admission branch from cbb7a4f to 55bab97 Compare November 29, 2026 23:19
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Ready To Merge

Rebasing onto c146d7be cleanly resolved the prior merge-conflict blocker, and every SchedulerCapabilities construction site is now updated. The change closes the #505 unsalted-admission gap at the right layer with net code deletion and no hot-path or lifecycle regression; confirm GitHub Actions CI passes on 55bab978 before merging.

  • Blockers: 0 · Should fix: 0 · Subtract/Simplify: 1 · Nits: 1
Walkthrough
  • Scheduler-owned core-parameter declarations: Adds pub core_parameters: Vec<CoreParameter> to SchedulerCapabilities (helios/src/scheduler.rs:109-110), validates declarations in RequestScheduler::new (:696), populates them from config.contract.core_parameters in scheduler_capabilities (helios/src/model.rs:336), and updates plan_admission / plan_admission_with_core_parameters (helios/src/scheduler.rs:1448-1491) so declaring cores reject parameterless admission before slot reservation or cache lookup.
  • Server runtime simplification: Drops the redundant core_parameter_defs slice parameter from begin_pool_lookup, admit_with_checkpoint_accounting, admit_with_host_store, and their call sites in helios/src/server/runtime.rs (+8/−36).
  • Graph-kind & wire-validator cleanup: Deletes the duplicated is_text_forward_graph free function from helios/src/model/contract.rs in favor of GraphKind::is_text_forward() (helios/src/execution/manifest.rs:89-104, with samples() delegating) and renames runtime_core::validate_core_parameters → validate_core_parameter_declarations across helios/src/runtime_core/{mod.rs,protobuf.rs} and heliopause/src/export/binding.rs:1051.
  • Shared Python FP32 narrowing & dead-parameter removal: Exports wire_fp32(value, label="value") from ignition/preparation/contract.py:15-28, deletes the duplicate _wire_fp32/_FP32_MAX implementation and unused tokens=None argument on _cache_key in ignition/direct/scheduler.py (+6/−21), and adds binary32 boundary/type-gate unit tests in tests/direct/test_scheduler.py:997-1025.
  • Tests & qualification documentation: Adds duplicate-declaration constructor rejection (helios/src/scheduler/tests.rs:2432-2449), parameterless rejection without slot consumption (helios/src/model/tests.rs:135-139), and distinct parameterless-rejection vs different-scale cache-miss vs matching-scale cache-hit checks (helios/src/server/runtime/phase_tests.rs:6843-6860); records pending GPU qualification in docs/TODO.txt:10-16 and updates docs/api.md:766-770, docs/direct-execution.md:86-89, docs/prefix-cache-offload.md:773-781, and helios/model-contract.md:128-134.
Merge Risk: Low · up to 55bab97
  • Minimal hot-path footprint, zero resource leaks on rejection: RequestScheduler::plan_admission_with_core_parameters (helios/src/scheduler.rs:1457-1505) borrows &self.capabilities.core_parameters instead of taking a caller slice—adding no lock, allocation, or I/O—and validates resolved values (:1473-1483) strictly before self.free_slot()? (:1484) and self.cache.lookup(&history)? (:1499). The core_parameters[parameter.name.as_str()] lookup at :1488 is total because RequestScheduler::new (:696) rejects duplicate declarations and validate_resolved_core_parameters (helios/src/model/contract.rs:471-485) enforces exact name-set and cardinality agreement.
  • Backward compatibility preserved: Declaration-free cores populate core_parameters: vec![] (helios/src/model.rs:336) and produce byte-identical prefix keys (PrefixHistory::new already delegates to PrefixHistory::with_core_parameters with an empty iterator at helios/src/cache/hash.rs:37-39, pinned by BLAKE2b-128 golden digests in helios/src/cache/tests.rs:96-125). No protobuf wire fields, HTTP schemas, or host-restore cost/timing spans (helios/src/server/runtime.rs:2721-2805) change.
  • Rust API surface changes contained in tree: Adding SchedulerCapabilities.core_parameters (helios/src/scheduler.rs:110), dropping the declaration slice from plan_admission_with_core_parameters (:1457-1461), and renaming helios_core::runtime_core::validate_core_parameters (helios/src/runtime_core/mod.rs:48) are breaking Rust API changes, but the crates are unpublished and all 20 in-tree SchedulerCapabilities literals and validator callers are updated cleanly.
Pre-merge checks: ✅ 4 passed · ⚠️ 1 warnings
  • ✅ Security / malicious screen: Pure validation hardening and deduplication; no unsafe code, external I/O, dependency changes, or prompt-injection attempts.
  • ✅ Charter & value fit: Model-agnostic root-cause fix aligning with #417 (reject missing/invalid inputs rather than silently dropping them) and keeping Helios small and generic; pending GPU qualification is transparently tracked in docs/TODO.txt:10-16 while no in-repo recipe declares core parameters yet.
  • ✅ Related / duplicate / conflict check: Clean follow-up to Bind core-declared FP32 parameters into text forward graphs #505 rebased onto c146d7be (main tip, Remove copy drafts and history drafts while keeping legacy cores loadable #620) with no conflicts or competing PRs.
  • ⚠️ Tests & verification evidence: Reported local runs cover every applicable docs/design-review.md CPU gate (--locked --release suites across Helios/Heliopause/Flare/CLI, 13/13 Kani harnesses, TLC + Rust lifecycle conformance, 86 Python tests, and isolated real-path new tests), but GitHub Actions check statuses on 55bab978 (native-serving.yml, python-cpu.yml, helios-lifecycle.yml) are not observable here—verify CI is green on 55bab978 prior to merge.

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.

A declaring core could start a prefix lookup through the parameterless Rust admission API without including its parameter values in the cache identity. The HTTP server already passed the declarations; no production cache mix-up was observed.

Store the validated declarations on SchedulerCapabilities. Reject missing values before lookup or reservation and preserve declaration-free prefix keys. Share FP32 conversion between preparation and direct execution, and use one text-forward classifier for packing and binding. The HTTP and protobuf formats do not change.

On c146d7b the locked release suites passed for Helios (1799), Heliopause (216), Flare (245) and the CLI (227). The exporter qualification feature built, all 13 Kani harnesses passed, and eight lifecycle suites replayed 593697 transitions. The affected Python tests passed 86 with two CUDA skips. On the earlier 44f59df base, substituting an empty declaration slice made the parameterless-admission rejection assertion fail; restoring the declarations restored the pass. No live GPU export or serving was exercised.

Design-Signed-Off-By: GPT-6.2 Astra (agent for Josh Cartu); design-review=2e5b
Signed-off-by: Joshua Cartu <jcartu@users.noreply.github.com>
@jcartu
jcartu force-pushed the fix/scheduler-core-parameter-admission branch from 55bab97 to 3b2f2db Compare December 3, 2026 21:18
@jcartu

jcartu commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@flare-autobot Rebased onto main (509f585a, including #674 and #709) at 3b2f2db6 to clear the merge conflict:

Verified locally (--locked, prlimit --memlock=unlimited): helios --features runtime-core,server 1,945 passed (86 ignored), heliopause 229 passed (6 ignored), flare 255 passed (4 ignored), flare-cli 247 passed (3 ignored), tests/direct/test_scheduler.py 51 passed, tests/preparation/test_codec_layout.py 8 passed, 0 failed; clippy clean on touched lines.

Discord: jcartu

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

Labels

area:scheduling Request scheduling, fairness, batching, and speculative-width selection. bug Something isn't working 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.

2 participants