tests: serve GPU draw cases from one offscreen_check device #2766

Manually merged
github merged 12 commits from github-bot/gh-2766 into gh-pr/2766/base 2026-11-27 18:44:42 +00:00 AGit
Owner

@⁠tedin7 on GitHub · 2026-11-26 06:50 UTC · original
tedin7:x2w-fastdraw → main · +545 −10 · 9 files · 12 commits · merged 2026-11-27 18:41 UTC

Part of #448

What this unblocks: the GPU draw checks create the D3D12 device once per test instead of once per case, which is where #448 measured most of the time (about 0.25 s of start-up per launch against about 0.03 s per case on a real card with the debug layer on).
Source: Microsoft D3D12 documentation, D3D12CreateDevice and ID3D12Device lifetime; earlier code of this repo (tests/offscreen_check draw cases and their CTest entries in CMakeLists.txt).

What changed

  • offscreen_check <warp|hardware> --serve (tests/offscreen_check.cpp): runs any other operation, case after case, on the one device it already created. One case per stdin line, the operation and its operands separated by tabs, exactly the arguments that follow the adapter name in a one-shot call. Each case goes through the same argument validation, capability gate, debug-layer check and exit-code mapping as a one-shot call (0, 1, 77, 2), and its stdout and stderr text is what the one-shot call prints. Both streams end the case with a marker line so the client can split the text per case; the debug messages are cleared between cases; a removed device ends the loop after answering.
  • tests/gpu_case_runner.py: run(renderer, adapter, args) has the signature and result of subprocess.run([renderer, adapter, *args], capture_output=True, text=True), but starts one --serve process per renderer and adapter and sends the case to it. The adapter banner is repeated in front of every case, so a check that looks for debug_layer=enabled and debug_errors=0 debug_warnings=0 sees it in each case, as in a one-shot call. Only a server that cannot start (an older offscreen_check without --serve, no adapter, X2W_FLAT_SERVER=0) falls back to the one-shot call. Once a case has been sent, a renderer that dies, does not answer within one deadline or answers with the wrong case number gives a FAILED verdict for that case and is never run again, so a crash cannot turn into a pass; both reply indices are validated and the renderer is ended as a whole process group.
  • Adopted by startup_flat_param_check.draw (imported by 50 checks, among them startup_gfx2hlsl_f16_alu_draw), startup_gfx2hlsl_f32_sdwa, startup_gfx2hlsl_f32_nan and startup_image_sample_b. Their cases, references and controls are unchanged. startup_flat_param_check.compile_hlsl now routes DXC compiles through the opt-in X2W_DXC_CACHE cache that pixel_aot_check and compute_store_check already use.
  • tests/gpu_case_runner_check.py (new, gpu_case_runner): a fake offscreen_check that speaks the protocol checks per-case text and exit codes, the banner with every case, skip (77), a renderer without --serve, a crash after the handshake (failed verdict, case not run again), a silent renderer (one deadline), a wrong reply index, a launcher child that keeps the pipes open, a second-case debug warning, and X2W_FLAT_SERVER=0.

Builds on the batching work in #2635, #2654, #2615 and #2690 and the compiler reuse in #2711 (credit to RavenCurseBurg), and on the DXC cache of #448. Those make one test launch fewer processes by batching its references; this adds the same saving for every check that still starts a process per case, without changing any test's cases.

Why it is safe

Every case of the four adopted checks was run twice on Windows Server 2025 WARP, once through the served device and once through the old one-shot call, and compared (exit code, stdout, stderr; the banner is part of each served case and was compared too):

check cases identical wrong-value controls (both paths must fail)
startup_gfx2hlsl_f16_alu_draw 220 220 32 of 32 failed on both, same message
startup_gfx2hlsl_f32_nan 194 194 28 of 28
startup_gfx2hlsl_f32_sdwa 288 288 42 of 42
startup_image_sample_b 72 72 11 of 11

Each control changes one bit of the expected words (or the first byte of the reference file) of every seventh case and runs it through both paths.

Time (Windows Server 2025 WARP, idle host, one run each, DXC cache off)

check one-shot served
startup_gfx2hlsl_f32_nan 8.2 s 2.1 s
startup_gfx2hlsl_f32_sdwa 12.0 s 2.7 s
startup_image_sample_b 4.1 s 1.7 s
startup_gfx2hlsl_f16_alu_draw 26.7 s 20.7 s

f16_alu_draw still spends most of its time compiling one vertex shader per case with DXC and FXC one after the other; that is the next step (compiling in parallel), not part of this change. The saving on a real card is larger, because the debug layer makes each launch more expensive.

What stays the same

Only --startup-flat-param, --startup-pixel-words and --startup-image-2d-array-mips cases changed path; every other operation and every check that is not listed above is untouched. offscreen_check --self-test still validates the operation table, and --serve itself is listed there like any other operation.

Verification

  • python3 -B tests/gpu_case_runner_check.py: all tests OK (Linux).
  • python3 -B tests/startup_flat_param_check.py: controls OK (Linux).
  • Windows Server 2025 (aws-1), dev build of offscreen_check with this change and ctest -R 'gpu_case_runner|startup_gfx2hlsl_f16_alu_draw|startup_gfx2hlsl_f32_sdwa|startup_gfx2hlsl_f32_nan|startup_image_sample_b_(warp|hardware)|startup_flat_param': 15/15 passed.
  • Old versus new per case and the wrong-value controls: the table above, run with the same binary on WARP.
  • RunPod (RTX 3090, Wine + vkd3d-proton, hardware adapter), same old-versus-new comparison on the same binary:
check cases identical wrong-value controls one-shot served
startup_gfx2hlsl_f16_alu_draw 220 220 32 of 32 failed on both 441.7 s 8.1 s
startup_gfx2hlsl_f32_nan 194 194 28 of 28 322.8 s 7.2 s
startup_gfx2hlsl_f32_sdwa 288 288 42 of 42 476.4 s 8.3 s
startup_image_sample_b 72 72 11 of 11 138.5 s 5.4 s

(times are the summed offscreen_check calls only, not compiles.) ctest of the same 15 tests: 15/15 passed.

  • Win2025 WARP (proxmox pool), dev and release on the final head, 17/17 each: cmake --build --preset <dev|release> --target offscreen_check then ctest --preset <dev|release> --no-tests=error -R "gpu_case_runner|startup_gfx2hlsl_f16_alu_draw|startup_gfx2hlsl_f32_sdwa|startup_gfx2hlsl_f32_nan|startup_image_sample_b|startup_flat_param|draw_skip" -V (gpu_case_runner, startup_flat_param_{controls,warp,hardware}, startup_image_sample_b_{controls,warp,hardware}, startup_gfx2hlsl_f32_nan{,_warp,_hardware}, startup_gfx2hlsl_f32_sdwa{,_warp,hardware}, startup_gfx2hlsl_f16_alu_draw{controls,warp,hardware}, startup_gfx2hlsl_draw_skip).

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 06:50 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766) `tedin7:x2w-fastdraw` → `main` · +545 −10 · 9 files · 12 commits · merged 2026-11-27 18:41 UTC Part of #448 What this unblocks: the GPU draw checks create the D3D12 device once per test instead of once per case, which is where #448 measured most of the time (about 0.25 s of start-up per launch against about 0.03 s per case on a real card with the debug layer on). Source: Microsoft D3D12 documentation, `D3D12CreateDevice` and `ID3D12Device` lifetime; earlier code of this repo (tests/offscreen_check draw cases and their CTest entries in CMakeLists.txt). ## What changed - `offscreen_check <warp|hardware> --serve` (tests/offscreen_check.cpp): runs any other operation, case after case, on the one device it already created. One case per stdin line, the operation and its operands separated by tabs, exactly the arguments that follow the adapter name in a one-shot call. Each case goes through the same argument validation, capability gate, debug-layer check and exit-code mapping as a one-shot call (0, 1, 77, 2), and its stdout and stderr text is what the one-shot call prints. Both streams end the case with a marker line so the client can split the text per case; the debug messages are cleared between cases; a removed device ends the loop after answering. - `tests/gpu_case_runner.py`: `run(renderer, adapter, args)` has the signature and result of `subprocess.run([renderer, adapter, *args], capture_output=True, text=True)`, but starts one `--serve` process per renderer and adapter and sends the case to it. The adapter banner is repeated in front of every case, so a check that looks for `debug_layer=enabled` and `debug_errors=0 debug_warnings=0` sees it in each case, as in a one-shot call. Only a server that cannot start (an older `offscreen_check` without `--serve`, no adapter, `X2W_FLAT_SERVER=0`) falls back to the one-shot call. Once a case has been sent, a renderer that dies, does not answer within one deadline or answers with the wrong case number gives a FAILED verdict for that case and is never run again, so a crash cannot turn into a pass; both reply indices are validated and the renderer is ended as a whole process group. - Adopted by `startup_flat_param_check.draw` (imported by 50 checks, among them `startup_gfx2hlsl_f16_alu_draw`), `startup_gfx2hlsl_f32_sdwa`, `startup_gfx2hlsl_f32_nan` and `startup_image_sample_b`. Their cases, references and controls are unchanged. `startup_flat_param_check.compile_hlsl` now routes DXC compiles through the opt-in `X2W_DXC_CACHE` cache that `pixel_aot_check` and `compute_store_check` already use. - `tests/gpu_case_runner_check.py` (new, `gpu_case_runner`): a fake `offscreen_check` that speaks the protocol checks per-case text and exit codes, the banner with every case, skip (77), a renderer without `--serve`, a crash after the handshake (failed verdict, case not run again), a silent renderer (one deadline), a wrong reply index, a launcher child that keeps the pipes open, a second-case debug warning, and `X2W_FLAT_SERVER=0`. Builds on the batching work in #2635, #2654, #2615 and #2690 and the compiler reuse in #2711 (credit to RavenCurseBurg), and on the DXC cache of #448. Those make one test launch fewer processes by batching its references; this adds the same saving for every check that still starts a process per case, without changing any test's cases. ## Why it is safe Every case of the four adopted checks was run twice on Windows Server 2025 WARP, once through the served device and once through the old one-shot call, and compared (exit code, stdout, stderr; the banner is part of each served case and was compared too): | check | cases | identical | wrong-value controls (both paths must fail) | |---|---|---|---| | startup_gfx2hlsl_f16_alu_draw | 220 | 220 | 32 of 32 failed on both, same message | | startup_gfx2hlsl_f32_nan | 194 | 194 | 28 of 28 | | startup_gfx2hlsl_f32_sdwa | 288 | 288 | 42 of 42 | | startup_image_sample_b | 72 | 72 | 11 of 11 | Each control changes one bit of the expected words (or the first byte of the reference file) of every seventh case and runs it through both paths. ## Time (Windows Server 2025 WARP, idle host, one run each, DXC cache off) | check | one-shot | served | |---|---|---| | startup_gfx2hlsl_f32_nan | 8.2 s | 2.1 s | | startup_gfx2hlsl_f32_sdwa | 12.0 s | 2.7 s | | startup_image_sample_b | 4.1 s | 1.7 s | | startup_gfx2hlsl_f16_alu_draw | 26.7 s | 20.7 s | `f16_alu_draw` still spends most of its time compiling one vertex shader per case with DXC and FXC one after the other; that is the next step (compiling in parallel), not part of this change. The saving on a real card is larger, because the debug layer makes each launch more expensive. ## What stays the same Only `--startup-flat-param`, `--startup-pixel-words` and `--startup-image-2d-array-mips` cases changed path; every other operation and every check that is not listed above is untouched. `offscreen_check --self-test` still validates the operation table, and `--serve` itself is listed there like any other operation. ## Verification - `python3 -B tests/gpu_case_runner_check.py`: all tests OK (Linux). - `python3 -B tests/startup_flat_param_check.py`: controls OK (Linux). - Windows Server 2025 (aws-1), dev build of `offscreen_check` with this change and `ctest -R 'gpu_case_runner|startup_gfx2hlsl_f16_alu_draw|startup_gfx2hlsl_f32_sdwa|startup_gfx2hlsl_f32_nan|startup_image_sample_b_(warp|hardware)|startup_flat_param'`: 15/15 passed. - Old versus new per case and the wrong-value controls: the table above, run with the same binary on WARP. - RunPod (RTX 3090, Wine + vkd3d-proton, hardware adapter), same old-versus-new comparison on the same binary: | check | cases | identical | wrong-value controls | one-shot | served | |---|---|---|---|---|---| | startup_gfx2hlsl_f16_alu_draw | 220 | 220 | 32 of 32 failed on both | 441.7 s | 8.1 s | | startup_gfx2hlsl_f32_nan | 194 | 194 | 28 of 28 | 322.8 s | 7.2 s | | startup_gfx2hlsl_f32_sdwa | 288 | 288 | 42 of 42 | 476.4 s | 8.3 s | | startup_image_sample_b | 72 | 72 | 11 of 11 | 138.5 s | 5.4 s | (times are the summed `offscreen_check` calls only, not compiles.) `ctest` of the same 15 tests: 15/15 passed. - Win2025 WARP (proxmox pool), dev and release on the final head, 17/17 each: `cmake --build --preset <dev|release> --target offscreen_check` then `ctest --preset <dev|release> --no-tests=error -R "gpu_case_runner|startup_gfx2hlsl_f16_alu_draw|startup_gfx2hlsl_f32_sdwa|startup_gfx2hlsl_f32_nan|startup_image_sample_b|startup_flat_param|draw_skip" -V` (gpu_case_runner, startup_flat_param_{controls,warp,hardware}, startup_image_sample_b_{controls,warp,hardware}, startup_gfx2hlsl_f32_nan{,_warp,_hardware}, startup_gfx2hlsl_f32_sdwa{,_warp,_hardware}, startup_gfx2hlsl_f16_alu_draw_{controls,warp,hardware}, startup_gfx2hlsl_draw_skip). AI-assisted; commands listed were executed locally.
offscreen_check --serve runs any operation case after case on one D3D12 device; tests/gpu_case_runner.py starts it once per test and falls back to the one-shot call on any problem. compile_hlsl gets a content-addressed object cache. Adopted by startup_flat_param_check (draw), f32_sdwa, f32_nan and image_sample_b. Builds on #2711 and #2690.
The adopted draw checks now go through gpu_case_runner.run, so the late-skip check patches that instead of subprocess.run.
A failed handshake, a dead server and the restart now wait for the process, join the pump threads and close all three pipes; a runner test checks it before the one-shot fallback.
Every served case now carries the adapter banner (debug_layer line) like a one-shot call; both reply markers must carry the case number; one deadline per case; a renderer that dies, hangs or answers the wrong case after the handshake fails that case and is never re-run. New runner controls fail on the previous runner.
The runner accepts the renderer as a command list; the runner tests launch the fake interpreter directly so a kill releases its pipes on Windows too. A missing reply waits for the process only up to the case deadline, so a crash reports its exit code instead of a timeout.
The Wine launcher on RunPod does not pass the end of stdin to the renderer, which stayed alive and held the pipes of the test. The client now writes --end before closing stdin and the service loop stops on it; an older renderer answers 2 and still ends at the end of stdin.
A Wine launcher leaves the real renderer alive after its wrapper is killed, and it keeps the test's pipes open: closing the pipe then blocked the test for good (seen on RunPod as 1800 s timeouts). The renderer now runs in its own process group, which is killed with it; a pipe is closed only when its reader has ended. New runner test with a launcher child that holds the pipes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:21:00 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-26 07:01 UTC · original

I reproduced the Linux failure on this head. The f32_nan and f32_sdwa cases now call gpu_case_runner.run, so the existing subprocess.run mock misses them and Popen tries to execute the fake renderer. In startup_gfx2hlsl_draw_skip_check.py, set renderer_runner = getattr(module, "gpu_case_runner", module.subprocess) and patch renderer_runner.run. On Windows Python 3.12 this kept all 18 existing subcases green, including failure-before-skip = 1 and clean skip = 77.

The five runner tests also pass here, but emit ResourceWarning for unclosed pipes and a live child after fallback. Please close the stdio handles and wait for the process on every exit, including failed handshake and dead-server restart. The runner test should verify cleanup before calling the one-shot fallback.

**@⁠R0Y00** on GitHub · 2026-11-26 07:01 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#issuecomment-7185015119) I reproduced the Linux failure on this head. The f32_nan and f32_sdwa cases now call gpu_case_runner.run, so the existing subprocess.run mock misses them and Popen tries to execute the fake renderer. In startup_gfx2hlsl_draw_skip_check.py, set renderer_runner = getattr(module, "gpu_case_runner", module.subprocess) and patch renderer_runner.run. On Windows Python 3.12 this kept all 18 existing subcases green, including failure-before-skip = 1 and clean skip = 77. The five runner tests also pass here, but emit ResourceWarning for unclosed pipes and a live child after fallback. Please close the stdio handles and wait for the process on every exit, including failed handshake and dead-server restart. The runner test should verify cleanup before calling the one-shot fallback.
Author
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-26 07:43 UTC · original

I will check the updated served renderer on native Windows D3D12 on the Intel UHD 770 and RTX 4060, with WARP as a control. I will compare the one-shot and served routes on the same executable, including wrong expected values followed by valid draws, and report the exact head and timings here.

**@⁠RavenCurseBurg** on GitHub · 2026-11-26 07:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#issuecomment-7185762797) I will check the updated served renderer on native Windows D3D12 on the Intel UHD 770 and RTX 4060, with WARP as a control. I will compare the one-shot and served routes on the same executable, including wrong expected values followed by valid draws, and report the exact head and timings here.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 07:50 UTC · original

Thanks for the repro and the exact fix.

  • Linux failure: fixed in 6c2e55d1b. startup_gfx2hlsl_draw_skip_check.py now also patches gpu_case_runner.run, next to the existing subprocess.run patch, so the 18 subcases (failure-before-skip = 1, clean skip = 77) stay green. I kept both patches instead of getattr(module, "gpu_case_runner", ...) because the same loop also covers modules that still call subprocess.run.
  • ResourceWarning: fixed in aa6c9bd71. Every exit of a served process (failed handshake, skip 77, dead server and its restart, close at exit) now waits for the process, joins the two reader threads and closes stdin, stdout and stderr. New runner test test_every_exit_leaves_no_process_and_no_open_pipe checks that each of those servers has exited and has all three pipes closed, before the one-shot fallback result is used; I also fixed the test's own cleanup order, which emptied the server table before closing the servers. python3 -B -W error::ResourceWarning tests/gpu_case_runner_check.py: 6 tests OK; the four adopted checks also run clean with that flag.
  • Old versus new on a real card (RTX 3090, Wine + vkd3d-proton, same executable): f16_alu_draw 220/220, f32_nan 194/194, f32_sdwa 288/288, image_sample_b 72/72 identical (exit code, stdout, stderr); 113/113 wrong-value controls fail on both routes with the same message. Table in the description.

@⁠RavenCurseBurg, thank you for checking native Windows D3D12 on the Intel UHD 770 and RTX 4060. The head to test is aa6c9bd71.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 07:50 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#issuecomment-7185885399) Thanks for the repro and the exact fix. - Linux failure: fixed in 6c2e55d1b. `startup_gfx2hlsl_draw_skip_check.py` now also patches `gpu_case_runner.run`, next to the existing `subprocess.run` patch, so the 18 subcases (failure-before-skip = 1, clean skip = 77) stay green. I kept both patches instead of `getattr(module, "gpu_case_runner", ...)` because the same loop also covers modules that still call `subprocess.run`. - ResourceWarning: fixed in aa6c9bd71. Every exit of a served process (failed handshake, skip 77, dead server and its restart, close at exit) now waits for the process, joins the two reader threads and closes stdin, stdout and stderr. New runner test `test_every_exit_leaves_no_process_and_no_open_pipe` checks that each of those servers has exited and has all three pipes closed, before the one-shot fallback result is used; I also fixed the test's own cleanup order, which emptied the server table before closing the servers. `python3 -B -W error::ResourceWarning tests/gpu_case_runner_check.py`: 6 tests OK; the four adopted checks also run clean with that flag. - Old versus new on a real card (RTX 3090, Wine + vkd3d-proton, same executable): f16_alu_draw 220/220, f32_nan 194/194, f32_sdwa 288/288, image_sample_b 72/72 identical (exit code, stdout, stderr); 113/113 wrong-value controls fail on both routes with the same message. Table in the description. @⁠RavenCurseBurg, thank you for checking native Windows D3D12 on the Intel UHD 770 and RTX 4060. The head to test is aa6c9bd71. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-26 08:28 UTC · original

Windows 11 build 26200, Python 3.12, exact 7e0a4e39: python -B -W error::ResourceWarning tests/gpu_case_runner_check.py failed 2/9. The crash reported a 300 s timeout immediately, and the 2 s hang case returned after 60.06 s. The separate draw-skip ordering test passed.

I isolated two causes. The Windows fake runs through a .cmd parent. Killing that parent leaves its sleeping Python child holding stdout/stderr, so cleanup blocks until the child exits. Launching the fake Python renderer directly made the 2 s hang test pass, but the crash still raced EOF against Popen.poll(). With the direct child plus a bounded self.proc.wait(timeout=max(0.0, deadline - time.monotonic())) when the reply is missing, all 9 tests passed with ResourceWarning promoted to an error. The exit-code check and the no-replay assertions stayed in place. Please make the Windows fake a direct child of the runner and preserve the one shared deadline when collecting the process status.

**@⁠R0Y00** on GitHub · 2026-11-26 08:28 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#issuecomment-7186630687) Windows 11 build 26200, Python 3.12, exact `7e0a4e39`: `python -B -W error::ResourceWarning tests/gpu_case_runner_check.py` failed 2/9. The crash reported a 300 s timeout immediately, and the 2 s hang case returned after 60.06 s. The separate draw-skip ordering test passed. I isolated two causes. The Windows fake runs through a .cmd parent. Killing that parent leaves its sleeping Python child holding stdout/stderr, so cleanup blocks until the child exits. Launching the fake Python renderer directly made the 2 s hang test pass, but the crash still raced EOF against Popen.poll(). With the direct child plus a bounded `self.proc.wait(timeout=max(0.0, deadline - time.monotonic()))` when the reply is missing, all 9 tests passed with ResourceWarning promoted to an error. The exit-code check and the no-replay assertions stayed in place. Please make the Windows fake a direct child of the runner and preserve the one shared deadline when collecting the process status.
Author
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-26 08:34 UTC · original

Native Windows comparison at 7e0a4e39: all 2,694 one-shot/served pairs matched on exit code, full stdout and full stderr, including the repeated adapter banners. The comparison covers the four adopted checks on WARP, Intel UHD 770 and RTX 4060. The runner stayed attached to the live server throughout each suite.

Suite Fixture calls per adapter Extra wrong-value + restored pairs Total paired calls per adapter
image sample bias 72 4 + 4 80
binary16 ALU 220 32 + 32 284
binary32 NaN 194 13 + 13 220
binary32 SDWA 288 13 + 13 314

Each of the 62 additional wrong-value calls per adapter returned 1 through both routes and printed the same mismatch; the immediately following valid draw returned 0. For timing, one-shot/served summed renderer call times in seconds were WARP 147.86 / 14.99, UHD 770 524.30 / 36.81, RTX 4060 454.01 / 53.20. The three suites of adapter measurements ran concurrently on the same host, with alternating call order and shader compilation outside the timer. These are single-run measurements under load.

Windows 11 build 26100.9711, in-box D3D12, WARP 10.0.26100.9711, Intel 32.0.101.5973, NVIDIA 32.0.15.9579. The debug layer was unavailable. The local Zig 0.13/Clang build included the PR's actual service loop, argument and diagnostic paths, the three adopted operation handlers, desktop GPU setup and D3D12 draw implementations. The local executable selected those operations and explicitly flushed output at one-shot exit for MinGW. All four suites used both DXC and FXC. The comparison script also takes a standard full offscreen_check.exe:

python -B tests/verify_served_native_parity.py <renderer> <dxc> <fxc> <WARP|Intel|NVIDIA> <output-dir>

The separate process-lifecycle unit suite reproduced the two Windows failures already reported above, including the 2-second case returning after 60.43 seconds. The device comparisons above all completed. AI-assisted with Codex.

**@⁠RavenCurseBurg** on GitHub · 2026-11-26 08:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#issuecomment-7186766645) Native Windows comparison at `7e0a4e39`: all **2,694 one-shot/served pairs** matched on exit code, full stdout and full stderr, including the repeated adapter banners. The comparison covers the four adopted checks on WARP, Intel UHD 770 and RTX 4060. The runner stayed attached to the live server throughout each suite. | Suite | Fixture calls per adapter | Extra wrong-value + restored pairs | Total paired calls per adapter | |---|---:|---:|---:| | image sample bias | 72 | 4 + 4 | 80 | | binary16 ALU | 220 | 32 + 32 | 284 | | binary32 NaN | 194 | 13 + 13 | 220 | | binary32 SDWA | 288 | 13 + 13 | 314 | Each of the 62 additional wrong-value calls per adapter returned 1 through both routes and printed the same mismatch; the immediately following valid draw returned 0. For timing, one-shot/served summed renderer call times in seconds were WARP **147.86 / 14.99**, UHD 770 **524.30 / 36.81**, RTX 4060 **454.01 / 53.20**. The three suites of adapter measurements ran concurrently on the same host, with alternating call order and shader compilation outside the timer. These are single-run measurements under load. Windows 11 build 26100.9711, in-box D3D12, WARP 10.0.26100.9711, Intel 32.0.101.5973, NVIDIA 32.0.15.9579. The debug layer was unavailable. The local Zig 0.13/Clang build included the PR's actual service loop, argument and diagnostic paths, the three adopted operation handlers, desktop GPU setup and D3D12 draw implementations. The local executable selected those operations and explicitly flushed output at one-shot exit for MinGW. All four suites used both DXC and FXC. The [comparison script](https://github.com/RavenCurseBurg/Xbox2Windows/blob/2e8f1e7458b57ccb09b667e302469900f43fd232/tests/verify_served_native_parity.py) also takes a standard full `offscreen_check.exe`: ```text python -B tests/verify_served_native_parity.py <renderer> <dxc> <fxc> <WARP|Intel|NVIDIA> <output-dir> ``` The separate process-lifecycle unit suite reproduced the two Windows failures already reported above, including the 2-second case returning after 60.43 seconds. The device comparisons above all completed. AI-assisted with Codex.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 08:42 UTC · original

Thank you both, this is exactly the data I needed.

@⁠R0Y00: both causes fixed in 069f17228.

  • The runner now accepts the renderer as a command list, and the runner tests launch the fake interpreter and its script directly, so there is no .cmd or shell parent holding the pipes after a kill.
  • When a reply is missing, the runner waits for the process only up to the same case deadline (proc.wait(timeout=max(0, deadline - now))) before reading its exit status, so a crash reports exited (code 3) and not a timeout. One deadline per case stays.
  • The exit-code check and the no-replay assertion (the case log shows the crashing case once) are unchanged. On Linux: 9 tests OK with -W error::ResourceWarning, and the four adopted checks plus the draw-skip check pass. I cannot run Windows Python 3.12 here, so please re-run python -B -W error::ResourceWarning tests/gpu_case_runner_check.py on 069f17228.

@⁠RavenCurseBurg: thank you for the 2,694 matching pairs on WARP, UHD 770 and RTX 4060, wrong-value controls included. Your numbers are for 7e0a4e39; the runner changed only in the process handling since, not in the protocol, the banners or the verdict mapping.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 08:42 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#issuecomment-7186930308) Thank you both, this is exactly the data I needed. @⁠R0Y00: both causes fixed in 069f17228. - The runner now accepts the renderer as a command list, and the runner tests launch the fake interpreter and its script directly, so there is no `.cmd` or shell parent holding the pipes after a kill. - When a reply is missing, the runner waits for the process only up to the same case deadline (`proc.wait(timeout=max(0, deadline - now))`) before reading its exit status, so a crash reports `exited (code 3)` and not a timeout. One deadline per case stays. - The exit-code check and the no-replay assertion (the case log shows the crashing case once) are unchanged. On Linux: 9 tests OK with `-W error::ResourceWarning`, and the four adopted checks plus the draw-skip check pass. I cannot run Windows Python 3.12 here, so please re-run `python -B -W error::ResourceWarning tests/gpu_case_runner_check.py` on 069f17228. @⁠RavenCurseBurg: thank you for the 2,694 matching pairs on WARP, UHD 770 and RTX 4060, wrong-value controls included. Your numbers are for 7e0a4e39; the runner changed only in the process handling since, not in the protocol, the banners or the verdict mapping. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-26 09:28 UTC · original

Rechecked 069f1722 on native Windows 11 build 26200 with Python 3.12. python -B -W error::ResourceWarning tests/gpu_case_runner_check.py now passes 9/9, including the 2 s deadline and crash exit-code tests. startup_gfx2hlsl_draw_skip_check.py also passes. This resolves my two Windows runner findings. Raven's 2,694 paired GPU results above were on the preceding head; this run covers the revised process-handling tests.

**@⁠R0Y00** on GitHub · 2026-11-26 09:28 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#issuecomment-7188030169) Rechecked `069f1722` on native Windows 11 build 26200 with Python 3.12. `python -B -W error::ResourceWarning tests/gpu_case_runner_check.py` now passes 9/9, including the 2 s deadline and crash exit-code tests. `startup_gfx2hlsl_draw_skip_check.py` also passes. This resolves my two Windows runner findings. Raven's 2,694 paired GPU results above were on the preceding head; this run covers the revised process-handling tests.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 09:50 UTC · original

@⁠R0Y00: thank you for the native Windows re-check of 069f1722 (9/9 and the draw-skip check).

Gate status from our independent reviewer: code gate PASS on 069f17228. Win2025 dev and release 17/17 each (gpu_case_runner passes there in 13 s), served-versus-one-shot compared on every case of the four adopted checks with the banner included, wrong-value controls included: 0 mismatches. A RunPod run showed one intermittent 1800 s timeout of startup_gfx2hlsl_f32_sdwa_warp on that head; it did not repeat on the next head, and the re-gate on that head is running.

The head is now 43360b0e9: the client ends the served renderer with an explicit --end line before closing stdin (the service loop stops on it), because a Wine launcher may not pass the end of stdin on. An older renderer answers that line with exit 2 and still ends at the end of stdin. Nothing else changed in the protocol, banners or verdicts.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 09:50 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#issuecomment-7188541654) @⁠R0Y00: thank you for the native Windows re-check of 069f1722 (9/9 and the draw-skip check). Gate status from our independent reviewer: code gate PASS on 069f17228. Win2025 dev and release 17/17 each (gpu_case_runner passes there in 13 s), served-versus-one-shot compared on every case of the four adopted checks with the banner included, wrong-value controls included: 0 mismatches. A RunPod run showed one intermittent 1800 s timeout of `startup_gfx2hlsl_f32_sdwa_warp` on that head; it did not repeat on the next head, and the re-gate on that head is running. The head is now 43360b0e9: the client ends the served renderer with an explicit `--end` line before closing stdin (the service loop stops on it), because a Wine launcher may not pass the end of stdin on. An older renderer answers that line with exit 2 and still ends at the end of stdin. Nothing else changed in the protocol, banners or verdicts. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 10:36 UTC · original

Independent review of head f5747cc0b (served GPU draw cases): PASS.

Verification:

  • Windows Server 2025 (D3D12 WARP), dev 17/17 and release 17/17 with ctest --no-tests=error -R 'gpu_case_runner|startup_gfx2hlsl_f16_alu_draw|startup_gfx2hlsl_f32_sdwa|startup_gfx2hlsl_f32_nan|startup_image_sample_b|startup_flat_param|draw_skip': gpu_case_runner, startup_flat_param_{controls,warp,hardware}, startup_image_sample_b_{controls,warp,hardware}, startup_gfx2hlsl_f32_nan{,_warp,_hardware}, startup_gfx2hlsl_f32_sdwa{,_warp,hardware}, startup_gfx2hlsl_f16_alu_draw{controls,warp,hardware}, startup_gfx2hlsl_draw_skip.
  • Same verdicts with and without the fast path: on the previous head, a patched runner sent every case of the four adopted checks through the served device and through the one-shot call and asserted identical exit code, stdout (banner included) and stderr: 16 tests, no mismatch, wrong-value controls included. The commits since only change how the renderer process is ended.
  • Review findings re-checked with controls that fail before the fix: a second-case debug warning now fails the sample_b-style check; a renderer crash after the handshake is a failed verdict and the case is not run again; both reply indices are validated; one deadline per case; a launcher child holding the pipes no longer blocks the end of the test (removing the group kill makes that test fail). Linux python3 -B tests/gpu_case_runner_check.py passes; mutating the failed verdict to a pass, dropping the index check or dropping the per-case banner each fail the check.
  • The PR body now describes the final behaviour (failed verdict instead of a retry, banner with every case, strict comparison).
  • Not run here: RunPod (non-blocking, off). A test that fails without the explicit --end line is still missing; closing stdin also ends the server in the fake renderer, so the line itself is covered only by the real Wine run.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 10:36 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#issuecomment-7189588050) Independent review of head f5747cc0b (served GPU draw cases): PASS. Verification: - Windows Server 2025 (D3D12 WARP), dev 17/17 and release 17/17 with `ctest --no-tests=error -R 'gpu_case_runner|startup_gfx2hlsl_f16_alu_draw|startup_gfx2hlsl_f32_sdwa|startup_gfx2hlsl_f32_nan|startup_image_sample_b|startup_flat_param|draw_skip'`: gpu_case_runner, startup_flat_param_{controls,warp,hardware}, startup_image_sample_b_{controls,warp,hardware}, startup_gfx2hlsl_f32_nan{,_warp,_hardware}, startup_gfx2hlsl_f32_sdwa{,_warp,_hardware}, startup_gfx2hlsl_f16_alu_draw_{controls,warp,hardware}, startup_gfx2hlsl_draw_skip. - Same verdicts with and without the fast path: on the previous head, a patched runner sent every case of the four adopted checks through the served device and through the one-shot call and asserted identical exit code, stdout (banner included) and stderr: 16 tests, no mismatch, wrong-value controls included. The commits since only change how the renderer process is ended. - Review findings re-checked with controls that fail before the fix: a second-case debug warning now fails the sample_b-style check; a renderer crash after the handshake is a failed verdict and the case is not run again; both reply indices are validated; one deadline per case; a launcher child holding the pipes no longer blocks the end of the test (removing the group kill makes that test fail). Linux `python3 -B tests/gpu_case_runner_check.py` passes; mutating the failed verdict to a pass, dropping the index check or dropping the per-case banner each fail the check. - The PR body now describes the final behaviour (failed verdict instead of a retry, banner with every case, strict comparison). - Not run here: RunPod (non-blocking, off). A test that fails without the explicit `--end` line is still missing; closing stdin also ends the server in the fake renderer, so the line itself is covered only by the real Wine run. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 10:36 UTC · original · edited 2026-11-26 10:52 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T10:52:41.975949Z f5747cc Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 10:36 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#issuecomment-7189595874) · edited 2026-11-26 10:52 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"f5747cc0bf45b98728c70ee1c9699364fd799678","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T10:52:41.975949Z">2026-11-26T10:52:41.975949Z</relative-time> | `f5747cc` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 10:52 UTC · original · reviewed

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5747cc0bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback".

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 10:52 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#pullrequestreview-6072833634) · **reviewed** <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `f5747cc0bf` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback". </details>
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 10:52 UTC · original

P2 Badge Retain renderer diagnostics when a served case is lost

When a renderer writes a diagnostic and then crashes or times out before its end markers, this returns only the generic _Lost message. For crashes, case() has already consumed the unmarked stderr chunk before raising; for timeouts, this skips draining while the renderer is alive and never recovers output after killing it. The empty stdout also drops the cached adapter/driver/debug-layer banner on first-case failures. A fake renderer printing an error before exiting with code 3 reproduces the diagnostic loss. Preserve the collected chunks, post-termination output and banner in the failed result.

AGENTS.md reference: AGENTS.md:L95-L96

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 10:52 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#discussion_r4707306454) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Retain renderer diagnostics when a served case is lost** When a renderer writes a diagnostic and then crashes or times out before its end markers, this returns only the generic `_Lost` message. For crashes, `case()` has already consumed the unmarked stderr chunk before raising; for timeouts, this skips draining while the renderer is alive and never recovers output after killing it. The empty stdout also drops the cached adapter/driver/debug-layer banner on first-case failures. A fake renderer printing an error before exiting with code 3 reproduces the diagnostic loss. Preserve the collected chunks, post-termination output and banner in the failed result. AGENTS.md reference: [AGENTS.md:L95-L96](https://github.com/R0Y00/Xbox2Windows/blob/f5747cc0bf45b98728c70ee1c9699364fd799678/AGENTS.md#L95-L96) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
@ -0,0 +111,4 @@
def setUp(self):
R._servers.clear()
self.addCleanup(R._servers.clear)
self.addCleanup(R._close_all) # runs first: the servers of the test are closed before the table is emptied
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 10:52 UTC · original

P2 Badge Reset the opt-out flag for the served-path unit tests

When X2W_FLAT_SERVER=0 is set to exercise the supported one-shot path, R.SERVER_OFF is already True at import and this fixture never overrides it. The served-path tests consequently execute one-shot calls and fail—for example, test_served_cases_carry_their_own_text_and_exit_code receives the unexpected ONESHOT prefix. Since the runner check is registered in CMake, running the suite with the opt-out produces spurious failures even though the fallback works correctly. Save and restore R.SERVER_OFF in the fixture and set it to False for the served-path tests.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 10:52 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#discussion_r4707306463) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Reset the opt-out flag for the served-path unit tests** When `X2W_FLAT_SERVER=0` is set to exercise the supported one-shot path, `R.SERVER_OFF` is already `True` at import and this fixture never overrides it. The served-path tests consequently execute one-shot calls and fail—for example, `test_served_cases_carry_their_own_text_and_exit_code` receives the unexpected `ONESHOT` prefix. Since the runner check is registered in CMake, running the suite with the opt-out produces spurious failures even though the fallback works correctly. Save and restore `R.SERVER_OFF` in the fixture and set it to `False` for the served-path tests. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 10:52 UTC · original

P2 Badge Distinguish terminated zombies from live launcher children

In a Linux container whose PID 1 does not reap orphaned children, _close_all() successfully kills the grandchild but its PID remains as a zombie. os.kill(pid, 0) still succeeds for that dead process, so this loop reaches self.fail() and the runner check rejects correct cleanup. This reproduces in the current container, where the child has state Z; all 10 tests pass under a reaping harness. Check whether the child is actually running or arrange for the fixture to reap it instead of requiring the PID to disappear.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 10:52 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#discussion_r4707306476) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Distinguish terminated zombies from live launcher children** In a Linux container whose PID 1 does not reap orphaned children, `_close_all()` successfully kills the grandchild but its PID remains as a zombie. `os.kill(pid, 0)` still succeeds for that dead process, so this loop reaches `self.fail()` and the runner check rejects correct cleanup. This reproduces in the current container, where the child has state `Z`; all 10 tests pass under a reaping harness. Check whether the child is actually running or arrange for the fixture to reap it instead of requiring the PID to disappear. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 12:02 UTC · original

Fixed in f01ff5b6c (head 619ae700 after merging main): a lost case now returns the adapter banner, what the renderer printed for the case before it was lost, and everything still queued after the process group is killed. New test test_a_crash_keeps_the_diagnostics_and_the_banner, and the silent-renderer test checks the same; both failed before the change. Ran tests/gpu_case_runner_check.py: 11/11 OK.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 12:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#discussion_r4708075531) Fixed in f01ff5b6c (head 619ae700 after merging main): a lost case now returns the adapter banner, what the renderer printed for the case before it was lost, and everything still queued after the process group is killed. New test test_a_crash_keeps_the_diagnostics_and_the_banner, and the silent-renderer test checks the same; both failed before the change. Ran tests/gpu_case_runner_check.py: 11/11 OK. AI-assisted; commands listed were executed locally.
@ -0,0 +111,4 @@
def setUp(self):
R._servers.clear()
self.addCleanup(R._servers.clear)
self.addCleanup(R._close_all) # runs first: the servers of the test are closed before the table is emptied
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 12:02 UTC · original

Fixed in f01ff5b6c: the fixture patches R.SERVER_OFF to False for every test and restores it; the opt-out test patches it to True. Ran tests/gpu_case_runner_check.py with X2W_FLAT_SERVER=0 in the environment: 11/11 OK (6 failures before the change).

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 12:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#discussion_r4708076120) Fixed in f01ff5b6c: the fixture patches R.SERVER_OFF to False for every test and restores it; the opt-out test patches it to True. Ran tests/gpu_case_runner_check.py with X2W_FLAT_SERVER=0 in the environment: 11/11 OK (6 failures before the change). AI-assisted; commands listed were executed locally.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 12:02 UTC · original

Fixed in f01ff5b6c: the check treats a killed child that nobody reaped (state Z in /proc) as gone, so it no longer depends on PID 1 reaping orphans. Ran tests/gpu_case_runner_check.py: 11/11 OK.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 12:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#discussion_r4708076601) Fixed in f01ff5b6c: the check treats a killed child that nobody reaped (state Z in /proc) as gone, so it no longer depends on PID 1 reaping orphans. Ran tests/gpu_case_runner_check.py: 11/11 OK. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 13:37 UTC · original

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 619ae7009534dcbfce40cfd60d309bfe2ac885fd:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target offscreen_check -- -j 2): 54.60s (configure 2.52s)
    • Test (ctest --preset dev -R '^gpu_case_runner$' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (16.54s: gpu_case_runner 16.38s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target offscreen_check -- -j 2): 53.76s (configure 2.62s)
    • Test (ctest --preset release -R '^gpu_case_runner$' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (15.27s: gpu_case_runner 15.06s)
  • Windows Python checks: tests/gpu_case_runner_check.py ok (14.9s), tests/startup_flat_param_check.py ok (0.2s), tests/startup_image_sample_b_check.py ok (0.3s), tests/startup_gfx2hlsl_f32_nan_check.py ok (5.5s)
  • sccache: 247/280 hits; wall 156.1s
    tested: 619ae700 via fetch (pull/2766/head, no patch)

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 13:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#issuecomment-7193617919) Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `619ae7009534dcbfce40cfd60d309bfe2ac885fd`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target offscreen_check -- -j 2`): `54.60s` (configure `2.52s`) - Test (`ctest --preset dev -R '^gpu_case_runner$' --parallel 2 --no-tests=error --output-on-failure`): **1/1 passed** (`16.54s`: `gpu_case_runner` `16.38s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target offscreen_check -- -j 2`): `53.76s` (configure `2.62s`) - Test (`ctest --preset release -R '^gpu_case_runner$' --parallel 2 --no-tests=error --output-on-failure`): **1/1 passed** (`15.27s`: `gpu_case_runner` `15.06s`) - **Windows Python checks**: `tests/gpu_case_runner_check.py` ok (`14.9s`), `tests/startup_flat_param_check.py` ok (`0.2s`), `tests/startup_image_sample_b_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_f32_nan_check.py` ok (`5.5s`) - `sccache`: 247/280 hits; wall `156.1s` tested: 619ae700 via fetch (pull/2766/head, no patch) AI-assisted; commands listed were executed locally.
Author
Owner

@⁠pigalot on GitHub · 2026-11-27 18:18 UTC · original · approved these changes

Independently reviewed 619ae700 integrated over main 429f11d5 (tree a8658aad, clean merge).

What I traced. I read the --serve loop in tests/offscreen_check.cpp. Each case goes through resolve_cli and run_operation_spec on the existing device, the same path as a one-shot call. Stored debug messages are cleared after each case, and a removed device answers its case and then ends the loop.

On the client side (tests/gpu_case_runner.py):

  • a case that is lost, silent or answered with the wrong number gets returncode 1 and is never replayed;
  • arguments that contain a tab or newline fall back to the one-shot call.

What I ran. I built offscreen_check in dev and release. I then ran every CTest entry whose script imports gpu_case_runner or startup_flat_param_check, which is 305 tests: 122 _hardware, 122 _warp, plus the controls and Python checks. The non-hardware ones ran with -j 8 and the hardware ones with -j 1:
ctest --test-dir out/build/<preset> --no-tests=error -j 1 --output-on-failure -R '^(<the 122 _hardware names>)$'

  • Release /O2: 305/305 passed, no skips.
  • Debug: 304/305 passed, no skips. The one failure is startup_slot67_indirect_dispatch_{warp,hardware}. It launches startup_stream_consumer, which I had not built in that tree, through plain subprocess.run, and it does not use the runner. It only matched my name filter by prefix.
  • Debug layer: debug_layer=enabled appears in all 72 served cases of startup_image_sample_b_hardware, so the banner is repeated per case as described.

Runner check. python -B -W error::ResourceWarning tests/gpu_case_runner_check.py passed 3 of 3 runs: 11 tests, 8.5 s each. The one skip is the POSIX-only launcher-child test.

Mutant. I made a lost case return 0 in _failed. That fails four runner tests: crash after the handshake, crash keeps diagnostics, wrong case number, and silent renderer. On main 429f11d5, gpu_case_runner is not registered. git diff --check is clean.

Speed on a real card, Release, debug layer on, one run each:

test served X2W_FLAT_SERVER=0
startup_image_sample_b_hardware 4.7 s 19.2 s
startup_gfx2hlsl_f32_nan_hardware 9.5 s 48.6 s
startup_gfx2hlsl_f32_sdwa_hardware 12.8 s 70.9 s

Non-blocking finding. The server reads a case with fgets into a 64 KiB buffer, so a longer line is read as two cases. Both halves are answered with consecutive numbers, so the client's index check still matches, and every later verdict shifts by one case.

On WARP, through gpu_case_runner.run with out/build/dev/offscreen_check.exe, I sent six calls in order:

  1. --compute-root
  2. --compute-root <70,000-char arg>
  3. --compute-root
  4. --compute-root
  5. --bogus-op
  6. --compute-root

They returned 0, 2, 2, 0, 0, 2 where one-shot semantics give 0, 2, 0, 0, 2, 0. The invalid operation came back as a pass.

No current caller can reach this. Every adopted case was a one-shot command line, which Windows caps at 32,767 characters; a one-shot call of the 70,000-char case fails with WinError 206. But the served path now accepts lines that the one-shot path rejects, so a future caller could hit it silently. Either fix would close it: send lines of 64 KiB or more through the one-shot call, which fails loudly, or read whole lines on the server, for example with std::getline. This is not a reason to hold the PR.

Verdict: approve on 619ae700.

Environment: NVIDIA GeForce RTX 5090, driver 32.0.16.1088; Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; Python 3.12.10; debug layer on.
CI: Build and test on Windows passes on 619ae700. All review threads are resolved.

This reply was AI-assisted.

**@⁠pigalot** on GitHub · 2026-11-27 18:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2766#pullrequestreview-6092014897) · **approved these changes** Independently reviewed `619ae700` integrated over `main` `429f11d5` (tree `a8658aad`, clean merge). **What I traced.** I read the `--serve` loop in `tests/offscreen_check.cpp`. Each case goes through `resolve_cli` and `run_operation_spec` on the existing device, the same path as a one-shot call. Stored debug messages are cleared after each case, and a removed device answers its case and then ends the loop. On the client side (`tests/gpu_case_runner.py`): - a case that is lost, silent or answered with the wrong number gets returncode 1 and is never replayed; - arguments that contain a tab or newline fall back to the one-shot call. **What I ran.** I built `offscreen_check` in `dev` and `release`. I then ran every CTest entry whose script imports `gpu_case_runner` or `startup_flat_param_check`, which is 305 tests: 122 `_hardware`, 122 `_warp`, plus the controls and Python checks. The non-hardware ones ran with `-j 8` and the hardware ones with `-j 1`: `ctest --test-dir out/build/<preset> --no-tests=error -j 1 --output-on-failure -R '^(<the 122 _hardware names>)$'` - **Release `/O2`:** 305/305 passed, no skips. - **Debug:** 304/305 passed, no skips. The one failure is `startup_slot67_indirect_dispatch_{warp,hardware}`. It launches `startup_stream_consumer`, which I had not built in that tree, through plain `subprocess.run`, and it does not use the runner. It only matched my name filter by prefix. - **Debug layer:** `debug_layer=enabled` appears in all 72 served cases of `startup_image_sample_b_hardware`, so the banner is repeated per case as described. **Runner check.** `python -B -W error::ResourceWarning tests/gpu_case_runner_check.py` passed 3 of 3 runs: 11 tests, 8.5 s each. The one skip is the POSIX-only launcher-child test. **Mutant.** I made a lost case return 0 in `_failed`. That fails four runner tests: crash after the handshake, crash keeps diagnostics, wrong case number, and silent renderer. On `main` `429f11d5`, `gpu_case_runner` is not registered. `git diff --check` is clean. **Speed on a real card, Release, debug layer on, one run each:** | test | served | `X2W_FLAT_SERVER=0` | |---|---|---| | `startup_image_sample_b_hardware` | 4.7 s | 19.2 s | | `startup_gfx2hlsl_f32_nan_hardware` | 9.5 s | 48.6 s | | `startup_gfx2hlsl_f32_sdwa_hardware` | 12.8 s | 70.9 s | **Non-blocking finding.** The server reads a case with `fgets` into a 64 KiB buffer, so a longer line is read as two cases. Both halves are answered with consecutive numbers, so the client's index check still matches, and every later verdict shifts by one case. On WARP, through `gpu_case_runner.run` with `out/build/dev/offscreen_check.exe`, I sent six calls in order: 1. `--compute-root` 2. `--compute-root <70,000-char arg>` 3. `--compute-root` 4. `--compute-root` 5. `--bogus-op` 6. `--compute-root` They returned `0, 2, 2, 0, 0, 2` where one-shot semantics give `0, 2, 0, 0, 2, 0`. The invalid operation came back as a pass. No current caller can reach this. Every adopted case was a one-shot command line, which Windows caps at 32,767 characters; a one-shot call of the 70,000-char case fails with `WinError 206`. But the served path now accepts lines that the one-shot path rejects, so a future caller could hit it silently. Either fix would close it: send lines of 64 KiB or more through the one-shot call, which fails loudly, or read whole lines on the server, for example with `std::getline`. This is not a reason to hold the PR. **Verdict:** approve on `619ae700`. Environment: NVIDIA GeForce RTX 5090, driver 32.0.16.1088; Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; Python 3.12.10; debug layer on. CI: `Build and test on Windows` passes on `619ae700`. All review threads are resolved. This reply was AI-assisted.
github-bot changed target branch from main to gh-pr/2766/base 2026-11-27 18:44:41 +00:00
github manually merged commit 619ae70095 into gh-pr/2766/base 2026-11-27 18:44:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.