Tests: compare extra-page tiles when an unaligned va is placed again (#718) #765
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/770"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by Luxuryig on 2026-11-24T05:01:26Z.
Part of #718. Placing an unaligned 16 KiB texture at a virtual address that already holds one was checked by comparing the device-wide video-memory byte count. That count also falls when unrelated pages have been idle for two seconds, so the assert fails even when this placement still shares its extra tile. The check now compares that resource's extra-page tile identities.
#447 covers the cubemap assert later in the same test (
cubemap extra_pages must be reused at same va). This commit does not change that assert. The helper here ismapped_tiles_for, inserted beforepage_bytes_for, so it can land next to #447'stile_mappings_for.What is in it
crates/xcl/src/hle/d3d12x/vram.rs:mapped_tiles_for(#[cfg(test)]) returns the title-page tiles and the extra-page tiles of one mapped resource.crates/xcl/src/hle/d3d12x/title_textures.rs: the unaligned reuse assert inplaced_title_textures_share_vram_and_preserve_pixelscompares those extra-page tiles. When the resource is not a placed texture, the old device-wide count remains. The following "reclaimed immediately" assert still uses that device-wide count, captured before the second placement.Tested
cargo test --workspace --offline -- --test-threads=1on this diff, immediately before commit234a8e1: 701 passed, 0 failed, 41 ignored, exit 0, 86.60s. Package lines: 660/21, 0, 13, 3/4, 1, 3, 2, 7, 0/4, 1, 1, 2, 1, 1, 6/12, 0, 0.gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware.XCL_SAMPLE_*were unset; those tests are part of the 41 ignored.--test-threads=1 --exact: 1 passed, 0 failed, finished in 1.57s. With a temporary 2100 ms sleep before the second placement, long enough for the idle sweep, the same test passed again (1 passed, finished in 3.49s). That sleep is not in the commit..\scripts\test.ps1(--test-threads=4) on this same diff failed in the xcl lib tests: 657 passed, 3 failed, 21 ignored. The first failure was the unchanged cubemap assert attitle_textures.rs:1916(cubemap extra_pages must be reused at same va, left 2555904, right 16187392). The next two failures werePoisonErroron the shared vram mutex (transitions_apply_when_their_list_is_submitted,d32s8_targets_take_their_own_size_of_video_memory). That is the flake #447 is fixing. The serial run above is the result for this commit.cargo build --release -p xcl --offlinesucceeded for main64b3f35and for this head. The only warning is the pre-existingfetch_updatedeprecation inxgameruntime.Regression run
No retail Scarlett title on this machine. Both runs are the in-tree test title (the
tests/data/testgamefolder plusxcl_testtitle.exe) with--hello, for 20 seconds, each with its ownXCL_DATA_ROOT.scripts/smoke.ps1on main cannot pass title arguments, so these runs used a local-TitleArgsthat is not in this commit. A stocksmoke.ps1without--hellomakes the title exit 0x1, and that counts ascrashes: 1. Both logs sayprocess ends (at about 2.1s (exit 0). The earlyrust_panicis the title's expected caught C++ exception.Not tested
AI use
Grok Build (Grok 4.7) investigated the flake, wrote the tile comparison, ran the tests and both smoke runs, and opened this pull request.
Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T05:15:55Z.
Test run of
234a8e144f3c7f4a098ddc7e574570b1499a2afaon AMD RDNA4. I merged it onto currentmain6025201locally (clean merge).Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 704 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 663 passed, 0 failed, 21 ignoredSKIPPED; the title-texture and VRAM tests pass, the changed unaligned-placement check included.Review: Comparing the extra-page tiles themselves instead of the device-wide VRAM byte count removes the dependence on unrelated pages going idle after 2 s, which is the same flakiness #447 addresses for the cubemap check (and which I measured on
mainin my #694 / #681 reports). 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 ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Imported from ivall/xcl. Originally posted by milas6669 on 2026-11-24T05:26:56Z.
Test report on
234a8e144f3c7f4a098ddc7e574570b1499a2afa(PR head, base main64b3f35; main is nowd208e14, no conflict).Tested
x86_64-pc-windows-msvc, debugcargo test --workspace --no-fail-fast -- --test-threads=4, three runs in a row on this head: 701 passed, 0 failed, 41 ignored; then 698 passed, 3 failed, 41 ignored; then 701 passed, 0 failed, 41 ignored.placed_title_textures_share_vram_and_preserve_pixelsattitle_textures.rs:1916, "cubemap extra_pages must be reused at same va" (left 2555904, right 17170432). The other two (transitions_apply_when_their_list_is_submitted,d32s8_targets_take_their_own_size_of_video_memory) fail withPoisonErrorafterwards, from the lock the first panic left poisoned.mainf4ce27c(which also had the e2e failuretest_title_runs_and_game_folder_is_untouched, so 4 failed there) and one full run on #778's head527a2c9. That is two runs, on other commits than this one; I did not runmaind208e14. So here the flakiness is the cubemap assert that #447 covers; this PR does not change it, as its description says.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)Not tested
--test-threads=1, AMD / wave64,scripts/smoke.ps1(a test-only diff; I did not run a title)AI use
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #172Imported from ivall/xcl. Originally posted by jmal423 on 2026-11-24T12:24:00Z.
One adjacent assertion still compares against the pre-reuse count:
pages_after_cover < pages_before_reuse. On main47efa2ewith #447 and #770 applied, RX 9070 XT, the 2.1 s idle sweep during reuse took the count from 16973824 to 327680 before the covering placement. This leaves the old assertion true even if the covering placement reclaims zero pages.I tested sampling
let pages_before_cover = dev_pages();immediately beforelet cover = place_tex(base, &d64);and using that value in the comparison and diagnostic. Normal placement: 327680 -> 131072, focused test passed. Negative control substituting a clone of the existing resource for that placement: 327680 -> 327680, the revised assertion failed at the intended line (exit 101). The older baseline would accept those same numbers. Keep the pre-reuse count for the fallback reuse check. This addresses the earlier sweep observed here; the counter is still device-wide.AI use: Codex instrumented and ran the two local debug tests and prepared this report.
I also applied just the following diff to a clean export of this PR head (
234a8e1) and ran the focused test without the injected delays or #447. It passed (1 passed, 680 filtered out, debug).Minimal diff against this PR head
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:08:52Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by ivall on 2026-11-25T19:36:10Z.
Merging: this is the second timing-dependent check of the test #447 fixes (futurepro62 showed it failing 3 of 3 with the sweep forced). Tested on AMD RDNA4, Windows, DXC 1.8.2502.11, on
main06055a7:title_texturesandvram10 of 10 runs,hle::d3d12xon 16 threads once, 249 passed, 0 failed.Left for a follow-up, from jmal423 above:
pages_after_cover < pages_before_reusecompares with a count taken before the reuse, so it can hold without any page being reclaimed; the count would have to be taken right before the covering placement.AI use: Claude Code (Claude Opus 5.5) read the thread, ran the tests and wrote this on the maintainer's behalf.
upstream-sync referenced this pull request2026-11-26 15:02:54 +00:00