Skip to content

vulkan: classify command batches in one pass - #1264

Open
Kadamitas wants to merge 1 commit into
ProjectLeonida:mainfrom
Kadamitas:perf/classify-queue-batch-once
Open

Kadamitas wants to merge 1 commit into
ProjectLeonida:mainfrom
Kadamitas:perf/classify-queue-batch-once

Conversation

@Kadamitas

@Kadamitas Kadamitas commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 25, 2026
@PierreEbele

Copy link
Copy Markdown
Contributor

Reviewed e13477c: 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 0b45fdc: 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

clquwu added a commit to clquwu/leonida-ultimate that referenced this pull request Nov 25, 2026
…, bounded KHR pools & single-pass batch classification

Ports five GPL-3.0 upstream PRs from ubiquitarianism/leonida cleanly onto ultimate:

- ubiquitarianism/leonida#1901 (IlyassRS3): zero-alloc stack run buffer (kStackRuns=128), hoisted power-of-two shifts/masks, compile-time fixed-width dispatch with tail peeling, and contiguous linear slice fast path in runtime/src/console_texture_layout.h + console_texture_layout_test.
- ubiquitarianism/leonida#146 (ChalanaGimhanaX / old-pr/9879): strip-mined 64B/256B cache-line micro-tile detiling/tiling with compile-time layout proof in runtime/src/resource_detile.h + exhaustive scalar-oracle coverage in resource_detile_test.
- ubiquitarianism/leonida#1874 (IlyassRS3): BAR-aware device/host memory ordering, VUID-01713 heap-size filtering, OOM retry fallback, and zero-extent guard in PresentComposer, OcclusionResolve, and VulkanQueue::acquire_stage; plus pre-prepare reclamation (recycle_completed_khr_pools), best-fit reuse, and bounded <=8 caps on khr_stage_pool_ and khr_as_query_pool_ + vk_memory_fallback_and_pools_test.
- ubiquitarianism/leonida#1879 (IlyassRS3): BAR-aware memory selection, heap-size filtering, multi-type OOM retry fallback, and failed-handle cleanup in BindlessSet (preserving VK_ERROR_DEVICE_LOST fast-fail for #1092) + vk_bindless_memory_fallback_test.
- ubiquitarianism/leonida#1264 (Kadamitas): single-pass command batch classification (non-direct clear rejection, predication capture count, and runs_shaders) in VulkanQueue::execute_now.
@Kadamitas
Kadamitas force-pushed the perf/classify-queue-batch-once branch from e13477c to 73d939f Compare November 27, 2026 18:56
@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants