You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(pathfinder): derive two header flags and the driver check from packaged_with - #3619
Header catalog: every CTK entry had conda_targets_layout and use_ctk_root_canary set to True, and every other entry set both to False, in all nine versions of the file since it was added. They are now read-only properties derived from packaged_with, and the 14 non-CTK entries no longer repeat them. Readers of the two names are unchanged.
Loader: _DRIVER_ONLY_LIBNAMES was a second copy of desc.packaged_with == "driver". The loader asks the descriptor. Two tests used the set as test data; they build it from the catalog.
No behavior change. The flag values are identical for all 31 header entries. 1294 passed, 6 skipped.
Also in this PR: three docstrings in find_nvidia_headers.py still described use_ctk_root_canary as a flag a descriptor sets. They now say the canary step runs for CUDA Toolkit headers only.
Testing
Full cuda_pathfinder test suite at this commit: 1294 passed, 6 skipped (Linux, Python 3.14).
pre-commit clean, including mypy-pathfinder.
Not run on Windows. Windows rules are exercised by tests that simulate Windows on Linux.
PLC Local Security Evidence (Advisory)
Local advisory checks only, run over the whole stack. Not release-gate results.
Check
Status
Tool
Details
Secrets
SKIP
Pulse Secret Scanner
scanner image not available locally (registry login); the repo trufflehog pre-commit hook passed
SAST
WARN
Semgrep
1 finding, not from this stack: the existing subprocess.run call in the canary probe in load_nvidia_dynamic_lib.py
Dependencies
WARN
pip-audit / osv-scanner
no manifest or lockfile in scope, so the local scan could not run; this stack changes no dependencies
Reviewing files that changed from the base of the PR and between 51150bf and bec1a9d.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Refactor
CUDA header discovery applies toolkit-root checks only to headers packaged with the CUDA Toolkit; the documented search order remains unchanged.
Header layout behavior follows package classification. Driver libraries continue to use the existing system-only loading path.
Header descriptor flags now derive from packaged_with. Driver-library dispatch checks each descriptor’s packaging classification, and its tests derive cases from the descriptors.
Changes: Packaging classification consumers
Layer / File(s)
Summary
Header flags from packaging classification cuda_pathfinder/cuda/pathfinder/_headers/header_descriptor_catalog.py, cuda_pathfinder/cuda/pathfinder/_headers/find_nvidia_headers.py
conda_targets_layout and use_ctk_root_canary are read-only properties derived from whether packaged_with is "ctk". Catalog entries no longer specify these values individually. Header lookup documentation describes the CTK-root canary scope as CUDA Toolkit headers only.
Driver-library dispatch from descriptors cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py, cuda_pathfinder/tests/test_driver_lib_loading.py
Driver dispatch checks desc.packaged_with directly. The loading tests derive driver library names from LIB_DESCRIPTORS.
Suggested reviewers:cpcloud
Change: Refactor
Merge Risk: Minimal · previous review 51150
This refactor derives two header flags and the driver-library check from each descriptor's packaging classification. No behavior change is expected, and no concrete merge-blocking risk was found.
Security architecture risk: Minimal · up to 51150
The change removes duplicate configuration without changing which search paths the shipped entries use. The public APIs are unchanged, and the review identified no new security exposure or rollout risk.
Retained concerns
No architecture-level concerns identified.
Security review details
Trust Boundaries and Controls
observed — The public loader still checks the requested name against known and platform-available names. The name selects a catalog entry; the caller does not supply the packaging classification that controls dispatch.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 3 remain after this review.
…om packaged_with
Both restated what `packaged_with` already says.
- Header catalog: every CTK entry had `conda_targets_layout` and
`use_ctk_root_canary` set to `True`, and every other entry set both
to `False`, in all nine versions of the file since it was added. They
are now read-only properties derived from `packaged_with`, and the 14
non-CTK entries no longer repeat them. Readers of the two names are
unchanged.
- Loader: `_DRIVER_ONLY_LIBNAMES` was a second copy of
`desc.packaged_with == "driver"`. The loader asks the descriptor. Two
tests used the set as test data; they build it from the catalog.
No behavior change. The flag values are identical for all 31 header
entries. 1293 passed, 6 skipped.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Rob Parolin <rparolin@nvidia.com>
This change made `use_ctk_root_canary` a property derived from
`packaged_with == "ctk"`. Three docstrings in `find_nvidia_headers.py`
still described it as a flag a descriptor sets (`use_ctk_root_canary=True`,
"does not opt in").
They now say what decides it: the canary step runs for CUDA Toolkit
headers only.
Docstrings only. No code changes.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Rob Parolin <rparolin@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
— codex on behalf of Ralf —
Description
Part 14 of 23 of a readability stack for
cuda.pathfinder(stack: #3623 → #3602 → #3603 → #3604 → #3605 → #3606 → #3607 → #3608 → #3609 → #3610 → #3611 → #3613 → #3618 → #3619 → #3620 → #3621 → #3622 → #3627 → #3628 → #3629 → #3630 → #3631 → #3632). No behavior change.Both restated what
packaged_withalready says.conda_targets_layoutanduse_ctk_root_canaryset toTrue, and every other entry set both toFalse, in all nine versions of the file since it was added. They are now read-only properties derived frompackaged_with, and the 14 non-CTK entries no longer repeat them. Readers of the two names are unchanged._DRIVER_ONLY_LIBNAMESwas a second copy ofdesc.packaged_with == "driver". The loader asks the descriptor. Two tests used the set as test data; they build it from the catalog.No behavior change. The flag values are identical for all 31 header entries. 1294 passed, 6 skipped.
Also in this PR: three docstrings in
find_nvidia_headers.pystill describeduse_ctk_root_canaryas a flag a descriptor sets. They now say the canary step runs for CUDA Toolkit headers only.Testing
cuda_pathfindertest suite at this commit: 1294 passed, 6 skipped (Linux, Python 3.14).mypy-pathfinder.PLC Local Security Evidence (Advisory)
Local advisory checks only, run over the whole stack. Not release-gate results.
subprocess.runcall in the canary probe inload_nvidia_dynamic_lib.pyChecklist
🤖 Generated with Claude Code