Explore scratchpad · NVIDIA/hyperflare-inference #690

Raw Markdown for agents: https://autobot.eidonix.com/p/e860ef90-bfb9-47e7-9511-477f6393984b.md

#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):

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:

  1. POSIX: ambient non-blank TRITON_PTXAS_PATH now 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).
  2. A blank/whitespace TRITON_PTXAS_PATH previously blocked setting it; now it is treated as unset and overwritten from the toolkit.
  3. Inherited CUDA_HOME values are now normalized: whitespace stripped and re-exported as a Path string (e.g. " /opt/cuda " -> "/opt/cuda").
  4. Inherited blank CUDA_HOME is deleted from os.environ when no default toolkit dir exists (description does state this).
  5. paths.cuda still resolves through Configuration.directory (ignition/cli/config.py:172-175), which returns None for the empty built-in default paths.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:

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:

#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:

  1. "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.
  2. "[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()); test test_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.
  3. "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.
  4. "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-33 runs pytest tests/ -q with CUDA_VISIBLE_DEVICES="" on ubuntu-24.04 with no CUDA toolkit, so CI would exercise the tests only through the monkeypatched _DEFAULT_LINUX_CUDA.
  5. "Verified post-session environment restoration ... every managed variable in _ENV_KEYS matched its pre-session value" — plausible via the clean_environment fixture (tests/cli/test_environment.py:44-59), which is an unusual pattern: it calls monkeypatch.setenv(key, "") then os.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.
  6. 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/cuda and a second toolkit.
  7. Not claimed or evidenced: any check that ForwardCache/Triton libdevice selection follows the preserved CUDA_HOME, i.e. that the downstream consumer really honors the variable (tests/preparation/test_toolchain.py:31-69 asserts libdevice comes from torch's CUDA_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

#7 [high] People: author jcartu's standing and history; area owners eugr/Luke Alonso; no reviewers yet

#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:

#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):

  1. 2026-10-23/24 — #71 (eugr, merged) removes automatic CUDA_HOME assignment: set it only when [paths] cuda is configured, because the pip cuTile bundle nvidia/cu13 was being chosen and broke native builds with cannot find -lcudart. Docs updated in the same PR (docs/cli-design.md, docs/model-preparation.md).
  2. 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/cuda when [paths] cuda is 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.
  3. 2026-11-30 — #636 (hiroshi-ya) reports that treating /usr/local/cuda as the source of truth overrides an inherited CUDA_HOME, citing flashinfer's get_cuda_path() and PyTorch/CMake/Numba as precedent. Labeled bug/enhancement/priority:P2/triage:design-review. No maintainer reply.
  4. 2026-12-02 — #690 (jcartu) implements the issue's ask with [paths] cuda > inherited CUDA_HOME > /usr/local/cuda > native discovery, and additionally makes [paths] cuda beat an ambient TRITON_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:

#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:

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:

  1. "Ambient non-blank TRITON_PTXAS_PATH now loses to [paths] cuda, blank one is filled" — GONE. 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, 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.
  2. "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

  1. "Undeclared TRITON_PTXAS_PATH precedence reversal" — gone. 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, identical to main:67). A non-blank ambient TRITON_PTXAS_PATH still 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. CPATH handling is likewise byte-identical to main (environment.py:77-81 vs main:69-73).

  2. "AGENTS.md and docs/cli-design.md still contradict the new policy" — largely resolved. docs/cli-design.md:46-57 now reads "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, and :58-62 appends 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 was rewritten 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". docs/model-preparation.md:123-126 now summarises and links cli-design.md instead of restating the rules, and the table row docs/cli-design.md:1489 matches the code.

    • Residual nit, not a conflict: AGENTS.md:452-455 still states the unqualified "never read an environment variable to choose behavior" with no pointer to the :461 exception, and docs/cli-design.md:53-54 documents "keeps a pre-set TRITON_PTXAS_PATH" as if it were new when it is unchanged main behavior.

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

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.