Skip to content

Tests: cover Wait64 recording and satisfied batch submission - #569

Open
Prime1997 wants to merge 1 commit into
xcl-dev:mainfrom
Prime1997:contrib/wait64-submission-regression
Open

Prime1997 wants to merge 1 commit into
xcl-dev:mainfrom
Prime1997:contrib/wait64-submission-regression

Conversation

@Prime1997

@Prime1997 Prime1997 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

#218 fixed Wait64BitValueX so it compares the entire 64-bit counter. These two tests drive the recorded command and submission paths that produced spurious two-second waits. Neither test needs a GPU.

What is in it

  • Record waits through the console entry point. Check a satisfied counter, an earlier counter and equality with realistic flag values. Check that Wait32 keeps its explicit mask.
  • Submit two command lists with a satisfied wait. Both should reach the same submission callback. The older flag-as-mask behavior splits the submission and waits for the timeout.
  • The existing tests construct a pending comparison directly. PR #539 exercises unsatisfied cross-queue waits and cycles. This pair checks flag recording and the already-satisfied multi-list case. This PR adds regression coverage to D3D12.X: Wait64BitValueX compares the whole value (retail title stood still after its first cinematic) #218 with zero production changes.

Tested

  • d9d61177814f328158bcb5f27c9190f7bf253933, Windows 11 Pro build 26200, Intel i5-10400, NVIDIA RTX 3060 Ti, driver 32.0.16.1714, Rust 1.100.0 MSVC.
  • The two regressions reproduced a wrong recorded mask and a split submission on the older implementation. With the merged fix, the focused release run passed both tests (2 passed, 0 failed, 0 ignored).
  • The full cargo test --workspace run with locked dependencies and four test threads completed with 682 passed, 0 failed, 41 ignored. Two hardware tests reported a wave64 skip.

Regression run

The same retail title was run for 60 seconds on each clean build. The patch changes tests only. Frame counts are individual observations.

Main

xcl-smoke v1
commit: 508a0c74d7c0625d6d2de8d24494e69dc2e1926f
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 556 (PresentX 556)
presents per 2 s (last 3): 4 5 4
device removals: 0
crashes: 0
peak commit: 14899 MB

PR head

xcl-smoke v1
commit: d9d61177814f328158bcb5f27c9190f7bf253933
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 1255 (PresentX 1255)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14468 MB

Not tested

AMD GPUs, wave64-only paths and sample-dependent RPF, TTPF, AWC, DLL, DXC and XG cases were outside this run.

AI use

OpenAI Codex (GPT-6) assisted with reproducing the stall, writing the regression tests, checking overlap and validating the branch. The runtime fix belongs to the author of #218.

I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord

The existing PendingWait checks construct the comparison directly, and the submission check manually pushes a 32-bit wait. Exercise wait64_x itself so interpreting the trailing flags slot as a mask cannot return unnoticed. Check high counter bits, garbage flag upper halves, unfinished and equal counters, and the unchanged Wait32 mask; an already satisfied Wait64 must keep the submitted batch together.

The production correction from Sr-0w PR xcl-dev#218 is already in upstream d4f17ca. This commit ports only the two original synthetic controls from42297943db3cfd4cf14ee37a7a0a53b8888d0d2c, byte-identical. Earlier separate negative controls captured both incorrect stored mask and a 2000ms false timeout/batch split with the old behavior. Fresh release focused run on official508a0c7 plus these tests:2passed,0failed,0ignored. Broader validation follows on this clean head.

Assisted-by: OpenAI Codex (exact model variant not exposed)
@thehollowedone

Copy link
Copy Markdown

Both Wait64 tests passed on exact head d9d6117. I also applied the same test-only diff to main at 9ce2070 in a scratch tree. Both tests passed there too, including the check that a satisfied wait keeps the batch together and leaves Wait32 masking intact.

Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, debug. cargo test --offline --locked -p xcl --lib wait64_ -- --test-threads=1 --nocapture reported 2 passed, 0 failed, 0 ignored in each build. This covered the synthetic recording and submission fixture. The full workspace suite, actual GPU submission, and retail titles remain untested in this run.

AI use

Codex with GPT-6.2 Sol ran the tests and drafted this report.

@towiice towiice 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 PR head d9d6117 on NVIDIA GeForce GTX 1650 SUPER (Turing / TU116, driver 610.88), Windows 11 build 10.0.26300 (26H2), Rust 1.100.0 (stable-x86_64-pc-windows-gnullvm), DXC v1.9.2609:

  • cargo test -p xcl --lib hle::d3d12x::list_x -- --test-threads=4: 18 passed, 0 failed (0.69 s), including wait64_flags_do_not_mask_the_recorded_counter and wait64_satisfied_counter_keeps_submission_together_and_wait32_keeps_its_mask.

All d3d12x::list_x tests pass on Turing.

@upipibi

upipibi commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Heads-up on an interaction with #708 that neither PR's CI can see: git merge-tree merges #569 (d9d6117781) and #708 (89184d1d38) cleanly, but the merged crates/xcl/src/hle/d3d12x/list_x.rs won't compile its tests.

  • D3D12.X: preserve recorded positions of 64-bit waits #708 changes execute_with_waits to take three arguments, (queue, lists, submit) -> Result<(), String> (line 977 of the merged file), and updates the existing tests to pass std::ptr::null_mut() (lines 3042 and 3055).
  • This PR's new test still calls the old form, execute_with_waits(&lists, |chunk| …) (line 2989 of the merged file). That's E0061 in the xcl lib test build, whichever PR lands second.

Fix for whichever lands second: pass std::ptr::null_mut() as the queue, as #708 does, and handle the Result. I read this from the merged tree and didn't compile it.

AI-assisted (Claude Code).

@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

Test run of d9d61177814f328158bcb5f27c9190f7bf253933 on AMD RDNA4. I merged it onto current main 64b3f35 locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 703 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 662 passed, 0 failed, 21 ignored
  • 0 SKIPPED; wait64_flags_do_not_mask_the_recorded_counter and wait64_satisfied_counter_keeps_submission_together_and_wait32_keeps_its_mask pass.

Review: Test-only coverage for #218 (Wait64 compares the whole 64-bit counter); no GPU needed, so this is mainly the whole suite on an AMD adapter. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

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.

5 participants