Repository navigation
refactor(pathfinder): search steps read the resolved search context - #3606
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
No actionable comments were generated in the recent review. Summary
Change: Refactor Merge Risk:
|
|
The search steps now read plain fields from the `SearchContext` record added in the previous change, instead of calling through a platform object. This removes the `SearchPlatform` protocol, both platform classes, the `PLATFORM` singleton, and the two copies of the site-packages finder (one per platform). `search_platform.py` goes from 339 to 180 lines. The one remaining platform branch is in `_find_lib_file`, where the real difference lives: which file names to try, and the Windows DLL checks. Tests: construction changes only. `platform=WindowsSearchPlatform( target_arch="x64")` becomes `windows_arch="x64"`. Assertions are unchanged. The comparison test from the previous change is removed with the classes it compared against. No behavior change. 1645 passed, 6 skipped. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Rob Parolin <rparolin@nvidia.com>
Add `test_not_found_error_lists_every_miss_in_search_order` here. It was first added one change later, together with the refactor it guards. The test passes on this code unchanged. The next change in the stack rewrites how search steps report misses and no longer touches this test, so CI shows the error text is the same before and after. Test only. No package code changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Rob Parolin <rparolin@nvidia.com>
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
0b7c8c3 to
3574f0b
Compare
— codex on behalf of Ralf —
Description
Part 6 of 23 of a readability stack for
cuda.pathfinder(stack: #3623 → #3602 → #3603 → #3604 → #3605 → #3606 → #3607 → #3608 → #3609 → #3610 → #3611 → #3613 → #3618 → #3619 → #3620 → #3621 → #3622 → #3627 → #3628 → #3629 → #3630 → #3631 → #3632). No behavior change.The search steps now read plain fields from the
SearchContextrecord added in the previous change, instead of calling through a platform object. This removes theSearchPlatformprotocol, both platform classes, thePLATFORMsingleton, and the two copies of the site-packages finder (one per platform).search_platform.pygoes from 339 to 180 lines. The one remaining platform branch is in_find_lib_file, where the real difference lives: which file names to try, and the Windows DLL checks.Tests: construction changes only.
platform=WindowsSearchPlatform(target_arch="x64")becomeswindows_arch="x64". Six assertions read the same value from the context instead of from the platform object; the expected values are unchanged. The comparison test from the previous change is removed with the classes it compared against.Also in this PR: pin the not-found error text before the refactor.
test_not_found_error_lists_every_miss_in_search_orderpins the fullDynamicLibNotFoundErrortext for a library that misses everywhere. It passes on this code unchanged. #3607 rewrites how misses are reported and does not touch this test, so CI shows the text is the same before and after.No behavior change. 1646 passed, 6 skipped.
Testing
cuda_pathfindertest suite at this commit: 1646 passed, 6 skipped (Linux, Python 3.14).mypy-pathfinder.PLC Local Security Evidence (Advisory)
Local advisory checks only, run over the whole stack. Not release-gate results.
subprocess.runcall in the canary probe inload_nvidia_dynamic_lib.pyChecklist
🤖 Generated with Claude Code