OLD-9879: resource_detile: strip-mined cache-line micro-tile copies (PERF-RESOURCE-DETILE) #1650

Closed
Tortoche wants to merge 1 commit from upstream-pr/1650 into main
Tortoche commented 2026-11-25 07:04:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tortoche on 2026-11-25T07:04:49Z.


Claim: #1570 (OLD-9879 / Draft #146, originally authored by ChAlanA)

Summary:

  • Optimizes with strip-mined cache-line micro-tile copies (bit-identical, faster detiling).
  • Adds validation & round-trip checks in .

Verification (Linux):

  • -> OK
  • [100%] Built target resource_detile_test -> OK
  • resource detile: all 64 KiB GFX10 swizzle round-trip and validation checks passed ->

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5486798500 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1650). Originally posted by [Tortoche](https://github.com/Tortoche) on 2026-11-25T07:04:49Z. --- Claim: #1570 (OLD-9879 / Draft #146, originally authored by ChAlanA) Summary: - Optimizes with strip-mined cache-line micro-tile copies (bit-identical, faster detiling). - Adds validation & round-trip checks in . Verification (Linux): - -> OK - [100%] Built target resource_detile_test -> OK - resource detile: all 64 KiB GFX10 swizzle round-trip and validation checks passed -> AI-assisted: yes
whoalin1 commented 2026-11-25 09:52:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T09:52:55Z.


Independent verification (native Windows): per-BPE verify_microtile_layout_64k proofs are static_asserts — clean build proves the memcpy tables match the LUT; edge tails reviewed (right-edge scalar tail, bottom-edge run/scalar tail; tile_cols always multiple of micro_w, strips cannot straddle tile bands — no overrun). resource_detile_test.exe passes claimed output; exhaustive new scalar-reference test covers all BPEs × edge remainders × block_dim; d3d12_vulkan_device.cpp (sole includer) rebuilds clean. CPU-only path — bit-identical output is the verifiable part; perf claim not re-measured. Authorship preserved (ChAlanA). AI-assisted verification.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7158926460 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1650#issuecomment-7158926460). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-25T09:52:55Z. --- Independent verification (native Windows): per-BPE `verify_microtile_layout_64k` proofs are `static_assert`s — clean build proves the memcpy tables match the LUT; edge tails reviewed (right-edge scalar tail, bottom-edge run/scalar tail; `tile_cols` always multiple of `micro_w`, strips cannot straddle tile bands — no overrun). `resource_detile_test.exe` passes claimed output; exhaustive new scalar-reference test covers all BPEs × edge remainders × block_dim; `d3d12_vulkan_device.cpp` (sole includer) rebuilds clean. CPU-only path — bit-identical output is the verifiable part; perf claim not re-measured. Authorship preserved (ChAlanA). AI-assisted verification.
zmasi commented 2026-11-28 21:42:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T21:42:20Z.


#1650 | head be109a051b (merged cleanly with main aa918e5d9f) | ctest --test-dir runtime/build -C RelWithDebInfo -R "^(resource_detile|d3d12_mapped_plane_async)$" --output-on-failure (LEONIDA_VK_VALIDATION=1) + tile_surface_64k+detile_surface_64k A/B sweep (1/4/8/16 BPE) | baseline on main: 147.86 ms (80x 1024x1024 1 BPE), 145.07 ms (40x 1024x1024 4 BPE), 39.02 ms (80x 2048x2048 BC1/8 BPE), and 31.24 ms (40x 2048x2048 BC7/16 BPE) on MSVC RelWithDebInfo | green on PR+main: 2/2 CTests pass (resource_detile bit-exact scalar-reference checks across all BPEs and edge remainders + d3d12_mapped_plane_async on RTX 3090 with 0 Khronos validation errors), cutting round-trip times to 7.23 ms (20.45x faster), 11.90 ms (12.19x faster), 8.75 ms (4.46x faster), and 8.63 ms (3.62x faster); check_no_game_data.py 0 violations | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246211197 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1650#issuecomment-7246211197). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T21:42:20Z. --- #1650 | head be109a051b9421544f3e4b9adddc796a9255ff45 (merged cleanly with main aa918e5d9f9e2f03e078d8f08854324890b5e176) | `ctest --test-dir runtime/build -C RelWithDebInfo -R "^(resource_detile|d3d12_mapped_plane_async)$" --output-on-failure` (`LEONIDA_VK_VALIDATION=1`) + `tile_surface_64k`+`detile_surface_64k` A/B sweep (`1/4/8/16` BPE) | baseline on main: `147.86 ms` (80x `1024x1024` 1 BPE), `145.07 ms` (40x `1024x1024` 4 BPE), `39.02 ms` (80x `2048x2048` BC1/8 BPE), and `31.24 ms` (40x `2048x2048` BC7/16 BPE) on MSVC `RelWithDebInfo` | green on PR+main: 2/2 CTests pass (`resource_detile` bit-exact scalar-reference checks across all BPEs and edge remainders + `d3d12_mapped_plane_async` on RTX 3090 with `0` Khronos validation errors), cutting round-trip times to `7.23 ms` (**20.45x faster**), `11.90 ms` (**12.19x faster**), `8.75 ms` (**4.46x faster**), and `8.63 ms` (**3.62x faster**); `check_no_game_data.py` `0` violations | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yes
OreoFR commented 2026-11-28 21:52:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:52:48Z.


Verified by OreoFR

  • Base: main c1ecf04ed + PR head be109a051; green run in a merge package of 15 PRs, no new ctest failure vs main
  • Test: ctest -R ^resource_detile$
  • Red on main: OK
  • Green with the PR: OK
  • Verdict: NO RED (bit-identical optimisation; the added tests also pass on main)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246339548 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1650#issuecomment-7246339548). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:52:48Z. --- **Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `be109a051`; green run in a merge package of 15 PRs, no new ctest failure vs main - Test: `ctest -R ^resource_detile$` - Red on main: OK - Green with the PR: OK - Verdict: NO RED (bit-identical optimisation; the added tests also pass on main) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 commented 2026-12-01 16:36:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:36:56Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317899322 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1650#issuecomment-7317899322). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:36:56Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1650
No description provided.