Skip to content

fix(cuda.pathfinder): preserve missing-library errors - #3367

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

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

Conversation

@0z5a

@0z5a 0z5a commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #3366.

When a static or bitcode library is missing, the CUDA Toolkit search lists the target directory to enrich the error message. If the listing raises an OS error, that diagnostic step currently replaces the documented library-specific not-found exception.

Retain the original OS exception type and message in the diagnostic text, then raise the usual BitcodeLibNotFoundError or StaticLibNotFoundError. Non-OS exceptions are still propagated.

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

Testing

  • Linux x86_64, Python 3.12.3, pytest 9.1.0: 31 passed across the new regression tests and the existing static- and bitcode-library test modules, with CUDA devices hidden.
  • Before the fix, the new regression file produced 12 failures, 2 passes. The tests cover real unreadable directories for all four public lookup APIs, simulated permission and directory-disappearance errors, and propagation of unexpected non-OS exceptions.
  • Ran the issue reproducer before and after the fix: the four APIs changed from PermissionError to their documented not-found exception types.
  • Ruff 0.17.3, mypy 2.4.1, SPDX and secret-scanning 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.

Keep the documented not-found exception when diagnostic directory listing fails, while including the original OS error in the message. Cover inaccessible directories and listing races.

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
    • Missing-library diagnostics now include the error details when a directory cannot be listed, while preserving the existing sorted directory entries when listing succeeds.
  • Tests
    • Added coverage for directory-listing errors, unreadable directories, and unexpected errors during library lookup.

The bitcode and static-library lookup diagnostics now catch OSError during directory listing and include its type and message in the not-found error attachments. Tests cover simulated and permission-based listing failures, and verify that other exception types propagate.

Changes: Missing library diagnostics

Layer / File(s) Summary
Handle directory-listing errors
cuda_pathfinder/cuda/pathfinder/_static_libs/find_bitcode_lib.py, cuda_pathfinder/cuda/pathfinder/_static_libs/find_static_lib.py
Both diagnostic helpers catch OSError from directory listing and add its type and message to the attachments. Successful listings still append sorted entries.
Verify lookup diagnostics
cuda_pathfinder/tests/test_missing_lib_diagnostics.py
Tests cover both library types and lookup APIs, simulated and permission-based listing failures, and propagation of a simulated RuntimeError.

Assessment against linked issues

Objective Addressed Explanation
Preserve the library-specific not-found exception when diagnostic directory listing fails, while retaining the listing error details. [#3366] ✅

Suggested labels: bug, cuda.pathfinder

Suggested reviewers: lesingh1, rwgk

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to 832e9

No actionable merge-blocking code risk was identified.

- [ ] 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 832e9ce.

Files selected for processing: 3
  • cuda_pathfinder/cuda/pathfinder/_static_libs/find_bitcode_lib.py
  • cuda_pathfinder/cuda/pathfinder/_static_libs/find_static_lib.py
  • cuda_pathfinder/tests/test_missing_lib_diagnostics.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]: missing-library diagnostics mask not-found errors when directory listing fails

1 participant