mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:05:54 +01:00
[PR #1965] perf(resource_detile): compile-time contiguous X micro-runs and macro-tile blocking for 64 KiB swizzle #1973
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1973
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1965
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:perf/rt-resource-detile-fast-runs📝 Commits (1)
d4628fcperf(resource_detile): macro-tile blocking and compile-time contiguous micro-runs for 64 KiB GFX10 swizzle📊 Changes
2 files changed (+170 additions, -41 deletions)
View changed files
📝
runtime/src/resource_detile.h(+109 -41)📝
runtime/test/resource_detile_test.cpp(+61 -0)📄 Description
Claim:
RT-RESOURCE-DETILE-FAST-RUNS(claim comment#7168674568on #1608).Optimization (
runtime/src/resource_detile.h)Previously
detile_typed<Bpe>andtile_typed<Bpe>copied a single element (1/2/4/8/16bytes) per iteration withx / tile_w,x % tile_w, andlut_xlookup on every element while walking row-major across alltiles_xmacro-tiles.SwizzleLut64K<Bpe>::lut_run_x):GFX10_SW_64K_D_RBPLUS_PATINFO, the lowest X coordinate bits form contiguous horizontal runs inside each 64 KiB tile (8×1B = 8B,8×2B = 16B,4×4B = 16B,2×8B = 16B,2×16B = 32B).lut_run_xandstatic_assert(runs_valid())proving for everyBpein{1, 2, 4, 8, 16}that every micro-run is contiguous, aligned torun_bytes, and bit-disjoint fromlut_y[y](sotile_row + lut_run_x[r]replaces|without per-element division/modulo).transfer_typed<Bpe, ToTiled>):run_bytes(8/16/32bytes) and handles any partial last macro-tile remainder with a single exact-length contiguous tailmemcpy(never writing past active bounds).Verification
CMakeLists.txtchanges).runtime/test/resource_detile_test.cppwithtest_oracle_exact<Bpe>()verifying bit-exact match against the scalar per-element LUT oracle and untouched0xA5padding bytes across every tail remainder (0..run_elems-1) and macro-tile boundary (tile_w-1,tile_w,tile_w+1, multi-tile, and BC1/BC7).resource_detile_testcleanly under:clang++ -std=c++20 -O1 -g -fsanitize=address,undefined -Wall -Wextra -Werrorclang++ -std=c++20 -O1 -g -fsanitize=thread -Wall -Wextra -Werrorclang++ -std=c++20 -O2 -Wall -Wextra -Werror-O2vsmain(best of 5 runs, Apple Silicon):python3 -I scripts/check_no_game_data.pyon both files andpython3 -I tests/test_text_write_line_endings.py: all passed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.