PR #581: ignition: set USE_NODE_PRIORITY flag on exported CUDA graphs

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/8d8384d8-f162-4dec-96aa-8faf4455a642

Opened by a workflow run, Nov 28, 2026 6:10 PM EST.

screen malicious

Screen Result: All Clear

Evidence: I reviewed PR #581's full diff (3 files, +137/−7: ignition/preparation/runtime_core.py, tests/preparation/test_capture_graph_metadata.py, tests/preparation/test_recorded_export_graph_cuda.py), its description, and the single review on it (voipmonitor, CHANGES_REQUESTED). No prompt injection or other content aimed at steering an agent was found.

Peripheral, non-malicious items: the PR body's "Discord: Dooner" line (which design-review.md Principle 17 requires) and a link to commit 61f64f18… in the author's fork FujitsuPolycom/flare-local-inference. Both are unverifiable claims, not instructions.

Open questions/limitations: CI reports no checks on the head commit, so the PR's stated test results (22 + 46 passed) could not be independently confirmed; the fork commit URL was not fetched (fetching it was deliberately avoided, since an unvetted external repository is exactly where injected instructions would live). Neither affects the screening outcome.

Full report · Notes decide malicious: all_clear (100%): No malicious content found

explore

Author: FujitsuPolycom (CONTRIBUTOR, 7 merged / 7 closed / 11 open PRs in 180 days; Discord "Dooner") Motivation: Graphs captured on a high-priority auxiliary stream only keep their per-node priorities on replay if the graph is instantiated with CUDA's USE_NODE_PRIORITY bit. The Rust side already accepts and applies such flags, but Ignition never emitted one, so the priority captured for small TP collectives was inert in exported cores. This PR makes record_export_graph record prior_flags | 8. Scale: +137 / −7 lines in 3 files Proposal:

Full report · Notes

Value Proposition

Verdict: worth it with changes

The idea is right and the layer is right, but as submitted this PR flips a scheduling-relevant CUDA flag on for every exported serving graph in every recipe with no serving measurement, and two of its stated claims are false. Fix those and it is a small, welcome change; merge as-is and it is an unmeasured global behavior change.

Why the idea is right (and why it needed almost no code)

What must change before merge

  1. Evidence for the actual serving path (blocking). The PR itself lists "live CUDA export, nondefault kernel-priority instantiation across target drivers, and signed-core flare run replay" as open on this revision. A change that alters GPU scheduling for every exported core needs before/after flare run latency on a real served workload (charter "Bring real evidence" / #210; docs/design-review.md principle 12); pytest counts are not that. At minimum: one exported TP core served through flare run with and without 8, plus the reviewer's requested assertion that the Helios-instantiated executable reports cuGraphExecGetFlags == 9.
  2. Make the switch explicit, not a library default. instantiation_flags=CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY at ignition/preparation/runtime_core.py:213 silently changes behavior for every recipe. The charter says "Be explicit and pin everything. No magic defaults," and docs/prefix-cache-offload.md:855-862 explicitly forbids leaning on stream priority without measurement. Even if the answer is "always on," the decision belongs at the single call site (ignition/preparation/capture.py:193) or in run configuration, with the reason written down — not in a helper's default argument.
  3. Fix the error path, or fix the claim. record_export_graph runs retain_object(...) and instantiate_graph(...) before validating executable-derived flags (runtime_core.py:236-242). The PR description's "rejecting unsupported bits on either source before mutating graph state" is therefore false for prior_flags, and on that raise the graph keeps retained owners with no _flare_instantiation_flags set (capture.py:182-200 has no cleanup). Validate what you can (both flag sets, _flare_graph_metadata, live template handle) before retaining, per reviewer Major #2.
  4. Fix the other description claim. "Passing instantiation_flags=None keeps executable-derived flags for startup tuning graphs" is wrong: tuning graphs go through capture_graph + instantiate_graph (runtime_core.py:246-269, tests/preparation/test_recorded_export_graph_cuda.py:62-65) and never call record_export_graph. docs/design-review.md principle 16 requires accurate evidence statements.
  5. Nit. Reuse PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS in _graphs() (runtime_core.py:284 hardcodes ~9) and cache the _Cuda() handle instead of reopening libcuda.so.1 per graph.

Who benefits, and the risk

Beneficiaries are users of TP/prefill cores whose recipes overlap small collective branches on the high-priority auxiliary stream — plausible latency wins when a small collective must preempt a main-stream GEMM; broad but likely small decode-only gains. Cost is low (one function, ~38 lines, no new contracts, backward compatible: existing cores still load, 9 is already within the accepted mask). The risk is that USE_NODE_PRIORITY is all-or-nothing per graph: every kernel captured on the auxiliary stream gets priority-based scheduling, including any recipe that puts heavy compute there, and nothing in the repo has measured whether that helps or hurts under contention. That risk is acceptable only once someone has actually run it, which is precisely what this PR does not do.

Bottom line: right problem, right layer, tiny footprint, no duplication of existing mechanisms — but it ships a global, unmeasured scheduling-policy change with a false evidence statement. Land it after (1)–(4), preferably as an explicit opt-in until a flare run measurement exists.

Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.

Simplicity

Verdict: should-fix issues only

Blocking:

Should fix:

Nits: 3 — _Cuda() reopened per exported graph (runtime_core.py:204); the added four-line docstring paragraph (219-222) restates prior | requested and describes a mode with no caller; the new tests (test_capture_graph_metadata.py:222-302) pin the unused kwarg modes and re-implement the whole capture_forwards mock surface to re-assert a value already asserted directly.

Link: https://github.com/NVIDIA/hyperflare-inference/pull/581

Full report · Notes

Architecture

Verdict: Blocking issues

Blocking:

Should fix:

Nits: 2 (PR-description order claim "before mutating graph state"; the nonexistent startup-tuning path sentence). Link: https://github.com/NVIDIA/hyperflare-inference/pull/581

Full report · Notes

Correctness

Verdict: should-fix issues only

Blocking:

Should fix:

Nits: 2 (dead None path doubles as a prose/coverage gap; a fresh _Cuda() per exported graph instead of a cached one, runtime_core.py:200-205)

Link: https://github.com/NVIDIA/hyperflare-inference/pull/581

Full report · Notes

Prose

Verdict: should-fix issues only

Blocking:

Should fix:

Nits: 2 (unused new PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS constant alongside hardcoded ~9 at runtime_core.py:284, and an unexplained permitted set; docstring at runtime_core.py:219-222 omits that the recorded flags replace the executable in the core and that unsupported executable bits abort after instantiation).

Link: https://github.com/NVIDIA/hyperflare-inference/pull/581

Full report · Notes

Conventions

Verdict: should-fix issues only Blocking:

Checked and clean: the 9-bit mask matches helios/src/runtime_core/format.rs:495 and heliopause/src/export/capture.rs:2822-2823; flags-on-export is the documented mechanism (docs/runtime-core-design.md:623, docs/core-format-design.md:220); no layering or injection issues. Open: real PyTorch executable flags (only the GPU test can settle) and whether cuda-python 13.3.1 exposes the flag enumerators. Link: https://github.com/NVIDIA/hyperflare-inference/pull/581

Full report · Notes

Subtractive

Verdict: make it smaller first The change: +137 / −7 lines Could remove: about 104 lines (25 production, 79 test), in 4 places Biggest subtractions:

Full report · Notes

code review summary

Recommendation: Changes Requested

Two blockers (default-on USE_NODE_PRIORITY with no served-workload evidence; ~104 of 144 added lines are an unused switch plus a duplicated flag guard) plus five should-fix items, four subtractive reductions and one combined prose item. The core one-line fact is right and backward compatible, so the fix path is subtraction, not redesign.

For the adjudicator (Verify & Adjudicate): decide (D1) whether "flag 8 on by default for every exported serving graph, unmeasured" blocks or is a disclosed follow-up — charter #210 and "no magic defaults" argue block, and bit 8 is already accepted by main's validators with voipmonitor's SM120 test passing; (D2) whether deleting the unused instantiation_flags kwarg is required (subtractive rule wins) or defensible as capture-time validation — no external caller is provable from this repo; (D3) whether to demand T2 (drop cuGraphExecGetFlags + OR, record plain 8), which is verified (no alloc/free nodes survive export) but contradicts the PR's stated "without clobbering permitted flags" purpose; (D4) whether voipmonitor's keep_graph=False finding (S3) keeps Major severity despite being unreachable from the sole caller; (D5) whether the 45-line capture_forwards test goes with T1.

Refuted upstream claims (do not resurface): the "real-CUDA assertion is skipped/unverified" line repeated by three lenses is stale — voipmonitor ran FLARE_RUN_CUDA_TESTS=1 on SM120 (1 passed, 3.29s, flags_by_name == {"decode": 9, "tune": 1}), so only the CI gap remains (S4); "value 9 lacks a core-format/compatibility statement, older engines may reject it" is false — flags & !9 already existed on main (heliopause capture.rs:589, :2823; helios format.rs:495) and docs/runtime-core-design.md:623 (not opened) already specifies the mechanism; "export regression on drivers setting bit 2" is overstated — the identical bits were already rejected pre-PR at capture.rs:589. No CI-infra/setup-java noise exists because the PR has no configured checks.

One finding is carried on voipmonitor's authority plus my own verification because no lens had it (S3). Nothing in the PR description or comments was an instruction to me; the only bot comment is a case-file notice.

Full report · Notes

Pre Test Report

Pre-Test Report — PR #581 "ignition: set USE_NODE_PRIORITY flag on exported CUDA graphs"

Author: FujitsuPolycom (CONTRIBUTOR, Discord "Dooner") · head 61f64f18, base main 167f22c · +137/−7 in 3 files · open, CHANGES_REQUESTED from voipmonitor (priority reviewer), no CI on head.

RECOMMENDATION: DO NOT REFER TO HARDWARE TESTING (HOLD)

Do not send this to a test engineer yet. Three independent reasons:

  1. A blocking architectural problem is unresolved and will change the code under test. The PR turns node-priority instantiation on by default for every exported serving graph of every recipe, with no served-workload evidence — the charter's explicit bar for this class of change. The likely fix (make it explicit at the call site, derive it from prepared data, or drop the default) rewrites the very lines a test would validate.
  2. The only behaviour that is currently testable has already been validated on the same GPU class. voipmonitor ran the PR's own live CUDA export test on SM120 and it passed (flags_by_name == {"decode": 9, "tune": 1}, 3.29 s). Re-running it on cn5 (also Blackwell/SM120) buys no new information.
  3. The claimed benefit cannot be measured from this repository. The node-priority mechanism only exists in recipe-owned overlap branches, and recipes live in the external local-inference-lab/hyperflare-recipes repo (AGENTS.md:12 (not opened), 391-393; boundary enforced by tests/preparation/test_core_boundary.py:39-45 (not opened)). No in-repo artifact produces a priority-bearing graph, so an A/B throughput test is not constructible here without importing external recipe code and model weights onto shared hardware.

Expected value if testing were performed now: low (~1–2 h of cn5 GPU time for near-zero decision value). The export-side assertion is already proven; the value-bearing measurements (served latency, SM121 replay) require a merged-or-reshaped design and an external recipe. Testing now would mostly confirm an unmeasured global scheduling change is live, not that it is good.


Why this is not ready: the blocking findings

B1. The flag is a magic default, applied to every graph, unmeasured — the charter's core objection to this PR

ignition/preparation/runtime_core.py:213 makes USE_NODE_PRIORITY (8) the default of instantiation_flags. The sole production caller, ignition/preparation/capture.py:193, passes no argument, and is reached whenever exporting = retain_graphs and warmup_storage is not None (capture.py:170) — i.e. every serving graph, every recipe, TP and TP1 alike.

Correction to the reviews (important for scope judgement): the architecture lens stated the priority stream is "TP scratch … TP-overlap-only". That is wrong. docs/core-design.md:852-863 and docs/performance-work.md:126-144 describe a single-rank auxiliary stream overlapping GDN projections, shared/routed experts, and QSA selection; it is created lazily by ScratchArena.auxiliary_stream (ignition/preparation/scratch.py:83-105) whenever overlap=True (the default, scratch.py:59). The blast radius is therefore broader than "TP" — it is whichever recipes use overlap, which no in-repo file determines.

B2. The PR's benefit premise is unverified, and it is the cheapest thing to falsify

USE_NODE_PRIORITY only changes scheduling for nodes that carry a non-zero priority attribute. Heliopause exports an attribute only when it is non-zero (heliopause/src/export/capture.rs:561-569, KERNEL_ATTRIBUTES includes 8 at :462), and Helios applies only recorded attributes (mod.rs:984-1013). Whether a kernel captured on ScratchArena.auxiliary_stream (created at greatest priority, scratch.py:93-99) is exported with a non-zero attribute 8 is a CUDA capture semantic that no test in this PR or the repo exercises. If the driver leaves it zero, the flag is inert on replay and the change ships a scheduling-mode flip for no benefit. This premise should be settled before any throughput work is commissioned. (It needs one GPU and no recipe — see the deferred plan.)

B3. _flare_instantiation_flags has no invalidation path (correctness, should-fix)

Set at runtime_core.py:242, consumed at :282-287, and never cleared. instantiation_flags=None skips rather than clears, so a re-record keeps a stale word; and nothing drops it on reset()/destroy, unlike _RecordedGraphMetadata.release (:153-158) and RecordedExportGraph.reset (:185-189). _graphs() prefers the stale attribute over the live executable, publishing a flag word derived from a dead executable in a wire shape that heliopause/src/export/capture.rs:2822 structurally cannot detect. Not reachable from today's sole caller (a fresh CUDAGraph per capture), which is why it is should-fix, not blocking.

B4. Rejection happens after mutation, contradicting the PR's own claim (should-fix, affects test design)

The requested-flags check runs before mutation (:224-229), but the executable-derived check runs after retain_object (:236) and instantiate_graph (:237) at :239-241. The description's "rejecting unsupported bits on either source before mutating graph state" is false for that source, and the failure leaves a graph instantiated with owners retained and no _flare_instantiation_flags. The new test (tests/preparation/test_capture_graph_metadata.py:244-248) asserts only the raise, while its neighbour at :250-255 asserts no partial mutation — so the asymmetry is documented rather than caught.

Correction to the reviews: the correctness lens claimed this creates a new export regression on targets that set e.g. bit 2 (DEVICE_LAUNCH). It does not. On main, heliopause already derived flags from the live executable (capture.rs:788-794) and already rejected flags & !9 != 0 at capture.rs:589 during the same export operation. The PR moves an existing rejection earlier into Python (and leaves the graph half-mutated). This is an error-path and lifetime defect, not a new compatibility failure.

B5. instantiation_flags is a speculative extension point; the description is wrong twice (should-fix)

The None and 0 modes exist only in tests (test_capture_graph_metadata.py:234, 240). The description's "Passing instantiation_flags=None keeps executable-derived flags for startup tuning graphs" describes a path that does not exist — tuning graphs use capture_graph + instantiate_graph (runtime_core.py:246-269, capture.py:171, 194-197) and never reach record_export_graph (AGENTS.md:188-193 (not opened) rejects switches without a concrete requirement). Additionally the description's "Before:" clause invents prior behaviour (main wrote no flags at all), and "Candidate 61f64f1… on main" mislabels the PR's own head commit. All seven lenses flagged at least one description inaccuracy; voipmonitor raised the same two.

Open item no lens checked: voipmonitor's Major #2 — record_export_graph does not validate keep_graph=False/_flare_graph_metadata graphs before setting the flag, so such a caller would succeed and fail later with graph=0 in _graphs/Heliopause. Unverified by me; worth confirming in re-review, since it is a second, independent precondition gap.

Nits (ignorable, not gating)

_Cuda() re-dlopens libcuda.so.1 per exported graph (:200-205, while capture.py:43-47 and scratch.py:88-101 use the pinned cuda.bindings.driver); _graphs keeps the hardcoded ~9 and duplicate error string (:284-285) beside the new PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS (:194-197); the new capture_forwards test clones the existing harness; the added docstring paragraph restates the OR. The subtractive lens estimates ~104 of the 144 added lines are removable, with the production change reducible to 1–2 lines.

What is genuinely fine (so it is not retested)


Deferred minimal test plan (to run only after the blocking design question is settled)

Use cn5 (4 × RTX PRO 6000 Blackwell, SM120, amd64 — matches the charter's target and the SM120 box voipmonitor used). Do not use cn7 for anything but the single optional SM121 item. Budget: ~45–60 min of cn5 GPU time total; do not run the A/B throughput leg until an explicit measurement decision exists.

T0 — premise check (the highest-value test; ~10 min, 1 GPU). Run this first regardless of the design outcome. Build a ScratchArena("cuda:0") (pattern already in tests/preparation/test_scratch_cuda.py:18-32), launch a few kernels on arena.auxiliary_stream and a few on the main stream, capture them into one graph, export via record_export_graph, then decode the exported nodes (decode pattern in tests/preparation/test_runtime_core.py:130-154) and print attribute id 8 per kernel node.

T1 — export correctness (only if T0 passes; ~5 min, 1 GPU). FLARE_RUN_CUDA_TESTS=1 pytest -q tests/preparation/test_recorded_export_graph_cuda.py with CUDA_VISIBLE_DEVICES set. Expect {"decode": 9, "tune": 1}. This duplicates voipmonitor's SM120 run; run it once as the regression baseline for the revised revision, not per-commit.

T2 — Helios load + replay of a flags=9 core (only after the revision; ~15 min, 1 GPU). This is the one genuinely untested area: no in-repo fixture has ever exported a non-zero instantiate_flags (helios/tests/runtime_core_fixture.py:146-158 uses record_template(..., 1)/RecordedExportGraph; the other fixtures instantiate with 0 or 1). Extend runtime_core_fixture.py so one graph carries instantiate_flags=9, flare run it, and assert (a) the node values are bit-identical to the pre-PR core (no numerical regression), and (b) cuGraphExecGetFlags on the Helios-instantiated executable reports 9. This satisfies voipmonitor's Major #1 second half and principle 13 ("validate previous cores through loading and serving").

T3 — served A/B throughput (defer; ~20 min, ≥2 GPUs, only on an explicit maintainer decision). Requires a real recipe from local-inference-lab/hyperflare-recipes plus model weights on cn5, and --bypass-performance-check if the workstation GPUs are not NVLink-paired (docs/cli-design.md:1538-1545). Baseline main vs PR branch on the same core, same checkpoint, same TP width, flare run only (not ignition debug-serve, per principle 12), reporting TTFT and decode tok/s with raw values and repeatability bounds (docs/performance-work.md:35-59). If T0 shows the attribute is only present on small-collective branches, the expected effect is small and concentrated in prefill — measure prefill separately and do not run a long sweep chasing noise.

Do not test: the CPU unit tests (22 + 46 passed are reproducible anywhere), old-core loading beyond the T2 regression leg (path unchanged), or anything on cn7 unless an SM121 replay is specifically requested.

What the author should be told

Make the flag explicit and data-driven, not a default (derive it from recorded per-node priority, or pass it at capture.py:193); delete the instantiation_flags None/0 modes and the duplicated validation, adopting the constant in _graphs; validate executable-derived flags before mutating, or fix the claim and assert the retained-on-failure state; clear/invalidate _flare_instantiation_flags on reset; validate keep_graph=False up front; and bring either the served-workload flare run comparison or the T0 premise evidence. T0 is cheap and the author can run it without our hardware — asking for it before referral is the efficient move.

Full report · Notes

Final review

Recommendation: Changes Requested

The downstream Heliopause/Helios pipeline already accepts USE_NODE_PRIORITY (8) and replays captured node priority attributes with full core compatibility, and live SM120 export passes ({"decode": 9, "tune": 1}). However, this PR globally enables CTA-priority scheduling on every exported serving graph without any live flare run serving measurement, silently breaks keep_graph=False / _flare_graph_metadata graphs passed to record_export_graph, leaves stale _flare_instantiation_flags across reset() / None, and makes two factually incorrect behavioral claims in the PR description.


Blockers

  1. Unqualified global GPU scheduling change without flare run serving evidence (ignition/preparation/runtime_core.py:208-243, ignition/preparation/capture.py:170-193, ignition/preparation/scratch.py:83-105, docs/core-design.md:852-863, docs/performance-work.md:133-144).
    • record_export_graph enables CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY (8) by default for every serving graph exported through capture_forwards (capture.py:193).
    • The repo's high-priority stream, ScratchArena.auxiliary_stream (ignition/preparation/scratch.py:83-105, created with cuStreamCreateWithPriority(..., greatest)), is used not only for small TP collectives, but also for heavy overlapped compute branches across recipes — shared experts up to 256 rows, Qwen GDN input projections, and QSA index selection (docs/core-design.md:852-853, docs/performance-work.md:133-138). Turning USE_NODE_PRIORITY on globally changes GPU CTA scheduling/preemption for every kernel captured on auxiliary_stream across all recipes.
    • The PR provides no flare run latency measurements and no live Helios instantiation/replay check (its own limitations note that live CUDA export, nondefault priority instantiation across target drivers, and signed-core flare run replay remain open).
    • This violates the Charter ("Bring real evidence. Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)"), docs/design-review.md:106-115 (Principle 12: performance claims require equivalent baselines and actual Helios service measurements), and docs/performance-work.md:142-144 ("Measure complete graph latency, including synchronization and resource contention, at each relevant row capacity"). Priority reviewer @voipmonitor has already issued CHANGES_REQUESTED on this requirement.
    • Required before merge: Qualify an exported TP/overlap core end-to-end via flare run with before/after serving latency (covering both collective overlap and heavy auxiliary_stream compute branches to confirm no scheduling regression), and confirm that the Helios-instantiated executable reports cuGraphExecGetFlags == 9.

Should Fix

  1. record_export_graph silently breaks keep_graph=False / _flare_graph_metadata graphs until export (ignition/preparation/runtime_core.py:208-243, :256-269, :282-292).

    • record_export_graph calls instantiate_graph(graph) (which explicitly accepts _flare_graph_metadata graphs created by capture_graph(retain_graphs=True) with keep_graph=False, whose CUDA template Torch releases upon instantiation) and then unconditionally sets graph._flare_instantiation_flags = prior_flags | instantiation_flags.
    • On main, _graphs() fell through to lines 288-292 and emitted graph=0, executable=executable, which Heliopause resolved via recorded_graph(graph.executable) (heliopause/src/export/capture.rs:775-786). With this PR, _graphs() (runtime_core.py:282-287) takes the flags is not None branch first and calls int(graph.raw_cuda_graph()), crashing late with RuntimeError ("template was released") or emitting graph=0 with instantiate_flags=9 (rejected at heliopause/src/export/capture.rs:2823).
    • Fix: When instantiation_flags is not None (or unconditionally if the kwarg is removed), validate up front before retain_object(...) and instantiate_graph(...) that getattr(graph, "_flare_graph_metadata", None) is None and that graph.raw_cuda_graph() returns a live nonzero template handle (matching @voipmonitor Major #2), and add a unit test covering that rejection.
  2. Stale _flare_instantiation_flags survives instantiation_flags=None re-recording and graph.reset() (ignition/preparation/runtime_core.py:238-243, :282-287, :153-166).

    • Unlike _RecordedGraphMetadata.executable, which clears itself on reset via register_destroy_callback (runtime_core.py:166), _flare_instantiation_flags is never cleared when record_export_graph is called with instantiation_flags=None on a previously recorded graph, nor when graph.reset() tears down the graph. Because _graphs() prefers _flare_instantiation_flags over the live executable, a reused graph would silently serialize stale flags.
    • Fix: Clear any pre-existing _flare_instantiation_flags on instantiation_flags=None (or at entry after pre-validation), and clear it on reset via a weakref-guarded destroy callback (do not capture a strong reference to graph in the callback, which would break GC reclamation tested in test_export_graph_retains_external_owners_until_release at tests/preparation/test_capture_graph_metadata.py:335-339).
  3. Post-failure mutation ordering and inaccurate PR description claims (ignition/preparation/runtime_core.py:236-242, tests/preparation/test_capture_graph_metadata.py:244-255).

    • record_export_graph runs graph.retain_object(...) and instantiate_graph(graph) before querying _executable_instantiation_flags(graph) and validating prior_flags (necessarily, since cuGraphExecGetFlags requires an instantiated CUgraphExec). On unsupported prior_flags, graph remains instantiated with owners retained and _flare_instantiation_flags unset. While retaining owners until reset is consistent with test_export_instantiation_failure_retains_owners_until_reset (test_capture_graph_metadata.py:342-363), it directly contradicts the PR description's statement "rejecting unsupported bits on either source before mutating graph state", and test_capture_graph_metadata.py:244-248 asserts nothing about post-failure state for unsupported_exec.
    • Two additional description statements contradict the code (AGENTS.md:88-112, docs/design-review.md Principle 16):
      • "Passing instantiation_flags=None keeps executable-derived flags for startup tuning graphs" is false: startup tuning graphs call capture_graph + instantiate_graph (tests/preparation/test_recorded_export_graph_cuda.py:62-65) and never call record_export_graph.
      • Before: misstates main (record_export_graph on main recorded no flags; _graphs() passed executable to Heliopause, which read executable_flags at heliopause/src/export/capture.rs:791-794).
    • Fix: Assert the intended post-failure contract for unsupported_exec in tests/preparation/test_capture_graph_metadata.py:244-248 (either owners retained until reset, or explicit cleanup), and update the PR description so its before/after, caller, and non-mutation claims match the code.

Subtract / Simplify

  1. Remove the unused instantiation_flags keyword parameter unless a concrete caller needs it (ignition/preparation/runtime_core.py:208-230, :238).

    • The sole in-repo production caller (ignition/preparation/capture.py:193) passes no instantiation_flags argument, and the only caller cited for instantiation_flags=None in the PR description (startup tuning graphs) does not call record_export_graph. Removing the speculative kwarg, its None/0 branches, and its duplicated input-validation guard trims ~15 production lines (AGENTS.md:188-190). Keep it only if a concrete caller (for example in hyperflare-recipes) actually requires per-call overrides — and name that caller in the PR description.
  2. Reuse PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS in _graphs() (ignition/preparation/runtime_core.py:284).

    • _graphs() still hardcodes flags & ~9 with the identical ValueError string duplicated from record_export_graph:229. Replace ~9 with ~PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS so the permitted mask has one definition in Python (matching @voipmonitor Nit #4).

Nits

  1. Lazily cache _Cuda() instead of reopening libcuda.so.1 / nvcuda.dll per graph (ignition/preparation/runtime_core.py:200-205, :76-78).
    • _executable_instantiation_flags constructs a fresh _Cuda() on every call, whereas CoreStorage (ignition/preparation/core_storage.py:76) and VirtualStorage (ignition/preparation/virtual_storage.py:27) instantiate _Cuda() once and reuse it. Cache a module-level _Cuda instance lazily (matching @voipmonitor Nit #4).

Verified passes


Dropped on verification

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 & Apply Labels

Applied: +triage:validation, +performance, +area:preparation

Threshold: 65%

Triage

Priority

Type

Area

Model