Files
metal2vulkan/docs
Anees Iqbal 9c1cd5500f Take NVIDIA's submit stall where the count puts it, under 2 ms too
The RTX 5080's device test tests::submit_stalls_idle failed since the
stall packet (7a6818deda): "idle_submits 168, stalls idle 2, on work 2;
bound 114 exceeded", and in other runs no stall was taken idle at all.

Root cause, timed on the RTX 5080 Laptop GPU (NVIDIA 615.71.09, Linux)
with temporary logging of every signalling call of 0.3 ms or more and of
each take: the driver stalled exactly every 1024 counted calls (the
test's calls 996, 2020, 3044, 4068, 5092, after the device's 28
uncounted priming calls), so the count was right; the planner's verdict
was not. It took every call of 2 ms (STALL_NANOS) or more for the stall
and every shorter one for none:
- 3 of 15 stalls took 1.97 to 1.99 ms. One the plan's empty submissions
  took where the count put it was judged a stall that did not come: the
  place forgotten, its empty submissions counted with no stall taken,
  and the next stall on work.
- The device's 62nd batch takes about 10 ms in the driver, a cost that is
  no periodic stall, and was taken for the stall. Where the real stall
  after it came under 2 ms, that false place stood, and the take due
  there found no stall (36 empty submissions spent).
The run that failed at b25f89d0af (168, 2, 2) is diagnostic run 2's
counts exactly: 36 empty submissions on the false place, 34 and 49 on
stalls taken, 49 on a 1.97 ms stall judged missing.

Fix (device/submit_stalls.rs, Period::called): STALL_NANOS 2 ms -> 1 ms,
half the shortest stall measured; and the queue's place is confirmed
once a stall comes where the count puts it (its 1024th call, or up to
MARGIN calls before). A long call elsewhere moves a place not yet
confirmed (a first batch's cost gives way to the next stall) and leaves
a confirmed one (another cost of the driver's: calls of 1.2 to 1.4 ms
came at the 162nd batch and later). The device test's bound is
unchanged: it holds once the plan's verdicts match the driver.
RUNTIME_VERSION 1694.

Docs: the module docs, STALL_NANOS, WorkCounts::submit_stalls_idle and
submit_stalls_on_work, and FAST-PATHS's row (2 to 4 ms, 1.97 to 4.06
measured).

Tests: tests::submit_stalls gains
long_calls_elsewhere_and_short_stalls_spend_no_empty_call (the 5080's
pattern in the model driver) and
a_long_call_away_from_a_confirmed_place_leaves_it; with the old planner
both fail (9/11), with the fix 11/11.

Verified: RTX 5080 Laptop GPU (615.71.09), device test under
--cfg m2v_gpu, NVIDIA ICD alone: development 3298b30510 failed 6 of 7
runs (idle_submits 36 to 143, 0 to 2 stalls taken idle); with the fix
9 of 9 passed (idle_submits 193, submit_stalls_idle 4,
submit_stalls_on_work 2 or 3: the first stall and the first batches'
long calls before it). Apple M3 Max (MoltenVK 1.4.2): tests::submit_stalls
11/11 and the device test pass (no fact, idle_submits 0). Clippy
--all-targets --all-features plain and --cfg m2v_gpu, and rustdoc
-D warnings, clean on Linux (msi).

One work packet, landed as 2 commits on archive/development-linear-2026-10-29: b2deee5402, then ec65322744 (the re-pin).
2026-10-29 15:43:52 +02:00
..