Skip to content

fix(runtime/test): warm up two CreateProcessW starts in queue_proxy_test handle check (TEST-779) - #3799

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
cixotdev:fix/queue-proxy-test-handle-warmup
Nov 23, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
cixotdev:fix/queue-proxy-test-handle-warmup

Conversation

@cixotdev

Copy link
Copy Markdown
Contributor

Summary

Fixes TEST-779: a deterministic false failure in runtime/test/queue_proxy_test.cpp (check_child_runner()) on Windows 11 (10.0.26200) that aborted the entire queue_proxy CTest target at line 1049 before reaching the host WARP, host NVIDIA GeForce RTX 4060, and Vulkan proxy suites.

Root Cause

check_child_runner() previously warmed up one successful CreateProcessW (--child-flood 0) and one failed CreateProcessW (.missing.exe) before calling GetProcessHandleCount(GetCurrentProcess(), &handles_before).

Using NtQueryObject(ObjectTypeInformation / ObjectNameInformation) on Windows 11 26200:

  • The 1st successful CreateProcessW opens and caches 8 EtwRegistration handles, \REGISTRY\MACHINE, and \REGISTRY\USER\<SID>\Software\Microsoft\Windows NT\CurrentVersion.
  • The 1st failed CreateProcessW opens 41-42 persistent AppCompat/PCA handles.
  • The 2nd successful CreateProcessW opens and caches one additional persistent registry Key handle in the parent process: \REGISTRY\USER\<SID> (HKEY_CURRENT_USER root).
  • The 3rd and all later CreateProcessW calls open 0 persistent handles.

Because check_child_runner() only ran one successful CreateProcessW before sampling handles_before, the 2nd successful CreateProcessW ran inside the measured window (--child-flood 8388608), causing handles_after == handles_before to fail by +1 (123 -> 124 under ctest, 116 -> 117 standalone) even though zero handles were leaked.

Change

  • Run the --child-flood 0 warmup twice in check_child_runner() before sampling handles_before, updating the inline comment to reflect the second-start \REGISTRY\USER\<SID> handle cache behavior.
  • Keep EXPECT(handles_after == handles_before) strict (+0 tolerance).

Verification & GPU Results (No Game Files)

  • Environment: Windows 11 (10.0.26200), NVIDIA GeForce RTX 4060 (driver 621.01), Vulkan 1.4.357 (Vulkan SDK 1.4.363.0), MSVC 19.44.35230.0.
  • Before (origin/main f847748c):
    • ctest --test-dir runtime/build -C RelWithDebInfo -R queue_proxy --output-on-failure: FAILED (123 handles before, 124 after at line 1049).
    • Standalone queue_proxy_test.exe: FAILED (116 handles before, 117 after at line 1049).
  • After (fix/queue-proxy-test-handle-warmup 6c6843fc):
    • ctest --test-dir runtime/build -C RelWithDebInfo -R queue_proxy --output-on-failure: 1/1 passed (14.07 sec on run 1, 12.22 sec on run 2).
    • LEONIDA_VK_VALIDATION=1 queue_proxy_test.exe: PASS (queue_proxy_test: 3 backend(s) passed) across host WARP, host NVIDIA GeForce RTX 4060, and Vulkan (0 validation errors, 27/27/32 differential edge cases, 8-thread stress, 12 create/release rounds, console-style client).
    • ctest --test-dir runtime/build -C RelWithDebInfo -R "^(queue_proxy|device_proxy)$" --output-on-failure: 2/2 passed (13.20 sec).
    • Negative control: Injecting a single leaked CreateEventW handle inside the measured window fails handles_after == handles_before (120 handles before, 121 after, exit code 1).

Coordination & Dependencies

AI-assisted with Argon (Antigravity).

…est handle check

On Windows 11 26200, check_child_runner() previously ran one successful
CreateProcessW and one failed CreateProcessW before recording handles_before.
However, NtQueryObject shows that the second successful CreateProcessW still
opens and caches one persistent HKCU registry key handle (\REGISTRY\USER\<SID>)
in the parent process before stabilizing at +0 handles on the third and later
calls. That caused `handles_after == handles_before` (e.g. 123 vs 124 under
ctest) to abort queue_proxy_test before testing WARP, hardware D3D12, or
Vulkan queue/fence proxies.

Warm up two successful `run_self(L"--child-flood 0", 30000)` starts before
recording `handles_before`, while keeping the strict `handles_after == handles_before`
handle-leak assertion intact.

AI-assisted with Argon (Antigravity).
@iurysf

iurysf commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 6c6843fc on Windows 11 (10.0.26300), RTX 4070 (NVIDIA 621.01), MSVC 14.44, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.1, RelWithDebInfo: pass. Built only queue_proxy_test at this head; queue_proxy_test.exe passed 3 of 3 runs (3 backends each) and ctest -R ^queue_proxy$ passed (12.6 s). The same test also passes 3 of 3 on main (f847748c) here, so TEST-779 does not reproduce on build 26300 and I could not show base-fails/head-passes; that needs Windows 11 26200. Not run: the full ctest, Windows 10, AMD/Intel. Tested with AI assistance (Claude).

@kapitche

Copy link
Copy Markdown
Contributor

Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head merged with main 4c52ce2, MSVC 14.51):

  • queue_proxy passes on the RTX 4080 SUPER (8.7 s) and on the Intel UHD 770 (7.7 s).

This is a test-only change (warm-up of the two CreateProcessW starts), so there is no fix to revert for a negative control, and one clean run cannot show a timing flake gone. Only queue_proxy was built and run.

@CowBoYdu76

Copy link
Copy Markdown
Contributor

Data point from Windows 11 build 26300, MSVC 19.44, Ninja RelWithDebInfo (RTX 4070 SUPER plus Intel UHD 770): I can't reproduce the false failure on main, and this PR passes.

main f847748 this PR (6c6843f)
queue_proxy_test.exe run directly, 5 times 5/5 exit 0 (8.3 to 9.1 s) 5/5 exit 0
ctest -R ^queue_proxy$ --repeat until-fail:5 5/5 passed 5/5 passed

So on 26300, the handle that the second successful CreateProcessW caches either isn't opened or is already open by the time handles_before is sampled. The extra warm-up is harmless here: a third start opens nothing new, as your table says. That fits a change between 26200 and 26300 rather than a flaky count. I didn't instrument the handles with NtQueryObject, so I can't say which of the two it is.

AI-assisted (Claude Code). No game files.

@Mayzkl

Mayzkl commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Data point from the build the PR names: Windows 11 10.0.26200.7840, NVIDIA GeForce RTX 5060 (driver 617.14), MSVC 14.44, Vulkan SDK 1.4.363.1, Ninja RelWithDebInfo. I can't reproduce the false failure on main here either, and this PR passes.

main f847748 this PR (6c6843f)
queue_proxy_test.exe run directly, 3 times 3/3 exit 0, "3 backend(s) passed" 3/3 exit 0, "3 backend(s) passed"
full ctest queue_proxy passed (132/132 then) 140/140, queue_proxy passed

So it isn't simply 26200 vs 26300, as @CowBoYdu76 suggested from 26300: on 26200 at update revision .7840, the extra handle that the second successful CreateProcessW caches is either not opened or already open before handles_before is sampled. It may depend on the cumulative update, or on something else in the environment, such as the AppCompat/PCA state the first failed start touches. I didn't instrument the handles with NtQueryObject, so I can't say which. The second warm-up is harmless on this host too.

AI-assisted check (Claude Code). No game files.

@ricardotanaka

Copy link
Copy Markdown

Another 26200 data point, at a later cumulative update than @Mayzkl's: Windows 11 Pro 26200.9457 (25H2), AMD Radeon RX 7600 (driver 26.11.2), MSVC 19.44.35230, Ninja RelWithDebInfo. No false failure on main here either, and this PR passes.

main f847748c this PR (6c6843fc merged onto f847748c)
ctest -R ^queue_proxy$ --repeat until-fail:10 10/10 passed (6.8 s each)
ctest -R ^queue_proxy$ -V passed, 3 backend(s) passed (host WARP, host AMD Radeon RX 7600, Vulkan); same with LEONIDA_VK_VALIDATION=1
full ctest 140/140 (twice, on drivers 26.10.1 and 26.11.2) 140/140

So 26200.7840 and 26200.9457 both pass on main; whatever caught the second CreateProcessW handle on the reporter's machine isn't the build number alone. The extra warm-up is harmless here. No game files. AI-assisted (Claude Code).

@ismailchaka1

Copy link
Copy Markdown
Contributor

Tested 6c6843fc on NVIDIA GeForce RTX 4070 SUPER, driver 32.0.16.1088, Windows 11, MSVC 2022 (Ninja, RelWithDebInfo), LEONIDA_VK_VALIDATION=1: pass.

  • ctest: 140/140 passed, including queue_proxy.
  • d3d12_vulkan_device_test, d3d12_descriptor_test, d3d12_present_test, d3d12_compute_test, d3d12_draw_test, d3d12_method_variants_test and d3d12_sampler2_test pass with 0 validation errors.
  • d3d12_clear_test exits 1 on depth format 55 case 1 byte 12: Vulkan ff, WARP 00. Current main (aa2988c) fails the same byte on the same GPU, so it doesn't come from this PR.
  • The build's four warnings (C4996 in d3d12_bundle_test.cpp and d3d12_first_light_test.cpp, C4456 in d3d12_compute_test.cpp and xgameruntime_test.cpp) are in files this PR doesn't touch.

PR head as-is, no game files. AI-assisted.

@LucasDonin

Copy link
Copy Markdown

Tested 6c6843fc (head as is, base f847748c) on an NVIDIA GeForce GTX 1660 (Turing TU116), driver 610.88, Windows 11, MSVC 19.44 (VS 2022 Build Tools, Ninja, RelWithDebInfo), LEONIDA_VK_VALIDATION=1: pass.

AI-assisted run (Claude). No game files involved.

@zzEmmazz

Copy link
Copy Markdown
Contributor

Tested 6c6843fc, applied alone on main f847748c: pass, but the failure it fixes does not occur on this PC, so this confirms only that the change does no harm.

Windows 11 (26200), MSVC 14.50 (VS 2026), Ninja RelWithDebInfo. Two GPUs: Ryzen 7 9700X iGPU (RDNA2, AMD 32.0.21042.62) and RTX 3070 (NVIDIA 610.74), picked with LEONIDA_VK_DEVICE.

  • f847748c without the change: ctest -R "^queue_proxy$" passes 3 runs of 3 with each GPU selected (18 to 41 s), and queue_proxy_test.exe run directly prints queue_proxy_test: 3 backend(s) passed with each. The handles before / after failure at line 1049 did not appear in any of these 8 runs, on the same Windows build (26200) the description names.
  • With the PR: ctest -R "^(queue_proxy|device_proxy)$" passes 2 runs of 2 with each GPU selected (queue_proxy 17 to 18 s). queue_proxy_test.cpp builds with no warning.

Not checked: the handle-type breakdown in the description (NtQueryObject), the injected-leak negative control, LEONIDA_VK_VALIDATION=1.

AI-assisted; measured on my PC.

@tupacfan04

Copy link
Copy Markdown
Contributor

Static review only (no GPU/build here): MERGEABLE, one file, applies cleanly. The loop runs two successful --child-flood 0 starts before sampling (queue_proxy_test.cpp:1006-1010), the first failed start stays before the sample (:1013), the window then spans about nine spawns, and EXPECT(handles_after == handles_before) stays strict (:1052), so a per-spawn leak is still caught.

Residual risk worth a sentence in the body: a handle leaked only on the second successful CreateProcessW now falls outside the window, so it would be indistinguishable from the HKCU cache described. That is the unavoidable cost of a warm-up, and the comment plus the strict later check make it acceptable. The "3rd+ add none" claim is also empirical to Windows 11 26200 and one driver set.

Mergeable. AI-assisted review, no game files, no GPU.

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.