Skip to content

Tests: a failed copy scratch check no longer aborts the lib test binary - #1817

Open
AlbanianReaper wants to merge 1 commit into
xcl-dev:mainfrom
AlbanianReaper:tests/copy-scratch-lock-poison
Open

AlbanianReaper wants to merge 1 commit into
xcl-dev:mainfrom
AlbanianReaper:tests/copy-scratch-lock-poison

Conversation

@AlbanianReaper

@AlbanianReaper AlbanianReaper commented Nov 24, 2026 •

Copy link
Copy Markdown

a_new_list_takes_no_copy_scratch_of_an_earlier_one asserted while holding the COPY_SCRATCH lock. If one of its asserts fails, the lock is poisoned. The test's command list is then dropped while the test unwinds. Its Release hook (real::cl_release → on_release → release_copy_scratch) panics on the poisoned lock, and because a panic there can't unwind, the whole lib test binary aborts ("thread caused non-unwinding panic. aborting.", exit status 9). Every other result of that process is lost. The test now reads both values under the lock and asserts after releasing it.

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: only the test changes (+8 −4); no runtime code is touched.

Tested

Regression run
scripts/linux/smoke.sh (#257) under Wine, retail title, 120 s each, fresh data folder each time. Both runs end with exit: killed. The title logs "XCL_RUN_SECONDS: 120 s – ending the title" and "process ends" at 130 s, after "D3D12 queue drain: GPU fences still pending after 10 s". After that the Wine process doesn't exit on this NVIDIA setup, even with the default 120 s grace. Main does the same, so the change doesn't cause it. Because only a test changes, could a maintainer add the test-only label?

main:

xcl-smoke v1
commit: b9b6ea62080cc62fc19e212033372d01c6214e5c
gpu: NVIDIA GeForce RTX 5060 Ti
title: fd4a6bcd
seconds: 120
exit: killed (no exit)
frames shown: 3236 (PresentX 3236)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

PR:

xcl-smoke v1
commit: 809932d140fee722e5a12a2dd12d8662b8bf5920
gpu: NVIDIA GeForce RTX 5060 Ti
title: fd4a6bcd
seconds: 120
exit: killed (no exit)
frames shown: 3258 (PresentX 3258)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

Not tested

  • Windows, AMD, Intel: no such machine. The suite and both smoke runs ran under Wine only.

AI use

  • Claude Code, Claude Opus 5.5:
    • found the abort and its cause from the test output;
    • wrote the change and the commit message;
    • ran the suite and the smoke runs;
    • wrote this description.
  • I read the diff and checked the results before opening the PR.

🤖 Generated with Claude Code

a_new_list_takes_no_copy_scratch_of_an_earlier_one asserted while it held
COPY_SCRATCH. When an assert failed, the lock was poisoned; the test's
command list was then dropped during unwinding, its Release hook
(real::cl_release -> on_release -> release_copy_scratch) panicked on the
poisoned lock, and a panic there is non-unwinding, so the whole lib test
binary aborted ("thread caused non-unwinding panic. aborting.", exit
status 9). Every test result of that process was lost.

Measured under Wine 11.22 + vkd3d-proton v3.1 on an RTX 5060 Ti, where
gpu_more_atomics_sub_dword_scratch_valu hangs the GPU and the device is
removed for later tests (the fence then reads as complete, so this test's
"stays until the fence" check fails): main aborted in 2 of 2 runs; with
this change the binary runs to the end and reports the failures.

The checks are now read under the lock and asserted after it is released.

Assisted-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fromthemoonx

Copy link
Copy Markdown

Passes on native Windows, and the abort it fixes reproduces there too.

Tested

  • NVIDIA GeForce RTX 3060 12 GB, driver 32.0.16.1088; AMD Ryzen 7 5700X; native Windows 11 Pro 26H2 (build 26300.9974); rustc 1.100.0 stable-x86_64-pc-windows-msvc; debug
  • Exact head 809932d140fee722e5a12a2dd12d8662b8bf5920 (base b9b6ea6): cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4: 889 passed, 0 failed, 42 ignored. Merged onto current main e9e94ce (no conflict): 892 passed, 0 failed, 42 ignored.
  • The abort, forced: I inverted the "stays until the fence" assert in both versions of the test so it fails, and ran cargo test -p xcl --lib -- --test-threads=4:
    • main b9b6ea6: thread caused non-unwinding panic. aborting., and the binary ends with 0xc0000409 and no results.
    • this PR: 839 passed; 1 failed; 22 ignored, with the failure being only a_new_list_takes_no_copy_scratch_of_an_earlier_one.
  • a_new_list_takes_no_copy_scratch_of_an_earlier_one, 10 runs: 10 of 10 passed

Not tested

  • AMD / Intel on Windows; release build.

AI use

  • Claude Code (Claude Opus 5.5) ran the builds and tests on the machine above, including the forced-failure check, and wrote this report from the output.

@futurepro62

Copy link
Copy Markdown

Adding an AMD GPU (RDNA2, native wave64) to the report above, which has none, with an NVIDIA run alongside. Tested exact head 809932d (on its base b9b6ea6).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record: 887 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • No new #[test] functions in the diff.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 889 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Two tests were skipped with --skip on NVIDIA. Both fail on main 7f7e768 too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. heap_window_out_of_memory_falls_back_to_the_switch_form skips when XCL_HEAP_WINDOWS is unset (Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #1651), and shaders::tests::pso_measurement_compiles_an_exact_synthetic_record skipped because Developer Mode was off. Developer Mode was turned on before the AMD run, and there pso_measurement_compiles_an_exact_synthetic_record ran and passed.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

@JJAutoCompare

Copy link
Copy Markdown

PR #1817 verification on STOR-WINLAB

Commit 809932d140fee722e5a12a2dd12d8662b8bf5920 (exact fetched head). The test-only change in list_x.rs drops the COPY_SCRATCH mutex guard before asserting. This prevents a failed assertion from poisoning the mutex and triggering a second panic in the command list's Release hook during unwind.

Tested

  • STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X. Intel Arc A770 16 GiB, driver 32.0.101.9175, wave sizes 8–32, DoublePrecisionFloatShaderOps=0, and no d3d12SDKLayers.dll. Rust 1.100.0 (0ef1bc386), DXC/DXIL 1.9.2609.5, unoptimized builds with debug info and incremental compilation disabled.
  • cargo build --workspace and cargo test --workspace --no-run succeeded.
  • cargo test -p xcl copy_scratch -- --nocapture reported 2 passed, 0 failed, 0 ignored, 0 skips. The changed list-reuse test and the scratch-budget test also passed in the full suite.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 ran once under the shared Arc lock and exited 1. All 20 targets emitted summaries. Summed libtest totals were 871 passed, 18 failed, 42 ignored, with 4 SKIPPED lines in pr1817-suite.log. Libtest includes those four early returns in its pass count. They provide no coverage.

Failures and skips

  • The library binary completed with 17 failures. Thirteen reported CreateComputePipelineState error 0x80070057, including FP64 cases. Four reported mismatches in FMA overflow, implicit-LOD sampling, f16 high-half preservation, and pixel-shader wave reductions.
  • The test title failed its dynamic depth-bias check (Split wave64: masks read only lane by lane stay in their half #94). The top-right pixel was blue where the check expected green.
  • Two skips required wave64, one required heap windows, and one could not disable the driver shader cache (0x887A002D).

Not tested

Forced copy-scratch assertion failure, comparison against main, retail-title smoke, release profile, and other adapters. The run does not establish which suite failures also occur on main.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1817-suite.log and published this report.

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