Evicting a resident run read every 16 KiB page to find the written ones. On Windows, reading a committed page that was never touched faults in a zeroed page, and 97% of the pages the game releases were never written, so the scan took 2.9 us per page and most of the time the guest-allocation lock was held (Soul Hackers 2: 7.1 s of every 10 s). While the run is write-watched, no collection has cleared the watch and no host import touched it, GetWriteWatch lists the only pages that can be non-zero, so only those are read. Runs that fail any of those conditions are scanned as before.
The test throws exceptions but did not link libc, so with
-fno-asynchronous-unwind-tables it failed to link (no __gxx_personality_v0)
on the supported WinLibs toolchain; the Windows CI job does not run on pull
requests. The valid case now maps 2 MiB at a 2-MiB boundary, so the mapping is
one resident run and both Reset calls take the exact-run path, and the test
requires that run.
Co-Authored-By: Claude Opus 5.5 <[email protected]>