Tiling: detile_level copies contiguous runs (16 B in swizzled modes) in one go #1512

Open
github-bot wants to merge 1 commit from github-bot/gh-1512 into main AGit
Owner

@⁠oishigeso on GitHub · 2026-11-24 17:10 UTC · original
oishigeso:detile-1-runs → main · +59 −3 · 1 files · 1 commits · draft

Part 1 of 2 for #1511. detile_level copied a texture one element at a time. Within a swizzled mode's 16-byte micro-tile run, and along a row in the linear and thin modes, consecutive elements are consecutive in both layouts, so it now copies those runs in one go.

What is in it

  • crates/xcl/src/gpu/tiling.rs: detile_level copies runs; the same offsets as before (Layout::offset_z)

Tested

  • AMD Radeon RX 6700 XT (driver 32.0.21030.2001), Ryzen 5 3600, Windows 10 Pro 19045, rustc 1.100.0, release
  • RGBA8 2048×2048 on the console pipe config: 22 ms → 10 ms; BC (8 / 16 B elements) ~10 % faster
  • cargo test -p xcl --lib detile -- --test-threads=1: 7 passed, 0 failed on the stack with part 2. Six of them are at this PR's head (detile_level_runs_match_elements, new, and detile_level_matches_element_by_element, linear_levels_detile_by_rows_as_by_elements, tile_then_detile_round_trips_with_partial_blocks, a_batch_detiled_on_several_threads_matches_one_thread, retail_ttpf_textures_detile_with_their_mip_chains); gpu_detile_matches_the_cpu comes with #1513. Run before the rebase onto 930e8b4, which had no conflicts

Regression run

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: AMD Radeon RX 6700 XT
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 373 (PresentX 374)
presents per 2 s (last 3): 0 28 60
device removals: 0
crashes: 0
peak commit: 19259 MB

PR (this PR's head commit; the title is run through a folder named RetailTitle):

xcl-smoke v1
commit: fddfa2675a3ffc722a7a0dcf2ed8da1938b97713
gpu: AMD Radeon RX 6700 XT
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 579 (PresentX 579)
presents per 2 s (last 3): 59 60 60
device removals: 0
crashes: 0
peak commit: 18876 MB

Not tested

  • NVIDIA, Intel; Linux / Wine

AI use

  • Claude Code (Claude Opus 5.5) wrote the change, its test and this description, and ran the tests and runs above on my PC at my direction.

🤖 Generated with Claude Code

**@⁠oishigeso** on GitHub · 2026-11-24 17:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/1512) `oishigeso:detile-1-runs` → `main` · +59 −3 · 1 files · 1 commits · draft Part 1 of 2 for #1511. `detile_level` copied a texture one element at a time. Within a swizzled mode's 16-byte micro-tile run, and along a row in the linear and thin modes, consecutive elements are consecutive in both layouts, so it now copies those runs in one go. **What is in it** - `crates/xcl/src/gpu/tiling.rs`: `detile_level` copies runs; the same offsets as before (`Layout::offset_z`) **Tested** - AMD Radeon RX 6700 XT (driver 32.0.21030.2001), Ryzen 5 3600, Windows 10 Pro 19045, rustc 1.100.0, release - RGBA8 2048×2048 on the console pipe config: 22 ms → 10 ms; BC (8 / 16 B elements) ~10 % faster - `cargo test -p xcl --lib detile -- --test-threads=1`: 7 passed, 0 failed on the stack with part 2. Six of them are at this PR's head (`detile_level_runs_match_elements`, new, and `detile_level_matches_element_by_element`, `linear_levels_detile_by_rows_as_by_elements`, `tile_then_detile_round_trips_with_partial_blocks`, `a_batch_detiled_on_several_threads_matches_one_thread`, `retail_ttpf_textures_detile_with_their_mip_chains`); `gpu_detile_matches_the_cpu` comes with #1513. Run before the rebase onto 930e8b4, which had no conflicts **Regression run** main: ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: AMD Radeon RX 6700 XT title: RetailTitle seconds: 60 exit: 0x0 frames shown: 373 (PresentX 374) presents per 2 s (last 3): 0 28 60 device removals: 0 crashes: 0 peak commit: 19259 MB ``` PR (this PR's head commit; the title is run through a folder named RetailTitle): ``` xcl-smoke v1 commit: fddfa2675a3ffc722a7a0dcf2ed8da1938b97713 gpu: AMD Radeon RX 6700 XT title: RetailTitle seconds: 60 exit: 0x0 frames shown: 579 (PresentX 579) presents per 2 s (last 3): 59 60 60 device removals: 0 crashes: 0 peak commit: 18876 MB ``` **Not tested** - NVIDIA, Intel; Linux / Wine **AI use** - Claude Code (Claude Opus 5.5) wrote the change, its test and this description, and ran the tests and runs above on my PC at my direction. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
RGBA8 2048x2048 on the console pipe config: 22 ms -> 10 ms; BC 8/16 B ~10%.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:56:01 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 18:53 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 18:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/1512#issuecomment-7141303931) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 00:59 UTC · original

Tested

I ran the CPU tiling unit suite on clean PR head fddfa2675a3ffc722a7a0dcf2ed8da1938b97713 and verified that SHA against the open PR after the run.

cargo test -p xcl --lib gpu::tiling::tests:: -- --test-threads=1 --nocapture
  • 15 passed, 0 failed, 0 ignored, 0 skipped, with 714 tests filtered out. Cargo exited 0 and emitted no SKIPPED lines.
  • detile_level_runs_match_elements, detile_level_matches_element_by_element, and linear_levels_detile_by_rows_as_by_elements passed. They compare against element-by-element output for contiguous swizzled copies, mip tails, truncated inputs, and padded linear rows.
  • Windows 11 Enterprise Evaluation 25H2 (build 26200.9974), AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175. Rust 1.100.0 (x86_64-pc-windows-msvc), Cargo 1.100.0, default unoptimized test profile. DXC 1.9.2609.5 configured through XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64. CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, and XCL_ADAPTER=A770 were set. Cargo target and TEMP/TMP were isolated on L:/XclTooling.

Not tested

GPU execution, the full workspace suite, retail-title smoke runs, and performance.

AI use

Codex (gpt-6.2-sol) ran the tests, verified the SHA, and wrote this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 00:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/1512#issuecomment-7149098117) **Tested** I ran the CPU tiling unit suite on clean PR head `fddfa2675a3ffc722a7a0dcf2ed8da1938b97713` and verified that SHA against the open PR after the run. ```powershell cargo test -p xcl --lib gpu::tiling::tests:: -- --test-threads=1 --nocapture ``` - **15 passed, 0 failed, 0 ignored, 0 skipped**, with 714 tests filtered out. Cargo exited 0 and emitted no `SKIPPED` lines. - `detile_level_runs_match_elements`, `detile_level_matches_element_by_element`, and `linear_levels_detile_by_rows_as_by_elements` passed. They compare against element-by-element output for contiguous swizzled copies, mip tails, truncated inputs, and padded linear rows. - Windows 11 Enterprise Evaluation 25H2 (build 26200.9974), AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175. Rust 1.100.0 (`x86_64-pc-windows-msvc`), Cargo 1.100.0, default unoptimized test profile. DXC 1.9.2609.5 configured through `XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64`. `CARGO_BUILD_JOBS=2`, `CARGO_INCREMENTAL=0`, and `XCL_ADAPTER=A770` were set. Cargo target and TEMP/TMP were isolated on `L:/XclTooling`. **Not tested** GPU execution, the full workspace suite, retail-title smoke runs, and performance. **AI use** Codex (`gpt-6.2-sol`) ran the tests, verified the SHA, and wrote this report.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1512/head:github-bot/gh-1512'
git switch 'github-bot/gh-1512'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1512'
git switch 'github-bot/gh-1512'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1512'
git switch 'github-bot/gh-1512'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1512'
git switch 'main'
git merge --squash 'github-bot/gh-1512'
git switch 'main'
git merge --ff-only 'github-bot/gh-1512'
git switch 'main'
git merge 'github-bot/gh-1512'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.