Title textures test: a 16 KiB texture in a small-pool block has no tiles #3661

Open
AC-Storm-YT wants to merge 1 commit from upstream-pr/3661 into amd-dev
AC-Storm-YT commented 2026-12-02 05:14:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by AC-Storm-YT on 2026-12-02T05:14:48Z.


Part of #2632 (lane 4 of #2996). Test-only: both changes are #[cfg(test)], so I'd ask for the test-only label instead of a smoke run.

placed_title_textures_share_vram_and_preserve_pixels has failed on amd-dev since aeefef10 wired vram_small back in. A sampled texture under 64 KiB that is not over a live page now gets a 4 KiB block of a shared heap and no tiles, but the test expected the 16 KiB texture at +0x4000 to have tile mappings, and expected covering the first 64 KiB to reclaim its extra pages. There are none: run alone, the page count still fell by one 64 KiB page (an idle sweep, as the test's comment allows); after the other title_textures tests it stayed equal. Its panic holds TEST_LOCK, so four more title_textures tests then failed with PoisonError.

What is in it

  • crates/xcl/src/hle/d3d12x/title_textures.rs: when the 16 KiB texture is in a small-pool block, the test checks that placing it again at the same va shares the block, and that covering the small-pool textures takes no new page. The tile and extra-page assertions are unchanged and still run when the textures are on pages (XCL_VRAM_SMALL=0).
  • crates/xcl/src/hle/d3d12x/vram_small.rs: block_for, a #[cfg(test)] helper returning a texture's (pool, offset).

Tested

  • AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010; Ryzen 7 9800X3D; Windows 11 Pro build 26200; Rust 1.100.0 stable-x86_64-pc-windows-msvc; DXC 1.8.2502.11; debug; XCL_ADAPTER=9070, no XCL_SAMPLE_*.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4:
    • amd-dev 41aa60ce: 2961 passed, 8 failed, 49 ignored
    • this PR: 2966 passed, 3 failed, 49 ignored
    • Still failing, and failing on 41aa60ce too: fuzz_validate_and_gpu_1 (#2115), sparse::tests::private_physical_pages_reach_the_gpu_on_mapping, gpu_two_pass_cache_e2e two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs.
  • SKIPPED: the per-lane forms of f16_programs_on_the_gpu / f32_programs_on_the_gpu (refused V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), two_pass_binds_set_the_shared_view_heap and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows), pso_measurement_compiles_an_exact_synthetic_record (Developer Mode off).
  • The test on its own (--exact --test-threads=1): fails on 41aa60ce ("the first unaligned placement is mapped"); passes on this PR, 3 of 3 runs. The hle::d3d12x::title_textures:: tests with --test-threads=4: 67 passed, 4 failed on 41aa60ce; 71 passed, 0 failed on this PR (2 runs). The same two with XCL_VRAM_SMALL=0 also pass, so the tile and extra-page assertions still run.

Regression run

  • None: no runtime change (#[cfg(test)] only).

Not tested

  • NVIDIA, Intel, RDNA2 / RDNA3; release build; any title.
  • main: this applies to amd-dev only (main has no vram_small).

AI use

  • Claude Code (Claude Opus 5.5) found the cause, wrote the change, ran the tests on my machine and drafted this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5600331211 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3661). Originally posted by [AC-Storm-YT](https://github.com/AC-Storm-YT) on 2026-12-02T05:14:48Z. --- Part of #2632 (lane 4 of #2996). Test-only: both changes are `#[cfg(test)]`, so I'd ask for the `test-only` label instead of a smoke run. `placed_title_textures_share_vram_and_preserve_pixels` has failed on `amd-dev` since aeefef10 wired `vram_small` back in. A sampled texture under 64 KiB that is not over a live page now gets a 4 KiB block of a shared heap and no tiles, but the test expected the 16 KiB texture at +0x4000 to have tile mappings, and expected covering the first 64 KiB to reclaim its extra pages. There are none: run alone, the page count still fell by one 64 KiB page (an idle sweep, as the test's comment allows); after the other `title_textures` tests it stayed equal. Its panic holds `TEST_LOCK`, so four more `title_textures` tests then failed with `PoisonError`. **What is in it** - `crates/xcl/src/hle/d3d12x/title_textures.rs`: when the 16 KiB texture is in a small-pool block, the test checks that placing it again at the same va shares the block, and that covering the small-pool textures takes no new page. The tile and extra-page assertions are unchanged and still run when the textures are on pages (`XCL_VRAM_SMALL=0`). - `crates/xcl/src/hle/d3d12x/vram_small.rs`: `block_for`, a `#[cfg(test)]` helper returning a texture's (pool, offset). **Tested** - AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010; Ryzen 7 9800X3D; Windows 11 Pro build 26200; Rust 1.100.0 `stable-x86_64-pc-windows-msvc`; DXC 1.8.2502.11; debug; `XCL_ADAPTER=9070`, no `XCL_SAMPLE_*`. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: - `amd-dev` 41aa60ce: 2961 passed, 8 failed, 49 ignored - this PR: 2966 passed, 3 failed, 49 ignored - Still failing, and failing on 41aa60ce too: `fuzz_validate_and_gpu_1` (#2115), `sparse::tests::private_physical_pages_reach_the_gpu_on_mapping`, `gpu_two_pass_cache_e2e` `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs`. - `SKIPPED`: the per-lane forms of `f16_programs_on_the_gpu` / `f32_programs_on_the_gpu` (refused V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), `two_pass_binds_set_the_shared_view_heap` and `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows), `pso_measurement_compiles_an_exact_synthetic_record` (Developer Mode off). - The test on its own (`--exact --test-threads=1`): fails on 41aa60ce ("the first unaligned placement is mapped"); passes on this PR, 3 of 3 runs. The `hle::d3d12x::title_textures::` tests with `--test-threads=4`: 67 passed, 4 failed on 41aa60ce; 71 passed, 0 failed on this PR (2 runs). The same two with `XCL_VRAM_SMALL=0` also pass, so the tile and extra-page assertions still run. **Regression run** - None: no runtime change (`#[cfg(test)]` only). **Not tested** - NVIDIA, Intel, RDNA2 / RDNA3; release build; any title. - `main`: this applies to `amd-dev` only (`main` has no `vram_small`). **AI use** - Claude Code (Claude Opus 5.5) found the cause, wrote the change, ran the tests on my machine and drafted this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Foniass commented 2026-12-02 05:15:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T05:15:34Z.


Review (head 78462f65, diff read, not a merge-check; draft, checks red):

No problems found in the diff. Checked that the small-pool branch (title_textures.rs ~7482-7492) applies only when the first 16 KiB texture actually got a vram_small block, that the tile and extra-page assertions still run unchanged when the textures are on pages (XCL_VRAM_SMALL=0), that the strict "extra pages reclaimed" check is kept whenever any of the superseded textures has extra tiles (superseded_extra, ~7510-7520) and relaxed to "no new page" only when none does, and that vram_small::block_for is #[cfg(test)], so there is no runtime change. The test-only label is the maintainer's call.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7335747548 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3661#issuecomment-7335747548). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T05:15:34Z. --- Review (head 78462f65, diff read, not a merge-check; draft, checks red): No problems found in the diff. Checked that the small-pool branch (`title_textures.rs` ~7482-7492) applies only when the first 16 KiB texture actually got a `vram_small` block, that the tile and extra-page assertions still run unchanged when the textures are on pages (`XCL_VRAM_SMALL=0`), that the strict "extra pages reclaimed" check is kept whenever any of the superseded textures has extra tiles (`superseded_extra`, ~7510-7520) and relaxed to "no new page" only when none does, and that `vram_small::block_for` is `#[cfg(test)]`, so there is no runtime change. The `test-only` label is the maintainer's call. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
bmjask commented 2026-12-02 19:56:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T19:56:01Z.


@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.

<!-- greyfinch-sync:ivall/xcl:comment:7356951759 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3661#issuecomment-7356951759). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-02T19:56:01Z. --- @Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3661:upstream-pr/3661'
git switch 'upstream-pr/3661'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'amd-dev'
git merge --no-ff 'upstream-pr/3661'
git switch 'upstream-pr/3661'
git rebase 'amd-dev'
git switch 'amd-dev'
git merge --ff-only 'upstream-pr/3661'
git switch 'upstream-pr/3661'
git rebase 'amd-dev'
git switch 'amd-dev'
git merge --no-ff 'upstream-pr/3661'
git switch 'amd-dev'
git merge --squash 'upstream-pr/3661'
git switch 'amd-dev'
git merge --ff-only 'upstream-pr/3661'
git switch 'amd-dev'
git merge 'upstream-pr/3661'
git push origin 'amd-dev'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!3661
No description provided.