D3D12.X: process 2D texture tiling in contiguous block runs #2810
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2820"
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?
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T14:29:09Z.
Part of #1833. This is T1 from the extraction plan in #2787. It takes
b81ac2ebfrom #2778 (bmjask), unchanged. That commit adapts raylitebull's032c661ablock-slab algorithm.CPU texture tiling and detiling in
gpu/tiling.rswent through swizzled 2D textures one element at a time and worked out each element's block position again. For each GFX10 layout, this caches the longest horizontal run that is provably contiguous, works on one 4 KiB / 64 KiB block at a time, and copies whole runs in one go. It keeps the element-by-element bounds checks for a truncated source. Low base-swizzle bits make the runs shorter. Thick 3D single-slice helpers keep their existing path. The persistent detile workers (6dd9d53f) are not included.What is in it
D3D12.X: process 2D texture tiling in contiguous block runs(crates/xcl/src/gpu/tiling.rs), cherry-picked with-xfromb81ac2eb. Its two new tests compare tiled and detiled output with the element-by-element path, including base XOR.Tested
cargo test --workspace -- --test-threads=4on065f31bb: 1437 passed, 0 failed, 47 ignoredSKIPPEDon this adapter: 24 recompiler GPU tests withno wave64(or the wave32 per-lane form refused), andheap_window_out_of_memory_falls_back_to_the_switch_formwithno heap windowsmainb49be183(RTX 4060 Laptop, i5-14500HX, release) in #2787. Output checksums were identical in all 8 cases. 1920×1080 R8 mode 5 detile went from 18.75 to 0.59 ms. 2048×2048 RGBA8 mode 10 detile went from 40.14 to 5.48 ms. 2048×2048 BC7 detile went from 2.84 to 1.11 ms. I did not repeat that benchmark.Regression run
main:This PR:
Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-26T15:32:30Z.
Ran the texture-tiling tests at
065f31b:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
All 17 pass, including the two new parity tests (
tile_level_matches_element_by_element_and_exploits_contiguous_runs,low_base_xor_bits_bound_runs_without_changing_bytes). This is CPU-side tiling; the adapter is not involved in the comparison.What this adds: the author ran the suite on an RTX 2070 SUPER and the benchmark on an RTX 4060 Laptop (in a separate issue). This host verifies the cherry-pick on a Blackwell machine; I did not repeat the timing benchmark.
Not tested: the full workspace suite, a paired 60 s smoke run, the release timing numbers, AMD and Intel GPUs, native wave64, Wine, release profile, title data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-26T15:36:28Z.
Paired Wine release measurements on Ryzen 7 7700, plus RX 9070 upload/readback checks.
Tested
065f31bbcd08b891af2b144d045feecd4a04fcd7against mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.8293130ebe370b1+(local asserts-disabled build), DXC/DXIL 1.9.2602.17, Rust 1.97.1, releasex86_64-pc-windows-gnu.CPU conversion
Original
gpu::tiling::tests::module: head 17 passed, main 15 passed, with both--test-threads=1and4. No failures or ignored tests.The local timing fixture uses
Chain::detile_levelandChain::tile_level, level 0 / slice 0, withPipeConfig { pipes_log2: 0, pkrs_log2: 0 }. Detile includes its output allocation; tile writes into a preallocated destination. Reference bytes are generated outside the timer through per-element offsets. Output equality is checked outside each timed interval.Three fresh processes per revision, alternating main/head order, two warmups and five measured iterations per workload/process. Each cell below is median milliseconds [minimum, maximum] across 15 samples. Builds and the workflow's GPU checks finished before timing; no cargo/rustc processes were active at the start of that phase. CPU affinity and unrelated system activity were not controlled.
The 16-byte block case is opaque CPU block conversion, equivalent in dimensions to 2048x2048 BC7; it does not decode BC7. Linear and tiled byte hashes match between revisions for all five workloads. These are warmed CPU conversion measurements under Wine, with no inference about title loading or FPS.
RX 9070 correctness
The local fixture compares full tiled buffers with per-element
Layout::offsetreferences, detiles those references, uploads the resulting 8x8 R32_UINT textures and reads all 64 texels through a native wave64IMAGE_LOADkernel.0, 1, 2, 5, 6, 9, 10, 17, 18, 21, 22, 24, 25, 26, 27.0,4,12and half the layout's block size. Same zero-valued pipe/packer configuration as above.All 22 top-level process summaries, raw readbacks, timing samples, source inventories and executable hashes were independently checked. Build:
cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run. Run the Wine libtest binary withgpu::tiling::tests::, or either exact local selectorgpu::tiling::workflow_tiling_cpu_wine_measurement/gpu::recomp::tests::gpu_tiling_conversion_upload_reads_all_texels, using--nocapture --test-threads=1. GPU processes useXCL_REQUIRE_GPU=wave64, explicit RX 9070 selection andXCL_DIRECT_DXIL=0/1; inheritedXCL_*flags are cleared before the explicit settings andXCL_NETWORK=0.Not tested
Retail inputs,
scripts/smoke.ps1, the full suite, native Windows, other GPUs, GPU BC7 decoding, other pipe/packer configurations, GPU mip/array/thick-3D variants, cold-cache performance, world-load time or FPS. The offset reference is software parity, not a native console tiling oracle.AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, created the local synthetic fixtures, ran the paired checks, independently verified the evidence and drafted this report. Publication authorized by the account owner.
Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-26T15:41:51Z.
I measured warm CPU texture preparation on Windows 11 25H2 with a Ryzen 7 5700X. I used two optimized local builds with the same instrumentation and fixture. The only code difference between them was
tiling.rs, taken from the PR’s parent and head065f31bbrespectively.I timed the full preparation call for eight synthetic textures spanning 24 mip levels, with both 4 KiB and 64 KiB swizzles. Across six paired rounds with alternating run order, every run produced byte-identical output. Median wall times were:
Two independent repeat rounds also favored the PR at both worker counts. These timings cover warm CPU preparation only. GPU upload and title loading were outside the measurement.
I also checked truncated input directly on parent
b49be183and head065f31bb. Across 48 cutoff comparisons per revision, a four-byte texel with only three source bytes available decoded to zero. Including the fourth byte restored the exact source texel. Both revisions matched the scalar reference, including cuts inside a later physical block.I used Codex GPT-6.2 Sol for the fixtures and measurements, and a separate GPT-6.2 Sol agent for independent verification. Codex GPT-6.2 Astra wrote this comment.
I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T16:35:49Z.
Independent RTX 4060 (8 GB) / Intel i5-11400F / Windows 11 release verification of PR #2820 at
065f31bbcd08b891af2b144d045feecd4a04fcd7(parent & merge-baseorigin/mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Measurements and targeted test results only; not a full source review.Setup
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2609.5, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs)title: 29640639viascripts/smoke.ps1 -Seconds 60(XCL_NETWORK=0, default flags, no input)Targeted release unit tests (
065f31bb)cargo test --release -p xcl --lib tile_level_matches_element_by_element_and_exploits_contiguous_runs -- --nocapture: 1 passed, 0 failed, 0 ignored (0.29 s,0SKIPPED).cargo test --release -p xcl --lib low_base_xor_bits_bound_runs_without_changing_bytes -- --nocapture: 1 passed, 0 failed, 0 ignored (0.01 s,0SKIPPED).cargo test --release -p xcl --lib gpu::tiling::(3 consecutive parallel passes): 17 passed, 0 failed, 0 ignored on all 3 passes (1.02 s/1.00 s/1.01 s,0SKIPPED).Paired 60 s RTX 4060 smoke (
b49be183vs065f31bb)Both runs held steady 60/2 s pacing with
0device removals and0crashes (065f31bbxcl.log:6,176 MBpeak /6,116 MBend local VRAM,4,651 MBend non-local VRAM,19,339translated draws /1,024dispatches with0skipped,8,192title-texture upload-skip milestones reached cleanly).Base
origin/main(b49be183):PR #2820 head (
065f31bb):Limits of coverage
gpu::tiling::, release build, and paired 60 s retail smokes).AI use
Ran the targeted release unit tests, release build, and paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts, timings, memory figures, and smoke blocks were extracted directly from
cargo test,xcl.log, andscripts/smoke.ps1outputs.Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T16:47:53Z.
This change is already on
main:git cherryshows its commit is the same patch as95f12a04(from #2778's stack, merged with #2959 on 28 Nov), andgpu/tiling.rson this branch is identical tomain's. Nothing is left to merge here; the PR author will close it. #1512, #1738 and #901, which go after the same speed-up, now build on that code.— Claude Code (Claude Opus 5.5), on behalf of the PR author
Pull request closed