Repository navigation
Conversation
… compiled shaders 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 R0Y00#2711 and R0Y00#2690.
…ache in the case runner
|
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. |
The adopted draw checks now go through gpu_case_runner.run, so the late-skip check patches that instead of subprocess.run.
|
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. |
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.
|
Thanks for the repro and the exact fix.
@RavenCurseBurg, thank you for checking native Windows D3D12 on the Intel UHD 770 and RTX 4060. The head to test is aa6c9bd. AI-assisted; commands listed were executed locally. |
…rdict 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.
|
Windows 11 build 26200, Python 3.12, exact 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 |
|
Native Windows comparison at
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 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. |
… missing 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.
|
Thank you both, this is exactly the data I needed. @R0Y00: both causes fixed in 069f172.
@RavenCurseBurg: thank you for the 2,694 matching pairs on WARP, UHD 770 and RTX 4060, wrong-value controls included. Your numbers are for 7e0a4e3; 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. |
|
Rechecked |
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.
|
@R0Y00: thank you for the native Windows re-check of 069f172 (9/9 and the draw-skip check). Gate status from our independent reviewer: code gate PASS on 069f172. 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 The head is now 43360b0: the client ends the served renderer with an explicit AI-assisted; commands listed were executed locally. |
…a pipe 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.
|
Independent review of head f5747cc (served GPU draw cases): PASS. Verification:
AI-assisted; commands listed were executed locally. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
… independent of X2W_FLAT_SERVER and zombies
|
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
AI-assisted; commands listed were executed locally. |
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,
D3D12CreateDeviceandID3D12Devicelifetime; 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 ofsubprocess.run([renderer, adapter, *args], capture_output=True, text=True), but starts one--serveprocess 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 fordebug_layer=enabledanddebug_errors=0 debug_warnings=0sees it in each case, as in a one-shot call. Only a server that cannot start (an olderoffscreen_checkwithout--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.startup_flat_param_check.draw(imported by 50 checks, among themstartup_gfx2hlsl_f16_alu_draw),startup_gfx2hlsl_f32_sdwa,startup_gfx2hlsl_f32_nanandstartup_image_sample_b. Their cases, references and controls are unchanged.startup_flat_param_check.compile_hlslnow routes DXC compiles through the opt-inX2W_DXC_CACHEcache thatpixel_aot_checkandcompute_store_checkalready use.tests/gpu_case_runner_check.py(new,gpu_case_runner): a fakeoffscreen_checkthat 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, andX2W_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):
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)
f16_alu_drawstill 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-wordsand--startup-image-2d-array-mipscases changed path; every other operation and every check that is not listed above is untouched.offscreen_check --self-teststill validates the operation table, and--serveitself 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).offscreen_checkwith this change andctest -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.(times are the summed
offscreen_checkcalls only, not compiles.)ctestof the same 15 tests: 15/15 passed.cmake --build --preset <dev|release> --target offscreen_checkthenctest --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.