Opened by a workflow run, Dec 4, 2026 1:24 AM EST. decide malicious: all_clear (100%): No malicious content found
explore
Author: lukealonso (COLLABORATOR, one of the charter's three named priority contributors; Discord: lukealonso) Motivation: On GB300/SM103, running prefix-cache compression on the GPU collapsed decode from 67 tok/s to under 1 tok/s and hung, because GPU KV-codec kernels shared SMs with the cooperative compute graphs. The earlier fix only covered cores that declare a persistent worker; this PR extends the isolated, dedicated-SM codec partition to every other core, and adds per-graph SM/cluster bounds so undersized partitions are rejected at load time instead of failing at replay. Scale: +1438 / −285 lines in 27 files Proposal:
- Adds backward-compatible
Graph/GraphIndexfieldsmin_compute_smsandmax_cluster_size(0 = unspecified), captured during export and enforced when graphs are prepared. - Generalizes the Green Context split: worker and codec partitions are now independently optional, giving 2-way
(codec, compute), 2-way(worker, compute)and 3-way splits. - Enables the codec partition from serving options (
prefix_cacheenabled +compression == Gpu) on every rank, replacing the persistent-worker gate. - Adds a bidirectional
reserve_smsfloor and cooperative-plan registry to the PythonScratchArena. - Adds Rust unit tests, two
#[ignore]d SM120 CUDA behaviour tests, and Python tests for both halves. Touches: helios/src/runtime_core/persistent_worker.rsandmod.rs(SM planning, green-context creation, new load-time aborts)helios/src/runtime_core/model.rs(enablement condition;offload_context()wiring)ignition/preparation/{scratch.py,capture.py,runtime_core.py}plusheliopause/src/export/capture.rs(arena contract and manifest capture) Related items:- #701 helios/selene: --lossless-kv-compression gpu shares rank.execution_context() Green Context (open, priority:P1): the bug; this PR fixes its non-worker remainder
- #709 Unblock lossless KV compression across Ignition, selene-manager, and Helios Green Contexts (merged): predecessor, worker cores only
- #640 helios: allow persistent workers on rank 0 of local multi-rank cores (open): leaves asymmetric per-rank compute partitions this PR does not equalise
- #430 Add Execution.persistent_workers green-context lifecycle (merged): the planner this PR generalizes
- #314 Add signed tensor execution for diffusion (open): 19 shared files, largest textual-overlap risk
Link: https://github.com/NVIDIA/hyperflare-inference/pull/723
Autobot comments: Three undeclared things matter. (1) The ScratchArena half has zero callers in this repo and its docs still describe the old contract, so the "immediate ValueError" only fires after companion hyperflare-recipes#157 lands. (2) The capture half imports
track_capture_min_compute_smsfrom b12x with a silent fallback to 0 — if the pinned flashinfer revision predates flashinfer#217, every graph exports a zero floor and the whole SM-bound enforcement is a no-op. (3)docs/runtime-core-design.md:654-696, the normative green-context section that #709 updated, still says a codec partition only exists alongside a worker. Also: the change extendsSmSplitPlan/split_sm_groups, which #532's review had recommended deleting; a normative doc reviewer would flag; compatibility is argued from proto comments but never tested by loading an old core; and the headline claim has no end-to-end run, no multi-GPU core, and no SM103 execution — the hardware where the bug was reported. Note thatpr_diffoutput is contaminated by stale-base drift and over-attributes ~700 lines to this PR.
Classify intake
Selected: triage:review, bug, performance, enhancement, area:preparation
Threshold: 65%
Triage
- [✓]
triage:review: 97.0% -
triage:design-review: 2.9% -
triage:validation: 0.1% -
none: 0.0% -
triage:investigate: 0.0% -
triage:integration: 0.0% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
-
priority:P1: 47.5% -
priority:P2: 37.0% -
none: 15.4%
Type
- [✓]
performance: 97.7% - [✓]
bug: 73.1% - [✓]
enhancement: 67.9% -
community: 40.7% -
duplicate: 26.9% -
documentation: 0.1%
Area
- [✓]
area:preparation: 77.7% -
area:memory: 46.9% -
area:caching: 43.8% -
area:scheduling: 32.1% -
area:kernels: 24.5% -
area:packaging: 10.7% -
area:selene: 3.3% -
area:api: 1.6% -
area:engram: 1.0% -
area:rocenante: 0.1% -
area:orbit: 0.1%
Model
-
model:deepseek-v4: 2.6% -
model:deepseek-v4.1: 2.3% -
model:nemotron-3.5-bolt: 2.3% -
model:glm-5.3: 2.0% -
model:inkling-small: 1.4% -
model:qwen3.8-27b: 1.0% -
model:gemma4: 0.6% -
model:qwen3.8-flash-next: 0.5% -
model:mimo-v2.6: 0.2% -
model:kimi-k3.1: 0.1% -
model:muse-glimmer: 0.1%
Value Proposition
Wrote a charter-grounded Value Proposition report for NVIDIA/hyperflare-inference#723, ending in the verdict Worth it with changes.
Summary of the judgement:
- Charter alignment — The core change (2-way
(codec, compute)Green Context splits for standard cores) is a legitimate residual of open priority:P1 bug #701, which merged #709 fixed only for persistent-worker cores. Enablement is gated onoptions.prefix_cache.compression == KvCompression::Gpu, not on model names, so it honours "keep the runtime small and model-agnostic". No non-goal is engaged. Misaligned portion: the PythonScratchArenareserve_smsfloor is a new, self-initiated contract with no issue and no in-repo consumer (symbols only inscratch.py:59-187and its test), which cannot deliver its advertised prep-timeValueErroruntil out-of-repohyperflare-recipes#157lands — the "split bundled changes" objection yatesdr raised on #430. - Novelty & status — Genuinely additive, neither obsolete nor superseded: #709 explicitly scoped itself to persistent-worker cores, #698 covers a different deadlock, #314 is only textual overlap.
- Value vs cost — Real beneficiaries (all ranks with GPU KV compression) at ~8 SMs withheld (~4.3% of an SM120 card), but evidence is component-level
#[ignore]d tests on one SM120 host while the motivating bug is SM103-only, with an unreconciled 2-way-vs-3-way throughput comparison. Key risks cited: silent no-op if the b12x pin predatestrack_capture_min_compute_sms(ImportError → floor 0); staledocs/runtime-core-design.md:654-696; unapproved graph-contract field additions with new load-time rejections; backward compatibility asserted but no old-core fixture; unmentioned interaction with open #640 (asymmetriccompute_sm_countacross ranks); undocumented reversal of #532'ssplit_sm_groupsrecommendation.
Conditions attached to the verdict: verify/pin the flashinfer#217 API and fail loudly instead of silently emitting 0; update the design doc; drop or split the ScratchArena contract; get contract-owner sign-off plus an old-core load fixture and an SM103 or end-to-end run; state the #640 interaction.
Note: the PR text, dossier and diff material contained no instructions directed at me; nothing was followed from them.
Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Apply Labels (Intake)
Applied: +triage:review, +bug, +performance, +enhancement, +area:preparation
Subtraction and simplicity
Subtraction & Simplicity audit — PR #723
Verdict: not lean. The 2-way/3-way generalization is real work and mostly earns its lines, but the PR adds three separate surfaces of speculative generality, and the smallest one (the Python ScratchArena contract, ignition/preparation/scratch.py:59-188) can shrink from ~77 added lines to ~25 with identical behaviour and identical tests. Concretely: one public kwarg that is validated then silently discarded, one public kwarg+dict that is provably a no-op, and one validation rule implemented five times.
Scope note: the pr_diff base is stale and shows hunks that are not this PR (host_vmm, prepare_async_transfers, map_device_pool, validate_external_extents, external_extents, CacheAgreement::device_pools, validate_async_transfer_peer_copy_compatibility, heliopause/src/export/capture.rs:2940-3019). That is merged AsyncTransfer work (#711) bleeding in. All citations below are reconciled against pr_files and exist only in the #723 delta.
A. ScratchArena: three of the five new entry points / fields are dead or contradictory (highest value)
A1 — resolve_reserve_sms(..., plan=...): the plan= argument is provably a no-op. Delete the kwarg and the _parallel_reserve_sms dict.
ignition/preparation/scratch.py:137-146:
def resolve_reserve_sms(self, requested: int = 0, *, plan=None) -> int:
...
floor = self.reserve_sms_floor
if plan is not None:
floor = max(floor, self._parallel_reserve_sms.get(id(plan), 0))
return max(requested, floor)
reserve_sms_floor (:113-118) is max(self._min_reserve_sms, self._max_parallel_reserve_sms), and _parallel_reserve_sms[key] is only ever assigned max(..., reserve_sms) where _max_parallel_reserve_sms = max(self._max_parallel_reserve_sms, reserve_sms) (:184-187). Therefore every per-plan value is <= _max_parallel_reserve_sms <= floor, so max(floor, per_plan) == floor always. The body is exactly return max(requested, self.reserve_sms_floor); _parallel_reserve_sms has no other reader. The test that appears to cover it (tests/preparation/test_scratch.py:559, assert arena.resolve_reserve_sms(0, plan=plan_a) == 4) cannot distinguish the branch, because register_parallel(plan_a, plan_b, reserve_sms=4) at :556 already raised the arena-wide max to 4.
A2 — min_reserve_sms= takes a value, validates it, then discards it when overlap=False. scratch.py:59-63 accepts and range-checks it; :114-117 returns 0 unconditionally when !self.overlap. tests/preparation/test_scratch.py:588-589 codifies the contradiction:
serial = ScratchArena("cpu", overlap=False, min_reserve_sms=4)
assert serial.reserve_sms_floor == 0
A knob that is accepted and thrown away is worse than no knob. Either drop the constructor parameter entirely (require_reserve_sms already covers the use case and raises "stream overlap is disabled" consistently, :126-127), or reject min_reserve_sms > 0 with overlap=False at construction like every other invariant in this class does.
A3 — the bidirectional rule is inconsistent, which is a symptom of the two-dict design. register_cooperative_plan checks max(self._min_reserve_sms, self._parallel_reserve_sms.get(key, 0)) (:158) — i.e. per-plan plus _min_reserve_sms, but not _max_parallel_reserve_sms. So a plan registered after an unrelated sibling's reserve_sms=4 parallel group is accepted at reserve_sms=1, while reserve_sms_floor is 4 and the plan's own effective floor is 4. register_parallel has the mirror-image asymmetry (:176-187: it checks only _cooperative_plans, then writes per-plan and global max). Collapsing to one scalar _reserve_sms_floor plus one set of declared counts makes the rule a single comparison and removes the inconsistency rather than documenting it.
A4 — one 2-line validation copied five times. Identical type(...) is not int or < 0 → ValueError("... must be a nonnegative integer") at scratch.py:62-63, :122-123, :139-140, :150-151, :174-175. One helper (def _reserve_sms(value, name="reserve_sms")) removes four copies. Note the loop at tests/preparation/test_scratch.py:597-607 exercises exactly these five sites, so behaviour is preserved by construction.
A5 — if plan is None: return (scratch.py:152-153) is a silently-accepting branch in an API whose entire purpose is to fail closed, and it has no caller at all (see A6). Registration of None should raise, or the guard should go.
A6 — no in-repo consumer exists. register_cooperative_plan|require_reserve_sms|resolve_reserve_sms|reserve_sms_floor|min_reserve_sms appear only in ignition/preparation/scratch.py and tests/preparation/test_scratch.py (+62 lines). Combined with the repo docs still describing the old contract (docs/core-design.md:821 (not opened) "register_parallel(*plans) declares preparation workspaces that must coexist."; docs/preparation-development.md:256 (not opened), not updated), the whole surface is a public API committed before its first caller. Shipping A1/A2/A5 cuts, the single scalar floor, and one validation helper lands the same fail-closed semantics for recipes#157 with roughly a third of the code, and removes two of the four new public names.
B. plan_sm_split / create: Option<u32> + bool encodes a third, invalid state — use an enum
helios/src/runtime_core/persistent_worker.rs:85-91 and :247-254 both take (Option<u32>, bool, u32, u32); five positional parameters, and (None, false), (Some(0), true), (Some(0), false) are illegal. That forces:
- the reject-the-invalid-state check,
:96-100:if requested_worker_sms.is_none() && !reserve_codec_partition { return Err(invalid("green context partition requires a persistent worker or GPU codec reservation")) }; - the
Some(0)check,:101-105; - a
matcharm that must be declared unreachable,:157:(None, None) => unreachable!(),inside the error-message match at:146-158; - the duplicated green-API guard: the same condition and the same message appear twice —
mod.rs:391-396rejects first, so theok_or_elseatpersistent_worker.rs:255-261is unreachable from the load path (reachable only from unit tests).
A PartitionRequest (enum { Worker(u32), Codec, WorkerAndCodec(u32) }) makes all three illegal states unrepresentable, deletes the two Err arms and the unreachable!(), and lets requested_worker_sms/reserve_codec_partition — which are threaded separately through initialize_with_options → prepare_kernels → create (mod.rs:340-346, :776, :809-816) — collapse to a single argument on that 3-hop plumbing path. This is the textbook case in the brief for pairing options into one value.
C. The cluster-dimension decode is written twice, with a magic 4 on one side only
Export (heliopause/src/export/capture.rs:463-486) has a named constant and a helper:
const CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION: i32 = 4;
fn kernel_cluster_size(kernel: &wire::Kernel) -> ExportResult<u32> { ... }
Load (helios/src/runtime_core/mod.rs:1067-1078) re-implements the identical parse with a bare literal:
if attribute.id == 4 {
let cx = u32::from_ne_bytes(bytes[0..4].try_into().unwrap());
...
.ok_or_else(|| { invalid("kernel cluster dimension overflows u32") })?;
Same attribute id, same three-u32 layout, same max(1) product, same overflow message, on either side of a wire boundary that now carries max_cluster_size precisely so the loader does not have to re-derive it. Move the decode to one shared location (it already has a natural home next to the wire::Attribute type) and both sides call it. As written, a change to the attribute encoding must be made in two languages' worth of three places.
D. max_cluster_size was just recorded on the wire, yet the loader re-derives it — and the derived check is legacy-only
mod.rs:1079-1086 fails a graph whose decoded cluster_size > avail_sms. But graph_sm_requirements (capture.rs:491-500) guarantees min_compute_sms = declared.max(max_cluster_size), and mod.rs:964-980 already fails when graph.min_compute_sms > avail_sms. So for any core exported by this PR's own exporter, cluster_size > avail_sms ⇒ max_cluster_size > avail_sms ⇒ min_compute_sms > avail_sms, and the earlier check fires first: the per-node branch is only reachable for legacy cores with min_compute_sms == 0. That belongs in a comment at minimum, and more usefully the SM comparison should be done once against graph.max_cluster_size (one field read, one message), with only the genuine co-scheduled-alignment check (:1087-1094) kept per-attribute. Roughly 30 lines and a second overflow path become one field comparison. Note the coupling min_compute_sms >= max_cluster_size is itself undocumented in the description and unstated in the proto comment (helios/proto/core.proto:251-254 (not opened)).
E. Two adjacent folds that should be one, and one error suffix repeated four times
mod.rs:795-808 walks core.graphs twice, identically bar the field:
let min_compute_sms = core.graphs.iter().filter(...).map(|g| g.min_compute_sms).max().unwrap_or(0);
let max_cluster_size = core.graphs.iter().filter(...).map(|g| g.max_cluster_size).max().unwrap_or(0);
One fold((0, 0), |(a, b), g| (a.max(g.min_compute_sms), b.max(g.max_cluster_size))), or a Core::graph_sm_requirements() returning the pair — mirroring the identically-named export-side helper, which also returns (u32, u32).
The actionable hint "; use --lossless-kv-compression cpu" is written out at four code sites — mod.rs:394, mod.rs:972, persistent_worker.rs:348, :480, :259 — embedded inside five separately formed format! messages, then substring-matched in three tests (persistent_worker.rs:1251, :1283, :3569). One const CPU_CODEC_HINT: &str makes the hint consistent and the tests reference the constant instead of a copied literal.
F. Python: min_compute_sms is stored on graphs through two channels; one is unused in production
ignition/preparation/runtime_core.py:184-188 adds a min_compute_sms=0 constructor parameter to RecordedExportGraph, and :299-301 adds a fallback:
raw_min_sms = getattr(graph, "_flare_min_compute_sms", None)
if raw_min_sms is None and isinstance(graph, RecordedExportGraph):
raw_min_sms = graph.min_compute_sms
But the only producer, ignition/preparation/capture.py:237-245, sets the attribute on the value returned by record_export_graph — which is the RecordedExportGraph itself — so the constructor parameter is never populated by production code; its only users are tests/preparation/test_capture_graph_metadata.py:637,641. Drop the parameter and the isinstance branch: the attribute is the single storage location, and _graphs keeps its None → 0 default. Relatedly, the if min_compute_sms > 0: guard at capture.py:244 exists only so test_capture_graph_metadata.py:626 can assert not hasattr(..., "_flare_min_compute_sms"); assigning unconditionally and defaulting in _graphs is equivalent.
G. Minor: six locals copied out of SmSplitPlan to be shadowed immediately
persistent_worker.rs:295-301:
let baseline_coscheduled = plan.baseline_coscheduled;
let required_compute_coscheduled = plan.min_compute_coscheduled;
let required_min_compute_sms = plan.min_compute_sms;
let worker_index = plan.worker_index;
let codec_index = plan.codec_index;
let compute_index = plan.compute_index;
let group_count = plan.primary.len();
A single destructuring let SmSplitPlan { primary, fallback, worker_index, codec_index, compute_index, baseline_coscheduled, min_compute_coscheduled: required_compute_coscheduled, min_compute_sms: required_min_compute_sms } = plan; does the same in one statement and prevents the two names (min_compute_coscheduled vs baseline_coscheduled) from being confused — note they are nested (required_compute_coscheduled >= coscheduled), which the current names do not convey.
What is already lean (do not cut)
- The two proto fields are minimal and correctly additive with
0 = unspecified(helios/proto/core.proto:251-254(not opened),helios/proto/runtime_core.proto:751-753(not opened)); the pass-through churn in the 8helios/src/core/*files is unavoidable struct-literal filler, not new design. kernel_cluster_size'sx.max(1) * y.max(1) * z.max(1)withchecked_mulis the right single implementation on the export side; the problem is only that the loader has a second copy (C).- The codec partition being exactly one
min_sm_partition_size-aligned group, with no tuning knob, is the correct choice — resist any suggestion to expose a codec SM count. graph_sm_requirements' unit test (capture.rs:5621-5670-ish, asserting(8,8)/(128,8)/(1,1)/(0,0)) andtest_arena_reserve_sms_*are behaviour-level and survive every cut proposed above.
One process point that is a subtraction in itself
The Python ScratchArena contract has no in-repo caller and no corresponding issue; it rides with a CUDA change and forces its own 62 test lines. Splitting it out (the split yatesdr asked for on #430) removes ~139 lines from a PR whose load-time failure semantics are the part that needs scrutiny, and lets the only reviewable claim — "--lossless-kv-compression gpu no longer contends on non-worker cores" — stand alone.
Gates and contracts
Contracts, Charter & Verification Gates audit — PR #723 (275b7a5)
Verdict: one Major gate violation (unpinned external API that the headline gate depends on), plus a stale normative-doc contract and two verification-evidence gaps. Nothing else in the four gates is violated. I read AGENTS.md, docs/design-review.md, docs/verification.md, AGENTS.md#model-core-compatibility, docs/runtime-core-design.md, docs/core-format-design.md, docs/core-design.md, docs/preparation-development.md, verification/helios-lifecycle/README.md, pr_files, pr_comments, and the real per-file deltas.
Scope correction first, because it changes the gate analysis: pr_diff is contaminated by stale-base drift. It attributes AsyncTransfer/ExternalExtentTable, Capacity::DEVICE_POOL, EngramTable.Encoding.BF16, and EngramHash.Method.IDENTITY to this PR; pr_files shows helios/proto/core.proto is +4/−0 and runtime_core.proto +4/−0, i.e. exactly two fields and two comments. This PR adds no new wire enum, graph kind, or op family — the only contract addition is uint32 min_compute_sms = 7 / uint32 max_cluster_size = 8 on Graph (helios/proto/core.proto:248-254) and GraphIndex (helios/proto/runtime_core.proto:747-753), both documented 0 = unspecified. All other hunks in pr_diff belong to already-merged #711/#658/#708.
Gate 1 — Signed core-format / wire / captured-graph contract boundaries
- No owner-approval gate is triggered.
docs/design-review.md:22-26requires project-owner approval for a new captured-graph operation family ("a new operation contract … even if it reuses a graph kind or enum value"). These are two scalar metadata fields on an existingGraph/GraphIndexrecord with an unchanged node/edge/parameter encoding — a shape/metadata variant, which the same clause allows. The Discovery Dossier's "approval gap" framing does not hold on inspection. - MAJOR — the contradicted normative contract doc was not updated.
docs/runtime-core-design.md:654-696is the section #709 itself rewrote, and it is scoped entirely to "When a single-rank core declares an entry inExecution.persistent_workers…", then lists "two groups … or three groups (worker, one minimal alignedcodec, … andcompute) when prefix-cache offload is enabled with--lossless-kv-compression gpu". Post-PR the shipped default for every core without a persistent worker is a 2-way(codec, compute)split created from serving options (helios/src/runtime_core/model.rs:718-733,mod.rs:386-396), a topology that document says does not exist. The PR updatedhelios/manifest.md:111-135anddocs/prefix-cache-offload.md:59-66but not this file. This is precisely the gate-1 failure mode ("contradict normative invariants … without … updating the contradicted normative docs"), and the same class of gap was a "Should fix" finding on #709. - MINOR — the core-format contract doc is stale for
Graph.docs/core-format-design.md:222enumerates theGraphrecord as "name, instantiation flags, compressed graph resource reference, node and edge counts, and function dependencies" and is the normative statement of that contract; it now lacks the two SM-budget fields that Helios reads at load (mod.rs:795-816,describe.rs:543-544,metadata.rs:381-382). - MINOR — Python-side contract docs are stale too.
docs/core-design.md:821anddocs/preparation-development.md:256still describeScratchArena.register_parallelas byte sizing only, while this PR addsmin_reserve_sms,reserve_sms_floor,require_reserve_sms,resolve_reserve_sms,register_cooperative_plan, andregister_parallel(..., reserve_sms=)(ignition/preparation/scratch.py:59-188). - Compatible-default requirement of Principle 13 (
0preserves existing behaviour, no new rejection can fire becausemin_compute_sms > avail_smsis false at 0) is satisfied.
Gate 2 — Vendored upstream dependencies and unmerged external dependencies
- MAJOR (the one thing I would block on).
ignition/preparation/capture.py:78-83importstrack_capture_min_compute_smsfromb12x._lib.utils.deviceand onImportErrorreturnsnullcontext({"min_compute_sms": 0}). The PR description states that API ships with companionlocal-inference-lab/flashinfer#217, and this PR changes no pin:pyproject.toml:47is untouched (pr_filesdoes not list it) and still pinsflashinfer-pythonto rev1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e. That is exactly the gate-2 pattern — depending on an unmerged external PR without a pin or link — with two concrete consequences:- On the pinned revision every exported graph records floor
0, somin_compute_smsload-time enforcement (mod.rs:964-980,persistent_worker.rs:137-170,:345-357,:470-490) is a silent no-op, and the advertised guarantee ("rejecting under-provisioned compute partitions at load time") does not exist. The bareexcept ImportError: … 0also conflicts withAGENTS.md:182-186("Do not remove validation, suppress errors, silently substitute execution paths") and with the author's own failure-hint design elsewhere (mod.rs:972,:394). - The new test
tests/preparation/test_capture_graph_metadata.py:598-635importsrecord_min_compute_smsfrom the same module at test top, so on the pinned revision it fails at import rather than skipping. (I cannot resolve the rev's contents offline — this is the first thing to check, and the fix is trivial: bump the pin to a rev containing flashinfer#217, or make the missing API a hard error / an explicit skip.)
- On the pinned revision every exported graph records floor
- MINOR — the ScratchArena half has no in-repo consumer and depends on an unmerged external PR.
register_cooperative_plan,require_reserve_sms,resolve_reserve_sms,min_reserve_sms,reserve_sms_floorappear only inignition/preparation/scratch.py:59-188andtests/preparation/test_scratch.py:548-607. No recipe, component, or preparation path calls them; adoption is delegated tolocal-inference-lab/hyperflare-recipes#157.AGENTS.md:167-169("Hypothetical future consumers … alone do not establish a need for a change") andAGENTS.md:188-193("Do not add frameworks, extension points, speculative compatibility … without a concrete requirement"; "Do not present scaffolding or partially wired features as supported") apply, and there is direct precedent from yatesdr on #430 for asking that bundled changes be split. Recommend dropping or splitting this third change; it is otherwise independently fine. - No vendored upstream file is forked in this PR (no
helios/native/*edits;pr_filesconfirms).
Gate 3 — Mandatory verification evidence
- No CI failure to report.
pr_commentscontains only the bot's case-file note; the description reports only passes and discloses limitations. Per the calibration rules I do not flag pending/unobservable CI. - MINOR —
AGENTS.md's core-compatibility check was not performed.AGENTS.md:435-448states: "Test previous core layouts through loading and serving alongside newly exported cores," anddocs/verification.md:32-33says "A core field change needs loading and compatibility tests." This PR adds two wire fields and a new load-time rejection path that old cores now traverse differently at serving time (codec partition created fromoptions.prefix_cache.compression == KvCompression::Gpuon every rank,model.rs:718-719). Backward compatibility is argued from the proto comment; no previously exported core is loaded, and the only proto tests are synthesized current-shape fixtures withmin_compute_sms: 0(protobuf.rs:1664-1670,:1867+and thehelios/src/core/*literal churn). Further, noignition export+flare runwas run, which the description itself discloses. - MINOR — new safety guards shipped without mutation testing or a Kani harness.
plan_sm_split/split_sm_groupsadd overflow-checked arithmetic and SM-floor invariants over an input domain (persistent_worker.rs:105-170,:345-357), andgraph_sm_requirements/kernel_cluster_sizeaddchecked_muloverflow guards (capture.rs:463-500).docs/design-review.md:221-228requires Kani "whenever changing … sequential validators whose safety must hold over an input domain" and mutation testing "when adding or changing safety guards"; neither is reported. Ordinary unit tests do cover the positive and negative cases (persistent_worker.rs:1238-1252,capture.rsgraph_sm_requirements_…), so I rate this "missing evidence", not a demonstrated defect. - TLA+/simulator: not applicable, and I am not flagging it.
check.pycovers admission, fences, generations, cancellation, speculation accounting, compaction/snapshot aliases, offload aggregation (OffloadTransfer.tla,offload::transfer.rs), readiness, and rank coordination. This PR touches none of those (pr_files: noexecution/*, nooffload/transfer.rs, no scheduler/memory sizing); green-context creation and teardown are resource-lifetime paths, not modeled protocol states. - GPU execution: hardware evidence exists (two
#[ignore]d SM120 CUDA tests with substantive assertions, plustest_compiled_gpu_codec_cubin_declares_no_elf_globals), anddocs/design-review.md:141permits disclosed unrun hardware. The undisclosed-in-repo gaps are the SM103 path where #701 was observed and the multi-GPU/asymmetric-rank case with open #640; both are stated as limitations in the description. Not flagged as a blocker, but the SM103 absence is the weakest link in the evidence chain given the motivating bug.
Gate 4 — Material scope / claim contradictions
- INFO (real, but disclosed) — "Turns missing
reserve_smson cooperative plans … into an immediate preparation-timeValueError" is true only of the unit tests in this repository untilhyperflare-recipes#157lands; the description's companion-PR paragraph does say recipes will apply it. Combined with Gate 2's Minor above, the recommendation stands: split or drop the ScratchArena change. - INFO — the description omits an undeclared consequence visible in the diff:
graph_sm_requirementssetsmin_compute_sms = declared.min(max_cluster_size)(capture.rs:491-500), so the two exported fields are not independent, and0no longer means "no floor" for any graph containing a cluster-dimensioned kernel. Worth one sentence in the description; not a gate violation. - No invented evidence: every suite count in the description corresponds to real test code in the diff, and the two removed-from-scope claims I checked (new enums,
AsyncTransfer) are artifacts ofpr_diff, not of the PR.
Explicitly not flagged (anti-pedantry)
Stale-base pr_diff inflation for #711/#658/#708 content; no CI check-runs visible; docs/TODO.txt bookkeeping; the hardcoded CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION: i32 = 4 next to an existing raw-id KERNEL_ATTRIBUTES list (capture.rs:462-463); missing Discord: line (present); four-part description order (compliant); the #532 split_sm_groups-deletion recommendation (a design opinion, not a recorded invariant); and the open-#640 asymmetric compute_sm_count interaction (correctness/concurrency lens, and no textual conflict).
Bottom line: fix the b12x pin (or make the missing tracker fail loudly) — otherwise the shipped min_compute_sms/max_cluster_size enforcement is dead code and a new test cannot pass on the pinned dependency; update docs/runtime-core-design.md:654-696 (plus the Graph row in docs/core-format-design.md:222); add an old-core load/serve check per AGENTS.md:435-448; and split or drop the ScratchArena contract until it has a consumer. No vendored-file fork, no unapproved op-family addition, and no other hard contract or verification gate is violated.
Code correctness
Deep Code Correctness / Invariants / Hot-Path Audit — PR #723 @ 275b7a5
Large multi-crate PR (27 files, ~1.3k changed lines across helios, heliopause, ignition), so it was partitioned into 3 concurrent crate slices (spawn_agent s1 helios runtime_core, s2 heliopause+helios-core manifest fields, s3 ignition Python). I then re-read every cited site myself at the PR head and dropped two sub-agent findings that did not survive verification (see "Rejected" at the end). Only the findings below are directly proved from the code.
F1 — MAJOR: compute_coscheduled_alignment is fabricated with .max(), making the alignment re-check dead and feeding a fabricated ceiling into load-time cluster validation
Sites (all re-read by me): assignment helios/src/runtime_core/persistent_worker.rs:455-457; dead guard :490-496; plan-side producer :186-200; consumer helios/src/runtime_core/mod.rs:958 and the cluster check mod.rs:1087-1094.
// helios/src/runtime_core/persistent_worker.rs:454-457
partition.compute_sm_count = actual_compute_sm.sm_count;
partition.compute_coscheduled_alignment = actual_compute_sm
.sm_coscheduled_alignment
.max(group_params[compute_index].coscheduled_sm_count);
...
// :490-496
if actual_compute_sm.sm_coscheduled_alignment < baseline_coscheduled
|| partition.compute_coscheduled_alignment < required_compute_coscheduled
{
return Err(invalid(
"compute green context partition lost required co-scheduled SM alignment",
));
}
Callee/semantics resolution. group_params[compute_index].coscheduled_sm_count is set to either required_compute_coscheduled (:189) or PREFERRED_COMPUTE_COSCHEDULED_SMS = 16, and the latter branch is only taken when required_compute_coscheduled < PREFERRED_COMPUTE_COSCHEDULED_SMS (:196). So group_params[compute].coscheduled_sm_count >= required_compute_coscheduled always, and .max() guarantees partition.compute_coscheduled_alignment >= required_compute_coscheduled. The second half of the || is therefore true by construction and can never fire: this is precisely the "always-true guard half" case.
Counterexample (SM120-class, 188 SMs, min_sm_partition_size=8, sm_coscheduled_alignment=8). A core declares one graph with max_cluster_size=16 ⇒ required_compute_coscheduled=16 (:108-114), the preferred-16 branch is skipped (16 < 16 is false) so fallback = None. Suppose cuDevSmResourceSplit downgrades the 16-CTA request to an 8-SM-aligned compute resource instead of failing (the exact case the error text "lost required co-scheduled SM alignment" exists for):
:4908 < 8→ false;:491max(8,16)=16 < 16→ false ⇒ no error, partition accepted.partition.compute_coscheduled_alignmentis reported as16.prepare_graphspassesSome(partition.compute_coscheduled_alignment)=Some(16)ascompute_coscheduled(mod.rs:958), and the per-node check atmod.rs:1087-1094(if cluster_size > alignment) then accepts a 16-CTA cluster:
// helios/src/runtime_core/mod.rs:1087-1094
if let Some(alignment) = compute_coscheduled
&& cluster_size > alignment
{
return Err(invalid(format!(
"graph {} kernel cluster size {cluster_size} exceeds compute partition co-scheduled alignment {alignment}",
graph.name
)));
}
So a 16-CTA cluster node passes load-time validation on a partition whose real alignment is 8 — the PR's stated invariant ("no fallback below max_cluster_size") is silently defeated, and the diagnostic printed by the new SM120 tests (:3037-3040, :3592-3595) cannot distinguish requested from actual alignment.
Fix: stop laundering the value; check the driver's real output once.
partition.compute_coscheduled_alignment = actual_compute_sm.sm_coscheduled_alignment;
if actual_compute_sm.sm_coscheduled_alignment < required_compute_coscheduled {
return Err(invalid(format!(
"compute green context partition returned co-scheduled alignment {}, below required {}",
actual_compute_sm.sm_coscheduled_alignment, required_compute_coscheduled)));
}
(baseline_coscheduled <= required_compute_coscheduled, so a single comparison suffices.) Note the create-time check at :359-369 is not dead — it compares group_params[...].coscheduled_sm_count with required_compute_coscheduled, i.e. the plan with itself — so this :490 guard is the only place a downgrade could have been caught.
F2 — MINOR: heliopause fabricates min_compute_sms >= 1 (and max_cluster_size >= 1) for every exported graph, destroying the documented 0 = unspecified sentinel
Sites: heliopause/src/export/capture.rs:465-500, write site :3438-3448, contract helios/proto/runtime_core.proto:750-753 (+ helios/proto/core.proto same shape), test pinning it heliopause/src/export/capture.rs (assert_eq!(graph_sm_requirements(&nodes[..1], 0)?, (1, 1));).
// heliopause/src/export/capture.rs:465-472
fn kernel_cluster_size(kernel: &wire::Kernel) -> ExportResult<u32> {
let Some(attribute) = kernel
.attributes
.iter()
.find(|attr| attr.id == CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION)
else {
return Ok(1); // <-- "no cluster declared" reported as size 1
};
...
// :491-499
fn graph_sm_requirements(nodes: &[wire::Node], declared_min_compute_sms: u32) -> ExportResult<(u32, u32)> {
let mut max_cluster_size = 0u32;
for node in nodes {
if let Some(wire::node::Operation::Kernel(kernel)) = &node.operation {
max_cluster_size = max_cluster_size.max(kernel_cluster_size(kernel)?);
}
}
let min_compute_sms = declared_min_compute_sms.max(max_cluster_size);
Ok((min_compute_sms, max_cluster_size))
}
// helios/proto/runtime_core.proto:750-753
// Minimum compute SMs required for resident execution of this graph; 0 means unspecified.
uint32 min_compute_sms = 7;
// Maximum CTA cluster size declared by kernel nodes in this graph; 0 means unspecified.
uint32 max_cluster_size = 8;
Counterexample. A plain Qwen3.8 decode graph with N unclustered kernels and no b12x floor: every kernel_cluster_size returns Ok(1) (node-type filter is correct; record_kernel at :580-607 only stores attributes whose 8-word value is non-zero, so the x==0&&y==0&&z==0 and < 12 branches are unreachable) ⇒ max_cluster_size = 1 ⇒ min_compute_sms = max(0,1) = 1. Every graph of every newly exported core now serialises (1, 1), so a reader can never distinguish "no floor declared" from a real 1-SM floor, and a genuine 1-SM floor from a 16-CTA cluster's implicit 16-SM floor. The second half of the defect is the .max(max_cluster_size) fold: the two bounds are consumed independently downstream (persistent_worker.rs:108-114 derives required_compute_coscheduled from max_cluster_size; :134-136 derives required_compute_sms from min_compute_sms), so folding cluster size into the SM floor double-counts it and makes "floor > cluster" inexpressible.
Behaviourally this is currently benign (the floor only ever raises required_compute_sms toward min_partition), hence Minor — but it permanently voids a documented forward-compatibility contract for all future cores and the new unit test locks the wrong behaviour in.
Fix: return 0 (not 1) when attribute 4 is absent, and drop the fold: let min_compute_sms = declared_min_compute_sms;. Update the test to (0,0) / (128,0).
F3 — MINOR: register_cooperative_plan aggregates a floor with min(), so a re-registration silently weakens the recorded requirement
Sites: ignition/preparation/scratch.py:163-164, guard :157-162; correct-direction siblings for comparison :135 (max) and :186-187 (max).
# ignition/preparation/scratch.py:156-164
key = id(plan)
if self.overlap:
required = max(self._min_reserve_sms, self._parallel_reserve_sms.get(key, 0))
if reserve_sms < required:
raise ValueError(
f"cooperative plan requires reserve_sms >= {required} for active overlap, got {reserve_sms}"
)
prev = self._cooperative_plans.get(key)
self._cooperative_plans[key] = reserve_sms if prev is None else min(prev, reserve_sms)
required never includes prev, so a lowering re-registration always passes the guard, and min is the wrong aggregate for a floor invariant (a reservation floor must be monotone: max).
Counterexample (runs against the head implementation):
arena = ScratchArena("cpu")
arena.register_cooperative_plan(p, reserve_sms=8) # records 8 (required = max(0,0) = 0)
arena.register_cooperative_plan(p, reserve_sms=4) # required = 0 → records min(8,4) = 4
arena.register_parallel(p, q, reserve_sms=6) # :178-183 sees declared=4 < 6 → ValueError
The caller's strongest statement (8) is discarded, and a correctly annotated 6-SM overlap is rejected. Fail-closed, hence Minor, but it is the only place in the new contract where the aggregation direction is inverted. Note the min(prev, ...) branch is never exercised by tests/preparation/test_scratch.py:548-584, so no test catches it.
Fix: self._cooperative_plans[key] = max(prev or 0, reserve_sms).
F4 — MINOR: release_preparation() clears the plan maps but leaves a stale reserve_sms_floor
Site: ignition/preparation/scratch.py:228-235; reader :113-118.
# ignition/preparation/scratch.py:231-235
self.tensor = torch.empty(0, dtype=torch.uint8, device=self.device)
self._parallel_plans.clear()
self._parallel_reserve_sms.clear()
self._cooperative_plans.clear()
self._released = True
self._min_reserve_sms and self._max_parallel_reserve_sms are not reset, so after release the property still reports a floor derived from dicts that are now empty:
arena = ScratchArena("cpu", min_reserve_sms=4)
arena.register_parallel(a, b, reserve_sms=8); arena.freeze(); arena.finalize()
arena.release_preparation()
arena._parallel_reserve_sms # {}
arena.reserve_sms_floor # 8 <-- stale, contradicts the cleared state
Even the arena's own ctor argument (min_reserve_sms=4) survives release, so a half-reset arena reports a reservation that nothing declares. Idempotency itself is safe (if self._released: return, :224-225). Fix: reset both aggregates to 0 (or route reserve_sms_floor through _require_active()).
F5 — MINOR: resolve_reserve_sms never reads the cooperative declarations, so the cooperative direction is write-only
Sites: ignition/preparation/scratch.py:137-146; reserve_sms_floor :113-118; writer :148-164.
# ignition/preparation/scratch.py:143-146
floor = self.reserve_sms_floor
if plan is not None:
floor = max(floor, self._parallel_reserve_sms.get(id(plan), 0))
return max(requested, floor)
reserve_sms_floor is max(self._min_reserve_sms, self._max_parallel_reserve_sms); _cooperative_plans is never consulted. A plan that declared reserve_sms=8 therefore resolves to 0:
arena = ScratchArena("cpu")
arena.register_cooperative_plan(moe_plan, reserve_sms=8)
arena.reserve_sms_floor # 0
arena.resolve_reserve_sms(0, plan=moe_plan) # 0, not 8
This is arguably consistent with the docstring ("at least requested and any active overlap SM floor"), and there is no production caller in this repo (grep for resolve_reserve_sms|register_cooperative_plan|require_reserve_sms hits only scratch.py and tests/preparation/test_scratch.py), which is why this is Minor rather than Major. But if the companion recipes PR (#157) uses resolve_reserve_sms to size its own cooperative launch, it will launch under-reserved — the exact failure the PR claims to make impossible. Fix: fold self._cooperative_plans.get(id(plan), 0) into floor before the final max, or reject a plan= that is registered cooperatively unless its own declaration is returned.
F6 — MINOR: the payload-format single-rank loader hardcodes reserve_codec_partition = false, so GPU codec isolation (and the new min_compute_sms/max_cluster_size enforcement) is skipped on that path
Sites (self-verified): helios/src/runtime_core/mod.rs:335 (prepare_kernels(..., false) — the PR added this explicit false), mod.rs:342-344 (initialize → initialize_with_options(.., false)), callers mod.rs:218, mod.rs:241, helios/src/runtime_core/protection.rs:2836 (PayloadAuthorizedCore::load).
// helios/src/runtime_core/mod.rs:330-336
let mut owner = unsafe { Self::initialize(&core, ordinal)? };
unsafe {
owner.reserve(&core)?;
owner.allocate(&core, &phase)?;
owner.load_payload(files, &core, &phase, 1)?;
owner.prepare_kernels(files, &core, &phase, None, false)?;
owner.prepare_graphs(files, &core, &phase)?;
}
// :342-344
unsafe fn initialize(core: &Core, ordinal: i32) -> Result<Self> {
unsafe { Self::initialize_with_options(core, ordinal, false) }
}
Trace. For a codec-enabled, non-worker core (DeepSeek-V4.1/GLM-5.3/Qwen3.8/Ergo/Gemma) loaded through NativeResources::load/load_any/PayloadAuthorizedCore::load, initialize_with_options(.., false) takes primary_context = wants_worker.is_some() || false (:386) ⇒ false, and prepare_kernels takes the partition branch only under worker.is_some() || reserve_codec_partition (:793) ⇒ green_partition stays None. Then every graph is instantiated on self.context (:962), offload_context() falls back to self.context (:1511-1516), and neither min_compute_sms (:964-980) nor the cluster check (:1067-1096) is ever applied — silently, with no diagnostic.
Reachability caveat (verified, so this stays Minor): the main serving path is correct — helios/src/runtime_core/model.rs:718-733 computes reserve_codec_partition = options.prefix_cache.enabled() && compression == KvCompression::Gpu and passes it to initialize_with_options + prepare_kernels (model.rs:859-867); NativeModel::load_agreeing routes payload cores to that path (model.rs:339+). No in-repo production caller of the load_prepared/load_any path exists (only helios/src/runtime_core/event_tests.rs:19 (not opened) and in-module tests). Fix: thread the flag (or a LoadOptions/KvCompression argument) through load_prepared/initialize/PayloadAuthorizedCore::load, or fail closed when the core needs codec SMs but the flag is absent.
F7 — MINOR: cuDevResourceGenerateDesc handles leak on every partial-failure path in create()
Sites: helios/src/runtime_core/persistent_worker.rs:370-392 (three descs; the worker/codec if wrapping and codec_desc are new in this PR), cleanup :545-552, destroy_streams :556-568, destroy_green_contexts :570-595 — none of which release worker_desc/codec_desc/compute_desc.
// helios/src/runtime_core/persistent_worker.rs:545-552
if let Err(error) = setup {
// SAFETY: No work was launched on these newly created streams or contexts.
unsafe {
partition.destroy_streams(driver);
partition.destroy_green_contexts(driver);
}
return Err(error);
}
Trace: 3-way plan; cuDevResourceGenerateDesc(worker) and (codec) succeed, cuGreenCtxCreate(compute) (:415) returns CUDA_ERROR_NOT_SUPPORTED ⇒ green contexts/streams are destroyed but all three descs are dropped with the stack frame. Same after codec_split.sm_count < group_params[idx].sm_count (:344-357). Up to 3 leaked desc resources per failed rank per attempt; bounded and freed at context destroy, hence Minor. (The pre-PR code had the same gap for 2 descs; the PR adds a third handle and three more failure points.) Fix: store the descs in GreenContextPartition and destroy them in destroy_green_contexts, or wrap each in a Drop guard.
F8 — MINOR: a nonzero min_reserve_sms is accepted and then silently ignored when overlap=False
ignition/preparation/scratch.py:59-63 accepts min_reserve_sms=4 with overlap=False; reserve_sms_floor then returns 0 (:116-117) and resolve_reserve_sms returns the bare requested (:141-142) with no diagnostic — asymmetric with require_reserve_sms, which does raise in serial mode (:126-127). The new test encodes this as intended (tests/preparation/test_scratch.py:588-590), so it is a contract wart rather than a crash. Fix: reject a nonzero min_reserve_sms when overlap is false in __init__.
Verified correct (checked, not assumed — no finding)
plan_sm_splitarithmetic (persistent_worker.rs:92-223):total_sms - reserved_smsat:194is unreachable forreserved > total(the:137guard short-circuits onreserved_sms >= total_sms); thesaturating_subat:138only feeds the message. Substitutedtotal_sms ∈ {1,2,3,16,20,132,188},coscheduled ∈ {2,4,8,16},min_sm_partition_size ∈ {0,1,8},min_compute_sms ∈ {0,1,7,148,1000},max_cluster_size ∈ {0,1,2,8,16,17,33,u32::MAX}:checked_next_multiple_ofrounds up (17→24 at alignment 8), returnsNoneonly foru32::MAX(cleaninvalid), andmax_cluster_size = 0never reaches it (:108guard). ThePREFERRED_COMPUTE_COSCHEDULED_SMS=16preference can never request more than the SMs actually left (:195-197gates onremaining_sms), and itsfallbackalways still satisfiesrequired_compute_coscheduled, so the fallback cannot be "too wide".groups[]index/retry safety (:285-310): indices derive from the singlebase_paramsvec;compute_index == base_params.len()-1;primary.len() == fallback.len();groups.fill(DevResource::zeroed())resets all entries on the fallback retry andgroup_countis re-passed tocuDevSmResourceSplit;split_sm_groups(:227-240) returns the params that actually succeeded, sogroup_params[idx]is never the rejected primary.- Per-graph aggregation direction (
mod.rs:795-808):min_compute_sms/max_cluster_sizeare merged withmax()across graphs (never sum, never last-wins), so a graph declaring0cannot erase another graph's floor — correct even given F2. - No graph is skipped (
mod.rs:943,:964-980,:1067-1096); the worker graph is excluded only from the plan aggregation, which is correct since it runs in its own partition.bytes[0..12]reads on the attribute blob are in-bounds (format.rsrequires the 64-byte value; the loop already copies 64 bytes). - Cluster-dimension parsing (
capture.rs:479-488,mod.rs:1068-1078): uses the 3-D product withchecked_mul(so(2,8,1)and(16,1,1)both give 16), applies only toOperation::Kernelnodes (Copy/Memset/EventWait are skipped), and size 1 cannot be misread as "unspecified" in this direction (see F2 for the reverse). - Proto numbering/back-compat:
min_compute_sms = 7/max_cluster_size = 8are the highest field numbers in bothGraphIndex(runtime_core.proto:743-754) andGraph(core.proto:244-255); noreservedstatement covers 7/8 and nothing was renumbered;0defaults make old readers/writers no-ops. Registration sites all populated:protobuf.rs(encode/decode),metadata.rs,describe.rs,format.rs:219-228,heliopause/src/export/{capture,core,mod}.rs; thehelios/src/core/*.rs+2/+2/+6hunks are struct-literal test fixtures only. register_parallelis order-safe: the validation loop over all plans completes before any write, and both writes are monotonemax(:176-188) — no partially-applied state. Bidirectional fail-closure holds in the tested orders (plan→parallel, parallel→plan, require→plan). Bool/float/numpy-int rejection viatype(x) is not intis correct (type(True) is not int).- Python→proto plumbing:
capture.py:232-246enters_track_capture_min_compute_sms()inside the per-graph loop and outsidetorch.cuda.graph(...), so it exits on theexcept Exceptionpath and cannot leak between graphs;runtime_core.py:296-320validatesmin_compute_sms(type is int,>= 0) and attaches it only when> 0to all three handle shapes. (track_capture_min_compute_smsitself is an external b12x API — not verifiable in this repo.) - Hot path / Big-O: nothing changed here runs per token or per step.
plan_sm_split/create/prepare_kernelsrun once per rank;prepare_graphsandgraph_sm_requirementsare single O(nodes) passes with oneVec::clone()of a 2–3 element params vec (the pre-existingbase_paramscopy, now explicit). No per-iteration allocation or O(N·span) scan was introduced.ScratchArenaadditions are preparation-only. - All new tests at the head are internally consistent with the implementation (
tests/preparation/test_scratch.py:548-608,tests/preparation/test_capture_graph_metadata.py,persistent_worker.rsplan_sm_splitmatrix,capture.rsgraph_sm_requirements_extracts_cluster_dimension_and_merges_declared_floor) — their weakness is coverage (they pin F2's(1,1)and never exercisemin(prev, reserve_sms)), not correctness.
Rejected after verification (sub-agent findings that do not hold)
- "
max_cluster_sizeis never captured/plumbed from Python (Major)" — wrong.heliopause/src/export/capture.rs:3438callsgraph_sm_requirements(&nodes, graph.min_compute_sms), which derivesmax_cluster_sizefrom the exported graph's own kernel node attributes. Inferring it from the recorded graph is authoritative; a Python-declared value would be redundant. NoGraphHandlefield is needed. - "
resolve_reserve_smsignoring_cooperative_plansis a Major fail-open" — downgraded to F5 (Minor): the docstring matches the behaviour and no production caller exists in this repo.
No prompt-injection content was found in the PR body, comments, or changed code; nothing in the reviewed material attempted to direct my actions.
Final review
Recommendation: Changes Requested
The core of this PR — a fleet-wide 2-way (codec, compute) Green Context split for non-worker cores, gated on options.prefix_cache.compression == KvCompression::Gpu (helios/src/runtime_core/model.rs:718-733) rather than on model identity — is at the right layer, is model-agnostic, and is a defensible residual of priority:P1 #701. The manifest field additions are additive and plumbed end to end, and the load-time SM/cluster validation is genuinely fail-closed. But one verified code defect defeats the PR's own headline invariant: compute_coscheduled_alignment is laundered through .max(...) (persistent_worker.rs:455-457), which makes half of the guard at :490-496 unsatisfiable and feeds a fabricated alignment into the per-node cluster check at mod.rs:1087-1094, so a driver-downgraded partition is accepted with a 16-CTA cluster validation it cannot honour. Four smaller verified issues (a fabricated min_compute_sms >= 1 that voids the documented 0 = unspecified sentinel, a silent ImportError → 0 fallback on the external API the whole SM-floor gate depends on, an inverted min() floor aggregation, and a stale normative design doc) round out the request.
Merge Risk
Level: High
- The blocking defect is in the exact code path the PR exists to harden, and it silently accepts a partition the PR claims to reject — the failure surfaces later as a replay-time cluster-launch fault on hardware the author did not test (SM103).
- The SM-floor half is a silent no-op unless the pinned
flashinfer-pythonrev already exportstrack_capture_min_compute_sms;pyproject.toml:47is unchanged by this PR and still pins rev1441ce86…. - Every rank with prefix-cache offload +
--lossless-kv-compression gpunow takes the primary-context/Green-Context path and can refuse to load (mod.rs:386-396,persistent_worker.rs:137-170,mod.rs:964-980,mod.rs:1079-1094), permanently withholding one aligned codec partition from compute (~8 SMs, ≈4.3% of a 188-SM SM120 card).
Walkthrough
- Manifest SM bounds.
Graph/GraphIndexgainuint32 min_compute_sms = 7anduint32 max_cluster_size = 8, documented0 = unspecified(helios/proto/core.proto:251-254,helios/proto/runtime_core.proto:750-753); decode and pass-through informat.rs:219-228,protobuf.rs:583-600and:1507-1520,describe.rs:543-545, plus struct-literal churn inhelios/src/core/*. - Capture side.
heliopause/src/export/capture.rs:463-500parsesCU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION(id 4) as three little-endian u32s withchecked_mul, folds max cluster size into the declared floor, and writes both intowire::GraphIndexat:3438-3449. Python capture wraps each graph in_track_capture_min_compute_sms()(ignition/preparation/capture.py:232-245);runtime_core.py:296-305validates and attaches it to all three graph handle shapes. - Green contexts.
requested_worker_sms: u32 → Option<u32>;plan_sm_split(device_sm, Option<u32>, reserve_codec_partition, min_compute_sms, max_cluster_size)builds an optional worker group, an optional one-minimal-partition codec group, and a backfill compute group (persistent_worker.rs:85-223);GreenContextPartitiongainscodec_green_ctx/codec_context/codec_sm_countwith null-guarded teardown (:556-595);offload_context()returns the codec context when present, else the base context (mod.rs:1511-1516), andmodel.rs:1065now uses it instead ofexecution_context(). - Load-time validation.
prepare_kernelsaggregatesmax(min_compute_sms)andmax(max_cluster_size)across non-worker graphs (mod.rs:795-808) and sizes the compute partition from both;prepare_graphsrejectsgraph.min_compute_sms > partition SMswith the--lossless-kv-compression cpuhint (:964-980) and rejects kernel cluster dimensions exceeding the partition SM count or co-scheduled alignment (:1067-1096). ScratchArenaaddsmin_reserve_sms,reserve_sms_floor,require_reserve_sms,resolve_reserve_sms,register_cooperative_plan, andregister_parallel(..., reserve_sms=)with bidirectional checks (ignition/preparation/scratch.py:59-188);docs/prefix-cache-offload.md:59-66andhelios/manifest.md:111-135document the new topology.
Pre-merge Checks
- [PASS] Security / malicious screen: No prompt injection, no credential or permission handling, no new network surface; PR body and code contain nothing addressed to reviewers.
- [PASS] Charter & value fit: Enablement keys on a serving option, not a model name (
model.rs:718-719), satisfying "keep the runtime small and model-agnostic"; driven by open priority:P1 #701, not speculative. The unapprovedScratchArenasurface is a should-fix, not a charter violation. - [WARN] Related / duplicate / conflict check: No textual conflict with #698 or #640; a real semantic interaction exists with open #640 (rank 0 with a worker + gpu compression gets a 3-way split while peer ranks without a worker get 2-way, so
compute_sm_countstays asymmetric), unmentioned in the description but not a defect in this diff. - [WARN] Tests & verification evidence: Substantive Rust unit tests (
plan_sm_splitmatrix,graph_sm_requirements, two#[ignore]d SM120 CUDA tests asserting null worker context/stream,codec_sm_count >= 8,offload_context() == codec_context, and 4096 limits on both contexts) and Python tests exist, and limitations are disclosed — but there is no old-core load/serve compatibility check (AGENTS.md:435-448,docs/verification.md:32-33), noignition export+ live serve, and no SM103/SM121 run for an SM103-observed bug.
Blockers
-
compute_coscheduled_alignmentis fabricated, which makes half of the create-time guard unsatisfiable and lets a downgraded partition pass the per-node cluster check.helios/src/runtime_core/persistent_worker.rs:454-457:partition.compute_coscheduled_alignment = actual_compute_sm .sm_coscheduled_alignment .max(group_params[compute_index].coscheduled_sm_count);group_params[compute_index].coscheduled_sm_countis set torequired_compute_coscheduled(:189) or toPREFERRED_COMPUTE_COSCHEDULED_SMS = 16, and the latter branch is only entered whenrequired_compute_coscheduled < 16(:195-200). Thereforegroup_params[compute].coscheduled_sm_count >= required_compute_coscheduledalways, so the second disjunct at:490-496(partition.compute_coscheduled_alignment < required_compute_coscheduled) can never be true. The first disjunct (actual_compute_sm.sm_coscheduled_alignment < baseline_coscheduled) is live, but only catches a drop below the baseline alignment, never a drop below the required alignment derived frommax_cluster_size— exactly the case the guard's message ("compute green context partition lost required co-scheduled SM alignment") exists for.The fabrication propagates:
prepare_graphsreadsSome(partition.compute_coscheduled_alignment)(helios/src/runtime_core/mod.rs:958) and compares it per attribute at:1087-1094. Withmin_sm_partition_size = 8,sm_coscheduled_alignment = 8and one graph declaringmax_cluster_size = 16,required_compute_coscheduled = 16; if the driver downgrades the request to an 8-SM-aligned compute resource,:490(8 < 8) and:491(max(8,16)=16 < 16) both evaluate false, the partition is accepted, and a 16-CTA cluster node then satisfiescluster_size > alignment=16 > 16= false. The PR's stated invariant ("no fallback belowmax_cluster_size") is silently defeated, and the diagnostic printed by the new tests (:3037-3040,:3592-3595) cannot distinguish requested from actual alignment.mainrecorded the driver's real value (persistent_worker.rs:265atmain:partition.compute_coscheduled_alignment = actual_compute_sm.sm_coscheduled_alignment;), so this is a regression introduced here.Fix: stop laundering the value and compare once against the real output:
partition.compute_coscheduled_alignment = actual_compute_sm.sm_coscheduled_alignment; if actual_compute_sm.sm_coscheduled_alignment < required_compute_coscheduled { return Err(invalid(format!( "compute green context partition returned co-scheduled alignment {}, below required {}", actual_compute_sm.sm_coscheduled_alignment, required_compute_coscheduled ))); }baseline_coscheduled <= required_compute_coscheduledholds by construction at:108-114, so one comparison covers both.
Should Fix
heliopausereportsmin_compute_sms >= 1andmax_cluster_size >= 1for every exported graph, voiding the documented0 = unspecifiedsentinel.heliopause/src/export/capture.rs:465-472returnsOk(1)when attribute 4 is absent, and:491-499setsmin_compute_sms = declared.min(max_cluster_size). A plain decode graph with no clustered kernels and no b12x floor therefore serialises(1, 1), so a reader can never distinguish "no floor declared" from a real 1-SM floor, nor a genuine 1-SM floor from a 16-CTA cluster's implicit 16-SM floor — contradicting the proto comment the description cites for backward compatibility (helios/proto/core.proto:251-254). The.max()fold additionally double-counts cluster size into the SM floor, andpersistent_worker.rs:108-114consumesmax_cluster_sizeindependently anyway, so the fold buys nothing. The new unit test locks the wrong behaviour in (capture.rs:5671:assert_eq!(graph_sm_requirements(&nodes[..1], 0)?, (1, 1));). Fix: return0when the attribute is absent, drop the fold (let min_compute_sms = declared_min_compute_sms;), and update the test to(0, 0)/(128, 0).- The load-time SM-floor gate silently becomes a no-op if the pinned b12x lacks the new API.
ignition/preparation/capture.py:78-83returnsnullcontext({"min_compute_sms": 0})onImportError, and this PR changes no pin (pyproject.toml:47still pinsflashinfer-pythonto rev1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e;pyproject.tomlis not inpr_files). On a rev withouttrack_capture_min_compute_sms, every graph exports floor0and the advertised rejection atmod.rs:964-980/persistent_worker.rs:137-170never fires — a silent substitution of execution behaviour, whichAGENTS.md:182-193prohibits. The companion test also importsrecord_min_compute_smsat module top (tests/preparation/test_capture_graph_metadata.py:599), so it errors rather than skips on an older pin. Fix: bump/verify the pin to a rev containing the API, and make the missing tracker a hard failure (or an explicit, named skip) instead of0. register_cooperative_planaggregates the reservation floor withmin(), so a re-registration can silently weaken it.ignition/preparation/scratch.py:163-164:self._cooperative_plans[key] = reserve_sms if prev is None else min(prev, reserve_sms). The guard at:158computesrequired = max(self._min_reserve_sms, self._parallel_reserve_sms.get(key, 0))and never includesprev, so a lowering re-registration always passes. Concretely:register_cooperative_plan(p, reserve_sms=8)records 8;register_cooperative_plan(p, reserve_sms=4)passes the guard (required == 0) and replaces 8 withmin(8, 4) = 4; a correctly annotatedregister_parallel(p, q, reserve_sms=6)then raises. A floor must be monotone; every other aggregate in the class usesmax(:135,:186-187). Not exercised bytests/preparation/test_scratch.py:548-584. Fix:self._cooperative_plans[key] = max(prev or 0, reserve_sms).docs/runtime-core-design.md:654-696now contradicts the shipped behaviour. The section — which #709 itself rewrote — is scoped to "When a single-rank core declares an entry inExecution.persistent_workers" and lists only "two groups … or three groups … when prefix-cache offload is enabled with--lossless-kv-compression gpu". The PR makes a 2-way(codec, compute)split with no worker entry the shipped default for every non-worker core (model.rs:718-733,mod.rs:386-396), a topology that document says does not exist.docs/prefix-cache-offload.md:59-66andhelios/manifest.md:111-135were updated; this file was not, andAGENTS.md:228names it as the required doc for Protobuf/core-loading changes. Also stale: theGraphrow atdocs/core-format-design.md:222, which enumerates the record's fields and now omits the two fields Helios reads at load. Fix: update both.- The public single-rank loader hardcodes
reserve_codec_partition = false, so codec isolation and both new bounds are skipped on that path.mod.rs:335(prepare_kernels(..., None, false)— the explicitfalseis added by this PR) andmod.rs:342-344(initialize→initialize_with_options(.., false)), reached fromNativeResources::load(:208),load_any(:232),load_selected(:269) andPayloadAuthorizedCore::load(protection.rs:2836). For a codec-enabled non-worker core loaded there,primary_contextisfalse(:386),green_partitionstaysNone(:793), every graph instantiates onself.context(:962),offload_context()falls back to the base context (:1511-1516), and neithermin_compute_sms(:964-980) nor the cluster check (:1067-1096) is applied — silently. The main serving path is correct (model.rs:729-733,:859-867), and no production caller of theload_preparedpath was found (onlyevent_tests.rs:19,helios/tests/tools/test_{fixed_,}runtime_core.rs, and in-module tests), which is why this is not a blocker. Fix: thread the flag (or aLoadOptions/KvCompressionargument) throughload_prepared/initialize/PayloadAuthorizedCore::load, or fail closed when a core needs codec SMs and the flag is absent.
Subtract / Simplify
resolve_reserve_sms(..., plan=...)is provably a no-op — delete the kwarg and_parallel_reserve_sms.ignition/preparation/scratch.py:137-146:floor = self.reserve_sms_floorismax(self._min_reserve_sms, self._max_parallel_reserve_sms), and every_parallel_reserve_sms[key]is assignedmax(..., reserve_sms)in lockstep with_max_parallel_reserve_sms = max(..., reserve_sms)(:186-187), soper_plan <= _max_parallel_reserve_sms <= flooralways andmax(floor, per_plan) == floor. The body reduces toreturn max(requested, self.reserve_sms_floor). The test that appears to cover it (tests/preparation/test_scratch.py:559) cannot distinguish the branch becauseregister_parallel(plan_a, plan_b, reserve_sms=4)at:556already raised the arena-wide max to 4.- Split out or drop the whole
ScratchArenasurface until it has a consumer.register_cooperative_plan,require_reserve_sms,resolve_reserve_sms,reserve_sms_floor, andmin_reserve_smsappear only inignition/preparation/scratch.py:59-188andtests/preparation/test_scratch.py:548-607; no recipe, component, or preparation path calls them, anddocs/core-design.md:821/docs/preparation-development.md:256still describeregister_parallelas byte sizing only.AGENTS.md:167-169("Hypothetical future consumers … do not establish a need") and:188-193("Do not present scaffolding or partially wired features as supported") apply directly, and 139 lines of it ride with a CUDA fix. - The cluster-dimension decode is written twice, with a magic
4on only one side. Export uses a named constant and helper (capture.rs:462-489); load re-implements the identical parse with a bare literal athelios/src/runtime_core/mod.rs:1067-1078— same attribute id, same three-u32 layout, samemax(1)product, same overflow message. Move one decode next to thewire::Attributetype and call it from both. - Duplicated Green Context API guard.
mod.rs:387-396rejects the missing-driver case beforepersistent_worker::createcan run, so theok_or_elseatpersistent_worker.rs:255-261with the same message is unreachable from the load path. Keep one. - Two identical passes over
core.graphs.mod.rs:795-808walks the graph list twice, once per field; onefold((0, 0), ..)or aCore::graph_sm_requirements()returning(u32, u32)(mirroring the identically shaped export-side helper) collapses them. (Option<u32>, bool)encodes an unrepresentable-but-checked state.persistent_worker.rs:85-91and:247-254both take five positionals, forcing the reject check at:96-100, theSome(0)check at:101-105, and theunreachable!()arm at:157. APartitionRequestenum (Worker(u32) | Codec | WorkerAndCodec(u32)) makes all three illegal states unrepresentable and collapses two arguments into one along theinitialize_with_options → prepare_kernels → createpath.
Nits
mod.rs:1079-1086fails a graph whose decodedcluster_size > avail_sms, butmin_compute_sms = declared.max(max_cluster_size)(capture.rs:498) means the earlier check at:964-980already fires for any core this PR's exporter produces; the per-node SM comparison is reachable only for legacy cores with floor0. A comment (or a single field comparison againstgraph.max_cluster_size) would say so."; use --lossless-kv-compression cpu"is spelled out at five sites (mod.rs:394,:972,persistent_worker.rs:259,:348,:480) and substring-matched in three tests (persistent_worker.rs:1251,:1283,:3569); oneconstwould keep them consistent.ScratchArena("cpu", overlap=False, min_reserve_sms=4)validates and then discards the argument (scratch.py:59-63vs:116-117), asymmetric withrequire_reserve_sms, which raises in serial mode (:126-127). Reject a nonzeromin_reserve_smswhenoverlapis false.release_preparation()clears the plan dicts but leaves_min_reserve_sms/_max_parallel_reserve_sms, soreserve_sms_floorsurvives release (scratch.py:231-235); harmless but half-reset.RecordedExportGraph.min_compute_sms(runtime_core.py:184-188) is a second storage channel populated only by tests (test_capture_graph_metadata.py:637); production uses the_flare_min_compute_smsattribute (capture.py:245).
Dropped on verification
- "Graph-contract owner approval is missing" — dropped.
docs/design-review.md:22-26gates approval on a new operation contract; these are two scalar metadata fields on an existingGraph/GraphIndexrecord with unchanged node/edge/parameter encoding, which the same clause allows as a shape/capacity variant.pr_filesconfirmscore.protois exactly +4/−0 andruntime_core.proto+4/−0. - "
cuDevResourceGenerateDeschandles leak on every failure path" — dropped as a defect claim.create()'s cleanup atpersistent_worker.rs:545-552destroys streams and green contexts but not descs; however nocuDevResourceDescDestroybinding exists inhelios/src/runtime_core/driver.rsbefore or after this PR, so this is a pre-existing driver-surface gap, not a regression introduced here. - "
max_cluster_sizeis never captured or plumbed from Python" — false.heliopause/src/export/capture.rs:3438-3439derives it from the exported graph's own kernel node attributes, which is authoritative; a Python-declared value would be redundant. - "
resolve_reserve_smsignoring cooperative declarations is a Major fail-open" — downgraded out. The docstring matches the behaviour ("at leastrequestedand any active overlap SM floor") and there is no in-repo consumer; the no-op body is filed as a subtraction instead. pr_diffover-attribution (host_vmm,async_transfers,Capacity::DEVICE_POOL,EngramTable.Encoding.BF16,EngramHash.Method.IDENTITY,pool_vram_limit) is stale-base drift from already-merged #711/#658/#708, not content of this PR; every finding above is reconciled againstpr_filesand the actual per-file deltas.- "The change reverses #532's
split_sm_groupsdeletion recommendation" — dropped. That was a design opinion in a prior review, not a recorded invariant, and the extension is coherence-preserving. - "Should have run TLA+/
check.py" — not applicable. This PR touches no admission, fence, generation, cancellation, speculation-accounting, compaction/snapshot-alias, offload-aggregation, readiness, or rank-coordination path; green-context creation/teardown are resource-lifetime paths. - "Missing Kani/mutation testing" — dropped from findings. The new arithmetic guards have direct unit coverage for both accept and reject (
persistent_worker.rs:3550-3571,capture.rs:5633-5673);docs/verification.md:21-23permits a contained edit with adequate existing coverage to stand without new machinery. The old-core compatibility gap is real and is stated under Pre-merge Checks rather than as a code finding. - Open #640 interaction, the raw
CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION = 4literal, and#[ignore]withoutFLARE_RUN_CUDA_TESTSgating — reviewed and dropped as non-defects: #640 has no textual conflict and its own review already owns that hazard; the literal sits beside the pre-existing raw-idKERNEL_ATTRIBUTESlist (capture.rs:462); the ignore strings name the requirement and the tests were run explicitly with--ignored. - No prompt-injection content was found in the PR description, comments, or changed code; nothing in the reviewed material attempted to direct my actions.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 100.0% -
triage:design-review: 0.0% -
none: 0.0% -
triage:validation: 0.0% -
triage:integration: 0.0% -
triage:partial: 0.0% -
triage:investigate: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Apply labels
No label changes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
Final review
Recommendation: Changes Requested
The 2-way (codec, compute) Green Context generalization is a well-scoped, model-agnostic continuation of #709 / #701, and its plan_sm_split arithmetic, cluster-dimension 3D product checks, proto field numbering, and ScratchArena weakest-link (min) reservation tracking are sound. However, two verified blockers must be resolved before merge: (1) the PR depends on unpinned b12x APIs from companion local-inference-lab/flashinfer#217, which will break the new test_capture_graph_metadata.py test on the pinned revision and silently turn min_compute_sms capture into a no-op via except ImportError; and (2) GreenContextPartition::create launders actual_compute_sm.sm_coscheduled_alignment with .max(group_params[compute_index].coscheduled_sm_count), rendering the post-creation alignment guard unconditionally dead and masking driver downgrades in load-time cluster validation. One normative-doc contradiction (docs/runtime-core-design.md) should also be updated alongside the code.
Merge Risk
Level: Medium
- Unpinned external dependency (
pyproject.toml:47): Clean checkouts and CI pinned toflashinfer-pythonrev1441ce86(from#707/ FlashInfer#213) lackb12x._lib.utils.device.{track_capture_min_compute_sms, record_min_compute_sms}, breaking the new unit test at import time and silently zeroingmin_compute_smsduring capture. - Fleet-wide behavioral change on
--lossless-kv-compression gpu: Every rank of every core (including standard non-worker and multi-rank cores) now retains the primary CUDA context, reserves one aligned codec partition (e.g., 8 SMs on SM103/SM120), and enforces fail-closed load checks for Green Context API availability,min_compute_sms, and kernel cluster dimensions. - Hardware coverage gap: The motivating bug (
#701) was observed on SM103 under live multi-request serving, whereas validation consists of#[ignore]d SM120 component tests without fullignition export+flare run --lossless-kv-compression gpuor SM103/SM121 execution (disclosed in the PR's Limitations).
Walkthrough
- Per-graph SM-budget manifest fields (
helios/proto/{core,runtime_core}.proto,heliopause/src/export/{mod,capture,core}.rs,ignition/preparation/{capture,runtime_core,runtime_core_pb2}.py,helios/src/runtime_core/{format,protobuf,metadata,describe,protection,selection}.rs,helios/src/core/*.rs): Adds additive proto3 fieldsuint32 min_compute_sms = 7anduint32 max_cluster_size = 8(0 = unspecified) onGraphandGraphIndex, wrapscapture_forwardsinb12x._lib.utils.device.track_capture_min_compute_sms(), and computes per-graph(min_compute_sms, max_cluster_size)fromCU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION(4) merged with the declared floor inheliopause/src/export/capture.rs:463-500, 3438-3449. - 2-way
(codec, compute)and 3-way(worker, codec, compute)Green Contexts (helios/src/runtime_core/{persistent_worker,mod,model}.rs): Generalizesplan_sm_splitandGreenContextPartition::createfromu32toOption<u32>worker SMs withmin_compute_sms/max_cluster_sizebounds and no fallback belowmax_cluster_size; addsNativeResources::initialize_with_optionsinvoked frommodel.rs:718-733whenever offload +KvCompression::Gpuis active; enforces per-graphmin_compute_smsand per-node cluster size / co-scheduled alignment inprepare_graphs(mod.rs:943-980, 1067-1096); guards nullworker_context/worker_streamon setup and teardown. ScratchArenacooperative SM reservation contract (ignition/preparation/scratch.py,tests/preparation/test_scratch.py): Addsmin_reserve_sms,reserve_sms_floor,require_reserve_sms,resolve_reserve_sms,register_cooperative_plan, andregister_parallel(..., reserve_sms=)with bidirectional fail-closed validation for companionhyperflare-recipes#157.- Docs & tests (
docs/prefix-cache-offload.md,helios/manifest.md,helios/src/runtime_core/persistent_worker.rs,heliopause/src/export/capture.rs,tests/preparation/{test_scratch,test_capture_graph_metadata}.py): Updates offload and manifest docs for the 2-way(codec, compute)topology and adds CPU unit tests plus an#[ignore]d SM120 2-way GPU codec concurrency test.
Pre-merge Checks
- [PASS] Security / malicious screen: No prompt-injection or instruction-like content; kernel attribute buffer length is validated to 64 bytes (
helios/src/runtime_core/format.rs:592) before indexingbytes[0..12](mod.rs:1068-1070);Discord: lukealonsopresent. - [WARN] Charter & value fit: Core change is a model-agnostic, root-cause completion of P1
#701, and the four-part PR description + limitations are complete; however, relying on unpinnedlocal-inference-lab/flashinfer#217with a silentImportError -> 0fallback violates explicit pinning and fail-closed error handling (AGENTS.md:184-186), anddocs/runtime-core-design.md:654-696is left contradicting the new topology. - [PASS] Related / duplicate / conflict check: Genuinely additive over merged
#709(which covered persistent-worker cores only); note semantic interaction with open#640(rank 0 worker+codec 3-way vs peer rank 2-way yields asymmetriccompute_sm_countacross ranks) and textual overlap with open#314on proto/capture files (informational only). - [WARN] Tests & verification evidence: Substantial CPU suites and SM120
#[ignore]d CUDA tests reported, buttest_capture_forwards_records_min_compute_sms_and_emits_only_when_nonzeroimports an unpinnedb12xsymbol (test_capture_graph_metadata.py:599), no legacy wire-bytes decode test for omitted fields 7/8 was added, and SM103 / end-to-endflare run --lossless-kv-compression gpuremains unrun (disclosed).
Blockers
-
Unpinned
flashinfer#217dependency breaks the new Python test on pinned checkouts and silently disablesmin_compute_smscapture (pyproject.toml:47,ignition/preparation/capture.py:78-83,tests/preparation/test_capture_graph_metadata.py:599)pyproject.toml:47is unchanged and still pinsflashinfer-pythontorev = "1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e"(landed in#707for FlashInfer#213), which predates companionlocal-inference-lab/flashinfer#217.tests/preparation/test_capture_graph_metadata.py:599unconditionally runsfrom b12x._lib.utils.device import record_min_compute_sms, which will fail withImportErroron the pinned revision.ignition/preparation/capture.py:78-83wrapsfrom b12x._lib.utils.device import track_capture_min_compute_smsinexcept ImportError: return nullcontext({"min_compute_sms": 0}), silently degrading exportedmin_compute_smsfloors to0on the pinned revision instead of failing closed (AGENTS.md:184-186).- Fix: Merge
local-inference-lab/flashinfer#217, bumppyproject.toml:47to pin the merged commit, and remove the silentexcept ImportErrorfallback inignition/preparation/capture.py:78-83(or raise an explicitRuntimeError/ImportErroridentifying the requiredflashinfer-pythonrevision).
-
compute_coscheduled_alignmentis overwritten with.max(group_params[compute_index].coscheduled_sm_count), making the post-creation alignment guard dead and defeating load-time cluster validation on driver downgrade (helios/src/runtime_core/persistent_worker.rs:359-369,:455-457,:490-496;helios/src/runtime_core/mod.rs:958,:1087-1094)- At
persistent_worker.rs:359-362,group_params[compute_index].coscheduled_sm_count < required_compute_coscheduledalready returnsErr, andgroup_paramsis never modified afterward (whilecompute_split.sm_coscheduled_alignmentis only checked againstbaseline_coscheduled, notrequired_compute_coscheduled). - At
:455-457,partition.compute_coscheduled_alignmentis assignedactual_compute_sm.sm_coscheduled_alignment.max(group_params[compute_index].coscheduled_sm_count). Becausegroup_params[compute_index].coscheduled_sm_count >= required_compute_coscheduledis already guaranteed after:360, the checkpartition.compute_coscheduled_alignment < required_compute_coscheduledat:491is unconditionally dead code. - Downstream,
prepare_graphs(mod.rs:958,:1087-1094) validates kernelcluster_size <= partition.compute_coscheduled_alignment. In#532on SM103,cuGreenCtxGetDevResourcereportedactual_compute_sm.sm_coscheduled_alignment == 16directly without.max(...). Taking.max(group_params[compute_index].coscheduled_sm_count)masks any case where the driver returns a lower actual alignment (e.g.,8when16was required formax_cluster_size = 16), silently passing oversized 16-CTA cluster nodes through load-time validation and printing the requested rather than actual alignment in test output (:3782). - Fix: Assign
partition.compute_coscheduled_alignment = actual_compute_sm.sm_coscheduled_alignmentdirectly, and checkcompute_split.sm_coscheduled_alignment < required_compute_coscheduled(:359) andactual_compute_sm.sm_coscheduled_alignment < required_compute_coscheduled(:490). (If SM120's driver genuinely reports8inactual_compute_sm.sm_coscheduled_alignmenteven when a 16-SM co-scheduled group was granted, verify whether SM120 actually honors 16-CTA clusters in that partition and remove the dead:491check rather than laundering the reported alignment through.max().)
- At
Should Fix
- Update contradicted normative design docs (
docs/runtime-core-design.md:654-696,docs/core-format-design.md:222)docs/runtime-core-design.md:654-696still scopes Green Context partitioning solely to single-rank cores declaringExecution.persistent_workersand enumerates only 2-way(worker, compute)and 3-way(worker, codec, compute)topologies, contradicting this PR's fleet-wide 2-way(codec, compute)split for standard and multi-rank cores and omitting the newmin_compute_sms/max_cluster_sizeload-time validation.docs/core-format-design.md:222lists theGraphrecord fields without the new optionalmin_compute_smsandmax_cluster_sizebounds.- Fix: Update
docs/runtime-core-design.md:654-696to cover all three partition topologies (including non-worker and multi-rank cores under--lossless-kv-compression gpu) and the SM-floor/cluster checks, and addmin_compute_sms/max_cluster_sizeto theGraphrow indocs/core-format-design.md:222.
Subtract / Simplify
- Drop the no-op
plan=branch inScratchArena.resolve_reserve_smsand deduplicate the 5× validation check (ignition/preparation/scratch.py:62-63,:122-123,:137-146,:150-151,:174-175): Every write toself._parallel_reserve_sms[key]also updatesself._max_parallel_reserve_smsviamax(:186-187), andself.reserve_sms_floorreturnsmax(self._min_reserve_sms, self._max_parallel_reserve_sms)(:118). Thus_parallel_reserve_sms.get(id(plan), 0) <= self.reserve_sms_flooralways holds, making lines:144-145a provable no-op (keep_parallel_reserve_smsitself, asregister_cooperative_planuses it at:158for per-plan checks). Also extract a single_validate_reserve_sms(value, name="reserve_sms")helper for the five identicaltype(...) is not int or < 0checks. - Replace
(Option<u32>, bool)with an enum inplan_sm_split/GreenContextPartition::create(helios/src/runtime_core/persistent_worker.rs:85-105,:157,:247-254): APartitionRequestenum (Worker(NonZeroU32),Codec,WorkerAndCodec(NonZeroU32)) makes(None, false)and(Some(0), _)unrepresentable, removes two error checks (:96-105) andunreachable!()(:157), and collapses two separate arguments threaded throughmod.rs. - Deduplicate cluster-dimension attribute parsing (
heliopause/src/export/capture.rs:463-489andhelios/src/runtime_core/mod.rs:1067-1078): Both sites parseCU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION(4) with identical 12-byte(cx, cy, cz)unpacking,.max(1)product, and overflow error, withmod.rs:1067using bare literal4. Share one named constant/helper. - Collapse duplicate
core.graphsfolds and repeated CPU-fallback hint (helios/src/runtime_core/mod.rs:795-808,:394,:972;persistent_worker.rs:259,:348,:480): Compute(min_compute_sms, max_cluster_size)in a singlefoldovercore.graphs, and share aconst CPU_CODEC_HINT: &str = "; use --lossless-kv-compression cpu";. - Drop unused
RecordedExportGraph(..., min_compute_sms=...)dual channel (ignition/preparation/runtime_core.py:184-188,:299-301):capture.py:244-245always attaches_flare_min_compute_smsdirectly on the returned graph, so the constructor kwarg is only used bytests/preparation/test_capture_graph_metadata.py:637-644.
Nits
ignition/preparation/scratch.py:231-235:release_preparation()clears_parallel_reserve_smsand_cooperative_plansbut leaves_min_reserve_smsand_max_parallel_reserve_smsintact, soarena.reserve_sms_floorstill returns the old floor after release (reset both to0or guardreserve_sms_floorwithself._require_active()).helios/manifest.md:146: still says "destroys both green contexts" next to the updated 2-way/3-way wording on lines114-135-> "destroys all created green contexts".docs/core-design.md:821anddocs/preparation-development.md:256: still describeScratchArena.register_parallelas workspace sizing only.helios/proto/{core,runtime_core}.proto&heliopause/src/export/capture.rs:465-500: note in the proto comment or PR description that newly exported graphs with unclustered kernel nodes emit(min_compute_sms=1, max_cluster_size=1)and foldmax_cluster_sizeintomin_compute_sms, while0represents legacy/unspecified or kernel-free graphs.helios/src/runtime_core/protobuf.rs: add a small wire-decode test confirming serializedGraphIndex/payload::Graphbytes omitting fields 7 and 8 decode to(0, 0).
Dropped on verification
- "
register_cooperative_planusesmin(prev, reserve_sms)instead ofmax, weakening the floor" (ignition/preparation/scratch.py:163-164): Disproved._cooperative_plans[key]tracks the guaranteed SM headroom provided by a plan's cooperative kernels (checked viadeclared < requiredat:131and:179). When multiple cooperative ops register on one plan (e.g., 8 and 4), the safe headroom across all ops is the weakest linkmin(8, 4) = 4; changing tomaxwould mask under-reserved kernels and allow deadlocks. - "
resolve_reserve_smsignores_cooperative_plans" (ignition/preparation/scratch.py:137-146): Disproved.resolve_reserve_smscomputes the required overlap floor before a cooperative plan registers its reservation; reading_cooperative_planswould conflate prior voluntary reservations with overlap demand. - "
cuDevResourceGenerateDeschandles leak on partial failure inGreenContextPartition::create" (helios/src/runtime_core/persistent_worker.rs:370-392): Disproved. The CUDA Driver API has no destroy/free function forCUdevResourceDesc(neither incuda.h(not opened) nor indriver.rs:173-193); descriptors are never destroyed on the success path either. - "
NativeResources::load_prepared/PayloadAuthorizedCore::loadhardcodereserve_codec_partition = false, skipping codec isolation" (helios/src/runtime_core/mod.rs:335,:342-344): Disproved. Those entry points are standalone single-rank raw core loaders with noLoadOptionsand no prefix-cache offload or GPU codec; persistent-worker cores still initialize green contexts (wants_worker.is_some()), and serving with offload flows throughNativeModel::load_agreeing(model.rs:718-734,:859-867), which passesreserve_codec_partitionon every rank including payload cores. - "
min_reserve_smsaccepted and ignored whenoverlap=Falseis a bug" (ignition/preparation/scratch.py:59-63,:116-117): Intentionally designed and pinned bytests/preparation/test_scratch.py:588-591so callers can passScratchArena(device, overlap=cfg.overlap, min_reserve_sms=4)without branching. - "
_parallel_reserve_smshas no other reader and can be deleted": Disproved.register_cooperative_planreadsself._parallel_reserve_sms.get(key, 0)atignition/preparation/scratch.py:158for per-plan checks (only the lookup insideresolve_reserve_sms:144-145is a no-op). - "
model.rsgating change allows cores withoutgpu_moduleto reserve codec SMs": Disproved.helios/src/runtime_core/model.rs:663-669rejects any core lacking an embedded GPU codec module whencompression == KvCompression::Gpubefore line718is reached (and#709commite899a4fealready made that cleanup). - "Unapproved captured-graph op-family addition and missing Kani harness gate violation": Disproved. Additive scalar metadata fields (
min_compute_sms,max_cluster_size,0 = unspecified) onGraph/GraphIndexdo not add a captured-graph operation family (docs/design-review.md:22-25), and no Kani harnesses exist forpersistent_worker.rsorheliopause(#[kani::proof]covers onlyasync_transfer,model, andoutput/tagged). - "
ScratchArenaviolates Charter 'hypothetical future consumer' rule": Overstated. In Flare's multi-repo layout (docs/design-review.md:42-46),ignition/preparation/*is the library consumed bylocal-inference-lab/hyperflare-recipes(matching#709'scodec_layoutprecedent), andhyperflare-recipes#157is an active companion PR. - "Recording
(1, 1)for unclustered kernels ingraph_sm_requirementsis a defect" (heliopause/src/export/capture.rs:465-500): Explicitly tested (capture.rs:5671) and behaviorally identical to(0, 0)at load time (coscheduled >= 2,avail_sms >= 1); downgraded to a documentation Nit. - "Stale-base
pr_diffhunks (AsyncTransfer,ExternalExtentTable,Capacity::DEVICE_POOL,Engram*,.github/workflows/*)": Artifacts of stale diff base already merged onmain; reconciled againstpr_files(27 files, +1438/−285).
Full report Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 99.9% -
triage:design-review: 0.0% -
triage:integration: 0.0% -
none: 0.0% -
triage:validation: 0.0% -
triage:partial: 0.0% -
triage:investigate: 0.0% -
triage:superseded: 0.0% -
triage:verify-for-closure: 0.0%
Apply labels
No label changes