Skip to content

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

Open
bradyyie wants to merge 2 commits into
xcl-dev:mainfrom
bradyyie:perf/detile-wide-runs
Open

bradyyie wants to merge 2 commits into
xcl-dev:mainfrom
bradyyie:perf/detile-wide-runs

Conversation

@bradyyie

@bradyyie bradyyie commented Nov 24, 2026 •

Copy link
Copy Markdown

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

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 Tiling: detile_level copies contiguous runs (16 B in swizzled modes) in one go #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 Tiling: detile_level copies contiguous runs (16 B in swizzled modes) in one go #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.

suppai-ringo and others added 2 commits November 24, 2026 06:44
…in one go

RGBA8 2048x2048 on the console pipe config: 22 ms -> 10 ms; BC 8/16 B ~10%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bradyyie
bradyyie marked this pull request as ready for review November 24, 2026 20:09
@futurepro62

futurepro62 commented Nov 24, 2026 •

Copy link
Copy Markdown

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 (Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #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.

@DavidM1911

Copy link
Copy Markdown
Contributor

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!

@JJAutoCompare

Copy link
Copy Markdown

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.

@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants