PR #690: Preserve inherited CUDA_HOME in ignition.cli.environment

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/759f637e-b9a6-45ae-8e64-cb931005b33b

Opened by a workflow run, Dec 2, 2026 4:08 PM EST. decide malicious: all_clear (100%): No malicious content found

explore

Author: jcartu (GitHub CONTRIBUTOR, not a maintainer; mostly Rust/helios & docs work, first change to ignition/cli/environment.py; Discord: jcartu) Motivation: Commit c9935887 made ignition fall back to /usr/local/cuda whenever [paths] cuda is unset, silently overwriting an inherited CUDA_HOME and pointing TRITON_PTXAS_PATH/CPATH at the wrong toolkit on hosts with several CUDA installs. The PR makes the config file win, then the caller's CUDA_HOME, then /usr/local/cuda, then native discovery. Scale: +183 / −10 lines in 5 files Proposal:

Full report · Notes

Value Proposition

Value Proposition — PR #690 "Preserve inherited CUDA_HOME in ignition.cli.environment"

Charter alignment. This is a 17-line fix in preparation tooling (ignition/cli/environment.py), not in the Helios runtime, so it adds no per-model branches or flags to shared runtime code. It addresses a concrete regression (#636, with a permalink to c9935887), which meets the charter's "reproducible bug" merge criterion. The one real tension is design-level: AGENTS.md:452-455 forbids reading an environment variable to choose behavior, while this same PR edits the neighbouring bullet (AGENTS.md:466-473) to document exactly that for CUDA_HOME. Principle 10's exception for "the documented CUDA device selection and dependency setup policies" (docs/design-review.md:89-92) is a plausible hook, but docs/cli-design.md:46-53 still states CUDA_VISIBLE_DEVICES is the only environment input and "Nothing else exists" — so post-merge the design doc contradicts the code. Fixable omission, not grounds to decline.

Novelty & status. Not obsolete: the only related merge since is c9935887, which is the regression. Not superseded: no open PR edits these lines; #231 (Triton/libdevice toolchain) is complementary, and #668/#678 touch apply() call sites, not the function. Genuinely additive: it is the first CPU-level coverage of environment.apply in the tree, since #71's tests/cli/test_serve.py cases have since vanished.

Value vs. cost. Blast radius is small — five call sites, all guarded by the empty paths.cuda default — against real benefit for users on multi-toolkit hosts. The residual cost is process risk: this four-line decision has been revised three times in six weeks (#71 → c9935887 → #690), each revision breaking the other camp, and #636 carries triage:design-review with zero maintainer comments. The PR also bundles an unrequested precedence reversal (ambient TRITON_PTXAS_PATH now loses to [paths] cuda, environment.py:78-81), against principle 10's "explicit user values win." Evidence is CPU-only, POSIX-only, author-reported, with no CI on head 682152b, no reproduction of the multi-toolkit scenario, and no downstream verification that the preserved value is honored.

Verdict: Worth it with changes. Required: (1) a recorded maintainer decision on #636's premise before merge; (2) drop or explicitly justify the TRITON_PTXAS_PATH precedence reversal; (3) reconcile docs/cli-design.md:46-53 and AGENTS.md:452-455; (4) a multi-toolkit reproduction or downstream toolkit assertion of the kind #231's review already requests.

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

Classify intake

Selected: triage:review, priority:P2, bug

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +triage:review, +priority:P2, +bug

Subtraction and simplicity

Subtraction/Simplicity lens on PR #690. The production diff is lean (9 lines in apply + one constant; no new knob, flag, schema change, wrapper or dead code). Four real simplifications, ranked:

  1. (high) Delete configured_cuda + the 3-line condition at ignition/cli/environment.py:58-59, 76-81. The alias exists only to flip precedence for TRITON_PTXAS_PATH, which #636 never asked for; reverting to the base one-liner removes a variable, a multi-line boolean and a .strip(), and costs two lines in tests/cli/test_environment.py:68,74 (the remaining 8 cases pass).
  2. (medium) tests/cli/test_environment.py:15-28, 45-58: the 12-entry _ENV_KEYS tuple duplicates the names apply writes and the setenv-then-pop trick needs a 3-line comment. A dict(os.environ) snapshot/restore fixture is ~18 lines shorter and cannot go stale.
  3. (medium) The same 4-step toolkit order is now written three times — docs/cli-design.md:1480, docs/model-preparation.md:123-132 (grown 4→10 lines), AGENTS.md:466-473 — while the now-false umbrella statements at docs/cli-design.md:46-53 ("No environment variables… one exception", "Two levels of precedence… Nothing else exists") were left untouched. Keep the table row plus a pointer; spend the two bullets instead.
  4. (low) Six identical skipif decorators (tests/cli/test_environment.py:61,78,92,109,123,138) should be one module-level pytestmark, as in 33 other test modules; and the new comment at environment.py:55-57 restates the branch below it while orphaning the pre-existing cuTile line 54.

Not removable: _DEFAULT_LINUX_CUDA (monkeypatch seam for the tests), the 1-line os.environ.pop("CUDA_HOME", None), and configuration.directory("cuda") (correct reuse of an existing helper). _load_config mirrors tests/cli/test_config.py:16-19 — consistent, not a violation.

Open: whether the ambient-TRITON_PTXAS_PATH override is intended (decides F1); where the toolkit policy should be documented; whether Windows will get a test.

Full report · Notes

Correctness and contracts

Correctness/contracts review of PR #690 (head 682152b): no Blocker; 4 Major findings, plus minors. Placement and ordering are right — environment.apply runs before torch import at all five call sites, the Windows branch is untouched, and there is no concurrency/memory/metric surface to break.

Majors: (1) the inherited CUDA_HOME is accepted with no validation (environment.py:61-63) while /usr/local/cuda is gated on is_dir() (:64), and libdevice/compiler identity derives from that root (tuning.py:52-65); a test asserts the invalid behavior (test_environment.py:110-120). (2) TRITON_PTXAS_PATH precedence silently reverses — [paths] cuda now beats an explicit ambient value, and blank values are filled (environment.py:78-81) against principle 10 "explicit user values win" (design-review.md:89-92); the blank arm has no test. (3) The design-doc contract is unreconciled: docs/cli-design.md:46-53 ("No environment variables … with one exception", "Nothing else exists") and AGENTS.md:461 ("the only variable Flare interprets") are unmodified and now false, though the PR relies on that clause for its principle-10 exception; issue #636 is triaged design-review with zero maintainer comments. (4) The resolved toolkit never appears in the plan/report (planning.py:383-420), contrary to AGENTS.md:456-460, and the #636 scenario (multi-toolkit host) is never reproduced — all 10 tests monkeypatch _DEFAULT_LINUX_CUDA.

Minors: stale #71 cuTile comment above code doing the opposite (environment.py:54-57); model-preparation.md:128-130 says "when unset" but blank values are also overwritten; whitespace normalization of an inherited CUDA_HOME untested; Windows untested (all cases skipif nt); latent non-idempotency (apply reads CUDA_HOME it wrote) unreachable since apply runs once per process.

Open: does a maintainer endorse CUDA_HOME outranking /usr/local/cuda? Is the ptxas override intended? Must cli-design 46-53 be amended for the exception to hold?

Full report · Notes

Final review

Recommendation: Changes Requested

The core fix in ignition/cli/environment.py is small, clean, well-placed before library imports, and directly addresses the regression reported in #636 without re-introducing #71's pip-bundle selection bug. Requesting changes before merge for two concrete items: (1) the PR leaves normative policy statements in AGENTS.md:461 and docs/cli-design.md:46-53 directly contradicting the new text it adds at AGENTS.md:468-471 and docs/cli-design.md:1480, and (2) it bundles an unrequested TRITON_PTXAS_PATH behavior change beyond #636 whose blank-value branch is untested and understated in docs/model-preparation.md:128-130 (on an issue still awaiting maintainer triage:design-review and with no CI run recorded on head 682152b).

Merge Risk

Level: Low

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

  1. Reconcile the self-contradictory environment-variable policy statements (AGENTS.md:461, docs/cli-design.md:46-53).
    • AGENTS.md:461 still states `CUDA_VISIBLE_DEVICES` is the only variable Flare interprets in the exact same bullet where this PR adds preserves a non-empty inherited `CUDA_HOME` (AGENTS.md:468-471).
    • docs/cli-design.md:46-53 still states "Flare reads none, with one exception: CUDA_VISIBLE_DEVICES" and "Two levels of precedence. Flags override the configuration file, which overrides the recipe. Nothing else exists", directly contradicting the updated CUDA toolkit row at docs/cli-design.md:1480 and ignition/cli/environment.py:61, 79.
    • Because Principle 10 (docs/design-review.md:91-92) makes the env-var exemption conditional on "the documented CUDA device selection and dependency setup policies", update AGENTS.md:461 and docs/cli-design.md:46-53 (2–3 sentences) so the normative policy matches the decision table and implementation. Also obtain maintainer sign-off on #636 (triage:design-review) and ensure Python CPU tests CI runs green on the updated head.
  2. Align scope, test coverage, and docs for the TRITON_PTXAS_PATH change (ignition/cli/environment.py:58-59, 78-81, docs/model-preparation.md:128-130).
    • Issue #636 asks only to preserve CUDA_HOME ahead of /usr/local/cuda. Beyond that, ignition/cli/environment.py:78-81 changes main's "TRITON_PTXAS_PATH" not in os.environ so that (a) explicit [paths] cuda now overwrites a non-blank ambient TRITON_PTXAS_PATH (aligning POSIX with Windows TRITON_PTXAS.EXE_PATH at :72), and (b) blank/whitespace TRITON_PTXAS_PATH values are now populated.
    • If keeping this change: add a unit test covering blank/whitespace TRITON_PTXAS_PATH (currently untested — every test in tests/cli/test_environment.py sets a non-blank value or leaves it absent) and update docs/model-preparation.md:129-130 from "populating it when unset" to "populating it when unset or blank". If scoping strictly to #636, see Subtract / Simplify #1 below.

Subtract / Simplify

  1. Optional strict-scope deletion (ignition/cli/environment.py:58-59, 78-81): If maintainers prefer not to change TRITON_PTXAS_PATH precedence beyond #636, delete configured_cuda and collapse lines 78–81 back to if ptxas.is_file() and not os.environ.get("TRITON_PTXAS_PATH", "").strip(): (or main's "TRITON_PTXAS_PATH" not in os.environ), removing the extra branch and keeping the PR strictly focused on CUDA_HOME.
  2. Deduplicate the 4-step toolkit precedence prose (docs/model-preparation.md:123-132): The same toolkit precedence order is now spelled out in three places (docs/cli-design.md:1480, docs/model-preparation.md:123-132, AGENTS.md:466-473) plus a fourth time in ignition/cli/environment.py:55-57. Given how frequently this policy has changed, keep the canonical specification in docs/cli-design.md and shorten docs/model-preparation.md:123-132 to a brief summary pointing to [the CLI design](cli-design.md).

Nits

Dropped on verification

Full report

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes Decision to Test: no (99%): 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. decide malicious: all_clear (100%): No malicious content found

explore

Author: jcartu (GitHub CONTRIBUTOR, not a maintainer; Rust/helios and docs work, first change to ignition/cli/environment.py; Discord: jcartu) Motivation: On non-Windows hosts where /usr/local/cuda exists, ignition overwrites an exported CUDA_HOME, so a preparation that picked a second CUDA toolkit silently gets the default one instead (issue #636). The PR makes a non-empty inherited CUDA_HOME win over /usr/local/cuda, while an explicit [paths] cuda setting still wins over both. Scale: +220 / −22 lines in 5 files (source change is 10 added lines in one function) Proposal:

Full report · Notes

Classify intake

Selected: triage:review, priority:P2, bug

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

No label changes

Subtraction and simplicity

PR #690 (head 39796ea4) is lean in code — 9 changed lines in one function, no new flags, config knobs, wrappers or dead code; the subtraction available is almost entirely prose.

  1. AGENTS.md:461-474 re-states the CUDA_HOME/TRITON_PTXAS_PATH/CPATH policy that the same sentence's trailing "as specified in [the CLI design]" already owns, and two of the three added clauses describe unchanged main behaviour. Replace with one clause pointing at docs/cli-design.md; also cross-link the :452-455 "never read an environment variable" prohibition to this carve-out.
  2. docs/cli-design.md states the same precedence three times: :50-55, :60-62 (pure restatement — delete) and the :1489 table row. The :53-55 TRITON_PTXAS_PATH/CPATH sentence duplicates the :1489 parenthetical and describes untouched code (environment.py:73-81 == main:65-73); keep the table row, trim the principle prose.
  3. ignition/cli/environment.py:54-64 — the trailing else: os.environ.pop("CUDA_HOME", None) is a no-op when CUDA_HOME is absent and unreachable for a non-empty value; hoisting it collapses the 3-way if/elif/else from 8 lines to 3 with identical behaviour.
  4. environment.py:22 _DEFAULT_LINUX_CUDA is used exactly once and exists only as a monkeypatch seam for the new tests; repo precedent (ignition/preparation/kv_codec.py:32) inlines the path. Defensible, but should be a deliberate choice. Minor: tests/cli/test_environment.py:151 and :165 both parametrize "" and " ", which .strip() to the same value at environment.py:58 — one blank case suffices.

Docs/model-preparation.md:123-126 (not opened) is the model: reduced correctly to a pointer. No existing repo helper is duplicated (Configuration.directory reused correctly; no conftest.py (not opened) exists).

Full report · Notes

Correctness and contracts

Correctness/contracts review of PR #690 (risk-lens 1/2/3/4). Two real findings plus two minor ones — but read the citation-basis caveat first.

Citation basis: the pr/690 snapshot this environment resolves does NOT match the stated head 39796ea (it still contains the pre-fix configured_cuda ptxas condition that the dossier says was removed, and docs/cli-design.md still has the old "No environment variables … only CUDA_VISIBLE_DEVICES" text). Findings below are marked [snapshot-verified] or [head-cited from prior pass].

Findings:

  1. Major [snapshot-verified] A stale/nonexistent inherited CUDA_HOME is accepted on truthiness alone — ignition/cli/environment.py:60-67, no is_dir() check unlike the /usr/local/cuda branch at :64. On a host that worked via /usr/local/cuda, a leftover exported CUDA_HOME now yields no TRITON_PTXAS_PATH and no CPATH; tests/cli/test_environment.py:109-120 freezes that no-op as contract and no doc discloses it (AGENTS.md:469-471).
  2. Major [snapshot-verified; dossier says fixed at head] TRITON_PTXAS_PATH precedence reversal — environment.py:78-81 overwrites a non-blank ambient TRITON_PTXAS_PATH whenever [paths] cuda is set, versus main:67 where ambient wins; test_environment.py:62-75 asserts the reversal. Contradicts the PR's "TRITON_PTXAS_PATH … unchanged".
  3. Minor [snapshot-verified] Docs unreconciled in this snapshot: docs/cli-design.md:46-51 still says CUDA_VISIBLE_DEVICES is the only variable while AGENTS.md:461-472 already describes CUDA_HOME preservation.
  4. Minor [snapshot-verified] apply() cannot distinguish inherited from derived CUDA_HOME (:61 reads the slot :69 writes), so a second call in one process can never un-set a previously written value.

Clean: Windows untouched and correctly gated (:70-75, :60); blank-value pop correct (:66-67, tested :140-149); no concurrency, lock, cache, allocation, metric or contract impact — the metric/rate/admission span check finds nothing sampled here.

Open: does the true head 39796ea contain finding 2? Should a nonexistent inherited CUDA_HOME fall back to /usr/local/cuda? #636 still has no maintainer decision; no end-to-end proof the preserved value steers flashinfer/nvcc.

Full report · Notes

Re-review

Recommendation: Ready To Merge

Head 39796ea cleanly resolves both prior Round 1 review items: ignition/cli/environment.py:75 restores main's exact "TRITON_PTXAS_PATH" not in os.environ check (keeping the diff strictly scoped to non-Windows CUDA_HOME fallback precedence), and AGENTS.md:461-474, docs/cli-design.md:46-62, 1489, and docs/model-preparation.md:123-126 are now mutually consistent with Principle 10 (docs/design-review.md:89-92). The code change is 10 added lines in a single startup function with well-isolated unit coverage (8 tests / 12 parametrized cases in tests/cli/test_environment.py) and zero runtime, concurrency, or Windows regressions. Maintainers should only confirm they endorse issue #636's policy premise (triage:design-review still has no recorded maintainer comment) and that PR CI passes on 39796ea.

Merge Risk

Level: Low

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

None.

Subtract / Simplify

  1. Optional prose deduplication (docs/cli-design.md:50-62, AGENTS.md:470-473): The full non-Windows CUDA toolkit precedence and TRITON_PTXAS_PATH/CPATH details are now written out three times in docs/cli-design.md (:50-55, :60-62, and the configuration ownership table at :1489) and once more in AGENTS.md:470-473. Consider keeping docs/cli-design.md:1489 as the single canonical specification, deleting the redundant second mention at docs/cli-design.md:60-62, and trimming docs/cli-design.md:50-55 and AGENTS.md:470-473 to brief pointers (matching the clean pattern already used in docs/model-preparation.md:123-126).

Nits

  1. docs/cli-design.md:50-52 / AGENTS.md:470-471: If maintainers want the stale-CUDA_HOME behavior explicit in docs, you can optionally note that a non-empty inherited CUDA_HOME is preserved verbatim without an existence check (matching [paths] cuda).

Dropped on verification

Full report Decision to Test: yes (50%): Testing will add considerable value with the code. It is ready to merge and the tests will validate and improve confidence on hardware we have available for testing.

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes

Pre Test Report

Hardware test plan — PR #690 "Preserve inherited CUDA_HOME in ignition.cli.environment"

Headline: this PR has no speedup to measure, and benchmarking it would waste GPU time

I read the actual head (39796ea4) rather than the case file, and the production diff is smaller than any of the review rounds described. ignition/cli/environment.py changes exactly one decision, executed once per process before any library import:

# main:55-58
if cuda is None and os.name != "nt" and Path("/usr/local/cuda").is_dir():
    cuda = Path("/usr/local/cuda")

# head:56-66
cuda = configuration.directory("cuda")
if cuda is None and os.name != "nt":
    inherited_cuda = os.environ.get("CUDA_HOME", "").strip()
    if inherited_cuda:                       cuda = Path(inherited_cuda)
    elif _DEFAULT_LINUX_CUDA.is_dir():       cuda = _DEFAULT_LINUX_CUDA
    else:                                    os.environ.pop("CUDA_HOME", None)

Verified byte-identical to main, i.e. out of test scope: POSIX TRITON_PTXAS_PATH (head:74-76 == main:66-68), CPATH prepending (head:77-81 == main:69-73), and the whole Windows branch (head:67-72 == main:59-64). The Round-1 TRITON_PTXAS_PATH precedence reversal and the doc contradictions were real at 682152b and are gone at this head.

Two consequences for the test engineer:

  1. No performance claim exists. The PR body, the dossier and all three review rounds make none. The change writes os.environ strings at startup; it cannot alter steady-state throughput. ignition bench measures captured-graph latency and explicitly excludes preparation (ignition/cli/bench.py:30-58), which is the only path this PR touches — so a bench run measures a quantity the diff cannot move, at the cost of a 96 GiB-GPU job.
  2. The property that can fail is toolkit identity, not speed: which CUDA_HOME/TRITON_PTXAS_PATH/CPATH/libdevice the process ends up with on a multi-toolkit host. Everything below tests that, and the whole thing fits in ~25 CPU-minutes and 0 GPU-minutes.

Host choice

Tier 0 — regression suite for the changed function (2 min, CPU, cn5)

uv sync --locked --extra prepare --extra test      # docs/model-preparation.md:67
CUDA_VISIBLE_DEVICES="" .venv/bin/python -m pytest tests/cli/test_environment.py -q

Expect 12 passed, 0 skipped. A skip means os.name == "nt" — wrong host. Do not count the author's 148/148 as evidence; it is author-reported and I found no CI result.

Tier 1 — close the two real CI blind spots (5 min, CPU, cn5)

CI runs ubuntu-24.04 with no CUDA toolkit installed (.github/workflows/python-cpu.yml:14 (not opened),21-33), so in CI _DEFAULT_LINUX_CUDA.is_dir() is always False and the /usr/local/cuda fallback and the pop branch never execute for real — the unit suite stubs them (tests/cli/test_environment.py:70,99,112,125,141,154,167). cn5 has a real toolkit, so it can cover both.

(a) Downstream proof that the toolkit is honored. tests/preparation/test_toolchain.py already exists and is GPU-free: it runs in a subprocess with CUDA_VISIBLE_DEVICES="", monkeypatches torch.cuda._lazy_init to raise so CUDA initialization cannot happen (:26-29), and asserts triton extern_libs["libdevice"] == Path(torch CUDA_HOME)/nvvm/libdevice/libdevice.10.bc (:34,67).

CUDA_VISIBLE_DEVICES="" .venv/bin/python -m pytest tests/preparation/test_toolchain.py -q   # want "2 passed"

2 skipped means no libdevice was found — report it as an unrun check, not a pass (AGENTS.md:302-307).

(b) Exercise the new is_dir() branch without monkeypatching:

env -u CUDA_HOME -u TRITON_PTXAS_PATH CUDA_VISIBLE_DEVICES="" .venv/bin/python -c "
from ignition.cli.config import Configuration; from ignition.cli import environment
import os; environment.apply(Configuration.load(None), ())
print({k: os.environ.get(k) for k in ('CUDA_HOME','TRITON_PTXAS_PATH','CPATH')})"

Configuration.load(None) with no file yields empty defaults, so paths.cuda == "" (ignition/cli/config.py:51,79-82). Expect CUDA_HOME=/usr/local/cuda iff that directory exists.

(c) Prove the tests are sensitive (docs/verification.md:121-135): in a scratch copy, replace environment.py:57-63 with main's one-liner; tests/cli/test_environment.py must fail. Restore.

Tier 2 — reproduce #636 at the decision point (10 min, CPU only, cn5)

Build two synthetic toolkits, each with real bin/ptxas, include/, nvvm/libdevice/libdevice.10.bc, and bin/nvcc symlinked to the real nvcc. The nvcc symlink is not optional: kv_codec._find_nvcc falls back to shutil.which("nvcc") and then /usr/local/cuda/bin/nvcc (ignition/preparation/kv_codec.py:26-32), so a toolkit without nvcc silently resolves to the real one and masks the decision under test.

Re-run the Tier 1(b) probe with variants:

Variant Env Expected (head) main
A -u CUDA_HOME /usr/local/cuda same
B (the fix) CUDA_HOME=/tmp/tk-b CUDA_HOME/TRITON_PTXAS_PATH/CPATH all under /tmp/tk-b /usr/local/cuda ← #636
C (regression) CUDA_HOME=/tmp/tk-b-missing CUDA_HOME kept verbatim; TRITON_PTXAS_PATH and CPATH absent /usr/local/cuda, works
D [paths] cuda=/tmp/tk-a + CUDA_HOME=/tmp/tk-b tk-a wins same
E preset TRITON_PTXAS_PATH=/opt/x/ptxas + CUDA_HOME=/tmp/tk-b ambient value kept (:75) same

Variant C is the only behavior regression versus main, and it is frozen as contract by tests/cli/test_environment.py:138-148: a host with a stale CUDA_HOME in its shell profile, which works today via /usr/local/cuda, will after this PR export CUDA_HOME and nothing else. Get a maintainer's explicit yes/no on that, or the test must change. Also confirm whitespace normalization: CUDA_HOME=" /tmp/tk-b " → CUDA_HOME=/tmp/tk-b (:58,:66).

Then the downstream leg — the thing no review round actually executed:

CUDA_HOME=/tmp/tk-b CUDA_VISIBLE_DEVICES="" .venv/bin/python -m pytest tests/preparation/test_toolchain.py -q
CUDA_HOME=/tmp/tk-b CUDA_VISIBLE_DEVICES="" .venv/bin/python -c "
from pathlib import Path
from ignition.preparation.kv_codec import compile_gpu_codec_cubin, _find_nvcc
print('nvcc:', _find_nvcc()); print('cubin:', compile_gpu_codec_cubin((12,0), cache_dir=Path('/tmp/kvcodec')))"

The second command proves CUDA_HOME steers a real compiler and produces an ELF cubin with no GPU (kv_codec.py:110-130). _find_nvcc() must print the /tmp/tk-b path.

Tier 3 — optional single-GPU prepare, only if "run it on hardware" must be satisfied (~1–2 GPU-hours, cn5, 1 of 4 GPUs)

Two arms with separate [paths] kernel_cache. This is essential: the compiled-forward cache key covers torch_key(), runtime_patches.identity(), device capability and name but not the toolkit (ignition/preparation/compilation.py:313-315), and kernel/tuning caches key on revision, recipe, GPU and settings (docs/cli-design.md:1762-1766). A shared cache makes the two arms identical and the run vacuous.

# Arm A — main behavior
env -u CUDA_HOME .venv/bin/ignition export nvidia/GLM-5.3-Flash-NVFP4 --gpus 0 --verbose   # kernel_cache=/data/pr690-a
# Arm B — PR fix
CUDA_HOME=/tmp/tk-b .venv/bin/ignition export nvidia/GLM-5.3-Flash-NVFP4 --gpus 0 --verbose # kernel_cache=/data/pr690-b

Log env | grep -E 'CUDA_HOME|TRITON_PTXAS_PATH|CPATH' before each. Compare the {"plan": ...} JSON on stderr: it should be identical — Plan.to_dict() records no [paths] settings (ignition/planning.py:383-420). Pass = both exports complete and arm B compiled against tk-b, with no -lcudart/pip-bundle error (the #71 recurrence check).

Do not run

What the engineer should report back

  1. Tier 0: 12 passed / 0 skipped, or the failures.
  2. Tier 1a: 2 passed vs 2 skipped (libdevice real vs missing).
  3. Tier 2: the variant table filled in, _find_nvcc() path, and whether the .cubin is a valid ELF file.
  4. An explicit maintainer answer on Variant C (stale CUDA_HOME yields no toolkit) — the one user-visible regression this PR introduces, test-frozen and undocumented.
  5. Confirmation that CI's Python CPU tests is green on the tested head; the last three review rounds each noted no observable CI result.

Bottom line: this is a low-risk, GPU-irrelevant change. Tiers 0–2 (≈17 CPU-minutes on cn5) fully validate the property that can fail, and one synthetic-toolkit prepare at most is worth the silicon. Approving a bench run would spend GPU time on a quantity the diff provably cannot change.

Full report · Notes

Discord Test Request

Discord post (ready to paste)

Recommendation: Test

High confidence — verified against the actual head (39796ea), not just the report: the production change is 10 added lines in ignition/cli/environment.py:56-66, replacing main:55-58. No performance claim exists anywhere in the PR, and none is possible. Test it on CPU, not on a GPU.

Hardware Required

Justification

Estimated Time to Complete

≈25 CPU-minutes on cn5 (Tier 0 ≈2 min regression suite, Tier 1 ≈5 min closing the CI blind spots, Tier 2 ≈10 min synthetic-toolkit precedence matrix). Add ~1–2 GPU-hours only if a real single-GPU prepare must be run to satisfy "tested on hardware."


Notes for whoever posts this (not part of the post)

  1. One maintainer decision is needed before merge, not before testing: Variant C — a host with a stale/non-existent CUDA_HOME in its shell profile currently works via /usr/local/cuda, but after this PR keeps CUDA_HOME verbatim and exports no TRITON_PTXAS_PATH/CPATH. I confirmed this is frozen as contract by tests/cli/test_environment.py:138-148. It is the only behavior regression versus main.
  2. Do not run ignition bench, any 4-GPU/TP job, a Windows comparison (no Windows host; the Windows branch :67-72 is byte-identical to main:59-64), or cn7 unless cn5 is down. facebook/dinov2-base and timm/vit_base_patch14_dinov2.lvd142m have no recipe anywhere in the tree — unusable; if a prepare is run, cn5's nvidia/GLM-5.3-Flash-NVFP4 is the one usable pair, with separate [paths] kernel_cache per arm (the cache key omits the toolkit, so a shared cache makes the two arms vacuous).
  3. Ask the engineer to report back: Tier 0 (12 passed / 0 skipped), Tier 1a (2 passed vs 2 skipped — a skip means no libdevice and must be reported as an unrun check, AGENTS.md:302-307 (not opened)), the filled-in variant table plus _find_nvcc() path and valid-ELF cubin, confirmation that Python CPU tests is green on the tested head (no observable CI result in any of the three review rounds), and the Variant C yes/no.

Full report