#1 [high] Change: what PR #690 changes in ignition/cli/environment.py (with line cites)
PR #690 (author jcartu, head 682152b, base main, 5 files +183/-10, opened 2026-12-02, state: open/ready for review, no reviews, no CI checks).
After (ignition/cli/environment.py:54-87 at pr/690):
_DEFAULT_LINUX_CUDA = Path("/usr/local/cuda")module constant added at line 22 (so tests can monkeypatch it).- lines 58-67:
configured_cuda = configuration.directory("cuda");cuda = configured_cuda; if None and os.name != "nt": inherited =os.environ.get("CUDA_HOME","").strip(); if inherited ->cuda = Path(inherited); elif_DEFAULT_LINUX_CUDA.is_dir()-> default; elseos.environ.pop("CUDA_HOME", None). - lines 68-87: unchanged Windows branch (
CUDA_PATH,TRITON_PTXAS.EXE_PATH, DLL dirs). POSIX:TRITON_PTXAS_PATHset only if<cuda>/bin/ptxasis a file AND (configured_cuda is not NoneOR current TRITON_PTXAS_PATH is blank/absent) — this is the only other logic change; CPATH prepend of<cuda>/includeunchanged (dedupe against existing entries, line 84-86). runtime_patches.apply()still called last (line 87).
Before (base main, same code as c9935887, lines 54-73):
cuda = configuration.directory("cuda")
if cuda is None and os.name != "nt" and Path("/usr/local/cuda").is_dir():
cuda = Path("/usr/local/cuda")
and POSIX ptxas condition was if ptxas.is_file() and "TRITON_PTXAS_PATH" not in os.environ:.
Behavior deltas not spelled out as separate items in the description:
- POSIX: ambient non-blank
TRITON_PTXAS_PATHnow loses to[paths] cuda(previously ambient env always won). This is a real precedence change for a variable the user set explicitly (design-review principle 10 "explicit user values win over defaults", docs/design-review.md:89-92). - A blank/whitespace
TRITON_PTXAS_PATHpreviously blocked setting it; now it is treated as unset and overwritten from the toolkit. - Inherited
CUDA_HOMEvalues are now normalized: whitespace stripped and re-exported as aPathstring (e.g. " /opt/cuda " -> "/opt/cuda"). - Inherited blank
CUDA_HOMEis deleted from os.environ when no default toolkit dir exists (description does state this). paths.cudastill resolves throughConfiguration.directory(ignition/cli/config.py:172-175), which returns None for the empty built-in defaultpaths.cuda = ""(config.py:51).
#2 [high] Why: issue #636 text and its linked provenance commit c9935887
Issue #636 "ignition no longer respects the CUDA_HOME environment variable" — open, opened 2026-11-30 11:36 by hiroshi-ya, updated 2026-11-30 11:37, labels: bug, enhancement, priority:P2, triage:design-review. No discussion comments (0). Referred to by #690 (this PR fixes it).
Arguments in the issue:
local-inference-lab/flashinferJIT resolves toolkit viaget_cuda_path()which checksos.environ.get("CUDA_HOME")first and substitutes$cuda_home/include.- PyTorch, CMake, Numba all prioritize
CUDA_HOMEover the hardcoded/usr/local/cudasymlink. - Root cause blamed on commit c99358879813f22557ac619044af514fafacecc6 (Luke Alonso, 2026-11-27, "Support integrated GA10B GPUs, adaptive executor parking, and explicit memory limits", PR #-not stated), which added the
cuda is None and os.name != "nt" and Path("/usr/local/cuda").is_dir()fallback. - The issue also notes
environment.apply(...)runs insideexport()(author cites ignition/cli/serve.py:291) before preparation, and the branch fires unconditionally when[paths] cudais unset. - The issue's ask: prioritize
CUDA_HOMEover/usr/local/cudaby default when config.toml doesn't exist; author asks for feedback.
Age/weight: open ~2 days before the PR (issue 2026-11-30, PR 2026-12-02). Labeled triage:design-review (labels are not readable in the repo copy — search_code over the tree for "triage:design-review" returns nothing, so label triage state cannot be confirmed from the repo).
#3 [high] Related work: #71 (merged) is the earlier CUDA-toolkit-precedence change that c9935887 later reversed in part
#71 "Preserve native CUDA toolkit selection with cuTile dependencies" — merged 2026-10-24 by eugr (COLLABORATOR), +39/-21, files: docs/cli-design.md, docs/model-preparation.md, ignition/cli/config.py, ignition/cli/environment.py (+2/-14), tests/cli/test_serve.py.
#71's rationale: installing cuda-tile[tileiras] adds nvcc under nvidia/cu13; Ignition had selected that compiler bundle as CUDA_HOME, breaking native weight-loader builds with cannot find -lcudart (wheel ships lib/libcudart.so.13, linker wants lib64/). Fix: set CUDA_HOME only when [paths].cuda is configured; otherwise let native build libraries do their own toolkit discovery. It explicitly says it covered "configured, unset, and inherited CUDA_HOME with a pip compiler present" in tests/cli/test_serve.py (+29/-2). Evidence in #71: tests/cli/test_serve.py + test_config.py 129 passed; fresh native-loader compile+import against system CUDA 13.0 passed; full CLI suite 417 passed / 7 failed all pre-existing.
Then c9935887 (2026-11-27, Luke Alonso) restored the /usr/local/cuda fallback on non-Windows (see current base code), which is the regression #636 reports.
Cross-reference: PR #690's docs edits modify the same two doc statements #71 introduced (docs/cli-design.md:1480, docs/model-preparation.md:123-131). #690 keeps #71's core rule (explicit [paths] cuda wins; nothing set when neither config nor default exists) but re-introduces an environment-derived flow that #71 had deliberately removed. Whether the "pip cuTile nvcc bundle" failure mode #71 fixed can reappear through the inherited-CUDA_HOME path is not addressed in #690's description.
#4 [high] Project fit: environment-variable policy in AGENTS.md and docs/cli-design.md vs this change
Rules the change touches:
- AGENTS.md:452-455 (Configuration): "Flare, Helios, recipes, and components never read an environment variable to choose behavior. Feature toggles, experiment switches, tuning overrides, debug modes, and alternate code paths selected through the environment are prohibited, including temporary ones." Then AGENTS.md:461-465: "
CUDA_VISIBLE_DEVICESis the only variable Flare interprets". The PR edits exactly this bullet (AGENTS.md:466-473) to add thatignition.cli.environmentpreserves a non-empty inheritedCUDA_HOMEbefore falling back to/usr/local/cuda. - docs/cli-design.md:46-51: "No environment variables. Flare reads none, with one exception:
CUDA_VISIBLE_DEVICES... Variables that underlying libraries read are set by Flare from its own configuration, and b12x's from the recipe's declared settings, before those libraries are imported." PR #690 does NOT update this statement, although after the change a variable (CUDA_HOME) is an input to what Flare sets, not only its own configuration. - docs/cli-design.md:52-53: "Two levels of precedence. Flags override the configuration file, which overrides the recipe. Nothing else exists." The new inherited-
CUDA_HOMElayer is a third source for the CUDA toolkit decision and is documented only in the per-decision table (cli-design.md:1480) and in docs/model-preparation.md:123-132, not reconciled with the "two levels" bullet. - docs/design-review.md:89-92 (principle 10) permits "the documented CUDA device selection and dependency setup policies" as an exception to the no-env-switch rule — the PR's justification for fitting the charter cites exactly this.
- AGENTS.md:165-169 (contribution scope): a change must address a demonstrated defect — #636 is a reproducer-style bug report citing the offending commit, so "demonstrated defect" is plausible, though the issue carries no log or repro output, only source reading.
- docs/cli-design.md:1403-1409 documents
[paths] cuda = "/opt/cuda" # Explicit CUDA toolkit directory for native builds.(unchanged text). - docs/windows.md:382-386 says "Configure
[paths] cudawith the toolkit root ... Ignition selects it from the configured toolkit" — Windows guidance unaffected and consistent with the PR's claim that Windows behavior is unchanged.
#5 [high] Claims and evidence: what #690 asserts and what backs it (and what is missing)
Claims in the description vs evidence, verified against the diff at pr/690:
- "Preserves a caller-supplied CUDA_HOME ... when [paths] cuda is unset" — implemented (ignition/cli/environment.py:58-67). Case 2 of the resolution order. OK.
- "[paths] cuda overrides inherited CUDA_HOME and ambient TRITON_PTXAS_PATH" — implemented (line 78-81:
configured_cuda is not None or not os.environ.get("TRITON_PTXAS_PATH","").strip()); testtest_configured_cuda_overrides_inherited_cuda_home_ptxas_and_default_toolkit(tests/cli/test_environment.py:61-75). Note: this ambient-override is a NEW behavior beyond the issue's ask (issue #636 only asked for CUDA_HOME precedence); it is stated in the description but only inside the precedence list. - "blank CUDA_HOME values are cleared when no toolkit source exists" — implemented (line 66-67) and tested (tests/cli/test_environment.py:138-149). Description states it.
- "pytest tests/cli -v: 146 passed, including all 10 cases in tests/cli/test_environment.py" — test count checks out: 4 single + 3+3 parametrized = 10 tests in the new file. The run is author-reported only; no CI check exists on head 682152b (orientation packet: "CI on the head commit: no checks"). The repo workflow
.github/workflows/python-cpu.yml:30-33runspytest tests/ -qwithCUDA_VISIBLE_DEVICES=""on ubuntu-24.04 with no CUDA toolkit, so CI would exercise the tests only through the monkeypatched_DEFAULT_LINUX_CUDA. - "Verified post-session environment restoration ... every managed variable in _ENV_KEYS matched its pre-session value" — plausible via the
clean_environmentfixture (tests/cli/test_environment.py:44-59), which is an unusual pattern: it callsmonkeypatch.setenv(key, "")thenos.environ.pop(key, None)for absent keys, relying on monkeypatch's undo entry surviving an immediate pop. That works with pytest's monkeypatch (undo recorded before mutating), but it is a non-obvious construction worth noting. - Limitations disclosed honestly: Windows (
os.name == "nt") not executed; no end-to-end GPU preparation. No GPU/hardware evidence at all, so the actual failure mode in #636 (wrong toolkit on multi-toolkit hosts) is not demonstrated as fixed on a host with both/usr/local/cudaand a second toolkit. - Not claimed or evidenced: any check that
ForwardCache/Tritonlibdevice selection follows the preservedCUDA_HOME, i.e. that the downstream consumer really honors the variable (tests/preparation/test_toolchain.py:31-69 asserts libdevice comes from torch'sCUDA_HOME, which is derived at torch import time — worth cross-checking, see related-work note on #231).
Design-acknowledgment trailer: repository .githooks/commit-msg:14-63 requires exactly one Design-Signed-Off-By: <identity>; design-review=<sha256[:4] of staged docs/design-review.md> trailer on every commit; I could not read the author's commit message body, so whether head 682152b carries one is unverified.
#6 [high] Related work: prior test coverage removed, in-repo consumers of CUDA_HOME, and files that overlap
- Test coverage history: #71 (merged, eugr) said it covered "configured, unset, and inherited CUDA_HOME" in tests/cli/test_serve.py (+29/-2). At PR head,
tests/cli/test_serve.pyhas no reference toenvironmentorapply(search_code over that file returns no matches), and no other tests/cli file calledenvironment.applybefore this PR. So PR #690's new tests/cli/test_environment.py (149 lines) is the only coverage of toolkit selection, and it re-establishes coverage that #71 introduced and later work dropped. - In-repo consumers of the decision: ignition/preparation/kv_codec.py:21-38
_find_nvccpreferstorch.utils.cpp_extension.CUDA_HOME, thenshutil.which("nvcc"), then/usr/local/cuda/bin/nvcc; scripts/qualify_qsa_fixed_partitions.py:229-230 requiresCUDA_HOME=/opt/cudaexplicitly; tests/preparation/test_toolchain.py:31-69 asserts Triton/Inductor's extern_libs libdevice path equalsPath(torch CUDA_HOME)/nvvm/libdevice/libdevice.10.bc. All three benefit from CUDA_HOME being preserved, and none is exercised against a multi-toolkit layout by #690's tests. - Helios/Rust never reads python's CUDA_HOME; nvcc paths are hardcoded in test helpers only (helios/src/runtime_core/persistent_worker.rs:1258-1259, 1824-1827, 2225-2228 → /usr/local/cuda-13.2, /usr/local/cuda). No compatibility impact from this PR.
- Open PR #231 (original-el8) touches the same domain: its Autobot review asks for a test that drives
CUDA_HOME/environment.applybefore the torch import and asserts libdevice comes from that toolkit. It does not edit ignition/cli/environment.py (files in common with #690: none besides docs). Complementary, not competing. related_items(690): only #636 is linked. Other PRs touching the same files are model/recipe work (#465, #432, #427, #410, #408, #117), #215 (FlashInfer pinning, docs), and open docs-touching PRs #671, #664, #597 — no conflicting edit to the four lines #690 changes (docs/cli-design.md:1480 and docs/model-preparation.md:123-131 were last authored by #71 then c9935887).- #668 (open) and #678 (open) concern
environment.applycall sites andb12x_environmentpropagation in ignition/cli/serve.py; #690 changes the same function that all fiveenvironment.applycall sites use (serve.py:210, 291, 436, 545; bench.py:205). Semantic interaction: for multi-host peers, rank-zero and peer each resolve CUDA_HOME independently on their own host, which is the intended per-host behavior but is not discussed in #690.
#7 [high] People: author jcartu's standing and history; area owners eugr/Luke Alonso; no reviewers yet
- Author: jcartu (GitHub association CONTRIBUTOR, i.e. not a maintainer; priority contributors per charter are @voipmonitor, @original-el8, @lukealonso — jcartu is not among them). Discord handle given per principle 17: "Discord: jcartu" (present in the description).
- History in repo: 3 merged (#505 "Bind core-declared FP32 parameters into text forward graphs" 2026-11-28; plus 2 more), 3 closed, 10 open. Open ignition-side PRs by the same author: #642 (relocate_inductor epilogue candidates), #621 (validate scheduler admission against core parameter declarations), plus several helios PRs opened the same day (#686–#693). Areas of merged PRs: docs (3), helios/src (3), heliopause/src (1), helios (1), helios/proto (1) — i.e. prior merged work is mostly Rust runtime/core, and this is his first change to ignition/cli/environment.py.
- Reported a related issue himself: #517 (closed) "Xid 31 in
_checkpoint_pages..." where he investigated TRITON_DEBUG instrumentation — shows prior engagement with preparation-time environment knobs. - Who normally works in these areas: ignition/cli — Luke Alonso (84 commits/180d), Martin Vit (25), jasonc (14); tests/cli — Luke Alonso (105), Eugene Rakhmatulin/eugr (29), Martin Vit (20); docs — Luke Alonso (391). The regression commit c9935887 is Luke Alonso's; the original CUDA_HOME precedent (#71) is eugr's. So the change is authored outside the two people who have owned this exact file (#71 by eugr, c9935887 by Luke Alonso).
- Engagement on this PR so far: zero comments, zero reviews, no reactions (pr_comments returns "No comments"). Issue #636 likewise has 0 comments and no maintainer answer to the reporter's "I'd appreciate any feedback" — so the issue's requested design confirmation (whether inheritance should be default) has not been recorded anywhere.
- Who the change affects: users on hosts with multiple CUDA toolkits (CUDA_HOME users), CI/preparation machines, anyone who sets TRITON_PTXAS_PATH ambiently, and Windows users (unchanged path); also any future test that calls environment.apply, since the new precedence changes previously ambient-wins semantics.
#9 [high] Community/Process: no reviewers, no CI, no issue discussion, docs-vs-code gaps, undeclared risk surface
Facts a reader could not get from the description:
- PR state: open, "ready for review" per orientation packet, opened and last updated 2026-12-02 (same day), head 682152b, base main, 5 files +183/-10. Labels: none. Reviews: none. No CI checks on head 682152b. Author association: CONTRIBUTOR.
- Discord line present ("Discord: jcartu"), satisfying principle 17 (docs/design-review.md:163-169) and AGENTS.md:142-153.
- Description follows the four-part scheme of principle 16 (why / what changed / claimed result / evidence + limitations), which is required (docs/design-review.md:147-160).
- Issue #636 carries labels bug, enhancement, priority:P2, triage:design-review — i.e. it was triaged toward design review, and this PR is the fix that claims to address it, but no maintainer has yet recorded a design decision in the issue.
- Tests added are 149 lines in a brand-new file; they are POSIX-only (every test carries
@pytest.mark.skipif(os.name == "nt", ...)at tests/cli/test_environment.py:61, 78, 92, 109, 123, 138), so Windows behavior — explicitly claimed unchanged — has no test at all. - Test file lists
"TRITON_PTXAS.EXE_PATH"in_ENV_KEYS(tests/cli/test_environment.py:26) but no Windows test uses it; it is defensive. - The fixture name
clean_environmentand the_ENV_KEYSlist duplicate the set of variablesapplywrites (environment.py:41-52, 69-72), so adding a new managed variable later requires updating both. - Scope: no user-facing CLI flag, no config-schema change (ignition/cli/config.py:31-32, 51 untouched); default behavior changes only for hosts where CUDA_HOME is set or blank, or where TRITON_PTXAS_PATH is set with
[paths] cudaconfigured. - Risk surface named nowhere in the description: #71's
-lcudartfailure mode. #71 removed automatic CUDA_HOME setting because the pip cuTilenvccundernvidia/cu13was selected and broke native builds. #690 never sets CUDA_HOME from a pip bundle — it only inherits what the caller exported — so the #71 failure can only recur if a user's own CUDA_HOME points at a pip cuda-tile bundle. That is worth stating explicitly for reviewers deciding merge risk, since docs/model-preparation.md:134-137 still says cuTile finds its own compiler independently. - Docs claim to reconcile: docs/model-preparation.md:128-131 says "On non-Windows hosts, Ignition also sets
TRITON_PTXAS_PATH(overriding the environment when[paths] cudais configured, or populating it when unset)". Code matches. It does NOT document the blank-TRITON_PTXAS_PATHcase (now overwritten) nor the whitespace-stripping of CUDA_HOME.
#10 [high] Connection: this 4-line decision has now been revised three times in six weeks, each time by a different author
Chain of custody for the CUDA toolkit decision (each step verified):
- 2026-10-23/24 — #71 (eugr, merged) removes automatic
CUDA_HOMEassignment: set it only when[paths] cudais configured, because the pip cuTile bundlenvidia/cu13was being chosen and broke native builds withcannot find -lcudart. Docs updated in the same PR (docs/cli-design.md, docs/model-preparation.md). - 2026-11-27 — c9935887 (Luke Alonso, "Support integrated GA10B GPUs, adaptive executor parking, and explicit memory limits") restores a fallback but not from the environment: it uses
/usr/local/cudawhen[paths] cudais unset on non-Windows and the directory exists. Verified by reading ignition/cli/environment.py at c99358879813f22557ac619044af514fafacecc6 (lines 53-58). This is the line #636 blames, with a permalink in the issue. - 2026-11-30 — #636 (hiroshi-ya) reports that treating
/usr/local/cudaas the source of truth overrides an inheritedCUDA_HOME, citing flashinfer'sget_cuda_path()and PyTorch/CMake/Numba as precedent. Labeled bug/enhancement/priority:P2/triage:design-review. No maintainer reply. - 2026-12-02 — #690 (jcartu) implements the issue's ask with
[paths] cuda> inheritedCUDA_HOME>/usr/local/cuda> native discovery, and additionally makes[paths] cudabeat an ambientTRITON_PTXAS_PATH. So the PR is the third revision of one 4-line decision in ~6 weeks, each revision by a different person (eugr → Luke Alonso → jcartu), each justified by a concrete downstream build failure. A reviewer deciding this should weigh that the previous two revisions each broke someone: #71 broke CUDA_HOME users (leading to #636), and c9935887 broke multi-toolkit hosts. The PR's design (config > environment > filesystem default) is the first version that can satisfy both as long as the caller's CUDA_HOME is a real toolkit.
#11 [high] Reach: five apply() call sites, silent TRITON_PTXAS_PATH override, doc-consistency gaps, no cross-host propagation
Who and what this touches:
- Users/operators: anyone preparing models on a host with more than one CUDA toolkit installed (the case in #636), and anyone who exports CUDA_HOME before
ignition export/ignition join/ignition bench/ignition debug-serve. Those five call sites are the entire blast radius: ignition/cli/serve.py:210 (multi-host export rank zero), :291 (_prepare), :436 (debug_serve), :545 (join, one GPU per peer host), and ignition/cli/bench.py:205. - Config/defaults: no new keys;
paths.cudaprecedence unchanged; the new behavior triggers only whenpaths.cudais empty (its built-in default, ignition/cli/config.py:51) so all users who never configurepaths.cudaare affected whenever CUDA_HOME is exported or blank. - Behavior changes for existing users (both stated in the PR body, but each is a silent switch): (a) ambient non-blank
TRITON_PTXAS_PATHis now replaced whenever[paths] cudais set — previously ambient won; (b) blank/whitespaceTRITON_PTXAS_PATH/CUDA_HOMEare normalized instead of left alone. A user reproducing a build with a pinnedTRITON_PTXAS_PATHand a[paths] cudaentry would see the pin silently overridden. - Compatibility: no Protobuf, core-format, ABI or Rust change; no exported artifact changes; nothing here can invalidate an existing core (design-review principle 13 unaffected). Windows path untouched (environment.py:70-75), so docs/windows.md:382-386 guidance stays valid.
- Dependencies: does not change pins; interacts with
cuda-tile[tileiras](docs/model-preparation.md:134-137), which supplies its own cuTile compiler independently of CUDA_HOME — unchanged by the PR. - Documentation reach: 3 of 5 changed files are prose (AGENTS.md:466-473, docs/cli-design.md:1480, docs/model-preparation.md:123-132). The doc edits are consistent with the code, but AGENTS.md now documents an environment-variable read in a section whose first bullet forbids environment-variable behavior switches (AGENTS.md:452-455), and docs/cli-design.md:46-51 still says
CUDA_VISIBLE_DEVICESis the only environment input and that Flare sets library variables "from its own configuration". Principle 10's exception wording ("documented CUDA device selection and dependency setup policies", docs/design-review.md:89-92) is the hook the PR relies on; whether this doc update is sufficient "documenting" of that policy is a judgment the reviewers must make. - Multi-host reach: each host resolves its own CUDA_HOME; nothing propagates values across
ignition join(unlike b12x_environment in #668), so heterogeneous toolkits across hosts remain possible and unaddressed — outside this PR's stated scope.
#12 [high] Research summary
Case file for PR #690 ("Preserve inherited CUDA_HOME in ignition.cli.environment", jcartu, head 682152b, open/ready for review, no reviews, no CI checks, 5 files +183/−10) is gathered; 11 scratchpad entries cover every angle.
Key findings a reader could not get from the description:
- This 4-line decision has now been revised three times in six weeks by three different people: #71 (eugr, merged, removed automatic CUDA_HOME to fix
cannot find -lcudart) → c9935887 (Luke Alonso, added the/usr/local/cudafallback that #636 blames) → #690 (jcartu, config > inherited CUDA_HOME >/usr/local/cuda> native discovery). Each prior revision broke the other camp. - #690 changes precedence for a second variable that the description only mentions inside its list: a non-blank ambient
TRITON_PTXAS_PATHis now overridden whenever[paths] cudais set (previously ambient always won), and blankTRITON_PTXAS_PATHis now populated where it previously blocked population. - Test coverage is new but POSIX-only (all 10 tests skip on
os.name == "nt"), and Windows behavior — claimed unchanged — has no test. The previous coverage that #71 said it added to tests/cli/test_serve.py no longer exists there. - Docs/doc-invariant tension: AGENTS.md:452-455 forbids environment-variable behavior switches while the same PR edits AGENTS.md:466-473 to document one; docs/cli-design.md:46-53 still says
CUDA_VISIBLE_DEVICESis the only environment input and that precedence has exactly two levels — neither statement was updated. Principle 10's documented CUDA/dependency exception (docs/design-review.md:89-92) is the hook relied on. - #71's cuTile
-lcudartfailure cannot recur through this path unless a user's own CUDA_HOME points at the pip bundle — nowhere stated in the PR. No GPU/multi-toolkit end-to-end evidence; #636 itself has zero comments and no maintainer design answer.
Angles with nothing further found: competing or superseding PRs (none; #231 is complementary, #668/#678 touch call sites only), and community engagement (zero comments/reviews/reactions on both #636 and #690). Full details, file:line cites and cross-links are in the scratchpad entries 1-11.
#14 [high] Report outline: key-findings order, file map, and angles with nothing found
File map of the change (pr/690): ignition/cli/environment.py:22 (new _DEFAULT_LINUX_CUDA), :54-67 (resolution order config > inherited CUDA_HOME > default > unset/pop), :78-81 (TRITON_PTXAS_PATH condition now configured_cuda is not None or not env value.strip()), :82-86 (CPATH prepend unchanged); tests/cli/test_environment.py:1-149 (new, 10 POSIX-only tests, clean_environment fixture at :44-59, _ENV_KEYS at :12-28); docs/cli-design.md:1480; docs/model-preparation.md:123-132; AGENTS.md:466-473. Unchanged but load-bearing: ignition/cli/config.py:31-32,51,172-175 (paths.cuda default ""), docs/cli-design.md:46-53 (no-env-vars and two-levels precedence bullets), docs/cli-design.md:1403-1409, docs/windows.md:382-386.
Suggested Key findings order (most-undiscoverable first): (1) three-author revision chain #71 → c9935887 → #690 with entry 10; (2) undeclared ambient TRITON_PTXAS_PATH precedence reversal, entry 1 and entry 11; (3) AGENTS.md/cli-design.md env-var invariants now inconsistent, entry 4; (4) POSIX-only tests + no GPU/multi-toolkit evidence, Windows untested, entry 5/9; (5) dropped coverage that #71 had added, entry 6; (6) #636 triaged triage:design-review with no maintainer answer and zero discussion, entry 2/7.
Angles with nothing beyond what is recorded: "Community" — zero comments, reviews and reactions on #690 and on #636 (pr_comments: "No comments"); "Related work: competing/superseded" — none; #668/#678 touch apply() call sites only, #231 is complementary, no open PR edits the same four lines. Everything else has entries 1-11.
#16 [high] Amendment 2026-12-02 (second report): head 39796ea4 narrows scope, reconciles docs, adds a review cycle
New head: 39796ea4 ("Preserve inherited CUDA_HOME in ignition.cli.environment", jcartu, pushed 2026-12-02 21:46). PR is now +220/−22 in 5 files (was +183/−10 at 682152b; per pr_files: AGENTS.md +13-8, docs/cli-design.md +18-9, docs/model-preparation.md +4-3, ignition/cli/environment.py +10-2, tests/cli/test_environment.py +175-0). Labels now exist: bug, priority:P2, triage:review (previously none reported). Note: pr_diff and search_history both error at this head ("Could not read c513e46a... bad revision" / "Failed to traverse parents"), so the unified diff was unavailable; facts below verified by reading files at pr/690.
RETRACTED findings from entry #15:
- "Ambient non-blank TRITON_PTXAS_PATH now loses to
[paths] cuda, blank one is filled" — GONE. The author removedconfigured_cudaand restored main's condition verbatim:if ptxas.is_file() and "TRITON_PTXAS_PATH" not in os.environ:(ignition/cli/environment.py:75, identical to main:67). No TRITON_PTXAS_PATH precedence change remains, so the principle-10 "explicit user values win" objection and the "undeclared second variable" objection are both resolved. - "AGENTS.md:452-455 / docs/cli-design.md:46-53 still contradict the new policy" — largely GONE. docs/cli-design.md:46-62 rewritten: "No environment-variable behavior switches. Flare reads environment variables only for CUDA device selection and non-Windows preparation toolkit dependency setup..." plus a two-levels bullet that explicitly carves out host CUDA toolkit discovery (:58-62). AGENTS.md:461-474 rewritten to "The only environment variables Flare inspects belong to its documented CUDA device selection and preparation dependency setup policies" and documents the CUDA_HOME fallback. docs/model-preparation.md:123-126 now only summarises and links cli-design.md. docs/cli-design.md:1489 table row updated. Residual (minor): AGENTS.md:452-455 still states the unqualified "never read an environment variable to choose behavior" with no pointer to the :461 exception; and cli-design.md:53-54 documents "keeps a pre-set TRITON_PTXAS_PATH" for "any resolved toolkit", which is unchanged main behavior, not new.
STILL STANDING / NEW:
3. Remaining diff is now exactly the CUDA_HOME fallback: _DEFAULT_LINUX_CUDA = Path("/usr/local/cuda") (environment.py:22) and resolution at :54-64 — [paths] cuda → stripped non-empty inherited CUDA_HOME → _DEFAULT_LINUX_CUDA if it is a dir → else os.environ.pop("CUDA_HOME", None). Windows branch (:67-72) and CPATH prepend (:77-81) untouched.
4. Residual risk now locked in by a test: a non-existent/stale inherited CUDA_HOME is preserved and deliberately does NOT fall back to /usr/local/cuda (tests/cli/test_environment.py:138-148, test_inherited_cuda_home_without_local_files_does_not_fall_back_to_default). On a host that previously "just worked" via /usr/local/cuda, an exported-but-stale CUDA_HOME now silently yields no toolkit env at all. This is the intended design (documented as "non-empty inherited CUDA_HOME") but it is the one regression path the PR creates relative to main, and no doc or PR text calls it out.
5. Tests: 8 functions / 12 parametrized cases in 175 lines (6 singles at :66, :81, :96, :109, :122, :138 plus 3+3 at :151 and :165), matching the author's "12/12" claim; POSIX-only via a single module-level pytestmark skipif (tests/cli/test_environment.py:15-18), so Windows is still entirely untested. clean_environment fixture at :50-63; _ENV_KEYS at :20-33. The [paths] cuda cases (:66-93) now assert only that an unset TRITON_PTXAS_PATH is filled and a pre-set one is kept, i.e. main behavior. CI does run pytest tests/ -q on ubuntu-24.04 with CUDA_VISIBLE_DEVICES="" (.github/workflows/python-cpu.yml:30-33), so the suite will execute in PR CI; I could not see check results for the new head.
6. Process now has one cycle where before there was none: Autobot review at 21:24 (Changes Requested, 0 blockers / 2 should-fix / 2 simplify / 3 nits; notes AGENTS.md:461 and docs/cli-design.md:46-53 contradictions and the unrequested TRITON_PTXAS_PATH change), author reply at 21:46 claiming all items addressed. Both review items are factually resolved in code/docs. Still unchanged: #636 has zero comments and carries triage:design-review (no maintainer design decision), no human reviewer assigned, and the three-author revision chain (#71 → c9935887 → #690) still has no owner-designated answer.
7. Evidence still author-reported and single-platform: "pytest tests/cli -v: 148 passed, 12/12 in test_environment.py" on Linux x86_64 with CUDA_VISIBLE_DEVICES=""; explicitly no Windows run and no GPU/multi-toolkit end-to-end reproduction of #636. The core claim (that preserving CUDA_HOME actually makes flashinfer's JIT / nvcc pick the right toolkit) is still untested — only the env dict is asserted.
#17 [high] Research summary
Amendments to the #690 case file (new head 39796ea4, 2026-12-02 21:46)
Scope of this amendment: PR #690 was pushed again (39796ea4) after the Autobot review at 21:24, and the author replied. The report of 2026-12-02 (notes #15) is superseded on two of its six key findings; the rest stand. Full reasoning in note #16.
Two findings retracted
-
"Undeclared
TRITON_PTXAS_PATHprecedence reversal" — gone. The author removedconfigured_cudaand restoredmain's condition verbatim:if ptxas.is_file() and "TRITON_PTXAS_PATH" not in os.environ:(ignition/cli/environment.py:75atpr/690, identical tomain:67). A non-blank ambientTRITON_PTXAS_PATHstill wins, as before; a blank one still blocks the assignment. The principle-10 "explicit user values win" objection and the "second variable the body understates" objection both dissolve.CPATHhandling is likewise byte-identical tomain(environment.py:77-81vsmain:69-73). -
"AGENTS.md and docs/cli-design.md still contradict the new policy" — largely resolved.
docs/cli-design.md:46-57now reads "No environment-variable behavior switches. Flare reads environment variables only for CUDA device selection and non-Windows preparation toolkit dependency setup…", naming theCUDA_HOMEfallback, and:58-62appends a precedence bullet ("no environment-variable settings layer exists… Host CUDA toolkit discovery on non-Windows hosts falls back through inheritedCUDA_HOMEand/usr/local/cudaonly when[paths] cudais unset").AGENTS.md:461-474was rewritten from "CUDA_VISIBLE_DEVICESis the only variable Flare interprets" to "The only environment variables Flare inspects belong to its documented CUDA device selection and preparation dependency setup policies".docs/model-preparation.md:123-126now summarises and linkscli-design.mdinstead of restating the rules, and the table rowdocs/cli-design.md:1489matches the code.- Residual nit, not a conflict:
AGENTS.md:452-455still states the unqualified "never read an environment variable to choose behavior" with no pointer to the:461exception, anddocs/cli-design.md:53-54documents "keeps a pre-setTRITON_PTXAS_PATH" as if it were new when it is unchangedmainbehavior.
- Residual nit, not a conflict:
Net effect on the change
The diff is now exactly one decision: _DEFAULT_LINUX_CUDA = Path("/usr/local/cuda") (ignition/cli/environment.py:22) plus resolution order at :54-64 — [paths] cuda → stripped non-empty inherited CUDA_HOME → _DEFAULT_LINUX_CUDA when that directory exists → os.environ.pop("CUDA_HOME", None). Windows (:67-72) untouched. PR is now +220/−22 in 5 files (was +183/−10 at 682152b): AGENTS.md +13/−8, docs/cli-design.md +18/−9, docs/model-preparation.md +4/−3, ignition/cli/environment.py +10/−2, tests/cli/test_environment.py +175/−0. Labels now report as bug, priority:P2, triage:review.
One new finding the earlier report could not make
The PR locks in a non-existent-CUDA_HOME regression as intended behaviour. test_inherited_cuda_home_without_local_files_does_not_fall_back_to_default (tests/cli/test_environment.py:138-148) asserts that a stale or nonexistent inherited CUDA_HOME is preserved, with neither TRITON_PTXAS_PATH nor CPATH set and no fallback to _DEFAULT_LINUX_CUDA. On a host that previously worked via /usr/local/cuda, exporting a stale CUDA_HOME now silently yields no toolkit environment at all — the inverse of #636 and the only path where main's behavior is arguably better. This follows from "preserves a non-empty inherited CUDA_HOME" and is now a deliberate, tested contract, but neither the PR text nor any of the three docs mentions it; it deserves a one-line note in docs/cli-design.md:50-53.
Test and process counts corrected
- Tests are 8 functions / 12 parametrized cases in 175 lines (
test_environment.py:66, 81, 96, 109, 122, 138, plus 3+3 at:151and:165), matching the author's "12/12", not the 10 cases quoted at682152b. - POSIX gating is now a single module-level
pytestmark(test_environment.py:15-18); Windows remains entirely untested, and the two[paths] cudacases (:66-93) now assert only unchangedmainbehaviour. - CI will execute the suite:
.github/workflows/python-cpu.yml:30-33(not opened) runspytest tests/ -qonubuntu-24.04withCUDA_VISIBLE_DEVICES="", so the_DEFAULT_LINUX_CUDAmonkeypatch works there; check results for39796ea4were not observable here. - Process improved from "no cycle" to "one cycle": Autobot review 21:24 (Changes Requested; 0 blockers / 2 should-fix / 2 simplify / 3 nits, naming the
AGENTS.md:461anddocs/cli-design.md:46-53contradictions and the unrequestedTRITON_PTXAS_PATHchange), author reply 21:46 with per-item disposition. Both should-fix items are factually resolved in the code and docs; the simplifications and one nit are done, the remaining two nits (optionally) open. - Unchanged and still the main review risk: #636 still has zero comments and carries
triage:design-reviewwith no maintainer design decision; no human reviewer; the three-author revision chain (#71 →c9935887→ #690) still has no owner-designated answer; evidence is still one platform, author-reported, with no GPU or multi-toolkit end-to-end run demonstrating that the preservedCUDA_HOMEactually steers flashinfer's JIT andnvcc. Only the environment dict is asserted, not the downstream toolkit selection that #636 is about.
Tooling note for downstream reviewers
pr_diff and search_history fail against this head (bad revision c513e46a…, "Failed to traverse parents of commit 682152b"), so the exact base-to-head diff could not be read; every statement above was verified by reading files at pr/690 and diffing them by eye against main (e.g. ignition/cli/environment.py:54-81 vs main:54-73).
#18 [high] Amendment report text (run 2, head 39796ea4) — the exact amendments to append to note #15
Use this as the addendum to the report in note #15; do not rewrite #15, only amend it.
Amendments (head 39796ea4, pushed 2026-12-02 21:46, after the Autobot review of 21:24)
1. RETRACTED — "undeclared TRITON_PTXAS_PATH precedence reversal"
The author removed configured_cuda and restored main's condition verbatim: if ptxas.is_file() and "TRITON_PTXAS_PATH" not in os.environ: (ignition/cli/environment.py:75 at pr/690 == main:67). A non-blank ambient TRITON_PTXAS_PATH still wins; a blank one still blocks the assignment. The principle-10 "explicit user values win" objection and the "second variable understated" objection both dissolve. CPATH handling is byte-identical to main (environment.py:77-81 vs main:69-73).
2. RETRACTED (mostly) — "AGENTS.md / docs/cli-design.md contradict the new policy"
docs/cli-design.md:46-57 is now "No environment-variable behavior switches. Flare reads environment variables only for CUDA device selection and non-Windows preparation toolkit dependency setup…" naming the CUDA_HOME fallback; :58-62 adds a precedence bullet ("no environment-variable settings layer exists… Host CUDA toolkit discovery on non-Windows hosts falls back through inherited CUDA_HOME and /usr/local/cuda only when [paths] cuda is unset"). AGENTS.md:461-474 changed from "CUDA_VISIBLE_DEVICES is the only variable Flare interprets" to "The only environment variables Flare inspects belong to its documented CUDA device selection and preparation dependency setup policies", plus the CUDA_HOME fallback sentence. docs/model-preparation.md:123-126 now summarises and links cli-design.md instead of restating the rules. Table row docs/cli-design.md:1489 matches the code.
Residual nit only (not a conflict): AGENTS.md:452-455 still states the unqualified "never read an environment variable to choose behavior" without a pointer to the :461 exception; and docs/cli-design.md:53-54 documents "keeps a pre-set TRITON_PTXAS_PATH" as if new, though it is unchanged main behaviour.
3. Net effect
The diff is now one decision: _DEFAULT_LINUX_CUDA = Path("/usr/local/cuda") (ignition/cli/environment.py:22) plus resolution at :54-64 — [paths] cuda → stripped non-empty inherited CUDA_HOME → _DEFAULT_LINUX_CUDA when that directory exists → os.environ.pop("CUDA_HOME", None). Windows (:67-72) untouched. PR is +220/−22 in 5 files (was +183/−10 at 682152b): AGENTS.md +13/−8, docs/cli-design.md +18/−9, docs/model-preparation.md +4/−3, ignition/cli/environment.py +10/−2, tests/cli/test_environment.py +175/−0. Labels now report as bug, priority:P2, triage:review.
4. NEW finding — a non-existent inherited CUDA_HOME regression is now a tested contract
test_inherited_cuda_home_without_local_files_does_not_fall_back_to_default (tests/cli/test_environment.py:138-148) asserts that a stale/nonexistent inherited CUDA_HOME is preserved with neither TRITON_PTXAS_PATH nor CPATH set and no fallback to _DEFAULT_LINUX_CUDA. On a host that previously worked via /usr/local/cuda, exporting a stale CUDA_HOME now silently produces no toolkit environment — the inverse of #636 and the only path where main's behaviour is arguably better. It follows from "preserves a non-empty inherited CUDA_HOME", but neither the PR text nor the three docs mention it; it deserves one line in docs/cli-design.md:50-53.
5. Corrected counts
Tests are 8 functions / 12 parametrized cases in 175 lines (test_environment.py:66, 81, 96, 109, 122, 138, plus 3+3 at :151 and :165) — matching the author's "12/12", not the 10 cases quoted at 682152b. POSIX gating is a single module-level pytestmark (:15-18); Windows remains entirely untested; the two [paths] cuda cases (:66-93) now assert only unchanged main behaviour. CI will execute the suite: .github/workflows/python-cpu.yml:30-33 runs pytest tests/ -q on ubuntu-24.04 with CUDA_VISIBLE_DEVICES="", so the _DEFAULT_LINUX_CUDA monkeypatch works there; check results for 39796ea4 not observable.
6. Process improved from "no cycle" to "one cycle"
Autobot review 21:24 = Changes Requested (0 blockers / 2 should-fix / 2 simplify / 3 nits; named the AGENTS.md:461 and docs/cli-design.md:46-53 contradictions and the unrequested TRITON_PTXAS_PATH change); author reply 21:46 with per-item disposition. Both should-fix items are factually resolved; simplifications done; two nits optionally open.
7. Unchanged, still the main review risk
#636 has zero comments and carries triage:design-review with no maintainer decision; no human reviewer; the three-author chain (#71 → c9935887 → #690) has no owner-designated answer; evidence is one platform, author-reported, with no GPU/multi-toolkit end-to-end run showing the preserved CUDA_HOME actually steers flashinfer's JIT and nvcc. Only the env dict is asserted, not the downstream toolkit selection #636 is about.
8. Tooling caveat
pr_diff and search_history fail at this head (bad revision c513e46a… / "Failed to traverse parents of commit 682152b"), so the exact base-to-head diff could not be read; all statements verified by reading files at pr/690 against main (ignition/cli/environment.py:54-81 vs main:54-73).
#8 [medium] The change: base implementation, authorship history of the function, and testability indirection
Base-branch code at pr/690's merge base (identical to c9935887 output, verified by reading ignition/cli/environment.py at c99358879813f22557ac619044af514fafacecc6, lines 53-73):
# cuTile discovers its compiler bundle independently of the native toolkit.
cuda = configuration.directory("cuda")
if cuda is None and os.name != "nt" and Path("/usr/local/cuda").is_dir():
cuda = Path("/usr/local/cuda")
if cuda is not None:
os.environ["CUDA_HOME"] = str(cuda)
... nt branch ... else:
ptxas = cuda / "bin/ptxas"
if ptxas.is_file() and "TRITON_PTXAS_PATH" not in os.environ:
os.environ["TRITON_PTXAS_PATH"] = str(ptxas)
include = cuda / "include"
if include.is_dir(): ... prepend to CPATH ...
runtime_patches.apply()
History of this function (search_history on ignition/cli/environment.py): 794b0bb4 2026-10-11 (separate Python preparation), 884b9b50 2026-10-14 (Windows), 63f45f3a 2026-10-15, d5fd9824 2026-10-23 eugr "Preserve native CUDA toolkit selection with cuTile dependencies (#71)", 225d4669 (#117), 28f0833b, af0907d9, c9935887 2026-11-27 Luke Alonso (added /usr/local/cuda fallback), 682152b6 2026-12-02 jcartu (this PR).
Note the function's own comment "cuTile discovers its compiler bundle independently of the native toolkit" survives in the new code (line 54) but the PR's comment block below it (lines 55-57) now describes a different intent — a prose/comment-accuracy observation, not a code-review issue.
Also notable: os.environ.update({... **dict(b12x)}) runs before the CUDA block; nothing in the CUDA block interacts with b12x keys, so no ordering hazard is introduced by the reordering.
_DEFAULT_LINUX_CUDA is read at call time (module attribute lookup inside apply), which is why the tests can monkeypatch it (tests/cli/test_environment.py:66 and 5 other sites). Adding this module-level indirection is a small testability change beyond the described fix, but it is what makes the tests hermetic on a host without /usr/local/cuda (the author says the test host has none).
#13 [medium] Recent activity: what changed lately in the four areas and whether #690 builds on, conflicts with, or reverses it
ignition/cli (last 60 days, per orientation packet + search_history): 0fca9938 2026-12-02 Luke Alonso (#683 CLI prog propagation / state.py kernels), a3c80e19 (#657 mDNS advertise), c146d7be (#620 remove copy/history drafts), f7d6428f (#592 sm110 identifiers, kbenkhaled), d3d0e783 (#212 context ceilings), c9935887 2026-11-27 Luke Alonso (the commit that introduced the regression), 5adb27f2, f3a5b709 (#544 dfly2). Fast-moving area dominated by Luke Alonso; #690's 17-line edit in environment.py is the only CUDA-toolkit change since c9935887.
tests/cli: 0fca9938 (#683), a3c80e19 (#657), efc6252d (#635), a39f6777, d3d0e783 (#212), 5adb27f2, f3a5b709 (#544), 698ee450 (#545). No test file exercised environment.apply before #690 (search_code over tests/cli for environment/apply found only the new file), so this is the first CPU coverage of the function.
docs: heavy, mostly scheduling/helios work by PCCessna and Luke Alonso (#681, #661, #665, #660, #670, #663, #666, #657). The two doc lines #690 edits were last touched by eugr's #71 and then c9935887; no open PR modifies docs/cli-design.md:1480 or docs/model-preparation.md:123-132.
Relation verdict: #690 builds directly on c9935887 (it keeps the /usr/local/cuda fallback and the _DEFAULT_LINUX_CUDA semantics) and partially reverses #71's intent by re-introducing an environment-derived toolkit — but without #71's trigger (a pip cuTile bundle being auto-selected), so it is a re-balancing rather than an outright revert. Nothing merged since 2026-11-27 conflicts with the four lines it edits; related_items(690) shows no other open PR changing ignition/cli/environment.py.