From c162ab8206fc50939282c441370d7f5ca0e733e8 Mon Sep 17 00:00:00 2001 From: Rob Parolin Date: Wed, 25 Nov 2026 16:14:13 -0700 Subject: [PATCH 1/3] docs(pathfinder): fix two stale references - `AGENTS.md` named `_utils/spawned_process_runner.py`, which was replaced by `_dynamic_libs/dynamic_lib_subprocess.py` in #1777. - A docstring in `load_dl_linux.py` named `LinkMapPrefix`; the class is `_LinkMapLNameView`. Comments and docs only. Co-Authored-By: Claude Fable 5.2 Signed-off-by: Rob Parolin --- cuda_pathfinder/AGENTS.md | 5 +++-- .../cuda/pathfinder/_dynamic_libs/load_dl_linux.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cuda_pathfinder/AGENTS.md b/cuda_pathfinder/AGENTS.md index 271e5797f82..6fbaa9ff49c 100644 --- a/cuda_pathfinder/AGENTS.md +++ b/cuda_pathfinder/AGENTS.md @@ -32,8 +32,9 @@ Windows. - `_static_libs/locate_file.py` holds the one search that `find_static_lib.py` and `find_bitcode_lib.py` share. - **Process isolation helper**: - - `cuda/pathfinder/_utils/spawned_process_runner.py` is used where process - global dynamic loader state would otherwise leak across tests. + - `cuda/pathfinder/_dynamic_libs/dynamic_lib_subprocess.py` runs in a fresh + Python process: for the CTK-root canary probe, and for tests where process + global dynamic loader state would otherwise leak. ## Editing guidance diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py index 484e5724593..5552b2296f4 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py @@ -69,7 +69,7 @@ class _LinkMapLNameView(ctypes.Structure): returned by `dlinfo(...)`. - Do **not** instantiate it or pass it **by value** to any C function. - Do **not** access any members beyond those declared here. - - Do **not** rely on `ctypes.sizeof(LinkMapPrefix)` for allocation. + - Do **not** rely on `ctypes.sizeof(_LinkMapLNameView)` for allocation. Rationale: - Defining only the leading fields avoids depending on internal/unstable From ff6bffcad2033fcee118c8ec119dca3ec4a25f08 Mon Sep 17 00:00:00 2001 From: Rob Parolin Date: Thu, 26 Nov 2026 10:32:21 -0700 Subject: [PATCH 2/3] docs(pathfinder): fix four comments and a docstring that say the wrong thing - `platform_loader.py`: said the platform module is wrapped in a namespace. Nothing is wrapped; `LOADER` is the module. - `supported_nvidia_binaries.py`: called the directory table "utilities available on both Linux and Windows". It is the same table everywhere, and some utilities ship for one platform only. - `__init__.py`: called `SUPPORTED_BINARY_UTILITIES` platform-aware. The tuple is the same on every platform. - `__init__.py`: said `_find_nvidia_header_directory` will be removed in release 1.2.4. It was not. The comment now says so and keeps the alias. - `find_nvidia_binary_utility` docstring: said Windows executables are found by `.exe`, `.bat` and `.cmd`. The search looks for `.exe`, with `.bat` first for `compute-sanitizer` and `ncu`. It never looks for `.cmd`. Comments and docstrings only. No code changes. Co-Authored-By: Claude Fable 5.2 Signed-off-by: Rob Parolin --- cuda_pathfinder/cuda/pathfinder/__init__.py | 6 +++--- .../pathfinder/_binaries/find_nvidia_binary_utility.py | 7 ++++--- .../cuda/pathfinder/_binaries/supported_nvidia_binaries.py | 3 ++- .../cuda/pathfinder/_dynamic_libs/platform_loader.py | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cuda_pathfinder/cuda/pathfinder/__init__.py b/cuda_pathfinder/cuda/pathfinder/__init__.py index a64b5ef64c7..d81c058ab5b 100644 --- a/cuda_pathfinder/cuda/pathfinder/__init__.py +++ b/cuda_pathfinder/cuda/pathfinder/__init__.py @@ -70,8 +70,8 @@ SUPPORTED_HEADERS_CTK = _SUPPORTED_HEADERS_CTK #: Tuple of supported CUDA binary utility names that can be located -#: via ``find_nvidia_binary_utility()``. Platform-aware (e.g., some -#: utilities may be available only on Linux or Windows). +#: via ``find_nvidia_binary_utility()``. The tuple is the same on every +#: platform; some utilities exist only on Linux or only on Windows. #: Example utilities: ``"nvdisasm"``, ``"cuobjdump"``, ``"nvcc"``. SUPPORTED_BINARY_UTILITIES = _SUPPORTED_BINARIES @@ -91,5 +91,5 @@ SUPPORTED_STATIC_LIBS = _SUPPORTED_STATIC_LIBS # Backward compatibility: _find_nvidia_header_directory was added in release 1.2.2. -# It will be removed in release 1.2.4. +# Its removal was planned for release 1.2.4 and has not happened. _find_nvidia_header_directory = find_nvidia_header_directory diff --git a/cuda_pathfinder/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py b/cuda_pathfinder/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py index b5fa3cc8cc3..c4068207599 100644 --- a/cuda_pathfinder/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py +++ b/cuda_pathfinder/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py @@ -175,9 +175,10 @@ def find_nvidia_binary_utility(utility_name: str) -> str | None: Results are cached using ``@functools.cache`` for performance. The cache persists for the lifetime of the process. - On Windows, executables are identified by their file extensions - (``.exe``, ``.bat``, ``.cmd``). On Unix-like systems, executables - are identified by the ``X_OK`` (execute) permission bit. + On Windows, the search looks for ``.exe``. For + ``compute-sanitizer`` and ``ncu`` it tries ``.bat`` + first. On Unix-like systems, a file counts only if it has the + ``X_OK`` (execute) permission bit. Lookup is restricted to the trusted directories and the canary-derived CTK root listed above. diff --git a/cuda_pathfinder/cuda/pathfinder/_binaries/supported_nvidia_binaries.py b/cuda_pathfinder/cuda/pathfinder/_binaries/supported_nvidia_binaries.py index c2f818da6c0..85483656dc1 100644 --- a/cuda_pathfinder/cuda/pathfinder/_binaries/supported_nvidia_binaries.py +++ b/cuda_pathfinder/cuda/pathfinder/_binaries/supported_nvidia_binaries.py @@ -9,7 +9,8 @@ _NSIGHT_SYSTEMS_BIN = os.path.join("nvidia", "nsight_systems", "bin") _NSIGHT_COMPUTE_BIN = os.path.join("nvidia", "nsight_compute", "bin") -# Common CUDA binary utilities available on both Linux and Windows +# Utility name -> site-packages bin directories to search, in order. +# The table is the same on every platform; some utilities ship for one only. SITE_PACKAGES_BINDIRS = { # Core compilation tools "nvcc": (_CUDA13_BIN, _CUDA_NVCC_BIN), diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/platform_loader.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/platform_loader.py index 1d65f696f04..283578fcfa8 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/platform_loader.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/platform_loader.py @@ -36,6 +36,6 @@ def load_with_abs_path(self, desc: LibDescriptor, found_path: str, found_via: st else: from cuda.pathfinder._dynamic_libs import load_dl_linux as _impl -# The platform modules already expose functions matching the PlatformLoader -# protocol. Wrap in a simple namespace so callers use LOADER.method() syntax. +# LOADER is the platform module itself. Its functions match the PlatformLoader +# protocol, so callers write LOADER.method(). LOADER: PlatformLoader = _impl From fb8772ac1bec5dbc76840325e7e0bd1921480579 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 26 Nov 2026 11:17:27 -0800 Subject: [PATCH 3/3] ci: require manual copy-pr-bot approval Signed-off-by: Ralf W. Grosse-Kunstleve