Repository navigation
Description
hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels sometimes fails at its cubemap reuse check on trees based on main 9ce2070. When it does, its panic poisons the lock it holds, and two more tests fail on that lock.
Seen
thread 'hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels' panicked at crates\xcl\src\hle\d3d12x\title_textures.rs:1782:21:
assertion `left == right` failed: cubemap extra_pages must be reused at same va
left: 2359296
right: 2555904
then, on the poisoned lock (PoisonError):
hle::d3d12x::title_textures::tests::transitions_apply_when_their_list_is_submitted(title_textures.rs:1368)hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory(vram.rs:778)
tree (PR head on 9ce2070) |
right (pages after placing the second cube) |
difference |
|---|---|---|
#606 62d31c5 (changes only kbm.rs, README.md) |
2555904 | +196608 (3 × 64 KiB) |
#608 2a3c7f4 (kernelx.rs) |
17170432 | +14811136 |
#604 a452faa (present.rs, window_mode.rs, …) |
2555904 | +196608 |
left was 2359296 every time. None of these PRs changes title_textures.rs or vram.rs, and #606 changes nothing on this path, so I don't think a PR caused it.
How often
cargo test --workspace -- --test-threads=4: 3 of 9 full runs on9ce2070-based PR heads failed this way (kbm: Page Up / Page Down hold the right stick up / down #606, kernelx: keep physical page release local to the page ID #608, D3D12.X: borderless fullscreen on Alt+Enter / F11, the image at its aspect #604). The other 6 (dxc: hash arguments into the DXIL cache key and honor XCL_DXC_ARGS (#559) #591, D3D12.X: preserve unwritten gaps when tracking same-list waits #592, Title textures: detile and hash the title's memory in place, not a copy #602, D3D12.X: promote R9G9B9E5_SHAREDEXP render/UAV targets to R11G11B10_FLOAT #605, xcl run: the launcher menu can pick the game's folder #607, D3D12.X: shrink the game image to the window with an area filter #555) passed.cargo test -p xcl --lib -- --test-threads=4, run afterwards: 0 of 15 (5 each onmain9ce2070, kbm: Page Up / Page Down hold the right stick up / down #606 and kernelx: keep physical page release local to the page ID #608), plus 0 of 1 on D3D12.X: borderless fullscreen on Alt+Enter / F11, the image at its aspect #604. The three failures came close together in one batch, so something on the machine at that time may play a part.- No failure in more than 20 completed runs (lib or full suite) on
508a0c7-based trees before that, where the same check is attitle_textures.rs:1708.
A guess, not checked
dev_pages() is vram::page_bytes_for(dev_key), the page total for the shared device. The test holds VRAM_TEST_LOCK and TEST_LOCK, but a parallel test that places textures on the same device without those locks could add pages between p0 and the second read. That would make this two tests sharing one device, like #343, rather than reuse failing. +196608 is three 64 KiB tiles.
Machine
NVIDIA GeForce RTX 5070 Ti 16 GB (32-lane waves), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed, XCL_REQUIRE_GPU=mesh. The machine also has an AMD iGPU; the tests ran on the NVIDIA card.
Not tested
- Whether it happens with
--test-threads=1, which test ran beside it, a stack or page dump at the failure, AMD.
AI use
- Claude Code (Claude Opus 5.5) ran the tests, read the test and wrote this issue. I checked it before posting.
Activity
LucasHoepfner commentedon Nov 24, 2026
This flake is what #447 (@Prime1997) fixes: an open tests-only PR that checks the cube's tile reuse independently of idle page reclamation, with passing reports on several GPUs.
AI use: Claude Code (Claude Opus 5.5) found the PR; I checked it before posting.
futurepro62 commentedon Nov 24, 2026
Found the cause, and my guess above was wrong: no other test is involved. It is the idle sweep (
IDLE= 2 s invram.rs) inside the test itself.I also misread the numbers:
assert_eq!(dev_pages(), p0)puts the count after the second placement on the left, so in every failure the page total went down (17170432 → 2359296 is 226 pages of 64 KiB, 2555904 → 2359296 is 3 pages).What happens
Part 1 of the test (the 512 streamed 1 MiB textures) releases its textures, and their pages go idle. If more than 2 s pass between that release and the cubemap check,
place_tex→Pages::bind→sweepgives those idle pages back, betweenp0and the seconddev_pages(). The cube's own pages are reused as intended; the total drops because of pages the test released earlier. Under--test-threads=4the test is slow enough to cross 2 s now and then.How I checked (
mainf4ce27c, temporary local changes, reverted after)sleepbetweenp0and the secondplace_tex: the test fails 5 of 5 in the parallel lib run and 2 of 2 alone (--exact … --test-threads=1), alwaysleft: 2359296, right: 17170432.bindfor every page taken while that window was open: none. So no page was added, by this test or another one.sweep_idlefor every page it removed in the window: 226 pages, all on the test's own thread, which is exactly the 14811136 B difference.So it is a test problem, not a fault a title would see: the check compares a device-wide total across a moment when pages from earlier in the test may expire. Two ways to fix it, both in the test only: take
p0and the second count only over the cube's own keys ((base, i)inextra_pagesand itspages), or make sure the earlier idle pages are gone beforep0is taken.AI use
fromthemoonx commentedon Nov 24, 2026
I'm taking this one. I reproduced it here (1 of 15
cargo test -p xcl --lib -- --test-threads=4runs onmainf4ce27c, RTX 3060) and found the cause. It is not a second test on the same device.Cause: in the assertion,
leftis the page total after the second cube andrightthe one before, so in every failure (yours and mine) the total went down.Pages::bindstarts withself.sweep(now), which returns pages left idle forIDLE(2 s) to the pool. Earlier steps of the same test leave pages idle. When the machine is busy and the test reaches the cube more than 2 s later, the second placement sweeps them, and the device total (page_bytes_for, which counts idle pages too) drops. With temporary logging, no other thread placed anything on the device during that window, and the total went from 17170432 to 15138816. The same applies to thereusing unaligned va must share extra_pages tilecheck.Plan (test-only,
vram.rs):page_bytes_for, used only by this test, counts the pages a texture still uses (users > 0), not idle ones. With a forced 2.1 s sleep before the placement, the cube check and the unaligned-reuse check fail every time onmainand pass with the change. If extra pages are deliberately not shared, the test still fails. PR shortly; it only touches a#[cfg(test)]function, so it will ask for thetest-onlylabel.AI use: Claude Code (Claude Opus 5.5) did the runs, the logging and this write-up.
fromthemoonx commentedon Nov 24, 2026
Withdrawing my claim above: I missed that #447 already fixes this, as @LucasHoepfner says. I won't open a PR.
One measured result that #447 does not cover yet: the
reusing unaligned va must share extra_pages tilecheck in the same test has the same cause. It also compares the device-widedev_pages()before and after aplace_tex, and that placement can sweep idle pages too.On
mainf4ce27c(RTX 3060,cargo test -p xcl --lib -- --exact hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels), with a temporarystd::thread::sleep(2100 ms)just beforelet reused = place_tex(base + 0x4000, &d16);:It fails every time this way, and the same sleep before the cube's second
place_texfails the cube check every time, like the flake. #447 might want the same tile-identity comparison for that check as well.AI use: Claude Code (Claude Opus 5.5) did the runs and wrote this; the sleep was a local change only.
Prime1997 commentedon Nov 24, 2026
Working on this.
SlopTart commentedon Nov 24, 2026
AMD + Wine datapoint: the flake reproduces here, and the threads=1 control you listed as not tested does not.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Wine = Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust 1.100.0 cross
x86_64-pc-windows-gnu, maind5442d2. (Same rig as my Linux row in #42; release profile,XCL_NETWORK=0.)cargo test -p xcl --lib -- --test-threads=4, 5 completed runs:placed_title_textures_share_vram_and_preserve_pixelsfails its cubemap reuse check, thentransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memorydie on the poisoned lockgpu_mirror_upload_follows_cpu_writes_and_later_mapping_changesSo 2 of 5 here, similar to your 3 of 9 full-suite rate. (Runs 6-8 were cut short by an unrelated desktop freeze on my machine, not a test crash.)
--test-threads=1control, 3 runs: 659/4 every time, zero hits on all three tests. Consistent with your page-count interference guess: the flake needs a concurrently running test that touches the shared device's pages; serial execution removes it.Second machine, NVIDIA: a GTX 1070 (Pascal, driver 550) under Linux/Wine (wine-10.0) at main
e50836bran the three test families filtered (title_textures transitions_apply d32s8, 14 tests) at--test-threads=4five times: 14/14 every time, zero hits — while that box's unrelatedgpu::recompfamily fails en masse (my #42 note), so the device does work. Vendor split so far: AMD/RADV 2/5 at threads=4 and 0/3 at threads=1; NVIDIA/Pascal 0/5 at threads=4.Not tested: the
left/rightpage numbers in my two hits (log truncated before I captured them — I can rerun until one breaks with full stdout), whether pinning each of the three tests to separate processes fixes it on this rig, Windows.Counts only, no game data.
AI use: Hermes agent (local Qwen-class) ran the loops and drafted this; I checked it before posting.
NathanTheophile commentedon Nov 24, 2026
Independent confirmation on a GeForce RTX 4060 Laptop GPU (driver 616.87), Windows 11 build 26200.9974, Rust 1.100.0 MSVC and DXC 1.8.2502.11. In
placed_title_textures_share_vram_and_preserve_pixels, a 2.2 s delay betweenlet p0 = dev_pages();and the second cubemap placement reproduces the assertion in just over 3 seconds on both #818’s head (baf0639) and its base (e50836b). The isolated check passes on both revisions without the delay.A test-only probe compared the ordered heap/tile mappings for the two cubemaps. All 33 owned tiles and 3 extra tiles matched while the device-wide counter fell from 17,170,432 to 2,359,296 bytes. The four-thread lib suite on the instrumented head reproduced the same result without the delay. This independently confirms the idle-page diagnosis and supports the mapping-based assertion in #447.
AI use — OpenAI Codex (GPT-6 family, exact variant unavailable) ran the tests, prepared the diagnostic probe, and drafted this comment.
NathanTheophile commentedon Nov 24, 2026
I tested #447 (
48e7434) and #770 (234a8e1) separately and together on the same base,mainatbeaa245. Windows 11 build 26200, RTX 4060 Laptop GPU (driver 616.87), Rust 1.100.0 MSVC and SDK DXC 1.8.2502.11.cargo test --workspace --no-fail-fast -- --test-threads=4results:PoisonErrorfailures. Tests: compare extra-page tiles when an unaligned va is placed again (#718) #770 alone reproduced the same trio in its one full run.VirtualFreeassertion failed in the first suite, passed in isolation on both main and Tests: check cubemap tile reuse independently of idle page reclamation #447, and did not recur in the second suite.Each full run had two native-wave64 capability skips. The unaligned-placement failure did not reproduce spontaneously. I used the existing tests without timing instrumentation or game data. The results support taking both test fixes together.
AI use
SlopTart commentedon Nov 24, 2026
New member of this flaky family from today's 28-PR sweep on my rig (mains
beaa245->1ec4c98, release,--test-threads=4):hle::d3d12x::title_textures::tests::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changesfailed in 9 of 28 lanes, across merged PRs that have nothing to do with each other (872, 859, 854, 844, 843, 833, 812, 806, 805). Same signature pattern as your trio: PR-independent, only at threads=4, and six lanes in the same sweep ran fully clean (711-718 passed / 7 failed), so it is load/order sensitive rather than content dependent.Also for tracking:
gpu_geometry_wave32_prefix_count_over_a_mask(#847) hit 0/28 in this batch on the same rig - consistent with the load-sensitive read there too.Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
fromthemoonx commentedon Nov 24, 2026
@SlopTart,
gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changesmay be #913 rather than this flake. On an RTX 3060 12 GB,maina1672ef, it fails withHRESULT(0x8007000E)(E_OUTOFMEMORY) attitle_textures.rs:1305in most lib runs. The three tests from this issue then fail on the lock it poisons.The cause is #348's
a_freed_block_is_decommitted_before_its_address_is_reused: it creates a new 64 MiB sparse pool almost every alloc/free cycle and holds up to ~284 of them at once. Video memory peaks at 12 GB with it and 1.65 GB with--skip a_freed_block_is_decommitted_before_its_address_is_reused. It is also load and order dependent, because the test only allocates when earlier tests in the process have set up the sparse windows.If your failing lanes show
0x8007000Ein that test's panic, they are this. Numbers and bisect are in #913.AI use: Claude Code (Claude Opus 5.5) did the runs and wrote this.
D3D12.X: a sparse pool retired a moment ago is taken back (#913)
fladit123 commentedon Nov 24, 2026
Independent reproduction on native Windows, without injected delays or source modifications.
Environment
f4ce27ceb6d1b0576d0c659b713b674778bf1968XCL_ADAPTER=4060, sample variables unset.Built with
cargo test --locked -p xcl --lib --no-run, then executed the same library test binary in separate processes with--test-threads=4 --show-output.The second run failed with exit code 101:
The subsequent failures were:
transitions_apply_when_their_list_is_submitted: PoisonErrord32s8_targets_take_their_own_size_of_video_memory: PoisonErrorBoth runs selected the real RTX 4060 backend. Two explicit no-wave64 skips were included in the passed counts.
This is consistent with the already reported #718 failure pattern and supports the relevance of #447 and #673. I did not independently instrument tile identity or idle reclamation in these runs.
The soak harness stopped automatically on the first failing run.
AI use: ChatGPT (GPT-6.2) assisted with the test harness, log analysis and reporting. All tests were executed locally by me.
KENAJBBY commentedon Nov 24, 2026
Before / after #923 on an RTX 5070 Ti and a Ryzen 7 9800X3D iGPU: the trio is gone here
On this PC the #718 trio failed in nearly every library run before #923 and in none after it.
Machine: Windows 11 Pro 26200, Ryzen 7 9800X3D, 32 GB. NVIDIA GeForce RTX 5070 Ti 16 GB, driver 621.24. AMD Radeon(TM) Graphics (9800X3D iGPU, 485 MiB dedicated), driver 32.0.21030.2001. Rust 1.100.0 MSVC, DXC 1.9.2602.17. No
XCL_SAMPLE_*.cargo test -p xcl --lib -- --test-threads=4, one test process at a time, each tree in its own target dir. Peak memory is device-wide (WindowsGPU Adapter Memorycounters, sampled every 0.5 s).main077ce4071bda93main9aec53dXCL_ADAPTER=radeon), debugCreateHeapof a 64 MiB pool refused0x887a0005, then0x887a0007)XCL_ADAPTER=nvidia), released32s8_targets_take_their_own_size_of_video_memory(D32S8 target at 0x4000000000), 1 × device removed afterE_OUTOFMEMORYleft2359296 or 2555904 andright2555904 or 17170432.9aec53d(debug,--test-threads=4): 724 passed, 0 failed, 41 ignored on each adapter.placed_title_textures_share_vram_and_preserve_pixelsruns whole on the 5070 Ti (it reportsTiledResourcesTier4 on 621.24), without the cube skip.--skip a_freed_block_is_decommitted_before_its_address_is_reusedon 077ce40, 7 of 8 runs were clean. The 8th failed onlycoherent_buffer_sanitizes_console_flags_and_state, the separate flake from Memory: a sparse alloc/free loop makes a new 64 MiB pool each cycle; lib tests fill a 12 GB card (#348's test) #913.E_OUTOFMEMORY.So on these two GPUs #718 was #913. Whether it is fully fixed elsewhere (#447 / #673 point at idle reclamation) I can't tell from this PC.
AI use: Claude Code (Claude Opus 5.5) ran the builds and tests, read the logs and drafted this comment. The numbers come from those runs.
jmal423 commentedon Nov 24, 2026
Native Windows / RX 9070 XT follow-up to the #872 run. I checked the ancestry: the #872 head tested there predates #923. Current main includes it.
98d987a6efdabcRX 9070 XT, driver 32.0.32029.2010, Windows 11 Pro build 26200, DXC 1.8.2502.11. The main binary was built in a fresh target directory; the three runs were sequential, with
XCL_ADAPTER=9070andXCL_REQUIRE_GPU=wave64,mesh. No retail inputs.This is a post-merge observation on discrete RDNA4. The two revisions include other changes, and three clean runs do not isolate #923 or establish a fix. AI use: Codex ran the tests and prepared this comment from the logs.
Combined check on main
47efa2ewith the diffs from #447 (48e7434) and #770 (234a8e1). I ran the focused placed-texture test twice, inserting a 2100 ms sleep immediately before each second placement and recording device page bytes on either side. Both runs passed both tile-identity checks. Device bytes dropped from 16973824 to 327680 for the unaligned placement and from 2555904 to 2359296 for the cubemap in each run. The cubemap reused 33 ordinary tiles and 3 extra tiles. The second run printed the DXGI adapter description from the adapter used to create the device: AMD Radeon RX 9070 XT. This exercises both fixes while the old byte-count equalities would have failed in the same run. Focused debug test only. Codex instrumented and ran the tests.Same-base library comparison (debug, four test threads, one run per configuration). Both builds used #770 at 234a8e1 plus the small cover-baseline test change documented in #770. Without #447: 657 passed, 3 failed, 21 ignored. The cubemap count fell from 17170432 to 2555904; the other two failures were poisoned locks. Adding only the #447 diff: 660 passed, 0 failed, 21 ignored. The combined tree also completed scripts/test.ps1 (Cargo totals: 701 passed, 0 failed, 41 ignored; external sample variables unset). The synthetic title completed with exit 0. This pair reproduces the cubemap assertion under normal library load without the artificial delays used above.
fladit123 commentedon Nov 24, 2026
Follow-up to my earlier reproduction of the three failures on
f4ce27c.20 consecutive successful library test runs on main
9e3831e1f570d3646e53ab753b19ec07eb8f1485, which includes #923.Environment
XCL_ADAPTER=4060, sample variables unset.f4ce27c9e3831eEvery new run reported 727 passed, 0 failed, 21 ignored, with exit code 0. Two explicit hardware skips were included in the passed count in every run:
gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64The test executable was built once using
cargo test --locked -p xcl --lib --no-runand executed in 20 separate processes with--test-threads=4 --show-output, a 20-second interval and a four-minute timeout per run.No timeouts occurred. The real RTX 4060 backend was confirmed in the first run's log. The checkout remains clean.
Mean wall-clock duration per run decreased from 39.48 s to 19.13 s.
The previously observed cubemap assertion and subsequent PoisonError failures did not recur.
This is a post-merge stability observation, not an isolated A/B test of #923. Other changes between the revisions may contribute to the improvement. No retail title was tested.
AI use: ChatGPT (GPT-6.2) assisted with the test harness, result analysis and reporting. All tests were executed locally on my hardware.
Aniseto commentedon Nov 24, 2026
Reproduced on current
mainand narrowed the interference to thegpu::recompgroup.XCL_ADAPTER=nvidia, noXCL_SAMPLE_*set.mainc160d86,cargo test --workspace -- --test-threads=4: 5 of 5 runs fail, always the same three tests (the cubemap assertion, then the twoPoisonErrorones). 672 passed, 3 failed, 21 ignored.--test-threads=1: 675 passed, 0 failed, 21 ignored.--test-threads=4:hle::d3d12xalone: 115 passed, 0 failed (1 ignored)gpu::alone: 283 passed, 0 failed (18 ignored)hle::d3d12x gpu::together: fails, same three testshle::d3d12x gpu::recomp: fails (300 passed, 3 failed)hle::d3d12x gpu::uma: 122 passed, 0 failedhle::d3d12x gpu::texture: 127 passed, 0 failedSo on this tree the interfering group is
gpu::recomp, which containsgpu_sparse_vram_descriptors_buffers_and_xmemfrom #343. That matches the guess there about two tests sharing one process's memory windows.For context, this machine was green with the same command on
47efa2eand930e8b4(3 of 3 runs each), so it has not been fixed; it just does not always show.Not tested: which single test inside
gpu::recomptriggers it, a release build, AMD.AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - ran the commands above on this machine; no game data was used.
Tests: compare extra-page tiles when an unaligned va is placed again (x…
Merge pull request #770 from Luxuryig/tests-unaligned-tile-reuse