Skip to content

fix(ci): make CUDA release checks hermetic - #1270

Merged
ndizazzo merged 4 commits into
mainfrom
codex/fix-cuda-release-consistency
Aug 13, 2026
Merged

fix(ci): make CUDA release checks hermetic#1270
ndizazzo merged 4 commits into
mainfrom
codex/fix-cuda-release-consistency

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Make the synthetic Jetson Orin installer fixture provide an explicit CUDA 13 lane instead of probing the CI runner's GPU environment.
  • Derive the expected Orin archive name from scripts/package-release.sh, preserving the published -cuda-13 naming.
  • Run repo-consistency release-targets in the lightweight PR Quality consistency job and assert that workflow contract.

Root cause

PR #1267 removed the legacy bare -cuda installer fallback because Linux CUDA releases are published as -cuda-12 and -cuda-13. The xtask Orin fixture still inherited ambient CUDA detection from the host, so the immutable Linux release-host runner failed when it had an NVIDIA GPU but no detectable supported CUDA toolkit.

Validation

  • bash -n install.sh
  • python3 -m unittest discover -s scripts/tests -p 'test_install_sh.py'
  • python3 -m unittest discover -s scripts/tests -p 'test_*.py' (409 tests, 7 skipped)
  • cargo fmt --all -- --check
  • cargo clippy -p xtask --all-targets -- -D warnings
  • cargo run -p xtask -- repo-consistency release-targets
  • actionlint -config-file .github/actionlint.yaml

Summary by CodeRabbit

  • Bug Fixes

    • Improved CUDA version detection by validating matching runtime libraries and respecting NVIDIA driver limits.
    • Added support for CUDA version overrides during installation testing.
    • Improved CUDA asset selection across supported platforms, including Linux ARM64.
    • CUDA versions above 13 are now capped at version 13.
    • Improved CI routing for pull requests that modify CI configuration.
  • Documentation

    • Clarified CI routing and bootstrap behavior.
  • Tests

    • Expanded coverage for CUDA detection, installer asset selection, and CI routing.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ndizazzo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a980475-e605-4545-9eb7-9e44262c2c9f

📥 Commits

Reviewing files that changed from the base of the PR and between 7448804 and 25352ab.

📒 Files selected for processing (2)
  • .github/workflows/pr_builds.yml
  • scripts/tests/test_ci_lane_workflows.py
📝 Walkthrough

Walkthrough

The installer now detects CUDA from matching libcudart, libcublas, and libcublasLt versions, constrained by the NVIDIA driver and CUDA 13 support. Orin fixtures resolve expected assets through the release script. PR routing now detects control-plane changes and selects bootstrap handling.

Changes

CUDA installer determinism

Layer / File(s) Summary
CUDA library detection and coverage
install.sh, scripts/tests/test_install_sh.py
CUDA detection probes three required libraries, honors test overrides, applies driver limits, clamps versions above 13, and rejects missing or mismatched versions.
Orin fixture alignment
tools/xtask/src/installer_fixtures.rs
Orin fixture checks pass the configured CUDA major and derive the expected asset through package-release.sh.

CI control-plane routing

Layer / File(s) Summary
Control-plane change routing
.github/workflows/pr_builds.yml, scripts/tests/test_ci_lane_workflows.py
The PR workflow lists changed files, detects control-plane paths, enables bootstrap routing, reports the detection result, and tests these conditions.
CI routing documentation and conditions
.agents/skills/manage-ci/references/current-inventory.md, ci/ci.md, .github/actions/plan-ci/action.yml
Documentation describes control-plane bootstrap routing, and quality and website conditions use explicit parentheses.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Mergeability Score: 🟡 Moderate · up to 74488

The PR makes CUDA release checks hermetic and changes workflow routing, but the current resolver can reject valid CUDA installations or select an archive without usable runtime support. Large pull requests may also be misrouted or fail because file-list truncation and pull-request read access are not handled. These concrete correctness and CI availability risks should be fixed or explicitly accepted before merging.

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant pr_builds.yml
  participant ControlPlanePaths
  participant BootstrapOrchestrator
  PullRequest->>pr_builds.yml: Provide changed pull request files
  pr_builds.yml->>ControlPlanePaths: Match files against configured paths
  ControlPlanePaths-->>pr_builds.yml: Return controlPlaneChanged status
  pr_builds.yml->>BootstrapOrchestrator: Dispatch when controlPlaneChanged is true
Loading

Possibly related PRs

Suggested reviewers: i386, michaelneale

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: making CUDA release consistency checks hermetic in CI.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-cuda-release-consistency

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ndizazzo
ndizazzo requested a review from michaelneale August 13, 2026 00:44
@ndizazzo
ndizazzo marked this pull request as ready for review August 13, 2026 00:44
@github-actions
github-actions Bot requested a review from i386 August 13, 2026 00:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@install.sh`:
- Around line 359-367: Update detect_cuda_major so nvidia-smi’s CUDA Version is
treated only as a driver compatibility upper bound, not sufficient evidence to
select a CUDA archive. Require matching-major libcudart, libcublas, and
libcublasLt evidence before returning a CUDA lane, while preserving
MESH_LLM_TEST_CUDA_MAJOR fixture behavior and clamping supported majors to the
published maximum.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d72936d-5e9a-4681-a6b3-ce7e8248bf15

📥 Commits

Reviewing files that changed from the base of the PR and between 602eae7 and 0df5dd3.

📒 Files selected for processing (7)
  • .agents/skills/manage-ci/references/current-inventory.md
  • .github/workflows/pr_quality.yml
  • ci/ci.md
  • install.sh
  • scripts/tests/test_install_sh.py
  • tools/xtask/src/installer_fixtures.rs
  • tools/xtask/src/workflow_checks.rs

Comment thread install.sh Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
scripts/tests/test_install_sh.py (1)

184-187: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add an explicit length check before zip().

strict=True requires Python 3.10, but the repository does not declare that minimum and one test job invokes unpinned python3. Use an explicit length check to prevent silent truncation without raising the runtime requirement.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/tests/test_install_sh.py` around lines 184 - 187, Update the output
construction around library_names and library_majors to validate that both
sequences have equal lengths before calling zip(). Preserve the existing
formatting and prevent zip() from silently truncating mismatched inputs without
using strict=True.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@install.sh`:
- Around line 348-351: Remove the lib/stubs glob from the CUDA library probe
loop near the library variable, so stub files cannot count as runtime evidence.
Keep only loader-path locations and require matching-major libcudart, libcublas,
and libcublasLt libraries before selecting a CUDA archive.
- Around line 342-345: Replace the per-library highest-major selection in
cuda_library_major and its callers with logic that collects all detected majors
for libcudart, libcublas, and libcublasLt, then selects the highest major
present in all three libraries and no greater than driver_max. Preserve
rejection when no common supported major exists, and add a regression case
covering libcudart 13/12 with libcublas and libcublasLt 12.

---

Nitpick comments:
In `@scripts/tests/test_install_sh.py`:
- Around line 184-187: Update the output construction around library_names and
library_majors to validate that both sequences have equal lengths before calling
zip(). Preserve the existing formatting and prevent zip() from silently
truncating mismatched inputs without using strict=True.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a04c360-1a15-4989-85fc-002d17536895

📥 Commits

Reviewing files that changed from the base of the PR and between 0df5dd3 and 883a271.

📒 Files selected for processing (2)
  • install.sh
  • scripts/tests/test_install_sh.py

Comment thread install.sh
Comment on lines +342 to +345
major="$(ldconfig -p 2>/dev/null | grep -oE "${library}\.so\.[0-9]+" | awk -F. '{print $3}' | sort -rn | head -n 1 || true)"
if [[ -n "$major" ]]; then
printf '%s\n' "$major"
return 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Select the highest common CUDA major.

cuda_library_major returns only the highest major for each library. A host with libcudart.so.13 and .12, plus libcublas.so.12 and libcublasLt.so.12, has a complete CUDA 12 lane. This code returns 13, 12, and 12, then rejects the host.

Collect all detected majors. Select the highest major shared by all three libraries that does not exceed driver_max. Add a regression case for this mixed-version host.

Also applies to: 386-396

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@install.sh` around lines 342 - 345, Replace the per-library highest-major
selection in cuda_library_major and its callers with logic that collects all
detected majors for libcudart, libcublas, and libcublasLt, then selects the
highest major present in all three libraries and no greater than driver_max.
Preserve rejection when no common supported major exists, and add a regression
case covering libcudart 13/12 with libcublas and libcublasLt 12.

Comment thread install.sh
Comment on lines +348 to +351
for lib in \
"$probe_root"/usr/local/cuda*/lib64/"$library".so.* \
"$probe_root"/usr/local/cuda*/targets/*/lib/"$library".so.* \
"$probe_root"/usr/local/cuda*/targets/*/lib/stubs/"$library".so.*; do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Do not treat CUDA stubs as runtime evidence.

Files in lib/stubs are link-time stubs. They do not prove that the dynamic loader can resolve the CUDA runtime libraries. A host can therefore select a CUDA archive that cannot initialize its native runtime.

Remove the lib/stubs probe. Require loader-resolvable matching-major libraries instead.

Based on learnings: Linux host-linked CUDA artifacts require matching-major libcudart, libcublas, and libcublasLt evidence on the dynamic loader path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@install.sh` around lines 348 - 351, Remove the lib/stubs glob from the CUDA
library probe loop near the library variable, so stub files cannot count as
runtime evidence. Keep only loader-path locations and require matching-major
libcudart, libcublas, and libcublasLt libraries before selecting a CUDA archive.

Source: Learnings

@ndizazzo
ndizazzo force-pushed the codex/fix-cuda-release-consistency branch 2 times, most recently from e455fd0 to 96d54c2 Compare August 13, 2026 01:08

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
scripts/tests/test_ci_lane_workflows.py (1)

45-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover every control-plane matcher branch.

The workflow matcher has rules for .github/, .omo/, ci/, and several script paths. This test checks only the .github/ rule. A later removal of another rule would still pass. Add assertions for each configured rule or execute the matcher with representative paths.

Example contract assertions
+        for marker in (
+            "filename.startsWith('.omo/')",
+            "filename.startsWith('ci/')",
+            "filename === 'scripts/affected-crates.sh'",
+            "filename === 'scripts/plan-ci.py'",
+            "filename.startsWith('scripts/plan-')",
+            "filename === 'scripts/collect-ci-metrics.py'",
+            "filename === 'scripts/tests/test_plan_ci.py'",
+        ):
+            with self.subTest(marker=marker):
+                self.assertIn(marker, pr_workflow)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/tests/test_ci_lane_workflows.py` around lines 45 - 51, The test
covering the PR workflow currently asserts only the .github/ matcher branch.
Extend the assertions in the relevant test method to cover every configured
control-plane path rule, including .omo/, ci/, and each script path, or run the
matcher against representative paths and verify each is detected.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/manage-ci/references/current-inventory.md:
- Line 11: Update the pr_builds.yml entry in the workflow inventory table to
explicitly include manual workflow_dispatch runs among the routes handled by
ci-orchestrator.yml, alongside control-plane changes, forks, and migrations.
Preserve the existing description of ordinary same-repository PR routing.

In @.github/workflows/pr_builds.yml:
- Around line 43-57: Update the controlPlaneChanged calculation using the
paginated pull-request file list so it is true when files.length >= 3000, in
addition to the existing filename checks. In the route job permissions, add
pull-requests: read so github.rest.pulls.listFiles can execute successfully.

Apply the same fix in @.github/workflows/pr_builds.yml around lines 43 - 47.

---

Nitpick comments:
In `@scripts/tests/test_ci_lane_workflows.py`:
- Around line 45-51: The test covering the PR workflow currently asserts only
the .github/ matcher branch. Extend the assertions in the relevant test method
to cover every configured control-plane path rule, including .omo/, ci/, and
each script path, or run the matcher against representative paths and verify
each is detected.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a215756-75d9-4258-803e-4651c435dbdd

📥 Commits

Reviewing files that changed from the base of the PR and between 92ac8eb and 7448804.

📒 Files selected for processing (4)
  • .agents/skills/manage-ci/references/current-inventory.md
  • .github/workflows/pr_builds.yml
  • ci/ci.md
  • scripts/tests/test_ci_lane_workflows.py

| Workflow | Trigger | Ownership |
| --- | --- | --- |
| `pr_builds.yml` | PR lifecycle, dispatch | Routes same-repository PRs to protected control; bootstraps forks and migrations through `ci-orchestrator.yml` |
| `pr_builds.yml` | PR lifecycle, dispatch | Routes ordinary same-repository PRs to protected control; bootstraps control-plane changes, forks and migrations through `ci-orchestrator.yml` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document manual dispatch bootstrap routing.

.github/workflows/pr_builds.yml sets bootstrap for every workflow_dispatch at Line 78. This row lists control-plane changes, forks, and migrations, but not manual runs. Add manual runs so the inventory does not imply that dispatches use protected control.

Proposed wording
-| `pr_builds.yml` | PR lifecycle, dispatch | Routes ordinary same-repository PRs to protected control; bootstraps control-plane changes, forks and migrations through `ci-orchestrator.yml` |
+| `pr_builds.yml` | PR lifecycle, dispatch | Routes ordinary same-repository PRs to protected control; bootstraps control-plane changes, forks, migrations and manual runs through `ci-orchestrator.yml` |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| `pr_builds.yml` | PR lifecycle, dispatch | Routes ordinary same-repository PRs to protected control; bootstraps control-plane changes, forks and migrations through `ci-orchestrator.yml` |
| `pr_builds.yml` | PR lifecycle, dispatch | Routes ordinary same-repository PRs to protected control; bootstraps control-plane changes, forks, migrations and manual runs through `ci-orchestrator.yml` |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/manage-ci/references/current-inventory.md at line 11, Update
the pr_builds.yml entry in the workflow inventory table to explicitly include
manual workflow_dispatch runs among the routes handled by ci-orchestrator.yml,
alongside control-plane changes, forks, and migrations. Preserve the existing
description of ordinary same-repository PR routing.

Comment thread .github/workflows/pr_builds.yml
@ndizazzo
ndizazzo force-pushed the codex/fix-cuda-release-consistency branch from 7448804 to 25352ab Compare August 13, 2026 01:34
@ndizazzo
ndizazzo merged commit ea9db63 into main Aug 13, 2026
107 checks passed
@ndizazzo
ndizazzo deleted the codex/fix-cuda-release-consistency branch August 13, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant