Skip to content

refactor(pathfinder): remove library tables that the package never reads - #3610

Open
rparolin wants to merge 2 commits into
pathfinder-readability/8-found-via-labelsfrom
pathfinder-readability/9-remove-unread-lib-tables
Open

rparolin wants to merge 2 commits into
pathfinder-readability/8-found-via-labelsfrom
pathfinder-readability/9-remove-unread-lib-tables

Conversation

@rparolin

@rparolin rparolin commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

— codex on behalf of Ralf —

Description

Part 10 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 change to the public API or to what the package does. This PR removes private names on purpose, including four that the 1.6.1 release notes said would remain. Details below.

supported_nvidia_libs.py defined 39 module-level names. This removes 20 that nothing in the package reads (139 -> 83 lines). #3613 removes the rest of the test-only data. Nothing is rewritten: the kept statements are unchanged and their values are identical.

Tests:

  • Tests that only compared a removed table with the catalog field it was derived from are removed.
  • Two tests stated real catalog rules through a removed table. They now read the catalog directly and check the same rule.
  • The two flag tables implied "a platform load flag needs that platform's filenames". That rule is now an explicit catalog test.

Risk: these are private names (cuda.pathfinder._dynamic_libs). No project on public GitHub imports them, but code outside public GitHub could.

Removed on purpose: names the 1.6.1 release notes mention.

The 1.6.1 notes say the unsuffixed SUPPORTED_LIBNAMES_WINDOWS* and SITE_PACKAGES_LIBDIRS_WINDOWS* names "remain x64 aliases for backward compatibility". This PR withdraws that. It removes the four aliases: SUPPORTED_LIBNAMES_WINDOWS, SITE_PACKAGES_LIBDIRS_WINDOWS, SITE_PACKAGES_LIBDIRS_WINDOWS_CTK and SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER. It also removes the six SITE_PACKAGES_LIBDIRS_WINDOWS*_X64 and *_ARM64 tables those notes introduced. SUPPORTED_LIBNAMES_WINDOWS_X64 and SUPPORTED_LIBNAMES_WINDOWS_ARM64 stay.

Why: the names are in a private module and nothing in this repository reads them. A search of public GitHub finds no import of them outside copies of this package. Code outside public GitHub that imports one would get an ImportError.

Release note, to add once the next version's notes file exists: "Remove unused internal tables from cuda.pathfinder._dynamic_libs.supported_nvidia_libs, including the unsuffixed SUPPORTED_LIBNAMES_WINDOWS and SITE_PACKAGES_LIBDIRS_WINDOWS* aliases that the 1.6.1 notes said would remain."

For the reviewer:

  • test_supported_libnames_windows_site_packages_libdirs_ctk_consistency was rewritten to read the catalog, so its marker moved from human_reviewed to agent_authored.

Testing

  • Full cuda_pathfinder test suite at this commit: 1399 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
License N/A - no dependencies changed
Container N/A - no container changed

Checklist

  • I have read the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

🤖 Generated with Claude Code

@rparolin
rparolin added this pull request to stack #3612 November 25, 2026 21:14
@copy-pr-bot

copy-pr-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.pathfinder Everything related to the cuda.pathfinder module label Nov 25, 2026
@rparolin rparolin added the enhancement Any code-related improvements label Nov 25, 2026
@rparolin rparolin added this to the cuda.pathfinder next milestone Nov 25, 2026
@rparolin
rparolin removed this pull request from stack #3612 November 25, 2026 22:28
@rparolin
rparolin added this pull request to stack #3616 November 25, 2026 22:29
@rparolin rparolin self-assigned this Nov 25, 2026
@rparolin
rparolin requested review from juenglin and rwgk November 25, 2026 23:06
@rparolin
rparolin marked this pull request as ready for review November 26, 2026 16:14
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 678b653 and 5fde05e.

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

  • Changes
    • Removed legacy NVIDIA library metadata exports, including platform-specific filename, dependency, loader-requirement, and package-directory tables. Consumers relying on these exports may need to adjust; supported-library selection remains available.
  • Documentation
    • Updated package guidance to describe the catalog as the source of library information.
  • Tests
    • Updated consistency checks to validate library support against catalog-derived information.

The package removes legacy library projections from supported_nvidia_libs.py. Tests check descriptor requirements and derive platform library names from LIB_DESCRIPTORS.

Changes: Descriptor-based library projections

Layer / File(s) Summary
Remove legacy projections
cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py, cuda_pathfinder/AGENTS.md
The module removes legacy library-name sets, dependency maps, loader-flag lists, and site-package maps. The architecture description and module docstring describe package-read projections.
Align tests with descriptors
cuda_pathfinder/tests/test_descriptor_catalog.py, cuda_pathfinder/tests/test_lib_descriptor.py, cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py
Catalog tests check descriptor filename and soname requirements. Tests remove comparisons with legacy tables and derive Linux and Windows site-package names from descriptors.

Possibly related PRs

  • NVIDIA/cuda-python#3613: Removes related test-only tables from supported_nvidia_libs.py and moves tests toward catalog data.
  • NVIDIA/cuda-python#3619: Derives loader flags from descriptor fields, which are also used by the catalog tests in this PR.

Suggested reviewers: cpcloud, isvoid

Change: Refactor

Merge Risk: Moderate · previous review 678b6

This refactor removes internal library tables and is meant to change no behavior. It also removes Windows alias names that the 1.6.1 release notes said would stay for backward compatibility. Only code that imports this private module directly would break. Before merging, either keep the aliases or withdraw the promise and add a release note.

Security architecture risk: Low · up to b5964

Code that still imports the documented Windows aliases can fail to start after upgrading. The package's own loader continues to use the same library-name and filename tables, so the risk is limited to consumers of the removed names.

Retained concerns

  • Low · architecture · observed: The PR removes SUPPORTED_LIBNAMES_WINDOWS and the unsuffixed SITE_PACKAGES_LIBDIRS_WINDOWS aliases that the 1.6.1 release notes retained for x64 compatibility. A downstream module that imports one of these names will fail at import time after upgrading.
Security review details

Security Blast Radius

  • inferred — The inspected change does not expand access to native-library loading: the loader still imports the same platform-filtered name set, and the subprocess still uses the same filename maps. The changed exposure is to callers of removed imports, not to a new loading path.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b596490 and 678b653.

Files selected for processing: 1

  • cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py
Files with no reviewable changes: 1

  • cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 8 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3cc5964 and b596490.

Files selected for processing: 5

  • cuda_pathfinder/AGENTS.md
  • cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py
  • cuda_pathfinder/tests/test_descriptor_catalog.py
  • cuda_pathfinder/tests/test_lib_descriptor.py
  • cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 4 remain after this review.

@@ -52,9 +41,6 @@ def _legacy_least_preferred_first(names: tuple[str, ...]) -> tuple[str, ...]:
SUPPORTED_LIBNAMES_WINDOWS_ARM64 = tuple(
desc.name for desc in _CTK_DESCRIPTORS if "arm64" in desc.supported_windows_arch
)

@coderabbitai coderabbitai Bot Nov 26, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Major · Data Integrity & Integration · Quick win

important: Keep the documented Windows aliases or revise the 1.6.1 promise.

The 1.6.1 release notes state that the unsuffixed SUPPORTED_LIBNAMES_WINDOWS* and SITE_PACKAGES_LIBDIRS_WINDOWS* names "remain x64 aliases for backward compatibility." This change removes those names. An import of any of them from cuda.pathfinder._dynamic_libs.supported_nvidia_libs now fails with ImportError.

The impact is limited to code that imports this private module directly. No code in this repository imports the removed unsuffixed names, and the public cuda.pathfinder API is unchanged. The suffixed SUPPORTED_LIBNAMES_WINDOWS_X64 and SUPPORTED_LIBNAMES_WINDOWS_ARM64 names remain.

Before merging, choose one of the following:

  • Keep the unsuffixed names, so they resolve to their x64 values.
  • Withdraw the compatibility promise in the 1.6.1 release notes, and document the removal in the next version's notes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Taking the second option: this withdraws the 1.6.1 promise.

The removal is intended. The names live in a private module and nothing in this repository reads them. The PR description now says this up front and lists the four aliases removed.

The release-note line is drafted in the description. It goes into the notes file once the next version has one.

@github-actions

Copy link
Copy Markdown
Contributor

rparolin and others added 2 commits November 26, 2026 11:17
`supported_nvidia_libs.py` derived about 30 tables from the catalog. The
package reads five names from it. This removes the other 20 tables
(139 -> 83 lines). Nothing is rewritten: the kept statements are
unchanged and their values are identical.

Tests:
- Tests that only compared a removed table with the catalog field it
  was derived from are removed.
- Two tests stated real catalog rules through a removed table. They now
  read the catalog directly and check the same rule.
- The two flag tables implied "a platform load flag needs that
  platform's filenames". That rule is now an explicit catalog test.

Risk: these are private names (`cuda.pathfinder._dynamic_libs`). No
project on public GitHub imports them, but code outside public GitHub
could.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Rob Parolin <rparolin@nvidia.com>
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
@rwgk
rwgk removed this pull request from stack #3616 November 26, 2026 19:19
@rwgk
rwgk force-pushed the pathfinder-readability/9-remove-unread-lib-tables branch from 88b6f5c to 5fde05e Compare November 26, 2026 19:19
@copy-pr-bot

copy-pr-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

1 similar comment
@copy-pr-bot

copy-pr-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.pathfinder Everything related to the cuda.pathfinder module enhancement Any code-related improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants