vulkan: classify command batches in one pass #1264

Closed
Kadamitas wants to merge 1 commit from upstream-pr/1264 into main
Kadamitas commented 2026-11-24 21:03:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kadamitas on 2026-11-24T21:03:05Z.


Claimed in the coordination issue as: queue command classification

What and why

Calculate the shader-use flag, predication capture count and queue-specific clear rejection during the existing pre-lock scan. Classification remains linear and avoids later command traversals inside the queue setup.

Tested

  • On the Nov 27 rebase, the Windows vk_queue and replay_query_edges tests both passed.
  • Before rebasing, all 1,581 CPU behavior comparisons matched the existing classifiers.
  • The native Vulkan queue test passed on SwiftShader on Windows 11 x64.
  • In the original synthetic comparison for 4,096 commands, median classification time was 3.31 to 3.08 microseconds on the direct-queue path and 4.87 to 3.76 microseconds on the compute-queue path.

GPUs tested: SwiftShader software Vulkan on Windows 11 x64.

AI-assisted: yes

  • One topic with synthetic inputs and no game data.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5480287193 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1264). Originally posted by [Kadamitas](https://github.com/Kadamitas) on 2026-11-24T21:03:05Z. --- Claimed in the coordination issue as: [queue command classification](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144407846) ### What and why Calculate the shader-use flag, predication capture count and queue-specific clear rejection during the existing pre-lock scan. Classification remains linear and avoids later command traversals inside the queue setup. ### Tested - On the Nov 27 rebase, the Windows `vk_queue` and `replay_query_edges` tests both passed. - Before rebasing, all 1,581 CPU behavior comparisons matched the existing classifiers. - The native Vulkan queue test passed on SwiftShader on Windows 11 x64. - In the original synthetic comparison for 4,096 commands, median classification time was 3.31 to 3.08 microseconds on the direct-queue path and 4.87 to 3.76 microseconds on the compute-queue path. GPUs tested: SwiftShader software Vulkan on Windows 11 x64. AI-assisted: yes - [x] One topic with synthetic inputs and no game data.
PierreEbele commented 2026-11-25 14:41:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T14:41:44Z.


Reviewed e13477cb4: read the change (three command-list scans folded into one in execute_now — clear refusal,
predication captures, runs_shaders) — a semantics-preserving code motion. Verified by building and running the 14
CPU-side replay/queue tests that drive execute_now (replay_query_edges, clear gate, predication, zero-init,
cpu-bench self-test) on the branch and on its merge base 0b45fdc21: identical, all passing on both (GPU queue tests
skipped, no device). The branch conflicts with current main (merge-tree: one region at the head of execute_now);
main's execute_now has since gained execute_call, before_execute_/input_probe_ and queue_unsupported —
please redo the fold on top of that.
AI-assisted review.

Recommendation: Fix first

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7165671576 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1264#issuecomment-7165671576). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T14:41:44Z. --- Reviewed e13477cb4: read the change (three command-list scans folded into one in `execute_now` — clear refusal, predication captures, runs_shaders) — a semantics-preserving code motion. Verified by building and running the 14 CPU-side replay/queue tests that drive `execute_now` (replay_query_edges, clear gate, predication, zero-init, cpu-bench self-test) on the branch and on its merge base 0b45fdc21: identical, all passing on both (GPU queue tests skipped, no device). The branch conflicts with current main (merge-tree: one region at the head of `execute_now`); main's `execute_now` has since gained `execute_call`, `before_execute_`/`input_probe_` and `queue_unsupported` — please redo the fold on top of that. AI-assisted review. **Recommendation:** Fix first
zmasi commented 2026-11-28 22:32:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:32:29Z.


#1264 | head 73d939f4ef (merged cleanly with main c7753ed98a; resolves the earlier conflict on e13477cb4 over execute_call / input_probe_ / queue_unsupported) | ctest --test-dir runtime/build -C RelWithDebInfo -R "^(vk_queue|vk_predicate_capture|vk_predicated_copy|vk_bc_zero_init|replay_query_edges|replay_clear_gate|replay_query_predication|d3d12_clear|d3d12_compute)$" --output-on-failure (LEONIDA_VK_VALIDATION=1) | baseline on main: 9/9 hardware GPU and CPU replay CTests pass on RTX 3090 (families: direct 0 (GCT), compute 2 (CT), copy 1 (T), non-direct clear rejection, 192 predicate snapshots, BC lazy zero-init, clear/compute submissions) | green on PR+main: all 9/9 CTests match baseline identically on physical RTX 3090 hardware with 0 Khronos validation errors; 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:7246807800 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1264#issuecomment-7246807800). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T22:32:29Z. --- #1264 | head 73d939f4ef55ef0efffd1d06974c277bdfa55d83 (merged cleanly with main c7753ed98a56677f10e34078b37eab0540e190ec; resolves the earlier conflict on `e13477cb4` over `execute_call` / `input_probe_` / `queue_unsupported`) | `ctest --test-dir runtime/build -C RelWithDebInfo -R "^(vk_queue|vk_predicate_capture|vk_predicated_copy|vk_bc_zero_init|replay_query_edges|replay_clear_gate|replay_query_predication|d3d12_clear|d3d12_compute)$" --output-on-failure` (`LEONIDA_VK_VALIDATION=1`) | baseline on main: `9/9` hardware GPU and CPU replay CTests pass on RTX 3090 (`families: direct 0 (GCT), compute 2 (CT), copy 1 (T)`, non-direct clear rejection, `192` predicate snapshots, BC lazy zero-init, clear/compute submissions) | green on PR+main: all `9/9` CTests match baseline identically on physical RTX 3090 hardware with `0` Khronos validation errors; `check_no_game_data.py` `0` violations | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yes
aslan2142 commented 2026-12-01 16:34:31 +00:00 (Migrated from github.com)

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


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