Skip to content

Tests: a panicking title-texture test no longer poisons the others - #673

Open
iggyvilla wants to merge 1 commit into
xcl-dev:mainfrom
iggyvilla:xcl-test-lock-poison
Open

iggyvilla wants to merge 1 commit into
xcl-dev:mainfrom
iggyvilla:xcl-test-lock-poison

Conversation

@iggyvilla

@iggyvilla iggyvilla commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

The title-texture and VRAM tests serialise on TEST_LOCK (title_textures.rs) and VRAM_TEST_LOCK (vram.rs) and take them with .lock().unwrap(). When one holder panics, the mutex is poisoned and every later test that takes it fails with PoisonError, though each passes alone. On main on RDNA2, placed_title_textures_share_vram_and_preserve_pixels fails (the packed-mip case open PR #470 fixes), and it takes transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory down with it. The locks guard no data, so they are now taken the way the crate's other test locks already are (ASYNC_TEST_LOCK, READING_CB_TEST_LOCK): unwrap_or_else(|e| e.into_inner()).

What is in it

  • crates/xcl/src/hle/d3d12x/title_textures.rs, crates/xcl/src/hle/d3d12x/vram.rs: the six lock().unwrap() calls on these two test locks, all in #[cfg(test)] code. No runtime code changes; 6 lines changed.

Tested

Regression run
The diff is test-only (#[cfg(test)] code in two runtime files); these runs are there so the check passes without a test-only label. 60 s each, XCL_NETWORK=0, the same retail title.

main:

xcl-smoke v1
commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95
gpu: AMD Radeon RX 6650 XT
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 569 (PresentX 570)
presents per 2 s (last 3): 23 24 23
device removals: 0
crashes: 0
peak commit: 15856 MB

This PR:

xcl-smoke v1
commit: 84b664514f979b6d3bab76b807c0023f5fef008f
gpu: AMD Radeon RX 6650 XT
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 563 (PresentX 564)
presents per 2 s (last 3): 24 25 23
device removals: 0
crashes: 0
peak commit: 15866 MB

Not tested

  • NVIDIA, Intel, wave32-only GPUs. The retail title's run covers only its first minute; this diff does not change what it runs.

AI use

  • Claude Code (Claude Opus 5.5) found the cause, wrote the change and this description, and ran the tests above.

🤖 Generated with Claude Code

The title-texture and VRAM tests serialise on TEST_LOCK and VRAM_TEST_LOCK
and took them with .lock().unwrap(). When one holder panics (on main,
placed_title_textures_share_vram_and_preserve_pixels fails on RDNA2, the
packed-mip case xcl-dev#470 fixes), the mutex is poisoned and every later test
that takes it fails with PoisonError, though it passes alone:
transitions_apply_when_their_list_is_submitted and
d32s8_targets_take_their_own_size_of_video_memory.

The locks guard no data, so take them the way the crate's other test
locks already do (ASYNC_TEST_LOCK, READING_CB_TEST_LOCK):
unwrap_or_else(|e| e.into_inner()). Test code only.

Measured on an RX 6650 XT, cargo test --workspace -- --test-threads=4:
lib tests 647 passed, 3 failed before; 649 passed, 1 failed after.

AI-assisted.

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

Copy link
Copy Markdown

Independent test report on 84b6645:

Tested

  • Hardware: NVIDIA GeForce RTX 3070 Ti Laptop GPU (driver 616.64, SM 6.6), Intel i7-12700H, Windows 11 Home 26H2 (build 26200), rustc 1.100.0 (x86_64-pc-windows-gnullvm), debug build, DXC 1.9.2609.5 (01b62ad4)
  • Command: cargo test -p xcl --lib title_textures -- --test-threads=4
  • Result: 10 passed, 0 failed, 0 ignored in 1.53s (including placed_title_textures_share_vram_and_preserve_pixels and gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes on real D3D12.X backend)

Not tested

  • AMD / Intel GPU, retail title

AI use

  • Antigravity (Google DeepMind agent) — fetched 84b6645 in a detached worktree, audited the diff, ran the test suite, and posted this report.

@relativespace2K

Copy link
Copy Markdown

Tested — independent validation of 84b664514f979b6d3bab76b807c0023f5fef008f on AMD RDNA2

  • AMD Radeon RX 6800 XT (16338 MiB), driver 32.0.21045.29003; Ryzen 5 5600, 31.9 GB;
    Windows 11 IoT Enterprise LTSC 26100; Rust 1.100.0 stable-x86_64-pc-windows-msvc;
    DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); debug; no XCL_SAMPLE_*.
  • Exact PR head, clean tree; based on dd2ae9a (main has since advanced to 91f9a5e).
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4,
    once on the parent and once on the PR head.
tree passed failed ignored SKIPPED
parent dd2ae9a 687 3 41 0
PR head 84b6645 689 1 41 0
  • Parent: placed_title_textures_share_vram_and_preserve_pixels fails with
    3D 64x64x64 4 mips: subresource 2 mismatch; then
    transitions_apply_when_their_list_is_submitted and
    d32s8_targets_take_their_own_size_of_video_memory fail with PoisonError.
  • PR head: only the packed-mip failure remains (the D3D12.X: map a one-slice title texture's packed mips where D3D12 addresses them #470 case); both formerly poisoned
    tests pass in the same parallel run. Both also pass alone on the parent.
  • No SKIPPED GPU tests on this adapter.

Not tested: retail title / smoke.ps1 (the diff is #[cfg(test)] code only),
release build, NVIDIA / Intel.

AI use: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests and drafted this report.

@CryingLaughing

Copy link
Copy Markdown

Tested

  • PR head 84b664514f979b6d3bab76b807c0023f5fef008f and its exact parent dd2ae9a70af5eb5aad60f02d86e386b72abe1e95, with the same scratch-only test in title_textures.rs. NVIDIA GeForce RTX 4080, driver 621.01, Intel Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC x64, Windows SDK DXC 1.8.2502.11, debug. XCL_ADAPTER=4080, XCL_REQUIRE_GPU=1, all XCL_SAMPLE_* variables unset.
  • Built each revision with cargo test -p xcl --lib --locked -j 4 --no-run --message-format=json and ran the executable with hle::d3d12x::title_textures::tests::gpu_title_texture_fixtures_reacquire_poisoned_locks --exact --test-threads=1 --nocapture. In each fresh process a worker acquired both test mutexes and intentionally panicked before any GPU activity. The fixture confirmed both mutexes were poisoned, then invoked the existing transitions, mirror-upload and placed-texture tests individually under catch_unwind.
  • On the parent, all three stopped at their lock acquisition with PoisonError. The wrapper failed 0/1. On the PR head all three completed and the wrapper passed 1/1, with zero skips. The backend logged the RTX 4080, and the mirror and placed fixtures completed their normal GPU readback assertions.

Not tested

  • Recovery after a panic that changes GPU resource state, the full workspace suite on this PR, other adapters, release builds, or retail titles. The injected panic tests the locks in isolation.

AI use

  • OpenAI Codex (GPT-6 family, exact variant unavailable) prepared the scratch fixture, ran the checks, and drafted this report.

@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

Test run of 84b664514f979b6d3bab76b807c0023f5fef008f on AMD RDNA4. I merged it onto current main 91f9a5e 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: 692 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 652 passed, 0 failed, 21 ignored
  • 0 SKIPPED; the title-texture and VRAM tests pass (none panicked here, so the poisoned-lock path itself was not exercised).

Review: Taking the guard with unwrap_or_else(|e| e.into_inner()) lets the later tests run after one panics, so a failure shows as one failed test instead of a cascade of PoisonErrors. Test-only. 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.

@fladit123

Copy link
Copy Markdown

Independent release-mode validation on NVIDIA.

Tested

  • Exact PR head: 84b664514f979b6d3bab76b807c0023f5fef008f
  • NVIDIA GeForce RTX 4060 8 GB, driver 610.88
  • Intel Core i5-12400F, 32 GB RAM
  • Windows 11 Pro build 26300
  • Rust 1.100.0 MSVC, DXC 1.8.2502.11
  • Release, XCL_ADAPTER=4060
Configuration Result
Focused title-texture and D32S8 tests 11 passed, 0 failed, 0 ignored
Release workspace build PASS
Full release workspace, 4 threads 690 passed, 0 failed, 41 ignored
Library tests 650 passed, 0 failed, 21 ignored

Commands

cargo test --release -p xcl --lib --locked -- title_textures d32s8_targets_take_their_own_size_of_video_memory --test-threads=4 --show-output

cargo build --release --workspace --locked

cargo test --release --workspace --locked --no-fail-fast -- --test-threads=4 --show-output

All four directly affected tests passed in both the focused and full workspace runs. The real D3D12.X backend selected the RTX 4060. No hangs or cascading PoisonError failures were observed.

Two explicit GPU capability skips, included in the passed count:

  • gpu_geometry_wave32_prefix_count_over_a_mask
  • gpu_wave32_program_in_wave64_hardware

Ten additional sample-dependent tests explicitly skipped because their sample variables were unset.

Both test commands exited with code 0. The worktree remained clean.

Not tested: deliberately poisoned mutexes (already covered independently by CryingLaughing), recovery after GPU state corruption, baseline comparison, AMD/Intel GPUs, native wave64 or retail titles.

No blocking findings within the tested scope.

AI use: ChatGPT (GPT-6.2) assisted with diff review, test planning, log analysis and reporting. All commands were executed locally by me.

@gutersohn

Copy link
Copy Markdown

Test run of 84b664514f979b6d3bab76b807c0023f5fef008f on an AMD Radeon RX 6600 (RDNA2, Navi 23, gfx1032), as is and merged onto current main 02bfd1d: the two PoisonError follow-on failures are gone and only the #470 case is left; with #470 merged as well, 0 failed. (Current main 6efdabc changes only scripts/pr_check.py and its test since then.)

Tested

  • AMD Radeon RX 6600 (8 GB), AMD Windows driver 32.0.21045.16010; Intel Core i5-14600KF; Windows 11 10.0.26200; Rust 1.100.0 (stable-x86_64-pc-windows-msvc), debug; DXC 1.9.2602.17 (Windows SDK 10.0.26100); XCL_ADAPTER=radeon; no XCL_SAMPLE_* set
  • cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4, one worktree per tree:
tree passed failed ignored failing tests
this PR's head 84b6645 (base dd2ae9a) 689 1 41 placed_title_textures_share_vram_and_preserve_pixels
main 02bfd1d 724 3 41 the same + transitions_apply_when_their_list_is_submitted, d32s8_targets_take_their_own_size_of_video_memory (PoisonError)
02bfd1d + this PR (local merge, clean) 726 1 41 placed_title_textures_share_vram_and_preserve_pixels
02bfd1d + this PR + #470 3896e4f (local merges, clean) 727 0 41 –

Not tested

  • the retail title / scripts/smoke.ps1 (no game data); release build

AI-assisted: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

@JJAutoCompare

Copy link
Copy Markdown

Empirical test report (84b6645)

Hardware / environment

  • Commit 84b664514f979b6d3bab76b807c0023f5fef008f, clean detached checkout.
  • Windows 11 Enterprise Evaluation, build 26200. AMD Ryzen 7 3800X (8 cores). Intel Arc A770, driver 32.0.101.9175.
  • Rust and Cargo 1.100.0 (x86_64-pc-windows-msvc), DXC 1.9.2609.5. Unoptimized test profile, debug info and incremental compilation disabled.

Commands and results

  • cargo test --workspace --no-run outside the Arc lock, exit 0 after adding Cargo to PATH. Build only.
  • CPU with XCL_ADAPTER=NONE_CPU_ONLY, exit 0, 1 passed / 0 failed / 0 ignored / 0 skipped.
    xcl-00e28da3621caf64.exe --exact hle::d3d12x::title_textures::tests::transitions_apply_when_their_list_is_submitted
    
  • GPU with XCL_ADAPTER=A770 inside Invoke-ArcTest.ps1, exit 0, 3 passed / 0 failed / 0 ignored as reported by libtest. The first wrapper invocation was blocked by PowerShell execution policy. The retry used a process-scoped bypass.
    xcl-00e28da3621caf64.exe --exact --test-threads=1 hle::d3d12x::title_textures::tests::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory
    
  • Both focused commands used the prebuilt xcl library test binary and RUST_TEST_NOCAPTURE=1. Zero case-sensitive ^SKIPPED lines, one inline skip counted as a pass by libtest.

Observed behavior

The CPU transition test and the GPU mirror test passed. The mirror test logged the real Arc A770 backend. The placed-texture test printed SKIPPED ... tiled tier < 2. The D32S8 test returned ok and can silently return early at its adapter and heap-tier checks.

Not tested

Full GPU workspace suite, game smoke runs, and recovery after an intentionally poisoned mutex. The placed-texture assertions were skipped, and D32S8 assertion coverage was unconfirmed.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr673-focused.log and published.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

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.

9 participants