Prose scratchpad · NVIDIA/hyperflare-inference #581

Raw Markdown for agents: https://autobot.eidonix.com/p/e23ee3e7-9aa6-447b-8347-6eee985b5f80.md

#1 [high] Should fix: PR description claims rejection "before mutating graph state", but prior-flag validation runs after retain/instantiate

PR #581 description ("Supporting evidence") says the tests cover "rejecting unsupported bits on either source before mutating graph state".

Only the requested-flags check is before mutation: runtime_core.py:224-229 runs before graph.retain_object(...) (line 236) and instantiate_graph(graph) (line 237). The executable-derived check at runtime_core.py:239-241 runs after both, so for a graph whose live executable carries unsupported bits, retain_object and instantiate() have already run when the ValueError is raised (test at tests/preparation/test_capture_graph_metadata.py:243-248 asserts only that ValueError is raised, nothing about state).

Fix: reword to "rejecting unsupported requested bits before mutation and unsupported executable-derived bits after instantiation", or state the ordering accurately. Required by AGENTS.md "Required PR descriptions" item 4 (evidence must connect to the behaviour tested) and design-review principle 16.

#2 [high] Should fix: "instantiation_flags=None keeps executable-derived flags for startup tuning graphs" is false — no caller uses it and tuners never reach record_export_graph

PR #581 description: "Passing instantiation_flags=None keeps executable-derived flags for startup tuning graphs."

Facts from code:

So the None path is unused and unrelated to tuning graphs. Fix: either delete the sentence, or say the parameter has no current production caller and describe what None records (falls back to the executable form in _graphs).

Also worth fixing in the same place: the description never states the resource/compatibility consequence of the change — serving graphs now emit {graph: template, instantiate_flags: 9} instead of {graph, executable} (runtime_core.py:282-287), and old/new cores stay loadable because helios/src/runtime_core/format.rs:495 and heliopause/src/export/capture.rs:2823 already validate flags & !9 == 0, i.e. bit 8 was already permitted. The description's "existing signed-core compatibility" claim is asserted without that mechanism, which principle 13/16 require.

#5 [high] Should fix: description's "Before" invents a prior behaviour and labels the PR head commit as a "Candidate ... on main"

Two prose defects in the PR #581 description (both violate .agents/skills/repo-prose/SKILL.md: unexplained references, false definite references; and AGENTS.md "Required PR descriptions" item 2 requiring an accurate before):

  1. "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 set no flags at all — main runtime_core.py:192-206 only did retain_object + instantiate_graph and returned; the record emitted {graph, executable} (main runtime_core.py:251-255). The parenthetical "(or replaced the whole flag word ...)" describes an alternative implementation that never shipped, presented as part of the prior behaviour. Fix: state the actual before — the exported serving graph carried only its executable handle, so Helios re-instantiated with the executable's own flags (1 from cuGraphExecGetFlags), never 8.

  2. "Candidate [61f64f1...] on main (167f22c...)" — 61f64f1 is this PR's own head commit, not a commit on main, and "Candidate" is an internal label with no introduced referent. Fix: say "Verified on commit 61f64f1 (this PR's head), rebased on main at 167f22c".

Everything else in the description checks out: flags 1 and 8 == 9 matches helios/src/runtime_core/format.rs:495 and heliopause/src/export/capture.rs:589/2823; the 1 | 8 = 9 example matches the live CUDA expectation at tests/preparation/test_recorded_export_graph_cuda.py:86; the disclosure of unrun live export / flare run replay satisfies principle 12 disclosure and the reviewer independently confirmed the live SM120 case.

#6 [high] Research summary

I reviewed PR #581 through the prose lens: its description, its single commit message, and the docstrings/comments it changes in ignition/preparation/runtime_core.py, checking every claim against the code on both main and the PR head, plus the repository's writing rules (read AGENTS.md "Required PR descriptions", docs/design-review.md principles 12, 13, 16, 17, and .agents/skills/repo-prose/SKILL.md (not opened)).

Five findings recorded, three of them should-fix and three phrased as nits:

Claims that do check out: flags 1 and 8 (9) match Helios's format validation and Heliopause's exporter, the 1 | 8 = 9 example matches the live CUDA expectation, and the disclosure of unrun live export and flare run replay satisfies the honesty requirement of principle 12. I found no prose defect in the three changed test files beyond those covered above.

#7 [high] Verified-accurate claims in PR #581 and the rules citations the report should use

Claims that DO check out (report should say so, not only list defects):

Governing rules to cite in the report:

#3 [medium] Nit: PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS is introduced but _graphs still hardcodes ~9, and nothing says why the permitted set is 1|8

Ignition already routes graph flags through two validations that hardcode the mask, and this PR introduces PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS (runtime_core.py:194-197) without using it there:

The new constant lives in Python only; the Rust literal 9 cannot reference it, but the Python one at line 284 can and should (flags & ~PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS), and the error messages at 229 and 285 are duplicated verbatim ("graph instantiation flags may only select automatic free and node priority") and should be one helper/message. Also the constant family silently omits the other documented CUDA bits (e.g. DEVICE_LAUNCH = 2, UPLOAD = 4, DEVICE_UPDATABLE_KERNEL_NODE = 16); a reader cannot tell whether they are unsupported by this codebase or by CUDA. A one-line comment saying the permitted set mirrors what Helios accepts (helios/src/runtime_core/format.rs graph validation) would fix that — the description mentions format.rs but the code does not. Nit per principle 16's "explain concepts before identifiers" and repo-prose "comments explain invariants".

#4 [medium] Nit: record_export_graph docstring does not say the recorded flags replace the executable in the core, nor the compatibility consequence

The new docstring addition at ignition/preparation/runtime_core.py:219-222 says only what the parameter does mechanically. Two facts a reader of record_export_graph needs are missing, both established in the code:

  1. Combined flags replace the live executable's flags; the export path switches from {graph: template, executable: N} to {graph: template, instantiate_flags: flags} (runtime_core.py:282-287), and Helios then re-instantiates with cuGraphInstantiateWithFlags(..., graph.flags) (helios/src/runtime_core/mod.rs:1217-1218). The export no longer emits an executable at all for serving graphs, which is why the CUDA test's expectation flipped from flags == 1 to {"decode": 9, "tune": 1} (tests/preparation/test_recorded_export_graph_cuda.py:85-87).
  2. _executable_instantiation_flags opens a new handle to libcuda.so.1 per call via _Cuda() (runtime_core.py:200-205 → 76-78) — a nit already raised by the reviewer; not blocking.

The docstring also does not mention that unsupported executable flags raise after instantiation, which is the ordering defect recorded separately. Fix: state that the recorded flags replace the executable-derived flags for Helios re-instantiation, and that unsupported prior bits abort after instantiation. Per docs/design-review.md principle 16 and .agents/skills/repo-prose/SKILL.md ("comments explain invariants... state compatibility impact").

#8 [medium] Review scope and method for PR #581 (prose lens)

Scope of this review: prose lens only — PR description, commit message, and changed docstrings/comments. Every one of the three changed files was read in context:

Deliberately not covered (other lenses): the correctness of the default-on USE_NODE_PRIORITY for every recipe, the keep_graph=False / _flare_graph_metadata validation gap, per-graph _Cuda() reopen cost, and the missing live flare run qualification — all four are already raised by voipmonitor's CHANGES_REQUESTED review of 2026-11-28 22:13 (findings 1, 2, and 4). My nits on the hardcoded ~9 and on _Cuda() overlap with that review's finding 4 and should be presented as agreement, not as new defects.

No documentation files are changed by this PR, so no docs prose was reviewed for staleness; note however that docs/runtime-core-design.md:623 ("instantiate each graph with its recorded flags") already describes the new behaviour and required no edit — the description could have cited it as the specification the change implements.

No prose defect found in the changed test files: the new test names (test_capture_forwards_export_sets_node_priority_instantiation_flag) and inline assertions are self-describing, and the module docstrings were left accurate.