Prose review — PR #581 "ignition: set USE_NODE_PRIORITY flag on exported CUDA graphs"
Scope: the PR description, its single commit message, and the docstrings/comments the diff adds, judged against AGENTS.md "Required PR descriptions" (AGENTS.md:72-140), docs/design-review.md principles 12, 13 and 16 (docs/design-review.md:106-123, 147-162), and .agents/skills/repo-prose/SKILL.md (not opened) (lines 13-46). Code correctness, the default-on USE_NODE_PRIORITY question, keep_graph=False validation and the _Cuda() reopen cost are other lenses' material and are not repeated as new findings here.
Key findings
The technical argument holds up: flags 1 and 8 (9) match the Helios and Heliopause validators, bit 8 does reach cuGraphInstantiateWithFlags, and the 1 | 8 = 9 example matches the live CUDA test. What does not hold up is the description's account of its own change: the "Before" clause describes an implementation that never shipped, the "After" clause claims a None default path used "for startup tuning graphs" that has no production caller and is unrelated to tuning, the evidence bullet claims rejection "before mutating graph state" while one of the two rejections happens after mutation, and the evidence line labels this PR's own head commit as a "Candidate … on main". Four should-fix prose defects, two nits, all in the PR description or the new docstring — no defect found in the changed test files.
Should fix
1. "Before" describes an alternative implementation, not the prior behaviour
Description: "Before: record_export_graph serialized executable-derived instantiation flags without USE_NODE_PRIORITY (or replaced the whole flag word instead of preserving prior permitted bits)."
On main, record_export_graph serialized no flags at all: it validated pools, called retain_object and instantiate_graph, and returned (runtime_core.py on main:192-206), and _graphs emitted {graph, executable} with no flag field (runtime_core.py on main:245-255). The parenthetical "(or replaced the whole flag word …)" describes an implementation that was never merged, presented as part of the prior state.
Why it matters: AGENTS.md:88-94 requires the before/after to be explicit and to name what is replaced, removed or added; docs/design-review.md:153-155 requires an explicit before/after and rejects prose that presents rejected attempts (.agents/skills/repo-prose/SKILL.md:26-29 (not opened), 40-43). A reader cannot tell what the exported core looked like before this PR.
Fix: state the real before — the exported serving graph carried only its instantiated executable, so Helios re-instantiated it with the executable's own flags (1, as main's CUDA test asserted flags == 1) and never with 8; after this change the record carries {graph, instantiate_flags} instead, which is also the material wire/compatibility change AGENTS.md:91-93 requires to be named.
2. "Passing instantiation_flags=None keeps executable-derived flags for startup tuning graphs" is false
Description: same sentence, last clause of the "After" paragraph.
- The only production call site of
record_export_graphis the export branch ofcapture_forwards(ignition/preparation/capture.py:193), which passes noinstantiation_flags, so it takes the default8. Nothing inignition/passesNone; the only caller anywhere is tests/preparation/test_capture_graph_metadata.py:240. - Startup tuning graphs never reach this function. Tuners are captured with
capture_graph(retain_graphs=True)and instantiated withinstantiate_graph(tests/preparation/test_recorded_export_graph_cuda.py:62-65), then packaged asTuningGraphand exported through the plainexecutableform of_graphs(runtime_core.py:288-292) — which is exactly why the live test expectstune = 1(tests/preparation/test_recorded_export_graph_cuda.py:86). WithNone,record_export_graphsimply skips setting_flare_instantiation_flags(runtime_core.py:238-242) and the graph falls back to the{graph, executable}form (test at tests/preparation/test_capture_graph_metadata.py:237-242).
Why it matters: AGENTS.md:103-112 forbids claims not connected to evidence and AGENTS.md:129-132 forbids process assurances in place of technical fact; .agents/skills/repo-prose/SKILL.md:30-34 (not opened) requires implementation to be distinguished from qualification. Here the description attributes a behaviour to a code path (startup tuning) that does not call the function at all. Note this is the same point voipmonitor raised as review finding 3 (PR #581 review, 2026-11-28 22:13) — this lens confirms it independently.
Also missing in this paragraph, and required by AGENTS.md:91-93 and docs/design-review.md:116-123: the compatibility consequence. Serving graphs now record {graph, instantiate_flags: 9} instead of {graph, executable} (runtime_core.py:282-287), and existing cores stay loadable because Helios and Heliopause already accept flags & !9 != 0 as the only rejection (helios/src/runtime_core/format.rs:495; heliopause/src/export/capture.rs:589, 2823) — i.e. bit 8 was already permitted in the signed format. The description asserts "existing signed-core compatibility" without that mechanism.
Fix: say the parameter has no current production caller, describe what None records (the executable form), and drop or rewrite the tuning-graph claim; add one sentence naming the format validators that make bit 8 backward-compatible.
3. "Rejecting unsupported bits on either source before mutating graph state" is only half true
Description, supporting-evidence bullet 2.
The requested-flags check is indeed before mutation (runtime_core.py:224-229, before retain_object at 236 and instantiate_graph at 237). The executable-derived check is not: prior_flags = _executable_instantiation_flags(graph) and the ValueError are at runtime_core.py:239-241, after the graph has been retained and instantiated, so a graph with unsupported executable bits has already been mutated when it is rejected. The corresponding test asserts only that ValueError is raised (tests/preparation/test_capture_graph_metadata.py:244-248); the ordering claim is not tested.
Why it matters: AGENTS.md:103-109 requires evidence tied to "the behavior tested … result, and limits"; docs/design-review.md:147-160 rejects unsupported claims in changed prose. This is also voipmonitor's review finding 3 (first bullet), independently confirmed here.
Fix: reword to something like "rejecting unsupported requested bits before any graph mutation, and unsupported executable bits after instantiation"; or, if the ordering is unintended, validate first (other lens).
4. "Candidate 61f64f1… on main" mislabels this PR's own head commit and introduces an unexplained label
Description, first line of "Supporting evidence and limitations": "Candidate [61f64f18…] on main (167f22c8…)."
61f64f18e06cdcb9de76c33765584a97752f3953 is the head commit of this PR (branch perf/ignition-export-use-node-priority), not a commit on main; 167f22c8 is the main commit it branched from. "Candidate" is an internal lifecycle label with no referent anywhere in the description.
Why it matters: .agents/skills/repo-prose/SKILL.md:13-19 (not opened) forbids lifecycle labels used as identities and false definite references; AGENTS.md:122-128 requires references to be resolved where they are used.
Fix: "Verified on commit 61f64f1 (this PR's head), rebased on main at 167f22c8."
Nits
5. New PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS is introduced but not used at the existing hardcoded mask, and its scope is unexplained
PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS is defined at ignition/preparation/runtime_core.py:194-197 and used at 227 and 240, but _graphs still hardcodes the same mask as flags & ~9 (runtime_core.py:284) with the identical error message text at 229 and 285. Two constants of the same concept in one module is exactly the drift AGENTS.md:116-121 ("explain the relevance of non-obvious constraints") asks to be avoided. The constant also carries no comment saying why the permitted set is bits 1 and 8 only, while the exported format's own validation lives in Rust (helios/src/runtime_core/format.rs:495; heliopause/src/export/capture.rs:589, 2823) and CUDA defines further bits (DEVICE_LAUNCH = 2, UPLOAD = 4, …) that this set omits — a reader cannot tell whether those are unsupported by CUDA or by this codebase. Fix: use the constant at line 284, route the duplicated message through one helper, and add a one-line comment that the permitted set mirrors what Helios accepts at load (naming format.rs). Agrees with voipmonitor's nit-level finding 4.
6. The new docstring never says the recorded flags replace the executable in the core
The added paragraph (ignition/preparation/runtime_core.py:219-222) explains the bit combination but not the consequences a caller needs: (a) setting instantiation_flags makes the export emit {graph, instantiate_flags} instead of {graph, executable} (runtime_core.py:282-287), so Helios re-instantiates the template with those flags (cuGraphInstantiateWithFlags(..., graph.flags), helios/src/runtime_core/mod.rs:1217-1218) rather than reusing the exported executable — that is why the CUDA expectation flipped from flags == 1 to {"decode": 9, "tune": 1} (tests/preparation/test_recorded_export_graph_cuda.py:85-87); and (b) unsupported executable bits abort after the graph is instantiated (runtime_core.py:239-241). .agents/skills/repo-prose/SKILL.md:38-39 (not opened) requires comments to state invariants and non-obvious constraints. Fix: add those two facts to the docstring.
What checked out
PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS=1 | 8=9matches the Rust validators: helios/src/runtime_core/format.rs:495, heliopause/src/export/capture.rs:589 and 2823 (flags & !9 != 0rejects), and the request validation thatexecutable == 0⟺instantiate_flags.is_none()(heliopause/src/export/capture.rs:2822).- Bit
8reaches instantiation: helios/src/runtime_core/mod.rs:1217-1218 passesgraph.flagstocuGraphInstantiateWithFlags, so the "why" of the PR is technically sound. - "
1 | 8 = 9when bit1was set" matches the live expectation at tests/preparation/test_recorded_export_graph_cuda.py:86 and theno_autofree/preserved_onlycases at tests/preparation/test_capture_graph_metadata.py:222-235. - "without clobbering permitted flags already present on the captured executable" matches
prior_flags | instantiation_flags(runtime_core.py:239-242). - The four-part order (Why / What changed / Claimed benefit / Supporting evidence and limitations) is respected, and the limitations paragraph honestly discloses unrun live CUDA export, non-default kernel-priority instantiation across drivers, and signed-core
flare runreplay — this satisfiesdocs/design-review.md:106-115(disclose unrun checks) andAGENTS.md:103-112. The reviewer independently ran the live SM120 CUDA test and it passed (flags_by_name == {"decode": 9, "tune": 1}), which strengthens rather than contradicts the disclosure. Discord: Dooneris present after the technical explanation, satisfyingAGENTS.md:142-150anddocs/design-review.md:163-169.- The single commit subject names the component and change ("ignition: set USE_NODE_PRIORITY flag on exported CUDA graphs"); since the PR body carries the four-part argument,
docs/design-review.md:147-155is met in substance. - No prose defect in the changed tests: the new test name
test_capture_forwards_export_sets_node_priority_instantiation_flagand theexpected_combinednaming are self-describing, and the CUDA test's module docstring (tests/preparation/test_recorded_export_graph_cuda.py:4) remains accurate.
Open questions / not settled here
- Whether
USE_NODE_PRIORITYshould be on by default for every recipe is a design question (principle 12 / scratch.py:83-105 preemption scope) owned by other lenses and voipmonitor's major finding 1; the description does disclose that live serving qualification is outstanding, which is what the prose rules require. - Whether the after-instantiation rejection is a defect or just a mis-stated description cannot be settled from prose alone; a test asserting graph state after the unsupported-executable rejection (e.g.
instantiations/retained objects, as tests/preparation/test_capture_graph_metadata.py:255 already does for the requested-flags path) would settle it. docs/runtime-core-design.md:623already specifies "instantiate each graph with its recorded flags", so the change implements documented behaviour; the description could have cited it as the specification instead of leaving the reader to infer the contract. No documentation file needed editing.