Skip to content

Tests: the queue slot 18 test signals a fence object that is complete (#1487) - #1523

Closed
upipibi wants to merge 1 commit into
xcl-dev:mainfrom
upipibi:tests/slot18-fake-fence
Closed

upipibi wants to merge 1 commit into
xcl-dev:mainfrom
upipibi:tests/slot18-fake-fence

Conversation

@upipibi

@upipibi upipibi commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1487: the 0xC0000005 part. The test-thread count doesn't matter; the order the tests happen to run in does.

hle::d3d12x::real::queue_tests::queue_slot_18_before_the_layout_is_known_writes_8_bytes registers a bare number, 0x5EED_0000, as one of the title's fences and sends a Signal of it through queue slot #14. That Signal goes on to the title-fence bookkeeping: list_x::note_title_queue_signal puts the fence into the sync graph's title_fences, and fence_x::note_queue_signal into its map. Nothing takes it out again. The next list_x call that looks for cycles (break_cycles_before_title_signal and the check before a Wait64 signal) walks title_fences and calls prune_title_fence. That calls GetCompletedValue() through 0x5EED_0000, and the process ends with STATUS_ACCESS_VIOLATION. With one test thread it never shows, because list_x's tests run before real's.

Test-only.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs, queue_tests: the test's fence is a static object that lives as long as the process. Its GetCompletedValue answers u64::MAX, so the bookkeeping drops its signal at the first look. Its other methods return E_NOTIMPL. The test's own checks are unchanged.

Tested
NVIDIA GeForce RTX 3070, driver 616.56; Windows 11 Pro 26100; Rust 1.100.0 MSVC; debug; main b7aa9f3.

Still flaky after this (not fixed here)

Regression run
The change is test-only (all inside real.rs's #[cfg(test)] mod queue_tests), so the release build is unchanged. The pair below is by Kalmarv (comment), thanks: RTX 5070 Ti 16 GB, driver 610.74, scripts/smoke.ps1, 60 s each, main at this PR's merge-base b7aa9f3, then this head. No device removal or crash in either run. Not checked in these runs: whether the fake-fence path was taken.

main:

xcl-smoke v1
commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1236 (PresentX 1236)
presents per 2 s (last 3): 21 13 18
device removals: 0
crashes: 0
peak commit: 26434 MB

PR:

xcl-smoke v1
commit: 1362129345ac91609bf8048361472f3f6bd6652e
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1302 (PresentX 1302)
presents per 2 s (last 3): 11 40 52
device removals: 0
crashes: 0
peak commit: 26887 MB

Not tested

  • AMD, Wine.

AI use

  • Claude Code (Claude Opus 5.5) narrowed the crash down on this machine, found the cause, wrote the change and ran the tests.

🤖 Generated with Claude Code

queue_slot_18_before_the_layout_is_known_writes_8_bytes passed a bare
number (0x5EED_0000) as the title's fence to a Signal at queue xcl-dev#14. That
Signal goes on to the title-fence bookkeeping: list_x's sync graph and
fence_x keep the fence, and later queue calls from other threads ask it
for its completed value (prune_title_fence -> GetCompletedValue). In a
parallel run, a list_x test that checks for cycles after this test
called through 0x5EED_0000 and the test process ended with
STATUS_ACCESS_VIOLATION (xcl-dev#1487). One thread at a time it never showed:
list_x's tests run before real's.

The test now uses a static fence object whose GetCompletedValue answers
u64::MAX, so the bookkeeping drops its signal the first time it looks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@GonZiin GonZiin 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.

I independently reproduced the access violation and verified the fix on an AMD RX 9070 XT.

Tested

  • Windows 11 Pro build 26300, Ryzen 7 7800X3D, Radeon RX 9070 XT (driver 32.0.32029.2010), Rust 1.100.0 MSVC, debug.
  • Used cargo test -p xcl --lib -- --exact --test-threads=32 <queue test> <list test> with the queue slot 18 test and each of cross_queue_cycle_and_same_queue_fifo_do_not_deadlock and cross_queue_wait64_before_signal_does_not_deadlock_submit_thread. Four executions per pair. Base b7aa9f3bd212088e0d927439284dc5ed325ce3c7 ended with 0xC0000005 in all eight executions. Head 1362129345ac91609bf8048361472f3f6bd6652e passed both tests in all eight executions.
  • cargo test -p xcl --lib -- --test-threads=32 at the PR head reported 722 passed, 0 failed, 21 ignored and 0 reported GPU skips.
  • The current PR description job asks for smoke blocks because the test lives inside real.rs. I ran the description checker with the current body on Linux. It reports two smoke-block errors by default and zero errors with test-only approval. A maintainer can apply the test-only label after checking the diff.

Not tested

Workspace-wide and retail smoke runs for this revision.

AI use

Codex (gpt-6.2-sol) ran the tests and wrote this report.

@marquezinii

Copy link
Copy Markdown

Test report on an RTX 5070 (Blackwell, 32-lane waves): with this PR the parallel lib runs stop crashing. #1456 was applied too, see below.

Tested

  • NVIDIA GeForce RTX 5070 12 GB, driver 621.40; Ryzen 5 5600X (12 threads), 32 GB; Windows 11 Pro 26300; Rust 1.99.1 MSVC; DXC 1.9.2602.17; debug.
  • The xcl lib test binary run directly with --test-threads=32, 10 runs per build, alternating builds:
build runs with an access violation runs with failed tests clean
main 9e3831e 9 1 0
9e3831e + #1456 (309b45a) + this PR (1362129), cherry-picked 0 3 7
  • The access violation is the one this PR describes. A procdump dump of a crashed run (b7aa9f3 + Tests: the sparse VRAM test's scalar loads take no s0 offset #1456) stops in list_x::prune_title_fence → ID3D12Fence::GetCompletedValue, a read of 0x5eed0000, called from list_x::tests::cross_queue_cycle_and_same_queue_fifo_do_not_deadlock (would_signal_close_cycle → signal_write64_pairs).
  • Failures left with both PRs: readback_routing_tests::coherent_buffer_sanitizes_console_flags_and_state in 2 runs, and kernelx::tests::fine_timer_makes_short_sleeps_short once (Sleep(1) took the 15.6 ms tick). The main runs that got far enough also failed coherent_buffer_sanitizes_console_flags_and_state (4 times), as you noted.

Not tested

AI use: Claude Code (Claude Opus 5.5) ran the builds and runs, read the dump and drafted this report.

@Bullet18x

Copy link
Copy Markdown

NVIDIA test report for head 1362129 (the AMD runs so far are GonZiin's).

Tested

Not tested

  • AMD and Intel, the release build, Wine.

Other

  • Device removal (0x887A0006, "device hung") ended 5 of 45 runs at 32 threads on every branch I ran, including the one with all three fixes. It looks unrelated to this PR. I have not looked into it.

AI use: Claude Code with Claude Opus 5.5 ran the tests and wrote this report. I checked the results.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.

Thanks!

@upipibi

upipibi commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

The PR description check fails because the diff is in real.rs, but the change is test-only: it touches only queue_tests (the fake fence). Could a maintainer add the test-only label, so the retail smoke check is waived as for other test-only PRs?

Otherwise, a smoke pair (main and 1362129) from anyone with the title would do it too; @eizispark and @Kalmarv have made these for our earlier PRs. Four testers have confirmed the crash fix above (RX 9070 XT, RTX 5070, RTX 5090, RTX 3060 Ti).

@Kalmarv

Kalmarv commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Regression pair for 1362129 against main b7aa9f3 (this PR's merge-base), for the Regression run section, as you asked. Both runs pass: no device removal, no crash, 105 % of main's frames, 102 % of its peak commit.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro 26200.
  • scripts/smoke.ps1, the same retail title for 60 s each: main at b7aa9f3 first, then this PR's head, one after the other on the same machine.

main b7aa9f3:

xcl-smoke v1
commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1236 (PresentX 1236)
presents per 2 s (last 3): 21 13 18
device removals: 0
crashes: 0
peak commit: 26434 MB

this PR, 1362129:

xcl-smoke v1
commit: 1362129345ac91609bf8048361472f3f6bd6652e
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1302 (PresentX 1302)
presents per 2 s (last 3): 11 40 52
device removals: 0
crashes: 0
peak commit: 26887 MB

Not tested

  • World loading: a 60 s run ends before it.
  • Whether the fake-fence path was taken in these runs: the logs were not read for it.
  • A second pair, AMD, Linux.

AI use: Claude Code (Claude Opus 5.5) ran the pair on this machine and wrote this; no person read the logs.

@upipibi

upipibi commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, Kalmarv: the pair is in the description under Regression run, with credit.

@JJAutoCompare

Copy link
Copy Markdown

Tested

  • Clean PR head 1362129345ac91609bf8048361472f3f6bd6652e, verified against the live PR after testing. Intel Arc A770 driver 32.0.101.9175, Ryzen 7 3800X, Windows 11 Enterprise Evaluation 25H2 build 26200.9974, Rust 1.100.0 x86_64-pc-windows-msvc, debug. DXC 1.9.2609.5 configured via XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64. These tests exercise D3D12 queue synchronization without shader compilation.
  • XCL_ADAPTER=A770, CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, isolated target and temporary directories. The GPU companions use the Windows default D3D12 adapter, which a probe under the Arc lock identified as the A770.
  • The build and standalone fixture ran outside the Arc lock. Each GPU pair ran four times under L:/XclTooling/Invoke-ArcTest.ps1.
cargo test -p xcl --lib --locked --no-run
$slot = 'hle::d3d12x::real::queue_tests::queue_slot_18_before_the_layout_is_known_writes_8_bytes'
$cycle = 'hle::d3d12x::list_x::tests::cross_queue_cycle_and_same_queue_fifo_do_not_deadlock'
$wait64 = 'hle::d3d12x::list_x::tests::cross_queue_wait64_before_signal_does_not_deadlock_submit_thread'
cargo test -p xcl --lib --locked -- --exact --nocapture --test-threads=1 $slot
cargo test -p xcl --lib --locked -- --exact --nocapture --test-threads=32 $slot $cycle
cargo test -p xcl --lib --locked -- --exact --nocapture --test-threads=32 $slot $wait64
  • Standalone fixture passed (1 passed, 0 failed, 0 ignored, 0 skipped). Each of the eight paired invocations reported 2 passed, 0 failed, 0 ignored, and 0 skips. All nine test invocations exited 0 without an access violation.

Not tested

Old baseline, full lib or workspace suite, retail smoke, release build, and other adapters.

AI use

Codex in T3 Code (gpt-6.2-sol) ran the tests, checked the logs and wrote this report.

@upipibi

upipibi commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #2002, which makes the same fix (a fake fence whose GetCompletedValue returns u64::MAX in place of 0x5EED_0000 in the queue slot 18 test, #1978) and adds cleanup helpers. One copy is enough.

AI-assisted (Claude Code).

@upipibi upipibi closed this Nov 25, 2026
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.

7 participants