🐛 Describe the bug
tools/testing/modulefinder_determinator.py splits changed-file paths with os.sep when classifying changed files and when deriving the dotted module name used for target determination.
Git and GitHub changed-file paths are repository-relative and commonly use POSIX-style / separators, even when the target determination code runs on Windows. On Windows, os.sep is \, so a path such as:
torch/nn/modules/linear.py
is treated as one path component. That can make test_impact_of_file() classify it as UNKNOWN instead of TORCH, and should_run_test() can fail to derive the expected dotted module name.
Expected behavior
Target determination should treat Git-style / changed-file paths and Windows-style \ paths consistently.
For example, both of these should classify as TORCH:
torch/nn/modules/linear.py
torch\nn\modules\linear.py
Likewise, test paths and CI paths should be classified consistently across separators.
Impact
When Windows target determination sees Git-style changed-file paths as UNKNOWN, it can conservatively run more tests than necessary and lose a useful modulefinder selection signal.
Additional context
This is a small path-normalization bug in CI/test tooling. A focused fix can normalize changed-file path separators before classification and module-name construction, without changing modulefinder dependency discovery itself.
cc @peterjc123 @mszhanyi @skyline75489 @nbcsm @iremyux @Blackhex @nkhasbag-nv @malfet @pytorch/pytorch-dev-infra @mruberry
🐛 Describe the bug
tools/testing/modulefinder_determinator.pysplits changed-file paths withos.sepwhen classifying changed files and when deriving the dotted module name used for target determination.Git and GitHub changed-file paths are repository-relative and commonly use POSIX-style
/separators, even when the target determination code runs on Windows. On Windows,os.sepis\, so a path such as:is treated as one path component. That can make
test_impact_of_file()classify it asUNKNOWNinstead ofTORCH, andshould_run_test()can fail to derive the expected dotted module name.Expected behavior
Target determination should treat Git-style
/changed-file paths and Windows-style\paths consistently.For example, both of these should classify as
TORCH:Likewise, test paths and CI paths should be classified consistently across separators.
Impact
When Windows target determination sees Git-style changed-file paths as
UNKNOWN, it can conservatively run more tests than necessary and lose a useful modulefinder selection signal.Additional context
This is a small path-normalization bug in CI/test tooling. A focused fix can normalize changed-file path separators before classification and module-name construction, without changing modulefinder dependency discovery itself.
cc @peterjc123 @mszhanyi @skyline75489 @nbcsm @iremyux @Blackhex @nkhasbag-nv @malfet @pytorch/pytorch-dev-infra @mruberry