vulkan: classify command batches in one pass #1264

Closed
leonida/mandy
Kadamitas wants to merge 0 commits from perf/classify-queue-batch-once into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

Kadamitas commented 2026-11-24 21:03:05 +00:00

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.
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

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

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

#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

#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

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.

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.
Sign in to join this conversation.
No description provided.