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

Manually merged
github merged 1 commit from gh-pr/1817/head into gh-pr/1817/base 2026-11-26 05:06:13 +00:00
Owner

@⁠AlbanianReaper on GitHub · 2026-11-24 21:07 UTC · original
AlbanianReaper:tests/copy-scratch-lock-poison → main · +8 −4 · 1 files · 1 commits · merged 2026-11-25 19:22 UTC

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

  • RTX 5060 Ti, NVIDIA 620.73.04, Ryzen 5 7500F; Linux, Wine 11.22 with DXVK and vkd3d-proton (scripts/linux from #257); rustc 1.100.0, release, target x86_64-pc-windows-gnu
  • How it fails on main: with vkd3d-proton v3.1, gpu_more_atomics_sub_dword_scratch_valu hangs the GPU and the device is removed (already reported in #42). After that, fences read as complete, so this test's "stays until the fence" assert fails. On main the lib binary then aborted in 2 of 2 runs. With this change it runs to the end and lists the failures.
  • cargo test --release --workspace --no-fail-fast -- --test-threads=4 on 809932d with vkd3d-proton master (ec207194):
    • lib: 862 tests, 837 passed, 1 failed, 22 ignored; the copy-scratch test passes.
    • The 1 failure: device_x::tests::gpu_depth_buffer_created_for_unordered_access_is_placed, which also fails on main.
    • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64), pso_measurement_compiles_an_exact_synthetic_record (no Developer Mode under Wine).
    • vram::tests::d32s8_targets_take_their_own_size_of_video_memory and reservable_agrees_with_the_driver hang under Wine. Both wait on VRAM_TEST_LOCK, so the binary was stopped after 20 min. They hang on main too.
    • Other binaries: all pass except e2e (cloaking under Wine), pls_quota (#810) and predication_e2e (#1272), which fail the same way on main.

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

**@⁠AlbanianReaper** on GitHub · 2026-11-24 21:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/1817) `AlbanianReaper:tests/copy-scratch-lock-poison` → `main` · +8 −4 · 1 files · 1 commits · merged 2026-11-25 19:22 UTC `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** - RTX 5060 Ti, NVIDIA 620.73.04, Ryzen 5 7500F; Linux, Wine 11.22 with DXVK and vkd3d-proton (`scripts/linux` from #257); rustc 1.100.0, release, target `x86_64-pc-windows-gnu` - How it fails on main: with vkd3d-proton v3.1, `gpu_more_atomics_sub_dword_scratch_valu` hangs the GPU and the device is removed (already reported in #42). After that, fences read as complete, so this test's "stays until the fence" assert fails. On main the lib binary then aborted in 2 of 2 runs. With this change it runs to the end and lists the failures. - `cargo test --release --workspace --no-fail-fast -- --test-threads=4` on `809932d` with vkd3d-proton master (`ec207194`): - lib: 862 tests, 837 passed, 1 failed, 22 ignored; the copy-scratch test passes. - The 1 failure: `device_x::tests::gpu_depth_buffer_created_for_unordered_access_is_placed`, which also fails on main. - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64), `pso_measurement_compiles_an_exact_synthetic_record` (no Developer Mode under Wine). - `vram::tests::d32s8_targets_take_their_own_size_of_video_memory` and `reservable_agrees_with_the_driver` hang under Wine. Both wait on `VRAM_TEST_LOCK`, so the binary was stopped after 20 min. They hang on main too. - Other binaries: all pass except `e2e` (cloaking under Wine), `pls_quota` (#810) and `predication_e2e` (#1272), which fail the same way on main. **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](https://claude.com/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 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:06:10 +00:00
github manually merged commit 809932d140 into gh-pr/1817/base 2026-11-26 05:06:13 +00:00
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-24 21:30 UTC · original

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.
**@⁠fromthemoonx** on GitHub · 2026-11-24 21:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/1817#issuecomment-7145011924) **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.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 22:22 UTC · original

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 (#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.
**@⁠futurepro62** on GitHub · 2026-11-24 22:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/1817#issuecomment-7146150669) 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 (#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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 00:39 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 00:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1817#issuecomment-7148740772) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 03:15 UTC · original

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 (#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.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 03:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1817#issuecomment-7151740601) # 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 (#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.
Author
Owner

@⁠ivall on GitHub · 2026-11-25 19:22 UTC · original

Merging: read under the lock, assert after it, so a failure no longer aborts the whole binary.

Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, main 2898511 with 27 test PRs merged locally, this one included: the whole suite 3 times, 1419 passed, 2 failed, 46 ignored each time (fuzz_validate_and_gpu_1 and _3, which fail the same way on main); hle::d3d12x on 16 threads 5 times, no failure.

AI use: Claude Code (Claude Opus 5.5) reviewed and tested this and wrote the comment on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 19:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/1817#issuecomment-7172207971) Merging: read under the lock, assert after it, so a failure no longer aborts the whole binary. Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, `main` `2898511` with 27 test PRs merged locally, this one included: the whole suite 3 times, 1419 passed, 2 failed, 46 ignored each time (`fuzz_validate_and_gpu_1` and `_3`, which fail the same way on `main`); `hle::d3d12x` on 16 threads 5 times, no failure. AI use: Claude Code (Claude Opus 5.5) reviewed and tested this and wrote the comment on the maintainer's behalf.
This discussion has been locked. Commenting is limited to contributors.
No description provided.