#1 [high] PR #581 ground truth (verified myself at head 61f64f1 / main)
PR #581 "ignition: set USE_NODE_PRIORITY flag on exported CUDA graphs", FujitsuPolycom (CONTRIBUTOR), perf/ignition-export-use-node-priority -> main, head 61f64f18e06cdcb9de76c33765584a97752f3953, base main 167f22c8. +137/-7, 3 files: ignition/preparation/runtime_core.py (+38/-1), tests/preparation/test_capture_graph_metadata.py (+96/-3), tests/preparation/test_recorded_export_graph_cuda.py (+3/-3). No CI checks configured. voipmonitor (priority reviewer) = CHANGES_REQUESTED 2026-11-28 22:13, with his own live SM120 run: CPU suite 12 passed; FLARE_RUN_CUDA_TESTS=1 test_recorded_export_graph_cuda.py -> 1 passed (3.29s), flags_by_name == {"decode": 9, "tune": 1}. Only other comment is a flare-autobot case-file notice (not a finding).
Single production behaviour change: record_export_graph now (a) queries cuGraphExecGetFlags on the freshly instantiated executable, (b) sets graph._flare_instantiation_flags = prior | 8, so _graphs emits {name, graph(template), instantiate_flags} instead of {name, graph, executable}.
Facts I verified myself:
- Sole production caller: capture.py:193
graph = record_export_graph(graph, warmup_storage, owners=(function,)), reached only when exporting = retain_graphs and warmup_storage is not None (capture.py:170), and that path allocates torch.cuda.CUDAGraph(keep_graph=True) (capture.py:171). grep for record_export_graph/_flare_instantiation_flags: only capture.py:18/193, runtime_core.py:208/242/282, and tests. - Downstream already accepts bit 8 on MAIN (pre-PR):
flags & !9at heliopause/src/export/capture.rs:589 and :2823, helios/src/runtime_core/format.rs:495 (all three verified at ref main). So bit 8 is not a new wire value, and the Architecture lens's "no compatibility statement for the other direction" is weak — previous engine versions already accept 9, and existing flags=1 cores still pass. DROP that sub-claim; keep only the duplication half. - Pre-PR, unsupported executable flags ALSO hard-failed, just later: capture.rs:589 rejects record_graph on
flags & !9 != 0, and capture.rs:788-794 feeds executable_flags() when instantiate_flags is None. So the Correctness lens's "compatibility regression on drivers that set bit 2" is overstated — the rejection predates the PR, only the moment/message changes. Use this to argue the record-side guard is redundant (supports the subtractive option). - Helios really consumes the field: helios/src/runtime_core/mod.rs:1215-1219 cuGraphInstantiateWithFlags(&mut executable, handle, graph.flags). So recording 9 changes instantiation, not just metadata.
- Export template cannot contain allocation/free nodes: heliopause capture.rs:607-679 maps node kinds 0 kernel, 1 copy, 2 memset, 5 empty, 6 event-wait and rejects everything else ("unsupported CUDA graph node type {kind}"). Kinds 3/4 (alloc/free) never survive export -> AUTO_FREE_ON_LAUNCH(1) has no allocation node to free at replay. Caveat: node kinds 5/6 DO exist, so the Subtract lens's "exactly three node kinds" wording is imprecise; the conclusion (no alloc nodes) still holds.
- cuda-python==13.3.1 pinned (pyproject.toml:26) and the repo's own driver pattern is
from cuda.bindings import driver as cuda(capture.py:43-47, scratch.py:88-102). - _Cuda instances: core_storage.py:76 and virtual_storage.py:27 keep one per storage; runtime_core.py:204 constructs
_Cuda()per exported graph (CDLL/WinDLL in _Cuda.init, runtime_core.py:77-78). - Docs already specify the mechanism: docs/runtime-core-design.md:623 "instantiate each graph with its recorded flags"; docs/core-format-design.md:220 names instantiation flags in the Graph record. No doc change owed.
- Tests: tests/preparation/test_runtime_core.py:18-37 already covers _graphs flag acceptance/rejection for flags 0/1/8/9 and rejection of -1/True/2/4/16/1.0 with match="instantiation flags".
- Charter/AGENTS hooks that matter: AGENTS.md:188-193 (no extension points/config switches without concrete requirement), :194-199 (mocks cannot establish runtime correctness), docs/design-review.md:187-189 ("validate rejection without partial mutation"), :153-155 (before/after, expected vs measured), :116-123 (core compat), charter "Bring real evidence ... benchmarks over main on a served workload (#210)", "Be explicit and pin everything. No magic defaults".
Lens claims I am DROPPING as refuted or stale:
- "The only real-CUDA assertion is skipped in the PR's own evidence run" (Architecture S3, Conventions #4, Correctness #3) — voipmonitor ran it live on SM120 in the latest comment and it PASSED ({"decode": 9, "tune": 1}), which also verifies the real cuGraphExecGetFlags FFI. Reduced to a note, not a candidate; the residual fact is only that CI never runs it (opt-in FLARE_RUN_CUDA_TESTS=1, test file line 14).
- Architecture S2's "optional core-format doc/compat statement missing / older engines reject 9" — contradicted (main's validators already accept !9).
- Correctness #1's "export regression on drivers setting bit 2" — the pre-PR path rejected the same bits downstream (capture.rs:589).
- Subtractive #2's "node kinds are exactly 0/1/2" — kinds 5 and 6 also exist (capture.rs:667-678); the bit-1 argument survives but must be stated as "no allocation/free nodes".
- No CI-red/setup-java/runner-infra notices exist for this PR, and no claim about files outside the diff survived.
#2 [high] BRIEF §Key findings + §Candidate Blockers (verified quotes)
TITLE: CANDIDATE BRIEF §Key findings + §Candidate Blockers (PR #581)
KEY FINDINGS (5 bullets, deduped across 6 lenses)
- One real production change: record_export_graph queries cuGraphExecGetFlags on the freshly instantiated executable and records
prior_flags | 8, so_graphsemits{name, graph(template), instantiate_flags}instead of{name, graph, executable}. Helios genuinely consumes it:cuGraphInstantiateWithFlags(&mut executable, handle, graph.flags)(helios/src/runtime_core/mod.rs:1215-1219), and heliopause already accepted bit 8 on main (flags & !9at heliopause/src/export/capture.rs:589, :2823 and helios/src/runtime_core/format.rs:495, all verified at ref main). So the wire value is not new and old flags=1 cores still load. - The disputed judgment call is scope, not correctness: bit 8 is turned on for EVERY exported serving graph by a Python default, with no served-workload measurement (charter: "Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)"; "Be explicit and pin everything. No magic defaults"). voipmonitor (priority reviewer, CHANGES_REQUESTED) raises the mechanism: the flag activates CTA preemption for every kernel captured on the overlap stream.
- Around that one line the PR ships an unused keyword (
instantiation_flags), its None/0 branches, a record-side guard that duplicates a guard already present in_graphsand twice in Rust, and ~79 duplicated test lines. The subtractive version isgraph._flare_instantiation_flags = 8(plus optionally the OR), i.e. +2 lines. - The PR description misstates its own behaviour in two places (executable-derived rejection happens after mutation; the None mode's "startup tuning graphs" caller does not exist), which voipmo independently flagged.
- Evidence that survives: the real FFI and the {decode:9, tune:1} mapping WERE verified on SM120 by voipmonitor in the latest comment (1 passed, 3.29s), so lenses that called that assertion "skipped/unverified" are stale — the residual fact is only that CI never runs it (opt-in FLARE_RUN_CUDA_TESTS=1).
CANDIDATE BLOCKER B1 — USE_NODE_PRIORITY is default-on for every exported serving graph, with no served-workload evidence Sources: Architecture B1 (blocking); voipmonitor review Major 1; Correctness #3-unmeasured; Subtractive #1 (partial). Merged, framed as architecture/policy rather than test nit.
ignition/preparation/runtime_core.py:208-214
208 def record_export_graph(
209 graph,
210 storage,
211 *,
212 owners=(),
213 instantiation_flags=CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY,
214 ):
ignition/preparation/runtime_core.py:236-243
236 graph.retain_object((pools, tuple(owners)), synchronize_before_release=True)
237 instantiate_graph(graph)
238 if instantiation_flags is not None:
239 prior_flags = _executable_instantiation_flags(graph)
240 if prior_flags & ~PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS:
241 raise ValueError("captured graph executable carries unsupported CUDA instantiation flags")
242 graph._flare_instantiation_flags = prior_flags | instantiation_flags
243 return graph
Blast radius — ignition/preparation/capture.py:168-171 and :192-197
170 exporting = retain_graphs and warmup_storage is not None
171 graph = torch.cuda.CUDAGraph(keep_graph=True) if exporting else capture_graph(retain_graphs=retain_graphs)
...
192 if exporting:
193 graph = record_export_graph(graph, warmup_storage, owners=(function,))
i.e. every graph of every recipe on every parallel layout (this is the serving-catalog export path).
The only in-repo source of non-default priority — ignition/preparation/scratch.py:88-101
88 from cuda.bindings import driver as cuda
90 # PyTorch's round-robin stream pool can alias a later capture stream.
91 # Highest stream priority lets small collective kernels preempt main-stream GEMMs.
92 with torch.cuda.device(self.device):
93 pstatus, _least, greatest = cuda.cuCtxGetStreamPriorityRange()
94 if pstatus == cuda.CUresult.CUDA_SUCCESS and greatest < 0:
95 status, handle = cuda.cuStreamCreateWithPriority(
96 cuda.CUstream_flags.CU_STREAM_NON_BLOCKING, greatest
97 )
98 else:
99 status, handle = cuda.cuStreamCreate(cuda.CUstream_flags.CU_STREAM_NON_BLOCKING)
100 if status != cuda.CUresult.CUDA_SUCCESS:
101 raise RuntimeError(f"cannot create overlap stream: {status}")
Verified: grep over ignition/ finds no other priority usage (no CU_LAUNCH_ATTRIBUTE_PRIORITY, no cuLaunchKernelEx). So most graphs get a scheduling mode they never asked for, and a data-driven trigger is available (heliopause serializes kernel-node attribute id 8 and Helios replays it, capture.rs:544-569 / helios mod.rs:984-1013).
Adjudication question: is "unconditional default + no served-workload measurement" blocking (charter #210 / "no magic defaults"), or acceptable as a follow-up because the flag is backward compatible and voipmo's SM120 run passed?
CANDIDATE BLOCKER B2 — ~104 of the 144 added lines are an unused switch plus duplicated validation; the intended change is one assignment Sources: Subtractive #1 (blocking there); Architecture S1; Conventions 1 & 5; Simplicity F1/F2; Correctness #3; Prose #2. Merged. The subtractive option wins per dedup rule.
Unused modes, ignition/preparation/runtime_core.py:224-229
224 if instantiation_flags is not None and (
225 type(instantiation_flags) is not int
226 or instantiation_flags < 0
227 or instantiation_flags & ~PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS
228 ):
229 raise ValueError("graph instantiation flags may only select automatic free and node priority")
The guard already exists downstream in the same module, ignition/preparation/runtime_core.py:282-292
282 flags = getattr(graph, "_flare_instantiation_flags", None)
283 if flags is not None:
284 if type(flags) is not int or flags < 0 or flags & ~9:
285 raise ValueError("graph instantiation flags may only select automatic free and node priority")
286 result.append(dict(name=name, graph=int(graph.raw_cuda_graph()), instantiate_flags=flags))
287 continue
288 executable = int(graph.raw_cuda_graph_exec())
Verified facts: (a) the only production call site is capture.py:193 and it passes no kwarg; (b) grep confirms None is passed only at tests/preparation/test_capture_graph_metadata.py:240 and 0 only at :234; (c) the new constant is introduced but _graphs:284 still hardcodes ~9 with the identical message; (d) record-side guard cannot catch anything _graphs misses, because it stores prior | requested and _graphs re-validates the stored word on every export. AGENTS.md:188-193: "Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement."
Adjudication question: blocking churn (delete kwarg + None/0 branches + record-side guard, then the CUDA test expectation becomes 8 unless the OR is kept) vs. acceptable defensive validation at the record boundary (capture-time error is earlier/clearer than export-time).
#3 [high] BRIEF §Candidate Should Fix (S1-S5, verified quotes)
TITLE: CANDIDATE BRIEF §Candidate Should Fix (5 merged items, verified quotes)
S1 — Rejection of unsupported executable bits happens AFTER the graph is mutated, contradicting the description Sources merged: Conventions 2; Correctness 1; Prose 3; Architecture N1; voipmonitor Minor 3 (first bullet). ignition/preparation/runtime_core.py:224-243 (requested-flag check is before mutation; the executable-derived check is after)
224 if instantiation_flags is not None and (
225 type(instantiation_flags) is not int
...
229 raise ValueError("graph instantiation flags may only select automatic free and node priority")
230 pools = (storage.pool, storage.graph_pool)
...
236 graph.retain_object((pools, tuple(owners)), synchronize_before_release=True)
237 instantiate_graph(graph)
238 if instantiation_flags is not None:
239 prior_flags = _executable_instantiation_flags(graph)
240 if prior_flags & ~PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS:
241 raise ValueError("captured graph executable carries unsupported CUDA instantiation flags")
242 graph._flare_instantiation_flags = prior_flags | instantiation_flags
The new test documents the asymmetry — tests/preparation/test_capture_graph_metadata.py:244-255
244 unsupported_exec = Graph(keep_graph=True, exec_flags=2)
247 with pytest.raises(ValueError, match="unsupported CUDA instantiation flags"):
248 record_export_graph(unsupported_exec, storage, owners=(kernel_owner,))
...
250 bad = Graph(keep_graph=True)
253 with pytest.raises(ValueError, match="instantiation flags"):
254 record_export_graph(bad, storage, instantiation_flags=2)
255 assert bad.instantiations == 0 and not bad._retained.objects
i.e. the bad (requested-flag) case asserts no partial mutation; the unsupported_exec case asserts nothing about post-failure state (graph stays instantiated with owners retained, _flare_instantiation_flags unset). docs/design-review.md:187-189 requires tests that "validate rejection without partial mutation".
IMPORTANT REFUTATION to keep the adjudicator honest: this is NOT a new failure mode. Pre-PR, bit 2 was already rejected downstream (heliopause/src/export/capture.rs:589 if graph == 0 || context == 0 || flags & !9 != 0 inside record_graph, reached via capture.rs:788-794 when instantiate_flags is None). So "export regression on drivers that set bit 2" (Correctness #1) is overstated; the real defect is the ordering/claim plus missing assertions.
Fix options: assert the post-failure contract (mirroring :255) and/or document it; or reset on that path.
S2 — _flare_instantiation_flags has no invalidation path (stale flag word survives reset/re-record)
Source: Correctness 2 (should-fix, unreachable today). Corroborated by voipmonitor Minor 2 ("consider clearing any pre-existing flag when instantiation_flags=None").
State that IS invalidated on executable death — ignition/preparation/runtime_core.py:153-158
153 def release(self, executable):
154 try:
155 self.recorder.release_graph(executable)
156 finally:
157 if self.executable == executable:
158 self.executable = 0
vs. the new attribute, ignition/preparation/runtime_core.py:238-243
238 if instantiation_flags is not None:
239 prior_flags = _executable_instantiation_flags(graph)
...
242 graph._flare_instantiation_flags = prior_flags | instantiation_flags
and _graphs prefers it over the live executable, runtime_core.py:282-287 (quoted in B2).
Two holes: (a) re-record with None leaves the old attribute in place (the test at :241 only asserts absence on a fresh graph); (b) after graph.reset() + re-capture, _graphs still emits the stale word instead of reading the new executable. Not reachable from capture.py:171 (fresh CUDAGraph(keep_graph=True) per capture), hence should-fix.
Fix: graph.__dict__.pop("_flare_instantiation_flags", None) at function entry + drop it from the destroy callback registered at runtime_core.py:166.
S3 — record_export_graph accepts a keep_graph=False / _flare_graph_metadata graph, failing only later in _graphs
Source: voipmonitor Major 2 — NOT covered by any of the six lenses (Architecture explicitly declined it). I verified it myself; include so the adjudicator does not lose it.
The metadata path it must reject — ignition/preparation/runtime_core.py:246-260
251 if not retain_graphs:
252 return torch.cuda.CUDAGraph()
253 images = ModuleImages.current()
254 if images is None:
255 return torch.cuda.CUDAGraph(keep_graph=True)
256 graph = torch.cuda.CUDAGraph(keep_graph=False)
257 metadata = _RecordedGraphMetadata(images.native)
258 graph._flare_graph_metadata = metadata
259 graph.register_post_instantiate_hook(metadata.record)
and the new write it feeds — runtime_core.py:238-242 + :286 (graph=int(graph.raw_cuda_graph()), which raises once the template is released; cf. tests/preparation/test_capture_graph_metadata.py:57-59, 123-125).
Verified reachability: capture.py:171 uses keep_graph=True on the exporting branch, and the keep_graph=False graphs only reach instantiate_graph (capture.py:194-197), so today no in-repo caller hits it. It is a latent public-API hazard (fails late with a template-released error rather than up-front). Adjudicator decides whether Major-2 severity holds given unreachability; the subtractive fix in B2 does not by itself add the guard.
S4 — The preserve/combine path is only proven through a monkeypatched helper on CPU; the one real-driver test is opt-in Sources merged: Conventions 4; Architecture S3; Correctness #3-test-caveat. DOWNGRADED because voipmonitor actually ran the real test on SM120 and it passed. The monkeypatch — tests/preparation/test_capture_graph_metadata.py:107-114
107 @pytest.fixture
108 def recorder(monkeypatch):
...
113 monkeypatch.setattr(runtime_core, "_executable_instantiation_flags", lambda graph: graph.exec_flags)
so the only line that calls the driver, ignition/preparation/runtime_core.py:200-205, is exercised solely by tests/preparation/test_recorded_export_graph_cuda.py, which is gated at :14 by @pytest.mark.skipif(os.environ.get("FLARE_RUN_CUDA_TESTS") != "1", ...) and is not part of CI. Real assertion: assert flags_by_name == {"decode": 9, "tune": 1} (test_recorded_export_graph_cuda.py:85-87), which voipmonitor reports passing on SM120. Residual risk: CI cannot regress the FFI signature or the PyTorch-reports-1 assumption. Low-cost fix: one CPU test that stubs _Cuda.call and asserts the driver name/argument shape, or wire the CUDA test into a GPU CI lane.
S5 — The new driver call bypasses the pinned cuda.bindings pattern and re-opens libcuda per graph
Sources merged: Conventions 3; Simplicity F3; Correctness 4; voipmonitor Nit 4.
ignition/preparation/runtime_core.py:200-205
200 def _executable_instantiation_flags(graph) -> int:
201 """Read the CUDA instantiation bitmask recorded on a live ``CUgraphExec`` handle."""
202 executable = int(graph.raw_cuda_graph_exec())
203 flags = C.c_uint64(0)
204 _Cuda().call("cuGraphExecGetFlags", C.c_void_p(executable), C.byref(flags))
205 return int(flags.value)
Repo pattern is the typed bindings: cuda-python==13.3.1 pinned (pyproject.toml:26), used as from cuda.bindings import driver as cuda in ignition/preparation/capture.py:43-47 and scratch.py:88-102. Handles are normally long-lived: core_storage.py:76 and virtual_storage.py:27 each keep one _Cuda(); _Cuda.__init__ does CDLL/WinDLL (runtime_core.py:77-78), so this adds one dlopen per exported graph. Also _Cuda.call raises instead of returning a status, and heliopause already has the same query typed (fn executable_flags at heliopause/src/export/capture.rs:517-527).
Unverified: whether cuda.bindings 13.3.1 exposes cuGraphExecGetFlags/CUgraphInstantiate_flags under those names — the adjudicator should not assert it; if absent, keep the ctypes call and only fix the handle reuse. NIT-GRADE if B2/T2 deletes the helper entirely.
#4 [high] BRIEF §Subtract/Simplify + §Nits + §Dropped noise
TITLE: CANDIDATE BRIEF §Candidate Subtract/Simplify + §Candidate Nits + dropped noise
=== SUBTRACT / SIMPLIFY (ranked, one merged item each) ===
T1 — Delete the instantiation_flags keyword, its None/0 branches, and the record-side flag guard (~45 prod+test lines; overlaps B2, listed here as the concrete rewrite)
Sources: Subtractive 1/2/4; Simplicity F1/F2; Architecture S1.
Target shape (verified equivalent for the only caller, capture.py:193, because _graphs:282-292 is the sole reader of the attribute):
def record_export_graph(graph, storage, *, owners=()):
...
graph.retain_object((pools, tuple(owners)), synchronize_before_release=True)
instantiate_graph(graph)
graph._flare_instantiation_flags = (
_executable_instantiation_flags(graph) | CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY
)
return graph
and _graphs:284 becomes flags & ~PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS. Deletes: signature kwarg (:213), validation (:224-229), if ... is not None wrapper (:238), the duplicate prior_flags guard (:240-241) — whose detection is not lost, since the same bits are re-validated on every export at :284 — the 4-line docstring paragraph (:219-222), and the CUDA-test expectation changes to 8 if the OR also goes.
Dissent to weigh: the guard is the only place that errors at capture time with a distinct message, and ceite; voipmonitor only asked for constant reuse, not deletion.
T2 — Delete _executable_instantiation_flags and the prior | ... join: bit 1 cannot matter for an exported template
Source: Subtractive 2 (should-fix). STRONGEST SUBTRACTIVE ARGUMENT; I verified its premise.
Replay never reuses the exported executable — helios/src/runtime_core/mod.rs:1215-1219
1215 let mut executable = null_mut();
1216 driver.check(
1217 "cuGraphInstantiateWithFlags",
1218 (driver.graph_instantiate)(&mut executable, handle, graph.flags),
1219 )?;
and the export recorder rejects allocation/free node kinds, heliopause/src/export/capture.rs:607-679 — accepted kinds are 0 kernel, 1 copy, 2 memset, 5 empty, 6 event-wait; kind => return Err(invalid(format!("unsupported CUDA graph node type {kind}"))). Kinds 3/4 (alloc/free) can never appear in an exported template, so AUTO_FREE_ON_LAUNCH (=1) has no allocation node to free at replay. Result: _flare_instantiation_flags = 8 is sufficient, the FFI call (:200-205), the join (:242), and the S5 nits all disappear, and the CUDA assertion becomes {"decode": 8, "tune": 1} — still inside every !9 validator.
Caveat (mine, correcting Subtractive): node kinds 5 (empty) and 6 (event-wait) DO survive export, so the lens's "exactly 0/1/2" phrasing is wrong; only the alloc/free conclusion holds. Counter-argument for the adjudicator: preserving bit 1 is the PR's stated purpose ("without clobbering permitted flags") and costs nothing at runtime if the helper is kept.
T3 — Delete test_capture_forwards_export_sets_node_priority_instantiation_flag (45 lines): third copy of the same mock harness asserting an already-asserted value
Sources: Subtractive 3; Simplicity F5; Conventions 6. Merged.
tests/preparation/test_capture_graph_metadata.py:276-302 — it re-installs the same eight torch.cuda monkeypatches used at :179-185/:276-281, stubs capture._warmup_stream/_seed_warmup_workspaces, then asserts _graphs(graphs) == [dict(name="prefill", graph=11, instantiate_flags=expected_combined), dict(name="decode", ...)]. The same value is asserted two lines after the only writer, :215-218, and end-to-end on real CUDA at test_recorded_export_graph_cuda.py:85-87 (passing on SM120 per voipmonitor). Its only unique fact is "capture.py:193 omits the kwarg" — a pass-through that disappears with T1.
Dissent: it is the only test proving the capture→export plumbing reaches the new attribute; keep one line of it if T1 is rejected.
T4 — Collapse the three new constants / one-literal duplication (~5 lines, nit-grade) Source: Subtractive 4; Conventions 1; Prose 5; voipmonitor Nit 4; Simplicity F2. Merged into one item. ignition/preparation/runtime_core.py:192-197
192 CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH = 1
193 CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY = 8
194 PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS = (
195 CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH
196 | CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY
197 )
vs. the surviving hardcoded mask at :284 (flags & ~9) and the message duplicated verbatim at :229 and :285. After T2, AUTO_FREE_ON_LAUNCH and the mask lose their only production readers. Keep one constant with a one-line comment naming Helios's accepted set (helios/src/runtime_core/format.rs:495), and use it at :284.
=== NITS (only defensible ones kept) ===
N1 — PR description accuracy, single combined item (per the "at most 1 prose item" rule)
(a) "rejecting unsupported bits on either source before mutating graph state" is false for the executable-derived source (see S1; runtime_core.py:236-241). (b) "Passing instantiation_flags=None keeps executable-derived flags for startup tuning graphs" describes no caller: the only call site is capture.py:193 (default), and tuning graphs go through capture_graph+instantiate_graph (runtime_core.py:246-269; test_recorded_export_graph_cuda.py:62-65) and export via the plain executable form at runtime_core.py:288-292 — which is why the CUDA test expects tune: 1. (c) "Before:" describes an implementation that never shipped — on main record_export_graph recorded no flags and _graphs emitted {graph, executable} (verified at ref main, runtime_core.py main:192-206 and main:245-255); the parenthetical "(or replaced the whole flag word …)" is an abandoned alternative. (d) "Candidate 61f64f1… on main" mislabels this PR's own head commit (branch perf/ignition-export-use-node-priority) and uses an undefined lifecycle label. Cited: AGENTS.md:88-94, :103-112, :129-132; docs/design-review.md:153-155, :159-160. voipmonitor Minor 3 covers (a) and (b).
Do NOT include: the four-part structure, Discord line, and disclosure of unrun checks are all correct — the prose lens confirmed them.
N2 — _Cuda() per graph / bindings vs ctypes → folded into S5; if T2 lands it vanishes. Keep only as the one-line nit under S5, not repeated.
=== DROPPED AS NOISE (state briefly so the adjudicator knows it was considered) ===
- "Real-CUDA assertion is skipped / unverified" framing (Architecture S3, Conventions 4, Correctness 3-test-caveat): stale — voipmonitor ran
FLARE_RUN_CUDA_TESTS=1on SM120 in the latest comment, 1 passed (3.29s), flags_by_name == {"decode": 9, "tune": 1}. Only the CI gap remains (S4). - "Exported value 9 lacks a core-format/compat statement; older engines may reject" (Architecture S2): refuted — main's validators already accept
flags & !9 == 0(heliopause capture.rs:589, :2823; helios format.rs:495), and docs/runtime-core-design.md:623 already specifies "instantiate each graph with its recorded flags". Keep only the constant-duplication half (T4). - "Export regression: drivers setting DEVICE_LAUNCH=2 now hard-fail" (Correctness 1): overstated — the same bits were already rejected at heliopause capture.rs:589 pre-PR; only the timing/message changes.
- "Described
Nonepath duplicates an existing capability" (Simplicity "what was checked"): kept, but as part of T1, not a separate item. - No CI-red / setup-java / runner-infra notices exist for this PR (no checks configured at all); no claim about files outside the three changed files survived verification.
- Low-value test nitpicks dropped: the
all(value.node_count > 0 ...)widening at test_recorded_export_graph_cuda.py:87 (harmless and strictly better), theno_autofree/preserved_onlyarithmetic cases at :222-235 (they do check a distinct combination — fold into T1 rather than flag as noise), and the fixture'sexec_flags=1default at :31 (realistic value, useful). - Verified non-findings worth one line: layer placement correct (decision made on the Ignition/export side, consumed only by Helios), no per-model special case, no new captured-graph op family, old flags=1 cores load. Patch is a prompt-injection-free PR; the only bot comment is a case-file notice.
#5 [high] Research summary
I verified every surviving claim directly against the files (PR head 61f64f1, plus ref: main for pre-PR behaviour) and reduced six lenses to 12 surviving candidates, each with exact quoted code. The full brief — key findings, 2 blockers, 5 should-fix items, 4 subtractive items, 1 combined prose nit, and an explicit dropped-noise list — is in scratchpad entries 1–4; the final report should be assembled from those.
Shape of the outcome. One behaviour change exists: record_export_graph queries cuGraphExecGetFlags and records prior_flags | 8 so _graphs emits {graph, instantiate_flags} instead of {graph, executable} (runtime_core.py:208-243, :282-292; consumed for real at helios/src/runtime_core/mod.rs:1215-1219). The only production caller is capture.py:193, reached for every serving graph (capture.py:170-171). That frames the two blockers: B1 is the policy/evidence judgment call (flag 8 default-on for every exported graph with no served-workload measurement, while the only in-repo priority source is the TP overlap stream at scratch.py:88-101); B2 is the subtractive call (unused instantiation_flags kwarg, its None/0 branches and a record-side guard that duplicates _graphs:284 and the Rust validators — ~104 of 144 added lines removable, leaving one assignment).
Three lens claims I refuted rather than passed downstream, which is where most of the pre-filter value sits: (a) the "real-CUDA test is skipped/unverified" line repeated by three lenses is stale — voipmonitor ran it live on SM120 in the latest comment (1 passed, 3.29s, {"decode": 9, "tune": 1}), so only the CI gap survives; (b) "PR #581 introduces an uncommented/unverified wire value that older engines may reject" is false — flags & !9 already existed on main in heliopause capture.rs:589, :2823 and helios format.rs:495, and docs/runtime-core-design.md:623 (not opened) already specifies "instantiate each graph with its recorded flags"; (c) Correctness's "export regression on drivers setting bit 2" is overstated, since the pre-PR path rejected the same bits downstream. I also added voipmonitor's Major 2 (keep_graph=False graphs pass record_export_graph and fail later in _graphs) as S3 because none of the six lenses covered it, while noting it is unreachable from today's sole caller. Subtractive's bit-1 argument survives but I corrected its premise: node kinds 5 and 6 do reach export (capture.rs:607-679), so only the "no allocation/free nodes" conclusion holds.
#6 [high] BRIEF appendix A — verbatim governing-rule citations
Verbatim rule text the report should cite exactly (I read all of these myself).
AGENTS.md:188-193 (contribution rejection criteria) "Reject unsupported abstractions and churn. Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement. Unsolicited formatting, renaming, comment expansion, annotation sweeps, and file rearrangements are not contributions by themselves. Refactoring must directly support the requested behavior or remove a demonstrated source of defect or cost."
AGENTS.md:194-199 "Require focused, meaningful validation. Tests must exercise the affected behavior or contract; source-text checks and mocks that bypass the behavior cannot establish runtime correctness. Do not present scaffolding or partially wired features as supported. Identify missing hardware, inputs, and unrun checks explicitly. Keep each PR focused on one coherent outcome and describe its problem, resulting behavior, validation, and material limitations."
AGENTS.md:88-94 (part 2 of the required description) "Make the before/after explicit: what is replaced, removed, or added, and how the resulting path works. Do not describe both behaviors in the same tense and leave the reader to infer the transition. Identify material numerical, compatibility, and resource-lifetime changes."
AGENTS.md:103-109 (part 4) "Connect each material claim to the relevant checks or measurements: the behavior tested, baseline or reference, configuration, result, and limits of the conclusion. State what remains untested or inconclusive."
AGENTS.md:129-132 "Remove process assurances that add no technical evidence. Statements that source "matches the tested implementation," work was reviewed, or a branch is ready do not explain behavior or establish correctness."
docs/design-review.md:187-189 (testing hierarchy layer 1) "Tests must exercise the actual production entry points, validate rejection without partial mutation, and avoid mocks or source-text checks that bypass runtime behavior."
docs/design-review.md:109-114 (principle 12) "Performance claims require equivalent baselines, complete GPU steps across all ranks, and actual Helios service measurements. ... Correctness failures block performance claims; keep raw measurements and disclose unrun checks and material limitations."
docs/design-review.md:116-118 (principle 13) "Every engine version must load models supported by previous engine versions without re-export, re-signing, or graph changes."
docs/design-review.md:153-155 (principle 16) "Require an explicit before/after explanation and distinguish expected benefits from measured results. Connect evidence to claims and disclose material limitations."
Charter (read_charter), verbatim lines used:
- "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)." - "Be explicit and pin everything. No magic defaults, and pin dependencies to exact versions or commits (#215)."
- "Look for the smallest footprint in shared code, or a way to solve it without new code at all. Good ideas in the wrong place will be declined."
- "No per-model special cases or flags: Keep shared runtime layers general rather than adding model-specific branches or flags."
- "Supported matrix & compatibility: ... verify that existing data, artifacts, and exported cores still load."
Supporting quote the report can reuse instead of re-deriving: tests/preparation/test_runtime_core.py:31-37 already covers the guard that survives T1
31 @pytest.mark.parametrize("flags", [-1, True, 2, 4, 16, 1.0])
32 def test_template_export_rejects_unsupported_flags(flags):
...
36 with pytest.raises(ValueError, match="instantiation flags"):
37 _graphs({"decode": SimpleNamespace(_flare_instantiation_flags=flags)})
(and :18-28 accepts 0/1/8/9), which is why deleting the record-side guard at runtime_core.py:224-229/240-241 loses no detection.
#7 [high] BRIEF appendix B — adjudicator decision queue + report skeleton
For the final report: the hard judgment calls to hand the frontier adjudicator, in priority order, plus the report skeleton and a couple of small facts not yet recorded.
DECISION QUEUE (each is genuinely a judgment call, not grunt work)
D1. B1 severity: does "USE_NODE_PRIORITY on by default for every exported serving graph, with zero served-workload measurement" BLOCK, given (i) bit 8 is already accepted by main's validators, (ii) voipmonitor's SM120 export test passes, (iii) the PR's own limitations paragraph discloses unrun flare run replay, and (iv) a priority reviewer already returned CHANGES_REQUESTED partly on this point? Charter #210 / "no magic defaults" argue block; the fact that the shipped artifact is backward compatible and opt-out-free argues follow-up. Report must present both, not decide silently.
D2. B2 vs "defensive validation": if the unused instantiation_flags kwarg is deleted, block-level churn disappears and everything drops to should-fix. Note the pre-filter rule (subtractive wins over expansion) points to deletion, but the author may reply that an external caller (hyperflare-recipes) passes non-default flags — unverifiable from this repo, and the description names none.
D3. T2 (drop the cuGraphExecGetFlags OR, record plain 8): strong and verified (no alloc/free nodes survive export, heliopause capture.rs:607-679; replay always re-instantiates, helios mod.rs:1215-1219), but it contradicts the PR's stated purpose ("without clobbering permitted flags") and changes the live-tested expectation 9 -> 8. Adjudicator should decide whether to demand it or only record it as a simplification.
D4. S3 (voipmonitor Major 2, keep_graph=False graphs accepted then failing in _graphs): unreachable from the sole caller today (capture.py:171), so is it Major (latent API contract) or should-fix/nit? No lens covered it; it is carried on voipmonitor's authority + my verification.
D5. T3 (delete the 45-line capture_forwards test): the only argument to keep it is proof that capture.py:193 reaches the new attribute; it vanishes entirely with T1.
REPORT SKELETON (12 candidates, target 5-12 items)
- Key findings: 5 bullets (scratchpad entry "BRIEF §Key findings + §Candidate Blockers").
- Candidate Blockers: B1 (default-on policy + evidence), B2 (unused switch / duplicated guard, subtractive framing).
- Candidate Should Fix: S1 rejection-after-mutation (+ the refutation that bit 2 was already rejected pre-PR), S2 stale
_flare_instantiation_flags, S3 keep_graph=False, S4 mock-only coverage of the FFI (CI gap only), S5 ctypes/_Cuda()per graph. - Candidate Subtract / Simplify: T1 delete kwarg+branches+record-side guard, T2 delete the flags query and OR, T3 delete the duplicated capture_forwards test, T4 collapse constants + use the mask at :284.
- Candidate Nits: N1 single combined prose item with four sub-points (no separate formatting/heading notes — those checked out clean).
- One-line dropped-noise list (stale "test skipped" claims, refuted compat-doc claim, overstated regression, harmless node_count widening, fixture default nit).
- Close with: verified non-findings (layer placement, model-agnostic, no new op family, old cores load), and note there is no CI-infra red-check noise for this PR because it has no configured checks at all.
Small facts not yet written down
- PR metadata for framing: open, "ready for review", 3 files, +137/-7, opened 2026-11-28 20:45, updated 23:16; the only non-review comment is the flare-autobot case-file notice (not a finding, and not an injection attempt).
- Correctness lens's open question about
_CudaWindows path:_Cuda.__init__handles nvcuda.dll (runtime_core.py:77-78), so the ctypes call itself is portable; the S5 objection is mechanism/handle reuse, not platform. - Unverified and must stay flagged as such: whether
cuda.bindings13.3.1 exposescuGraphExecGetFlags/CUgraphInstantiate_flags(Conventions lens admitted it cited the repo pattern, not the installed package); and whether any external caller passes non-defaultinstantiation_flags.