Skip to content

refactor(pathfinder): move two test-only helpers out of the package - #3604

Open
rparolin wants to merge 2 commits into
pathfinder-readability/2-remove-unused-helpersfrom
pathfinder-readability/3-move-test-only-helpers
Open

rparolin wants to merge 2 commits into
pathfinder-readability/2-remove-unused-helpersfrom
pathfinder-readability/3-move-test-only-helpers

Conversation

@rparolin

@rparolin rparolin commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

— codex on behalf of Ralf —

Description

Part 4 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.

  • quote_for_shell is only used to print paths in test summaries. It moves to tests/local_helpers.py.
  • _loadable_via_canary_subprocess is only used by tests/conftest.py, which now calls the function it wrapped.

No behavior change for the shipped package. 1645 passed, 6 skipped.

Testing

  • Full cuda_pathfinder test suite at this commit: 1645 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

@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 this pull request to stack #3612 November 25, 2026 21:14
@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:56
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.

Next included review available in 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 12 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1aeaa44 and 149fea4.

Files selected for processing: 7

  • cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py
  • cuda_pathfinder/cuda/pathfinder/_utils/platform_aware.py
  • cuda_pathfinder/tests/conftest.py
  • cuda_pathfinder/tests/local_helpers.py
  • cuda_pathfinder/tests/test_driver_lib_loading.py
  • cuda_pathfinder/tests/test_find_static_lib.py
  • cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests

    • Updated test setup to detect whether the NVIDIA library can be resolved on the system.
    • Kept platform-specific shell quoting coverage within the test suite; this does not change app behavior.
  • Chores

    • Removed an unused library-loading check and removed the shell-quoting utility from the application code.

The change removes the canary loadability helper and updates the nvcudla test fixture to check the resolved system path. It also moves shell quoting from a package utility to test helpers and updates test imports.

Changes: Library detection

Layer / File(s) Summary
Check the resolved nvcudla path
cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py, cuda_pathfinder/tests/conftest.py
The canary loadability helper is removed. The fixture checks whether the subprocess path resolver returns a path for nvcudla.

Test shell quoting

Layer / File(s) Summary
Move shell quoting into test helpers
cuda_pathfinder/cuda/pathfinder/_utils/platform_aware.py, cuda_pathfinder/tests/local_helpers.py, cuda_pathfinder/tests/test_driver_lib_loading.py, cuda_pathfinder/tests/test_find_static_lib.py, cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py
The package utility no longer defines quote_for_shell. Test helpers define the platform-aware function, and the test modules import it from there.

Change: Refactor

Merge Risk: Minimal · previous review 1aeaa

This change moves two test-only helpers out of the shipped package and updates the tests that use them. Shipped behavior is unchanged, and no concrete merge-blocking risk was found.

Security architecture risk: Minimal · up to 1aeaa

The changes are confined to test support and do not establish a new security exposure or a change to the shipped package’s behavior.

- [ ] 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 6e37a83 and 1aeaa44.

Files selected for processing: 7

  • cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py
  • cuda_pathfinder/cuda/pathfinder/_utils/platform_aware.py
  • cuda_pathfinder/tests/conftest.py
  • cuda_pathfinder/tests/local_helpers.py
  • cuda_pathfinder/tests/test_driver_lib_loading.py
  • cuda_pathfinder/tests/test_find_static_lib.py
  • cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py
Files with no reviewable changes: 2

  • cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py
  • cuda_pathfinder/cuda/pathfinder/_utils/platform_aware.py

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

@github-actions

Copy link
Copy Markdown
Contributor

rparolin and others added 2 commits November 26, 2026 11:17
- `quote_for_shell` is only used to print paths in test summaries. It
  moves to `tests/local_helpers.py`.
- `_loadable_via_canary_subprocess` is only used by `tests/conftest.py`,
  which now calls the function it wrapped.

No behavior change for the shipped package. 1645 passed, 6 skipped.

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/3-move-test-only-helpers branch from 1aeaa44 to 149fea4 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.

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