Skip to content

d3d12_queue_wait_timeout: the same 20 s budget as its positive test (TEST-586) - #2970

Open
whoalin1 wants to merge 1 commit into
ItsNotRexed:mainfrom
whoalin1:test-586-queue-wait-timeout
Open

whoalin1 wants to merge 1 commit into
ItsNotRexed:mainfrom
whoalin1:test-586-queue-wait-timeout

Conversation

@whoalin1

@whoalin1 whoalin1 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claim: #2891 (comment) (TEST-586)

Root cause

d3d12_queue_wait_timeout is the negative control for d3d12_queue_wait: the same binary with --timeout-control, which creates a D3D12 device, creates a fence that is never signalled, waits 20 ms for it, and then leaves the process with _Exit(1) (runtime/test/d3d12_queue_wait_test.cpp:41, :27) so that WILL_FAIL turns that exit code into a pass (runtime/test/d3d12_queue_wait_test.cpp:36-43). Everything it does before the 20 ms wait is create_vulkan_device_standalone — the same device bring-up the positive test pays — yet it was registered with TIMEOUT 10 while the positive test directly above it gets 20 (runtime/CMakeLists.txt:963 vs :965).

Under a parallel ctest that bring-up shares the CPU and the GPU with a dozen other device-creating tests. When it outlives 10 s, CTest kills the process and reports ***Timeout; WILL_FAIL inverts a completed non-zero exit and does nothing for a killed test, so the negative control fails for a reason that is not the thing it controls. @TheHoracio saw it fail that way in 2 of 6 ctest -j 8 runs with LEONIDA_VK_VALIDATION=1, while the control alone passes 6/6 in 0.2-0.34 s.

The CTest behaviour is repeatable without a GPU, with a two-control scratch CTest project (cmake -E as the test command, so no compiler and no game files):

1/2 Test #1: control_exits_one ................   Passed    0.04 sec     (WILL_FAIL TRUE, TIMEOUT 5)
2/2 Test #2: control_times_out ...***Timeout   2.04 sec                  (WILL_FAIL TRUE, TIMEOUT 2)

The following tests FAILED:
	  2 - control_times_out (Timeout)

Changes

runtime/CMakeLists.txt: d3d12_queue_wait_timeout gets TIMEOUT 20, the budget its positive sibling already has, plus a two-line comment saying why. Nothing else changes. Hang detection is unaffected: a control that really hangs is still killed at 20 s, which is exactly the guarantee the positive test has.

d3d12_queue_wait_timeout is the only WILL_FAIL test in runtime/CMakeLists.txt, so no other registration carries the same too-small budget.

Testing

Windows 11 Pro 26200, MSVC 19.44.35207 (VS 2022 Build Tools), Ninja RelWithDebInfo, Vulkan SDK 1.4.363. GPUs: AMD Radeon(TM) Graphics (Ryzen 5 7600 iGPU, RDNA2, AMD driver 24.10.24, Vulkan 1.3.280, 128-byte push constants) and NVIDIA GeForce RTX 4070 SUPER (driver 610.88). No game files.

powershell -NoProfile -ExecutionPolicy Bypass -File scripts\build_runtime.ps1     # 359/359 targets, exit 0

Every run below has VK_LOADER_DRIVERS_SELECT=*amd-vulkan*, LEONIDA_VK_DEVICE=radeon, VK_LOADER_LAYERS_DISABLE=~implicit~, LEONIDA_VK_VALIDATION=1:

ctest --test-dir runtime/build -C RelWithDebInfo -R "d3d12_queue_wait"
ctest --test-dir runtime/build -C RelWithDebInfo -R "^d3d12" -j 12        # 45 tests, four runs
ctest -R "^d3d12" -j 12, AMD iGPU d3d12_queue_wait_timeout
before (TIMEOUT 10), runs 1-4 Passed 1.43 s, 0.84 s, 0.72 s, 1.39 s
after (TIMEOUT 20), runs 1-4 Passed 0.42 s, 0.51 s, 0.42 s, 0.43 s

Solo runs, AMD iGPU, before and after the change: d3d12_queue_wait *Skipped (exit 77, "no independent Vulkan queue available") and d3d12_queue_wait_timeout Passed in 0.33 s / 0.31 s. On the RTX 4070 SUPER both halves run: d3d12_queue_wait Passed 0.92 s and d3d12_queue_wait_timeout Passed 0.76 s. The other 8 of the 45 tests fail identically before and after (the known 144-byte push-constant cases on this 128-byte device: d3d12_bundle, d3d12_fspx_compute, d3d12_pipeline_library, d3d12_msaa_draw, d3d12_draw, d3d12_compute, d3d12_set0_compute, d3d12_typeless_families).

What I could not do: reproduce the 10 s kill on this machine. Four parallel runs with validation on never took the control past 1.43 s (the after runs are faster because the box was less loaded, not because of this change). So the fix rests on the finder's 2 of 6 and on the CTest timeout-vs-WILL_FAIL behaviour above, not on a local reproduction; it cannot make a passing control fail. Note that this iGPU cannot run the positive test at all, so the control is the only half of the pair that runs there, which is why its budget is the one that matters on 128-byte iGPUs.

Untouched: scripts/run_wine_tests.py and its own --timeout (PRs #2882 and #2357 cover that side), and CI, which runs ctest serially — this shows up in local -j runs and in harnesses that run tests concurrently.

AI-assisted. Generated with Capy (DeepSeek V4.1 Flash).

@JRamos1993

Copy link
Copy Markdown
Contributor

Tested b576b7d merged onto main 1628210 on an RTX 5090 (driver 616.92), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, RelWithDebInfo:

  • Full ctest: 130/130.
  • Warnings: none new in the files this PR changes.

AI-assisted (Claude Code).

@zzEmmazz

Copy link
Copy Markdown
Contributor

Tested b576b7d9, applied alone on main 16282101: pass.
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.

  • After configuring, CTestTestfile.cmake has TIMEOUT "20" for d3d12_queue_wait_timeout ("10" on main); WILL_FAIL and SKIP_RETURN_CODE 77 are unchanged.
  • ctest -R "^d3d12_queue_wait" --repeat until-fail:5: d3d12_queue_wait_timeout passed 5/5 on the Radeon (0.40-0.55 s) and 5/5 on the RTX 3070 (0.82-1.10 s); d3d12_queue_wait 5/5 on both. Main gives 5/5 on both as well (0.40-0.62 s and 0.99-1.05 s).
  • python -I tests/test_ctest_registration.py: 4 tests OK.
  • Against TEST-586: extend the queue-wait timeout control deadline #2963 (aea683d8), the other pull request for TEST-586: the two generated CTestTestfile.cmake files are the same apart from source line numbers (266 lines, 0 differ). The property change is identical; this one also adds a two-line comment above the test.

Not checked: the timeout this fixes. The control took at most 2 s here and I did not run it under a loaded parallel ctest, so the ***Timeout on main was not reproduced.

@kotorvr

kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested b576b7d merged onto main 1628210 (clean merge, only runtime/CMakeLists.txt differs) on NVIDIA GeForce RTX 4090, 621.14, Windows 11 (26200): pass. Like the PR body, I could not reproduce the 10 s kill on main, so this confirms the registration and that nothing regresses, not the fix itself.

MSVC 19.44 (VS 2022), Ninja, RelWithDebInfo, scripts\build_runtime.ps1; main 1628210 built the same way for comparison. The machine was under other CPU load during the runs.

  • ctest --show-only=json-v1 -R "^d3d12_queue_wait": d3d12_queue_wait_timeout has TIMEOUT 10 on main and TIMEOUT 20 with this PR, WILL_FAIL on both; d3d12_queue_wait is 20 on both.
  • ctest -C RelWithDebInfo -R "^d3d12_queue_wait" alone: d3d12_queue_wait Passed 0.99 s, d3d12_queue_wait_timeout Passed 2.30 s.
  • ctest -C RelWithDebInfo -R "^d3d12" -j 12, three runs each:
53 d3d12* tests d3d12_queue_wait d3d12_queue_wait_timeout
main 1628210 53/53 in all three 4.62 s, 2.94 s, 3.29 s Passed 3.42 s, 2.43 s, 2.48 s
with b576b7d 53/53 in all three 3.33 s, 4.20 s, 3.05 s Passed 2.29 s, 1.85 s, 2.99 s

Both halves run on this GPU. #2963 makes the same property change without the comment; I ran the same check there. No game files. AI-assisted check (Claude Code).

@XFlawless1

Copy link
Copy Markdown
Contributor

Some timing data for the budget this PR raises, since the runs above couldn't reproduce a timeout. Windows 11 Pro 26300, MSVC 19.44, RTX 5080 (621.14), LEONIDA_VK_VALIDATION=1 (layer confirmed: the device line reads validation on).

So the 10 s budget is tight with validation on and parallel ctest; 20 s as here leaves the same margin as the positive test. The branch now conflicts with main (git merge-tree on runtime/CMakeLists.txt), so it needs a rebase before it can land.

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

The control runs create_vulkan_device_standalone before it waits its 20 ms,
so its TIMEOUT covers the whole device bring-up, exactly like the positive
test above it. Under a parallel ctest that bring-up can pass 10 s, and CTest
then kills the process: WILL_FAIL inverts an exit code but not a ***Timeout,
so the negative control failed for a reason it does not control.

TEST-586

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@whoalin1
whoalin1 force-pushed the test-586-queue-wait-timeout branch from b576b7d to 5280b01 Compare November 23, 2026 13:45

@devnull34 devnull34 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and verified at commit \5280b01e7\ on Windows 11 (Build 26300), AMD Radeon RX 7900 GRE (RDNA3, gfx1100): pass.

  • Positive test (\d3d12_queue_wait_test.exe): exit 0 (\copy/compute and direct/direct Wait-before-Signal completed).
  • Negative control (\d3d12_queue_wait_test.exe --timeout-control): exit 1 (\cross-queue Wait-before-Signal timed out), correctly matching CTest's \WILL_FAIL TRUE\ contract.
  • Device detection: \AMD Radeon RX 7900 GRE, 256-byte push constants, subgroup sizes 32..64.
  • \python -I tests/test_ci_registration.py: 14/14 passed.
  • \python -I tests/test_text_write_line_endings.py: 3/3 passed.
  • \git diff --check HEAD~1..HEAD: clean.
  • Diff review: Setting \TIMEOUT 20\ for \d3d12_queue_wait_timeout\ in
    untime/CMakeLists.txt\ appropriately balances device bring-up time during parallel test runs (-j), preventing premature CTest termination.

Approve.

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.

6 participants