You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mutmut 3 currently can be run on Windows through the WSL, but not natively on Windows.
We use fork() as a performance optimization, which only works on Unix systems. However, it should be possible to rewrite mutmut to also work with other multiprocessing options. This would be slower (as we cannot copy the whole memory at fork time, including the initialized pytest setup), but still a nice to have.
If someone wants to add native Windows support, we likely need to:
rewrite the _run() method to use a the spawn method instead of os.fork()
pass all necessary arguments to this process (currently we rely on global + local variables to be copied via forking the whole process memory)
While doing so, we want to ensure that (at least for Linux and MacOS) we have:
same performance as before (at least for Linux and MacOS)
same test error handling as before (not sure what/how we currently support this. But e.g. what happens a unit test calls os._exit()?)
test timeout (currently we use resource.RLIMIT_CPU, which is Unix-only if I'm not mistaken. This is necessary as mutants can easily create infinite loops)
I would consider following approaches, though there may be better ones:
create a new process per mutant (as we do now)
create max_children worker processes and initialize pytest there. The worker processes keep polling mutation tasks from a Queue and perform them
use a multiprocessing.pool.Pool of size max_children and initialize pytest in the setup
I've created a PoC for windows support in #404 . Feel free to take a look or even to continue working on it.
With the sample repo with around 1000 mutants, the performance on Linux with fork is the same as on the current main branch. So it would not degrade the performance, at least in this case. On Linux with spawn it was a little bit slower, but still acceptable (instead of 50s something around 70s).
In my tests, there were 3 mutants reported differently between main and this windows-support branch. This still requires debugging.
And it does not yet support timeouts. These should be possible to implement the same as before on Linux, and Windows would require a slightly different version as resource is not supported.
The tests already pass for Linux + Windows in the CI 😊
@mLetrone It should work with the windows-support branch. You can check it out locally and then use python -m pip install --editable <path_to_mutmut_codebase> to use this version.
See #404 for the current status, the main difference should be that timeouts are not implemented. If you encounter some other issue related to this branch, please report it there so I can fix it.
I also need the native support of Windows.
Out of curiosity: why do you need the support? Does running it from wsl2 not work in your case?
Activity
[-]Windows support[/-][+]Windows support (without using WSL)[/+]Otto-AA commentedon Jul 6, 2025
I've created a PoC for windows support in #404 . Feel free to take a look or even to continue working on it.
With the sample repo with around 1000 mutants, the performance on Linux with
forkis the same as on the current main branch. So it would not degrade the performance, at least in this case. On Linux withspawnit was a little bit slower, but still acceptable (instead of 50s something around 70s).In my tests, there were 3 mutants reported differently between main and this windows-support branch. This still requires debugging.
And it does not yet support timeouts. These should be possible to implement the same as before on Linux, and Windows would require a slightly different version as
resourceis not supported.The tests already pass for Linux + Windows in the CI 😊
mLetrone commentedon Sep 12, 2025
I also need the native support of Windows.
Is there any information on when this feature can be deployed?
PS: Thanks @Otto-AA for your work 🙏
boxed commentedon Sep 12, 2025
@mLetrone feel free to try out the branch and report back if it works for you.
Otto-AA commentedon Sep 12, 2025
@mLetrone It should work with the windows-support branch. You can check it out locally and then use
python -m pip install --editable <path_to_mutmut_codebase>to use this version.See #404 for the current status, the main difference should be that timeouts are not implemented. If you encounter some other issue related to this branch, please report it there so I can fix it.
Out of curiosity: why do you need the support? Does running it from wsl2 not work in your case?
chore(mutmut): pin mutmut<3 and add tool.mutmut config
test(audit): close v0.5.0 testing + cross-review gaps + 4 codex findi…
docs(dispatch): Phase 3.3 mutation-testing disposition + fix-brief
fix: move mutmut to linux-only dependency to restore Windows test runner
test: Phase 3.4 — mutmut mutation testing on weekly schedule
P2-2/P2-3:GitHub Actions 與 mutation testing 設定
test: skip mutmut contract tests on Windows (#612)
fix(ci): filter mutmut by dotted mutant names, not file paths (#612) (#…
ci: teste de mutacao nos dois modulos que mais importam (#43)
feat: reliability test coverage + mutation testing setup
v0.4.17 — Phase 16: Mutation testing scaffold (Windows blocker docume…
chore: S-tier polish -- AST mutation baseline, griffe API depth, Pyth…
WIP: mutation testing baseline – scoring.py coeur metier
test: real mutation run in WSL + gauntlet mutmut-3 fix + mutation-fou…
Implementing skills and cli (#2)
Tier 2 (partial): Snakemake workflow formalization
Measure the cosmic-ray comparison instead of disclaiming it
R4'(3/3) mutmut 补位评估定案 + R4' 文档收尾同步(暂停节点)