runtime/vulkan: unified per-frame perf pack (bindless 0-alloc, view/descriptor/format tables) #113

Closed
Andretuta wants to merge 4 commits from upstream-pr/113 into main
Andretuta commented 2026-11-24 02:20:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:20:45Z.


Carried over from old PR 9846 by TG0000 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9846, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
TG0000: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Consolidated per-frame Vulkan runtime performance pack replacing closed PRs #8021, #8042, #8159, and #8180 (all previously independently verified across multiple GPUs including RX 9070 XT, RX 7800 XT, RX 6800, RTX 5070 Ti, RTX 5070, RTX 3070 Ti, RTX 2080, and Intel UHD 770).

What this combines

  1. GFX10 descriptor format table indexing (was #8021): compile-time indexed lookup instead of linear scan (~20x faster: 111 -> 5 ns).
  2. Hashed attachment-view cache indexed by image (was #8042): 2x–4.5x faster lookup and up to 460x faster image destroy (0.67 ms -> 3.4 us).
  3. Hashed border-color table & address-keyed replaced views (was #8159): removes O(N) scans under descriptor_mutex (5x–62.5x border colors, 3.3x–22.1x replaced views).
  4. Flat per-binding pending-write arrays & memchr free-index scan in vulkan_bindless.h (was #8180): 0 heap allocations per frame (was 2,811), 4x faster (206 -> 48 us/frame).

Testing

  • Built on Windows 11 (Ryzen 9 5900X, AMD Radeon RX 6800 gfx1030, clang++/Ninja/CMake 4.5.1, -DLEONIDA_BUILD_WINDOWS_RUNTIME=OFF, RelWithDebInfo): 158/158 targets, 0 warnings.
  • All 7 touched Vulkan tests pass (gfx10_tiling, image_view_cache, descriptor_tables, bindless_sizing, bindless_queue, gfx10_descriptors, gfx10_format_bench_selftest); 73/74 full CTest pass (the only failure is vk_queue_query_sync, which fails identically on bare origin/main on RX 6800).
  • git diff --check and scripts/check_no_game_data.py clean. No game data used.

AI-assisted (Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5464856011 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/113). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:20:45Z. --- > Carried over from **old PR 9846** by `TG0000` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9846`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `TG0000`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Consolidated per-frame Vulkan runtime performance pack replacing closed PRs `#8021`, `#8042`, `#8159`, and `#8180` (all previously independently verified across multiple GPUs including RX 9070 XT, RX 7800 XT, RX 6800, RTX 5070 Ti, RTX 5070, RTX 3070 Ti, RTX 2080, and Intel UHD 770). ### What this combines 1. **GFX10 descriptor format table indexing** (was `#8021`): compile-time indexed lookup instead of linear scan (~20x faster: `111 -> 5 ns`). 2. **Hashed attachment-view cache indexed by image** (was `#8042`): `2x–4.5x` faster lookup and up to `460x` faster image destroy (`0.67 ms -> 3.4 us`). 3. **Hashed border-color table & address-keyed replaced views** (was `#8159`): removes O(N) scans under `descriptor_mutex` (`5x–62.5x` border colors, `3.3x–22.1x` replaced views). 4. **Flat per-binding pending-write arrays & `memchr` free-index scan in `vulkan_bindless.h`** (was `#8180`): `0` heap allocations per frame (was 2,811), `4x` faster (`206 -> 48 us/frame`). ### Testing - Built on Windows 11 (Ryzen 9 5900X, AMD Radeon RX 6800 gfx1030, clang++/Ninja/CMake 4.5.1, `-DLEONIDA_BUILD_WINDOWS_RUNTIME=OFF`, RelWithDebInfo): 158/158 targets, **0 warnings**. - All 7 touched Vulkan tests pass (`gfx10_tiling`, `image_view_cache`, `descriptor_tables`, `bindless_sizing`, `bindless_queue`, `gfx10_descriptors`, `gfx10_format_bench_selftest`); 73/74 full CTest pass (the only failure is `vk_queue_query_sync`, which fails identically on bare `origin/main` on RX 6800). - `git diff --check` and `scripts/check_no_game_data.py` clean. No game data used. AI-assisted (Claude Opus 5.5).
MoonEyes commented 2026-11-30 18:51:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T18:51:39Z.


Not merge-ready: this carried-over patch spans 12 runtime/test files (about 1,850 additions), is still a draft, conflicts with main, has no valid CI results, and has no current claim in coordination issue #2570. Given the stale conflicting base and breadth, a substantive review needs to be performed against an updated diff; I am not calling it obsolete without that evidence. Please claim the work, rebase/refresh it against current main, and rerun required CI before requesting merge. No merge until all criteria are satisfied.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7288474687 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/113#issuecomment-7288474687). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T18:51:39Z. --- Not merge-ready: this carried-over patch spans 12 runtime/test files (about 1,850 additions), is still a draft, conflicts with main, has no valid CI results, and has no current claim in coordination issue #2570. Given the stale conflicting base and breadth, a substantive review needs to be performed against an updated diff; I am not calling it obsolete without that evidence. Please claim the work, rebase/refresh it against current main, and rerun required CI before requesting merge. No merge until all criteria are satisfied.
aslan2142 commented 2026-12-01 11:15:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:15:25Z.

Review: COMMENTED


This carried-over 12-file Vulkan perf pack remains a draft, has merge conflicts with main, and has cancelled CI runs with no current owner or claim. Because it bundles several independent subsystems (vulkan_bindless.h, descriptor_tables.h, gfx10_descriptors.h, image_view_cache.h, d3d12_vulkan_device.cpp), re-introducing the still-relevant pieces as smaller, rebased, CI-verified PRs against current main (or rebasing and marking ready if an owner picks it up) is recommended.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130128204 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/113#pullrequestreview-6130128204). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:15:25Z. **Review:** COMMENTED --- This carried-over 12-file Vulkan perf pack remains a draft, has merge conflicts with `main`, and has cancelled CI runs with no current owner or claim. Because it bundles several independent subsystems (`vulkan_bindless.h`, `descriptor_tables.h`, `gfx10_descriptors.h`, `image_view_cache.h`, `d3d12_vulkan_device.cpp`), re-introducing the still-relevant pieces as smaller, rebased, CI-verified PRs against current `main` (or rebasing and marking ready if an owner picks it up) is recommended. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 12:08:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:08:39Z.


Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.

(AI-assisted triage.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7310713876 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/113#issuecomment-7310713876). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T12:08:39Z. --- Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. *(AI-assisted triage.)*
aslan2142 commented 2026-12-01 16:21:49 +00:00 (Migrated from github.com)

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


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:7317479137 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/113#issuecomment-7317479137). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:21:49Z. --- 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!113
No description provided.