Skip to content

Windows target determination misclassifies POSIX changed-file paths #188960

Description

@VectorPeak

🐛 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bot-triagedThis is a label only to be used by the auto triage botmodule: ciRelated to continuous integrationmodule: testsIssues related to tests (not the torch.testing module)module: windowsWindows support for PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions