Skip to content

Skip d32s8_targets_take_their_own_size_of_video_memory on adapters with under 8 GB of dedicated video memory. Fixes #42. - #1089

Closed
WASDeKeys wants to merge 5 commits into
xcl-dev:mainfrom
WASDeKeys:main
Closed

WASDeKeys wants to merge 5 commits into
xcl-dev:mainfrom
WASDeKeys:main

Conversation

@WASDeKeys

Copy link
Copy Markdown

What is in it

  • crates/xcl/src/hle/d3d12x/vram.rs: check DedicatedVideoMemory and call skip_test("< 8 GB VRAM") if under 8 GiB.

Tested

  • NVIDIA GeForce RTX 3050 6GB Laptop GPU (driver 595.97, 6144 MiB), AMD64 CPU, Windows 11 x64 (build 26200), rustc 1.100.0 (MSVC x64, debug).
  • cargo test --workspace -- --test-threads=4: 697 passed, 0 failed, 33 ignored.
  • SKIPPED GPU tests on this adapter: d32s8_targets_take_their_own_size_of_video_memory: < 8 GB VRAM.

@ivall Could you please add the 'test-only' label to waive the 'smoke.ps1' check for this unit test fix? thanks

Regression run
Test-only diff (touches only #[cfg(test)] mod tests in crates/xcl/src/hle/d3d12x/vram.rs). Requesting the test-only label per CONTRIBUTING.md.

Not tested

  • Retail game runtime changes (test-only change in unit tests).

AI use

  • Antigravity IDE (Claude Sonnet 4.6): analyzed VRAM allocation concurrency across thread counts and wrote the skip guard.

Under `--test-threads=4`, the full test suite exhausted VRAM (0x8007000E) on
a 6 GB GPU when `d32s8_targets_take_their_own_size_of_video_memory` placed
14 4K D32S8 targets (~935 MB) concurrently with other GPU tests. The
mutex poison from that failure then cascaded into title_textures tests.
All tests pass at `--test-threads=1` and `--test-threads=2`.

Check the adapter's dedicated video memory and call `skip_test("< 8 GB VRAM")`
when under 8 GiB so the suite completes cleanly on 6 GB and smaller adapters.

Fixes xcl-dev#42
Assisted by : Antigravity IDE (Claude Sonnet 4.6)
@AlexandreSchuelter

Copy link
Copy Markdown

A data point and a question: on a 16 GB card this test also fails in full runs, but not for lack of VRAM.

On an RX 6900 XT (16 GB, RDNA2), main 47efa2e, cargo test -p xcl --lib -- --test-threads=4, debug:

  • d32s8_targets_take_their_own_size_of_video_memory fails with PoisonError at vram.rs:935:49, the VRAM_TEST_LOCK.lock().unwrap(), after the RDNA2 packed-mip panic in placed_title_textures_share_vram_and_preserve_pixels poisons that lock (the cascade Tests: a panicking title-texture test no longer poisons the others #673 is about).
  • Run alone, it passes: 5/5 on main.
  • With this PR merged (3925533) the same full run gives the same 3 failures, which is expected here since the card has more than 8 GB.

The new check runs after VRAM_TEST_LOCK.lock().unwrap(), so on a card where the failure is this cascade, the skip is never reached. Could you post the panic message from the RTX 3050 6 GB run on main, and whether the test also fails there when run alone? If it is a real out-of-memory failure, the skip makes sense; if it is the PoisonError, #673 is the fix.

Not tested: a card under 8 GB (the skip path itself).

AI use: Claude Code (Claude Opus 5.5) ran the tests, read the diff and wrote this comment; I checked the points above against the code and the run output.

@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:

  • Hardware: NVIDIA GeForce GTX 1650 SUPER (Turing TU116, 4 GB / 3930 MiB DedicatedVideoMemory, driver 610.88), Windows 11 x64 (26H2 / 10.0.26300), toolchain stable-x86_64-pc-windows-gnullvm (llvm-mingw 23.1.6).
  • Test command: cargo test -p xcl --lib d32s8_targets_take_their_own_size_of_video_memory -- --nocapture
  • Result:
    SKIPPED hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory: < 8 GB VRAM
    test hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory ... ok
    

Cleanly detects dedicated video memory under 8 GiB on 4 GB GPUs and routes the skip through runner::skip_test("< 8 GB VRAM"), preventing VRAM exhaustion during concurrent test execution.

@WASDeKeys

WASDeKeys commented Nov 24, 2026 •

Copy link
Copy Markdown
Author

Thanks @towiice for confirming on the 4 GB GTX 1650 SUPER

@AlexandreSchuelter to answer your questions for the RTX 3050 6 GB Laptop GPU:

  1. Alone: All tests pass in isolation (13/13 in title_textures and 9/9 in vram).
  2. Failure on main: Under --test-threads=4, the failure on this 6 GB card was a flood of 0x8007000E (E_OUTOFMEMORY) errors when d32s8_targets_take_their_own_size_of_video_memory allocated 14 4K depth-stencil targets (~935 MB) concurrently with the rest of the suite. That OOM panic held VRAM_TEST_LOCK, which then caused the subsequent tests to fail on mutex poison.
  3. Verification: With this < 8 GB VRAM skip guard active, the entire workspace test suite under --test-threads=4 passes completely clean: 685 passed, 0 failed, 21 ignored (no crashes, no lock poisoning).

your point about checking before VRAM_TEST_LOCK is spot on. I'll push an update moving the DXGI adapter VRAM query before acquiring VRAM_TEST_LOCK, so low-VRAM GPUs skip cleanly without touching the mutex.

…-dev#42)

Move the `< 8 GB VRAM` skip check before acquiring `VRAM_TEST_LOCK`.
On GPUs under 8 GiB, the test now skips immediately without contending for
or risking poisoning from `VRAM_TEST_LOCK`.

Fixes xcl-dev#42
Assisted by : Antigravity IDE (Claude Sonnet 4.6)
@AlexandreSchuelter

Copy link
Copy Markdown

Thanks, 1bfd1f7 addresses it: the VRAM query now runs before VRAM_TEST_LOCK is taken, so a small card skips without touching the lock. On the RX 6900 XT (16 GB) the test still runs and passes at 1bfd1f7 (cargo test -p xcl --lib -- d32s8_targets_take_their_own_size_of_video_memory: 1 passed, not SKIPPED).

AI use: Claude Code (Claude Opus 5.5) read the diff, ran the test and wrote this comment.

@WASDeKeys

WASDeKeys commented Nov 24, 2026 •

Copy link
Copy Markdown
Author

So 1bfd1f7 is a valid commit? if yes, could you let me know how i can get my pull request approved? i cannot figure out the smoke.ps1 thing since i dont have an authorised Xbox GDK title build? any help maintainers? @ivall

@AlexandreSchuelter

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.

3 participants