Skip to content

Add Windows support - #640

Open
kimvais wants to merge 4 commits into
boxed:mainfrom
kimvais:main
Open

kimvais wants to merge 4 commits into
boxed:mainfrom
kimvais:main

Conversation

@kimvais

@kimvais kimvais commented Nov 18, 2026

Copy link
Copy Markdown

Fixes #397

No regression on Linux

The issue asks for the same performance as before, at least on Linux and macOS. On Linux and macOS the default process_isolation is still fork, and ForkRunner and ForkServerRunner are unchanged. The spawn runner is a separate class that Linux and macOS only use if you ask for it.

Same benchmark (benchmark_1k, WSL2 ext4, Python 3.13, --max-children 4, median of 3 runs):

process_isolation upstream 6837b3c this branch
fork 115 mut/s 113 mut/s
forkserver (collect) 74 mut/s 69 mut/s

The differences are within run-to-run noise on a shared machine: fork varied from 98 to 115 mut/s on this branch. Both versions gave the same results, 842 killed and 170 survived.

Windows has no os.fork, so neither existing runner can work there.
SpawnRunner starts a fresh Python process per mutant, hands it the
mutant and its tests on stdin and reads the verdict from the exit code.
It is the default on Windows; a config asking for fork or forkserver
falls back to it with a warning, so a pyproject.toml shared with POSIX
users keeps working.

Timeouts are wall-clock only, as there is no RLIMIT_CPU. A worker that
fails outside the tests exits 35 (suspicious) instead of Python's 1,
which would count as a kill.
Remove the exit that sent Windows users to WSL. Mutant generation and
coverage gathering relied on forked children inheriting state() and
sys.path; under the spawn start method they are handed what they need.

The my_lib segfault mutant is killed by a failing test on Windows,
because ctypes turns the access violation into an OSError there.

Refs boxed#397.
The default encoding there is the ANSI code page, which cannot encode
the "ǁ" in mutant names, the spinner or the emoji. It went unnoticed
locally because this machine runs with a UTF-8 code page; the Windows
CI runner added in 92e1540 does not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows support (without using WSL)

1 participant