Textures: cache GFX10 tiling Layout offset tables #1048
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1048
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1048/head"
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?
@AlpPesen on GitHub · 2026-11-24 10:52 UTC · original
AlpPesen:perf/cache-tiling-layout→main· +83 −23 · 1 files · 1 commits · merged 2026-11-25 10:49 UTCPart of #449 (item 2: cache
gpu::tiling::Layout::from_bitsoffset tables).Layout::newandLayout::new_3dpreviously recomputed the GF(2) bit-offset tables and allocated sixVec<u32>s on every call (CreatePlacedResourceXconstructsxg::Texture::newtwice per texture). Because the tables depend only on(is_3d, mode, elem_log2, pipe_cfg)and onlybase_xorvaries per texture, this caches the immutable tables as&'static [u32]in a boundedRwLock<HashMap<...>>and makesLayoutCopy.Overlap note: touches only
crates/xcl/src/gpu/tiling.rslines9-155and adds one unit test at the end oftiling.rs— disjoint from #901 (detile/image_layoutfrom line 178 onward).What is in it
crates/xcl/src/gpu/tiling.rs:HashonPipeConfigandCopyonLayout, changing private offset tables (ox/oy/oz/hx/hy/hz) fromVec<u32>to&'static [u32].LAYOUT_CACHE(OnceLock<RwLock<HashMap<(bool, u32, u32, PipeConfig), Layout>>>) incached_layout, canonicalizingPipeConfigfor non-XOR modes (!is_xor(mode)) and caching only valid combinations (invalid calls returnNonewithout inserting or allocating).layout_cache_shares_tables_and_isolates_base_xorverifying pointer sharing,base_xorisolation across callers, non-XORPipeConfigsharing, 2D vs 3D thick separation, and non-caching of invalid keys.Measured speedup (
--release, Intel Core i9-9900K, 4,000 calls, mode 25 / BC7)Vec<u32>heap allocations/drops):3.15 us/call(12,594 usfor 4,000 calls)Layout::new(25, 4, cfg):0.048 us/call(193 usfor 4,000 calls) — 65.3x faster, 0 per-call heap allocations.Tested
26300), Intel Core i9-9900K, AMD Radeon RX 6800 (16337 MiB VRAM, driver32.0.21045.29003),rustc 1.100.0(x86_64-pc-windows-msvc), DXC1.9.2602.17(debugfor tests,releasefor benchmark & smoke runs).cargo test -p xcl --lib gpu::tiling::: 15 passed, 0 failed.XCL_REQUIRE_GPU=wave64,mesh+cargo test --workspace --no-fail-fast -- --test-threads=4ond9fcdce: 725 passed, 3 failed, 41 ignored, 0 GPU skipped (xcllib: 683 passed / 3 failed / 21 ignored; integration/e2e: 42 passed / 0 failed / 20 ignored;XCL_SAMPLE_*unset).placed_title_textures_share_vram_and_preserve_pixels(3D 64x64x64 4 mips: subresource 2 mismatch, fixed by open PR #470) plus its 2VRAM_TEST_LOCKPoisonErrorcascades.Regression run
Both runs below on
YouKnowWho(60 s, release):main(09940bb87fa1):PR head (
d9fcdce14bb3):Not tested
XCL_SAMPLE_*unset).AI use
@DavidM1911 on GitHub · 2026-11-24 11:13 UTC · original
Independent verification, merged onto current
main384f7f7locally (clean merge).Machine: Windows 11, Ryzen 9 7900X Radeon iGPU (gfx1036 RDNA2) + RTX 3060 Ti; Rust stable MSVC, debug.
cargo test -p xcl --lib tiling: 15 passed, 0 failed — includes the newlayout_cache_shares_tables_and_isolates_base_xor.XCL_ADAPTER=radeon cargo test -p xcl --lib texture -- --test-threads=4: 29 passed, 0 failed — real placed-resource/title-texture paths on the Radeon exercise the cachedLayouttables.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@raylitebull on GitHub · 2026-11-25 01:08 UTC · original
Diff audit passed (
tiling.rsLAYOUT_CACHEsharing&'static [u32]tables across non-XORPipeConfigkeys while preserving per-texturebase_xor+Build and test+PR descriptiongreen), with strong AMD RX 6800 + RDNA2 iGPU results.Remaining before merge: one quick NVIDIA run on
d9fcdce(or merged ontomain) confirminggpu::tiling::+gpu::texture::/ workspace suite pass there too.@AmateurWizrd on GitHub · 2026-11-25 03:07 UTC · original
NVIDIA run on
d9fcdce(the PR head as it is):gpu::tiling::15 passed andgpu::texture::12 passed, 0 failed; thexclcrate's test binaries 727 passed, 1 failed (an access-rights failure of the test account, not this PR), 41 ignored. This is the run asked for in #1048.Tested
d9fcdce14bb3a2c3a98692fbfe512cf3ab55e8ae, clean checkout,cargo test --workspace --locked --offline --no-run, then each test binary of thexclcrate run with--test-threads=4gpu::tiling::: 15 passed, 0 failed, 0 ignored, includinglayout_cache_shares_tables_and_isolates_base_xorgpu::texture::: 12 passed, 0 failed, 0 ignoredxclcrate test binaries: 727 passed, 1 failed, 41 ignored. SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64)test_title_runs_and_game_folder_is_untouchedpanics ate2e.rs:46with "Access is denied", because the tests ran under a local account that may not write to that folder. It fails the same way on other commits here.Not tested
main; the other workspace crates; a retail-title smoke pair (not asked for; the PR's base is older than currentmain)AI use: omp. Claude Fable 5.2 ran the tests and wrote this report; Claude Opus 5.5 reviewed the diff before the build.
@thehollowedone on GitHub · 2026-11-25 08:54 UTC · original
Independent full workspace run on d9fcdce, clean detached checkout. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, Windows SDK 10.0.26100.0 / DXC 1.8.2502.11.
cargo build --workspace --offline --locked -j 4passed.cargo test --workspace --offline --locked --no-fail-fast -j 4 -- --nocapture --test-threads=4finished with 728 passed, 0 failed, 41 ignored. Cargo's pass count includes two runtime skips for unavailable native wave64.layout_cache_shares_tables_and_isolates_base_xorandtest_title_runs_and_game_folder_is_untouchedboth passed.This run used the workspace fixtures. Retail smoke and performance were outside its scope. AI use: Codex (GPT-6, exact variant unspecified) ran the suite and drafted this report.