Skip to content

fix(pathfinder): Linux .so glob fallback prefers newest (#1732)#1966

Merged
rwgk merged 2 commits intoNVIDIA:mainfrom
cpcloud:pathfinder-so-glob-1732
Apr 23, 2026
Merged

fix(pathfinder): Linux .so glob fallback prefers newest (#1732)#1966
rwgk merged 2 commits intoNVIDIA:mainfrom
cpcloud:pathfinder-so-glob-1732

Conversation

@cpcloud
Copy link
Copy Markdown
Contributor

@cpcloud cpcloud commented Apr 23, 2026

Resolves #1732.

Summary

  • cuda_pathfinder/cuda/pathfinder/_dynamic_libs/search_platform.py:
    _find_so_in_rel_dirs (the site-packages wheel lookup) now uses
    sorted(..., reverse=True) on its versioned-.so glob, matching the
    newest-first policy already used by LinuxSearchPlatform.find_in_lib_dir
    (the conda / CUDA_PATH lookup) and by the descriptor-driven
    already-loaded / system-search order in load_dl_linux/load_dl_windows.
  • Added an inline comment at _find_so_in_rel_dirs documenting why the
    fallback exists, that a single match is expected in practice, the
    newest-first tie-breaker, and a pointer back to this issue.
  • Appended the same issue pointer to the existing comment at
    LinuxSearchPlatform.find_in_lib_dir.
  • cuda_pathfinder/tests/test_search_steps.py: added six tests (three per
    call site) locking in the newest-first policy: zero / one / multiple
    versioned matches at both the site-packages and conda/CUDA_PATH call
    sites, using libcudart.so.12 / libcudart.so.13 as the fixtures.

Behavioral changes to ambiguity handling (raising when multiple versioned
files coexist) remain deferred to #1038, consistent with the triage
decision recorded on #1732.

Original review thread:
#1693 (comment)

Test plan

  • pixi run pytest tests/ from cuda_pathfinder/ — 966 passed, 4
    skipped (unchanged count except +6 new tests).
  • Ruff check + format pass on changed files.
  • Mypy on the changed source file — no new errors (same pre-existing
    set).
  • Sanity-checked that the new multi-match test fails on the
    pre-change sort by reverting the keyword locally.

@github-actions github-actions Bot added the cuda.pathfinder Everything related to the cuda.pathfinder module label Apr 23, 2026
@cpcloud cpcloud self-assigned this Apr 23, 2026
@cpcloud cpcloud requested a review from rwgk April 23, 2026 14:56
@github-actions

This comment has been minimized.

@rwgk rwgk added the P1 Medium priority - Should do label Apr 23, 2026
Copy link
Copy Markdown
Contributor

@rwgk rwgk left a comment

Choose a reason for hiding this comment

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

Thanks!

@rwgk rwgk merged commit 7cf4a1b into NVIDIA:main Apr 23, 2026
96 of 98 checks passed
@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Copy Markdown

Doc Preview CI
Preview removed because the pull request was closed or merged.

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 P1 Medium priority - Should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cuda_pathfinder: confirm intended behavior for Linux .so glob fallback

2 participants