Files
metal2vulkan/docs
Anees Iqbal 7a6818deda Take NVIDIA's stall in every 1024th signalling submit while idle
dev-perf measured on an RTX 5080 Laptop GPU (NVIDIA 615.71.09, Linux)
that one vkQueueSubmit in every 1024 that signals a fence or semaphore
on a VkQueue spends 2.2-3.7 ms in the driver, counted per queue, and
the batch it lands on, with everything committed behind it, waits that
long. Every batch signals, so the stall can only be moved.
device/submit_stalls.rs keeps each queue's place in the driver's period
under the queue's lock (Period): every signalling call the runtime times
is counted (batches via submit_logged, the device's own submission via
use_queue(Uses::OneSignalling), the plan's empty ones); a use it cannot
count (the program's, sparse binds, wait-idle, relay marks) or a due
stall that did not come forgets it. Once the scheduler's thread has had
nothing to submit for 1 ms and a queue's next stall is due within its
next burst plus 32 calls (at most 128), it submits the calls left as
empty submissions signalling a timeline semaphore of the queue's own,
outside its lock, stopping where a commit or waker came. WorkCounts
gains idle_submits, submit_stalls_idle, submit_stalls_on_work,
submits_behind_idle_stalls, wait_behind_idle_stall_longest_nanos;
host_ab prints them. FAST-PATHS records the stall among device gaps.

Ports dev-perf 76bf5a3189, 28c42746a5, b76d910450, 1ef8316ecf,
9d2f46431e. Adapted: keyed as development keys driver facts, a cost
fact DriverFact::SignallingSubmitsStallEvery1024 on NVIDIA's driver on
the RTX 5080 Laptop GPU (0x2c19, the GPU measured) at every release
(dev-perf's release-keyed DriverTrait table, fd2ddc8faa, not ported);
the scheduler's short idle sleep bounds WAIT_SLICE (development has no
head bound).

Public API: DriverFact::SignallingSubmitsStallEvery1024 (translator and
runtime re-export), five WorkCounts fields. RUNTIME_VERSION 1687.
Runtime-sources pin recomputed.

Tests: tests::submit_stalls (planner vs a model driver),
device::tests::driver_facts (the fact's GPU scope, the 5080 profile's
facts), device test tests::submit_stalls_idle (new: on a driver with the
fact, at least one stall taken idle over 5000 command buffers; elsewhere
no empty submission).

Verified on an M3 Max (MoltenVK 1.4.2): touched-module tests 268
passed; api_signatures/api_surface 15 passed; the planner tests fail
with due_idle forced to 0 (4 of 9) and pass restored; device tests 45
passed, the idle-stall test printing idle_submits 0 on MoltenVK; with
the gating forced on, a run made 106 empty submissions without driver
errors and the test failed as it should. Clippy plain and
--cfg m2v_gpu, rustdoc -D warnings clean. The stall path itself needs
the RTX 5080: see the round's 5080 run.
2026-10-28 23:05:15 +02:00
..