This CPU-only example computes a one-dimensional integer buffer plus a constant. It needs CMake 3.28+, Visual Studio 2022, Python, and a Halide distribution with serialization enabled. Tested with halide-bin==22.0.0.dev390 (shared Windows wheel).
From this directory in PowerShell, set $halideDir to your Halide CMake package directory and build in a new temporary directory:
$build = Join-Path $env:TEMP ('halide-repro-build-' + [guid]::NewGuid().ToString('N'))
# Example value: C:/path/to/halide/lib/cmake/Halide
cmake -S . -B $build -G 'Visual Studio 17 2022' -A x64 "-DHalide_DIR=$halideDir"
cmake --build $build --config Release --target cache_add_generator
python .\repro.py "$build\Release\cache_add_generator.exe"Ensure the selected distribution's Halide.dll is beside the generator or discoverable through its DLL search path. The investigation copied the SHA-verified wheel's DLL beside the executable.
The driver creates a new temporary output/cache/log root and prints its path. It varies only offset=1 versus offset=2, with target=x86-64-windows-no_runtime, and holds output files using CreateFileW(GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING). Every request is a new process; every handle is closed in finally.
On the affected wheel, it prints:
FALSE RESTORE HIT: True
FALSE RESTORE HIT: True
COLD CACHE POISONED: True
UNCACHED WRITE FALSE SUCCESS: True
The two restore checks cover object and static-library outputs. results.json and the per-invocation .log files contain structured diagnostics: commands with <generator> and <output> placeholders, full SHA-256 hashes, exit status and recognized cache messages. Raw native debug output is not saved. This is a diagnostic reproducer, so its own exit code is not a pass/fail verdict for a patched implementation. Inspect the four Boolean findings and detailed child statuses.
observed-results.md records the successful reproduction on Windows. All generated directories are disposable; the script does not delete existing output or cache directories.
The public archive contains only this README, the CMake file, the small generator, the Python driver and the observed-results table. Generated binaries, headers, caches and build directories are local verification artifacts and are not included.