refactor(pathfinder): unify header search architecture with library loading pattern#1738
Open
cpcloud wants to merge 1 commit intoNVIDIA:mainfrom
Open
refactor(pathfinder): unify header search architecture with library loading pattern#1738cpcloud wants to merge 1 commit intoNVIDIA:mainfrom
cpcloud wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
Contributor
a65ef88 to
3c96fcc
Compare
Contributor
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
Author
|
/ok to test |
3c96fcc to
550bd47
Compare
Contributor
Author
|
/ok to test |
550bd47 to
643fec9
Compare
|
Mirror the dynamic-library descriptor-catalog pattern for headers. All per-header metadata (basename, site-packages dirs, anchor layout, platform availability, system install dirs) is now authored once in HeaderDescriptorSpec entries in header_descriptor_catalog.py. - header_descriptor_catalog.py: authored catalog with HeaderDescriptorSpec; each entry declares its own search capabilities via fields like use_ctk_root_canary, conda_targets_layout, and system_install_dirs - header_descriptor.py: name-keyed HEADER_DESCRIPTORS registry and platform-dispatch helpers (platform_include_subdirs, resolve_conda_anchor) - supported_nvidia_headers.py: derives legacy tables from the catalog - find_nvidia_headers.py: composable HeaderFindStep functions with a single unified FIND_STEPS sequence and run_find_steps cascade runner; each step self-gates based on descriptor fields; search code is platform-agnostic Public API (LocatedHeaderDir, find_nvidia_header_directory, locate_nvidia_header_directory, SUPPORTED_HEADERS_CTK) is unchanged. Made-with: Cursor
643fec9 to
b26cf85
Compare
Contributor
Author
|
/ok to test |
leofang
reviewed
Mar 7, 2026
| 3. **CUDA Toolkit environment variables** — ``CUDA_HOME`` / ``CUDA_PATH``. | ||
| 4. **CTK root canary probe** — subprocess canary (descriptors with | ||
| ``use_ctk_root_canary=True`` only). | ||
| 5. **System install directories** — glob patterns from the descriptor. |
Member
There was a problem hiding this comment.
Q: This seems like an extra thing that did not exist before (also find_nvidia_header_directory does not have)?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HeaderDescriptorSpecdescriptor catalog for headers, mirroring theDescriptorSpeccatalog pattern already used for dynamic library loading. All per-header metadata (basename, site-packages dirs, anchor layout, platform availability, system install dirs) is now authored once in a single catalog tuple, rather than spread across several manually maintained dicts.supported_nvidia_headers.pynow derives its legacy table exports from the catalog (same approach assupported_nvidia_libs.py), andfind_nvidia_headers.pyoperates on descriptors directly — eliminating the name-basedif libname == "nvvm"/if libname == "cccl"branching in favor of descriptor fields (anchor_include_rel_dirs,include_subdirs,include_subdirs_windows).LocatedHeaderDir,find_nvidia_header_directory,locate_nvidia_header_directory,SUPPORTED_HEADERS_CTK) is unchanged.Intentional behavioral note: The old code raised
RuntimeErrorwhen callinglocate_nvidia_header_directorywith a header name not available on the current platform (e.g.,"cufile"on Windows). The new code returnsNoneinstead, since the descriptor exists but the search simply finds nothing. This is more consistent with how callers handle "not found" and mirrors the library side's distinction between unknown vs. unavailable.Test plan
test_find_nvidia_headers.py)test_descriptor_catalog.py)Made with Cursor