Tiling: use fixed-width copies for short runs of wide elements #1738

Open
github-bot wants to merge 2 commits from github-bot/gh-1738 into main AGit
Owner

@⁠bradyyie on GitHub · 2026-11-24 20:04 UTC · original
bradyyie:perf/detile-wide-runs → main · +75 −3 · 1 files · 2 commits · open

Stacked on #1512 (part of #1511). Only 59bc9ee is new. For an 8- or 16-byte element, a short contiguous run can be just one or two elements. At those widths, a fixed-size copy per element beat the variable-size run loop.

What is in it

  • tiling.rs: specialize 8-byte elements for runs of one or two and 16-byte elements for runs of one. Longer runs keep #1512's copy path.

Tested

  • Ryzen 5 5600X, RTX 2070 (610.88), Windows 11 build 26200, rustc 1.100.0, release.
  • Samply flame graphs, the retail title, one 75 s run per build, 20:A, stock pacing. In profile seconds 65–75, game-host stacks containing detile_level accounted for 19.48% of sampled thread CPU delta on #1512 (fddfa26), 12.30% here. Asset traffic differed between runs. The earlier PIX timing capture identified the streaming interval; the CPU comparison is from samply.
  • Fixed-work benchmark, mode 5 / mode 25, 513×509 elements. Median of seven alternating batches of six conversions. 8 bytes: 1.20× / 1.17× faster than #1512. 16 bytes: 1.53× / 1.43×. Smaller widths ranged from 0.93× to 1.06×. Compared bytes at seven mip levels with full and truncated inputs.
  • cargo test --release --workspace --locked -- --test-threads=4: 752 passed, 0 failed, 41 ignored. Two GPU tests reported SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.

Regression run

xcl-smoke v1
commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0
gpu: NVIDIA GeForce RTX 2070
title: A popular game
seconds: 75
exit: 0x0
frames shown: 1479 (PresentX 1479)
presents per 2 s (last 3): 1 4 9
device removals: 0
crashes: 0
peak commit: 25022 MB
xcl-smoke v1
commit: 59bc9eebdac509181118ac5bd7f281a832d0ddf9
gpu: NVIDIA GeForce RTX 2070
title: A popular game
seconds: 75
exit: 0x0
frames shown: 1491 (PresentX 1491)
presents per 2 s (last 3): 0 5 6
device removals: 0
crashes: 0
peak commit: 24695 MB

Not tested

  • AMD and Intel GPUs. No demonstrated improvement in time to finish loading.

AI use
OpenCode, GPT-6.2 Astra: implementation, benchmarks, test runs and PR text.

**@⁠bradyyie** on GitHub · 2026-11-24 20:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/1738) `bradyyie:perf/detile-wide-runs` → `main` · +75 −3 · 1 files · 2 commits · open Stacked on #1512 (part of #1511). Only `59bc9ee` is new. For an 8- or 16-byte element, a short contiguous run can be just one or two elements. At those widths, a fixed-size copy per element beat the variable-size run loop. **What is in it** - `tiling.rs`: specialize 8-byte elements for runs of one or two and 16-byte elements for runs of one. Longer runs keep #1512's copy path. **Tested** - Ryzen 5 5600X, RTX 2070 (610.88), Windows 11 build 26200, rustc 1.100.0, release. - [Samply flame graphs](https://gist.github.com/bradyyie/d417c2952db456917877dccbbbba81d5), the retail title, one 75 s run per build, `20:A`, stock pacing. In profile seconds 65–75, game-host stacks containing `detile_level` accounted for 19.48% of sampled thread CPU delta on #1512 (`fddfa26`), 12.30% here. Asset traffic differed between runs. The earlier PIX timing capture identified the streaming interval; the CPU comparison is from samply. - Fixed-work benchmark, mode 5 / mode 25, 513×509 elements. Median of seven alternating batches of six conversions. **8 bytes:** 1.20× / 1.17× faster than #1512. **16 bytes:** 1.53× / 1.43×. Smaller widths ranged from 0.93× to 1.06×. Compared bytes at seven mip levels with full and truncated inputs. - `cargo test --release --workspace --locked -- --test-threads=4`: 752 passed, 0 failed, 41 ignored. Two GPU tests reported `SKIPPED` (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. **Regression run** ``` xcl-smoke v1 commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0 gpu: NVIDIA GeForce RTX 2070 title: A popular game seconds: 75 exit: 0x0 frames shown: 1479 (PresentX 1479) presents per 2 s (last 3): 1 4 9 device removals: 0 crashes: 0 peak commit: 25022 MB ``` ``` xcl-smoke v1 commit: 59bc9eebdac509181118ac5bd7f281a832d0ddf9 gpu: NVIDIA GeForce RTX 2070 title: A popular game seconds: 75 exit: 0x0 frames shown: 1491 (PresentX 1491) presents per 2 s (last 3): 0 5 6 device removals: 0 crashes: 0 peak commit: 24695 MB ``` **Not tested** - AMD and Intel GPUs. No demonstrated improvement in time to finish loading. **AI use** OpenCode, GPT-6.2 Astra: implementation, benchmarks, test runs and PR text.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:03:09 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 21:15 UTC · original · edited 2026-11-24 21:57 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 59bc9ee (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: detile_level_runs_match_elements.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.
  • Two tests were skipped with --skip on NVIDIA. Both fail on main 7f7e768 too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. heap_window_out_of_memory_falls_back_to_the_switch_form skips when XCL_HEAP_WINDOWS is unset (#1651), and shaders::tests::pso_measurement_compiles_an_exact_synthetic_record skips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not set XCL_REQUIRE_GPU, so there both just print SKIPPED.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 21:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1738#issuecomment-7144694653) · edited 2026-11-24 21:57 UTC Full-suite run, since this PR has no test report yet. Tested exact head `59bc9ee` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record`: **752 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `detile_level_runs_match_elements`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**, no skips. - Two tests were skipped with `--skip` on NVIDIA. Both fail on main `7f7e768` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns their skips into failures. `heap_window_out_of_memory_falls_back_to_the_switch_form` skips when `XCL_HEAP_WINDOWS` is unset (#1651), and `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` skips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not set `XCL_REQUIRE_GPU`, so there both just print SKIPPED. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 22:44 UTC · original

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

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

Thanks!

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

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

PR #1738 — Windows / Arc A770 verification

Tested clean detached head 59bc9eebdac509181118ac5bd7f281a832d0ddf9. The diff changes only crates/xcl/src/gpu/tiling.rs.

STOR-WINLAB | Windows 11 Enterprise Evaluation x64, build 26200 | AMD Ryzen 7 3800X | Intel Arc A770, driver 32.0.101.9175 | DXC 1.9.2609.5 | rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Cargo used unoptimized dev and test profiles with debug info and incremental compilation disabled.

Tested

  • cargo build --workspace and cargo test --workspace --no-run both exited 0 outside the Arc lock. Cargo built 18 test executables.
  • With XCL_ADAPTER=NONE_CPU_ONLY, cargo test -p xcl --lib gpu::tiling::tests:: outside the lock gave 15 passed, 0 failed, 0 ignored, and 0 SKIPPED lines. The detile tests compare output bytes to element-by-element reads across supported swizzles, 1–16-byte elements (including the fixed-width 8- and 16-byte cases), pipe configurations, mip levels and tails. They exercise full and truncated sources, zero-fill for unreadable elements, and base swizzle offsets.
  • Under Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1, cargo test --workspace --no-fail-fast -- --test-threads=4 exited 101. The 19 result lines (18 executables and 1 doc-test target) report 736 passed, 16 failed, 41 ignored, and 0 filtered out. All 15 tiling tests also passed in this run.

Workspace failures and skips

  • The recompiler had 11 CreateComputePipelineState errors (0x80070057) and 4 output mismatches (fused overflow, mip sampling, f16 high-half preservation, and a wave reduction). The synthetic title failed the RSSetDepthBiasX check, drawing blue where green was expected.
  • The log has 5 exact SKIPPED lines. Two cite missing wave64, one cites tiled resources tier below 2, and two cite missing D3D12 debug-layer support. These five appear in the harness pass count and supply no coverage.

Not tested

Matched main baseline, retail-title smoke run, retail samples (XCL_SAMPLE_* unset), performance, and other GPU vendors.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1738-suite.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 04:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/1738#issuecomment-7152500153) # PR #1738 — Windows / Arc A770 verification Tested clean detached head `59bc9eebdac509181118ac5bd7f281a832d0ddf9`. The diff changes only `crates/xcl/src/gpu/tiling.rs`. STOR-WINLAB | Windows 11 Enterprise Evaluation x64, build 26200 | AMD Ryzen 7 3800X | Intel Arc A770, driver 32.0.101.9175 | DXC 1.9.2609.5 | rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Cargo used unoptimized dev and test profiles with debug info and incremental compilation disabled. **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` both exited 0 outside the Arc lock. Cargo built 18 test executables. - With `XCL_ADAPTER=NONE_CPU_ONLY`, `cargo test -p xcl --lib gpu::tiling::tests::` outside the lock gave 15 passed, 0 failed, 0 ignored, and 0 `SKIPPED` lines. The detile tests compare output bytes to element-by-element reads across supported swizzles, 1–16-byte elements (including the fixed-width 8- and 16-byte cases), pipe configurations, mip levels and tails. They exercise full and truncated sources, zero-fill for unreadable elements, and base swizzle offsets. - Under `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`, `cargo test --workspace --no-fail-fast -- --test-threads=4` exited 101. The 19 result lines (18 executables and 1 doc-test target) report 736 passed, 16 failed, 41 ignored, and 0 filtered out. All 15 tiling tests also passed in this run. **Workspace failures and skips** - The recompiler had 11 `CreateComputePipelineState` errors (0x80070057) and 4 output mismatches (fused overflow, mip sampling, f16 high-half preservation, and a wave reduction). The synthetic title failed the `RSSetDepthBiasX` check, drawing blue where green was expected. - The log has 5 exact `SKIPPED ` lines. Two cite missing wave64, one cites tiled resources tier below 2, and two cite missing D3D12 debug-layer support. These five appear in the harness pass count and supply no coverage. **Not tested** Matched `main` baseline, retail-title smoke run, retail samples (`XCL_SAMPLE_*` unset), performance, and other GPU vendors. **AI use** T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1738-suite.log` and published.
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/1738/head:github-bot/gh-1738'
git switch 'github-bot/gh-1738'

Merge

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