From 9d31bd274bbe40b13827fd999917c727a67c23e1 Mon Sep 17 00:00:00 2001 From: Rob Parolin Date: Thu, 26 Nov 2026 11:33:39 -0700 Subject: [PATCH 1/2] refactor(pathfinder): remove a Windows DLL filter that cannot match The Windows DLL search skipped NVRTC helper files (`.alt.dll`, `-builtins`) and 32-bit `cudart32_` / `nvvm32` files. That mattered when the search matched file-name patterns. Today it only tries the exact names in the catalog, and none of the 82 names is of those kinds, so the filter never fires. The filter is removed, with the six test lines that switched it off. Those lines were no-ops: the suite passes with them removed and the filter still in place. A catalog test now holds the rule the filter enforced: no catalog entry may name such a file. No behavior change for any library in the catalog. Co-Authored-By: Claude Fable 5.2 Signed-off-by: Rob Parolin --- .../pathfinder/_dynamic_libs/search_platform.py | 3 --- .../_dynamic_libs/supported_nvidia_libs.py | 11 ----------- cuda_pathfinder/tests/test_descriptor_catalog.py | 13 +++++++++++++ cuda_pathfinder/tests/test_search_steps.py | 6 ------ 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/search_platform.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/search_platform.py index 916ff315b14..447643c1cec 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/search_platform.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/search_platform.py @@ -18,7 +18,6 @@ from cuda.pathfinder._dynamic_libs.lib_descriptor import LibDescriptor from cuda.pathfinder._dynamic_libs.load_dl_common import DynamicLibNotFoundError -from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import is_suppressed_dll_file from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs_all_sitepackages from cuda.pathfinder._utils.found_via import FOUND_VIA_SITE_PACKAGES from cuda.pathfinder._utils.platform_aware import IS_WINDOWS @@ -153,8 +152,6 @@ def _find_descriptor_dll_under_dir( def candidate_is_usable(path: str) -> bool: if not os.path.isfile(path): return False - if is_suppressed_dll_file(os.path.basename(path)): - return False return target_arch is None or windows_pe_matches_arch(path, target_arch) for dll_basename in desc.windows_dlls: diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py index fbc677c0abf..89c26c01ece 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py @@ -41,14 +41,3 @@ else: assert IS_WINDOWS_ARM64 SUPPORTED_LIBNAMES = SUPPORTED_LIBNAMES_WINDOWS_ARM64 - - -def is_suppressed_dll_file(path_basename: str) -> bool: - if path_basename.startswith("nvrtc"): - # nvidia_cuda_nvrtc_cu12-12.8.93-py3-none-win_amd64.whl: - # nvidia\cuda_nvrtc\bin\ - # nvrtc-builtins64_128.dll - # nvrtc64_120_0.alt.dll - # nvrtc64_120_0.dll - return path_basename.endswith(".alt.dll") or "-builtins" in path_basename - return path_basename.startswith(("cudart32_", "nvvm32")) diff --git a/cuda_pathfinder/tests/test_descriptor_catalog.py b/cuda_pathfinder/tests/test_descriptor_catalog.py index 172baf51772..4764b9abba1 100644 --- a/cuda_pathfinder/tests/test_descriptor_catalog.py +++ b/cuda_pathfinder/tests/test_descriptor_catalog.py @@ -217,3 +217,16 @@ def test_windows_binary_arch_checks_cover_architecture_neutral_layouts(): checked_libs = {spec.name for spec in DESCRIPTOR_CATALOG if spec.requires_windows_binary_arch_check} assert checked_libs == {"nvvm", "cudnn"} + + +@pytest.mark.agent_authored(model="claude-fable-5-2") +def test_no_windows_dll_name_is_a_helper_or_32_bit_file(): + """The DLL search used to skip these file kinds at run time. The catalog must never name one.""" + + def is_helper_or_32_bit_file(dll_name: str) -> bool: + if dll_name.startswith("nvrtc"): + return dll_name.endswith(".alt.dll") or "-builtins" in dll_name + return dll_name.startswith(("cudart32_", "nvvm32")) + + named = [dll for spec in DESCRIPTOR_CATALOG for dll in spec.windows_dlls if is_helper_or_32_bit_file(dll)] + assert named == [] diff --git a/cuda_pathfinder/tests/test_search_steps.py b/cuda_pathfinder/tests/test_search_steps.py index 46082c71ba2..65e23295f91 100644 --- a/cuda_pathfinder/tests/test_search_steps.py +++ b/cuda_pathfinder/tests/test_search_steps.py @@ -313,7 +313,6 @@ def test_found_windows(self, mocker, tmp_path): f"{_PLAT_MOD}.find_sub_dirs_all_sitepackages", return_value=[str(bin_dir)], ) - mocker.patch(f"{_PLAT_MOD}.is_suppressed_dll_file", return_value=False) desc = _make_desc( name="cudart", @@ -400,7 +399,6 @@ def test_found_windows_arm64_prefers_cuda13_arch_dir_to_cuda12(self, mocker, tmp arm64_dll.touch() _patch_site_packages_search(mocker, tmp_path) - mocker.patch(f"{_PLAT_MOD}.is_suppressed_dll_file", return_value=False) desc = LIB_DESCRIPTORS["cudart"] result = find_in_site_packages(_ctx(desc, windows_arch="arm64")) @@ -422,7 +420,6 @@ def test_found_windows_x64_prefers_cuda13_arch_dir_to_cuda12(self, mocker, tmp_p (cuda12_dir / "cudart64_12.dll").touch() _patch_site_packages_search(mocker, tmp_path) - mocker.patch(f"{_PLAT_MOD}.is_suppressed_dll_file", return_value=False) desc = LIB_DESCRIPTORS["cudart"] result = find_in_site_packages(_ctx(desc, windows_arch="x64")) @@ -438,7 +435,6 @@ def test_found_windows_x64_uses_cuda12_when_cuda13_is_absent(self, mocker, tmp_p cuda12_dll.touch() _patch_site_packages_search(mocker, tmp_path) - mocker.patch(f"{_PLAT_MOD}.is_suppressed_dll_file", return_value=False) desc = LIB_DESCRIPTORS["cudart"] result = find_in_site_packages(_ctx(desc, windows_arch="x64")) @@ -453,7 +449,6 @@ def test_found_windows_arm64_skips_cuda12_when_cuda13_is_absent(self, mocker, tm (cuda12_dir / "cudart64_12.dll").touch() _patch_site_packages_search(mocker, tmp_path) - mocker.patch(f"{_PLAT_MOD}.is_suppressed_dll_file", return_value=False) desc = LIB_DESCRIPTORS["cudart"] ctx = _ctx(desc, windows_arch="arm64") @@ -487,7 +482,6 @@ def test_cudnn_wheel_architecture_and_archive_fallback( mocker.patch.dict(os.environ, {"CUDNN_PATH": str(archive_root)}) _patch_site_packages_search(mocker, tmp_path) - mocker.patch(f"{_PLAT_MOD}.is_suppressed_dll_file", return_value=False) desc = LIB_DESCRIPTORS["cudnn"] result = run_find_steps( From bf4c2a46d4b916dd5cc693d728ba510ef3f99fc7 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 26 Nov 2026 11:17:28 -0800 Subject: [PATCH 2/2] ci: require manual copy-pr-bot approval Signed-off-by: Ralf W. Grosse-Kunstleve