Skip to content

fix(cuda.pathfinder): return absolute static and bitcode paths - #3364

Open
0z5a wants to merge 1 commit into
NVIDIA:mainfrom
0z5a:codex/pathfinder-absolute-paths-20261104
Open

0z5a wants to merge 1 commit into
NVIDIA:mainfrom
0z5a:codex/pathfinder-absolute-paths-20261104

Conversation

@0z5a

@0z5a 0z5a commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #3363.

When CUDA_HOME or another search root is relative, the static- and bitcode-library finders return relative paths despite their absolute-path contract. A cached result then stops referring to the selected file after the working directory changes.

Return an absolute path for each successful site-packages, Conda and CUDA Toolkit lookup. Path.absolute() keeps symlink/.. traversal intact instead of lexically collapsing the parent component.

The issue is not yet assigned and is awaiting maintainer triage. The implementation and tests were prepared with GPT-6; the new tests carry the repository's agent_authored markers.

Testing

  • Linux aarch64, Python 3.12.3, pytest 9.1.0: both affected test modules passed (25 passed) with CUDA devices hidden.
  • Six relative-root regression cases failed on the unmodified main code. The new tests cover site-packages, Conda and CUDA Toolkit paths, cached results after changing directories, and POSIX symlink-parent traversal.
  • Ruff, mypy-pathfinder, SPDX and secret-scanning pre-commit checks passed. Hooks for unrelated C++, Cython, Markdown and GitHub Actions files were skipped.
  • Windows was not tested.

Checklist

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

Convert discovered static and bitcode paths to absolute paths so cached results remain valid after changing directories. Preserve symlink-parent traversal and cover each discovery source.

Signed-off-by: 0z5a <dezhen.lu@student.uni-tuebingen.de>
@copy-pr-bot

copy-pr-bot Bot commented Nov 4, 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.

@github-actions github-actions Bot added the cuda.pathfinder Everything related to the cuda.pathfinder module label Nov 4, 2026
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Library discovery now returns usable absolute paths when search locations are relative, including after the application’s working directory changes.
    • Lookups preserve expected behavior when paths contain symlinked directories or parent-directory segments, helping bitcode and static libraries remain accessible through those locations.

The bitcode and static library finders now convert located paths to absolute paths. Tests cover relative search roots, cached results after working-directory changes, and POSIX symlink traversal.

Changes: Absolute finder paths

Layer / File(s) Summary
Convert finder results to absolute paths
cuda_pathfinder/cuda/pathfinder/_static_libs/find_bitcode_lib.py, cuda_pathfinder/cuda/pathfinder/_static_libs/find_static_lib.py
Both finders apply Path.absolute() to results from site-packages, Conda, and CUDA home.
Test relative roots and symlink traversal
cuda_pathfinder/tests/test_find_bitcode_lib.py, cuda_pathfinder/tests/test_find_static_lib.py
Tests check lookup and cached paths with relative roots after changing directories. POSIX-only tests check paths through symlinked parents.

Assessment against linked issues

Objective Addressed Explanation
Return absolute bitcode and static library paths for relative search roots, including cached paths that remain valid after a working-directory change; preserve symlink and .. traversal. [#3363] ✅

Suggested labels: bug, cuda.pathfinder

Suggested reviewers: lesingh1

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to d6b3b

Static and bitcode library paths are made absolute. No merge-blocking risk is established.

- [ ] 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 deb3d04 and d6b3bf3.

Files selected for processing: 4
  • cuda_pathfinder/cuda/pathfinder/_static_libs/find_bitcode_lib.py
  • cuda_pathfinder/cuda/pathfinder/_static_libs/find_static_lib.py
  • cuda_pathfinder/tests/test_find_bitcode_lib.py
  • cuda_pathfinder/tests/test_find_static_lib.py

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: static and bitcode library finders return relative paths

1 participant