From 1f7f77e4cccabf543f5d2d8e5c545c96ab1de43a Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 22 Nov 2026 14:20:45 -0800 Subject: [PATCH] Runtime README: the pieces' cost in instructions and the Iris Xe's cross-queue wait, as known gaps What: two known gaps under Queues. The first records what the pieces cost on the compute harness: the encoding thread's instructions a command buffer on an RTX 3090 (burst_2000 +1,239, 2.5%; burst_160 +1,609, 3.5%; burst_160_shared +1,633, 2.7%; frame_5cb +1,843, 2.8%; burst_2000x5 +4,566, 4.4%, about 830 for each compute encoder past the first; the one-command-buffer rows +952 to +1,166), the remainder counts on an RX 7900 XTX (+964 and +883, and 848 to 1,014 and 550 to 745 with parts of the path put back, 710 and 465 with all of them: spread over the path, nothing built), and the times, of which none moved 3% or more beyond its spread. The second records the Iris Xe's two_queues waiter: its GPU start 30.4 us after the signaller's end at the median, against 9.0 us with no pieces (where the waiter waits is not placed), and the late frames the pieces bring in on that device (23.7 ms against 34.8 ms at the median, committed to completed). Why: the close rule is widened from the burst rows to every harness row: every row over 3%, burst or not, goes into the known gaps with its number; a row over 5% whose loss is a fixed amount a command buffer is recorded beside the Iris's +21 us line; a row over 5% whose loss grows with the work is a regression of the cut. In the randomized read no time row is over 3% and none over 5%, so no row goes beside the Iris line and none is a regression; the instruction rows over 3% (burst_160 3.5%, burst_2000x5 4.4%) are recorded. The form stays: no other form that keeps Metal's order was found to fix the Iris Xe's late frames, which the pieces do. The read: compute harness, RTX 3090, job m3-max-68794, exclusive, four rounds of the two builds in random order (A B, A B, B A, A B), every run at P0 but six samples at P8 at round 1's start: A is f979769faf (harness built in job m3-max-68792), B is fa77a9035b (job m3-max-68791). B against A, means of four runs, each arm's spread: bind_2000 +2.6% (1.2%, 2.5%), burst_160 +0.1%, burst_160_shared +0.2%, burst_2000 +0.1%, burst_2000x5 +0.2%, frame_5cb_from_idle +0.0%, all read pass; frame_5cb +0.4% (4.4%), waves +2.9% (5.6%), constant_private -3.3% (4.2%), sampling_distinct_512x512x16 -0.8% (3.5%), sampling_distinct_64x64x16 -19.5% (one A run at 77.0 us against 36.7-37.3), all read not resolved. The harness has no second size of bind_2000 or constant_private; sampling_distinct_64x64x16 is the second size of sampling_distinct_512x512x16. The Iris rows are jobs m3-max-68441, m3-max-68517, m3-max-68545 and m3-max-68608; the remainder, job m3-max-68607. waitshare's fix (53bf3a3f3c) is on development, not on queue-cut, so no part of it rides here. Verified: a README change alone; see the job named where it is handed over. --- crates/metal2vulkan-runtime/README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/crates/metal2vulkan-runtime/README.md b/crates/metal2vulkan-runtime/README.md index 80b70943f..a1bf60053 100644 --- a/crates/metal2vulkan-runtime/README.md +++ b/crates/metal2vulkan-runtime/README.md @@ -2207,6 +2207,33 @@ while the driver's exit handler waited on a lock, with every runtime thread alre an Intel UHD 630 under macOS 26.7.1 one of a queue at a lower priority number started about 0.4 ms after its commit, mid-way through a running 60 ms command buffer, whose own run did not change (job m3-max-68129). The runtime starts it at the next piece's boundary. +- The pieces cost host instructions on every command buffer, cut or not. Measured with the + compute harness on an RTX 3090 against the same runtime with no pieces (f979769faf), four runs + of each build in random order (job m3-max-68794), the thread that encodes and commits ran 1,239 + more instructions a command buffer in `burst_2000` (2.5%; all threads together ran 513 fewer), + 1,609 in `burst_160` (3.5%), 1,633 in `burst_160_shared` (2.7%), 1,843 in `frame_5cb` (2.8%) + and 4,566 in `burst_2000x5` (4.4%), whose command buffers open five compute encoders of one + dispatch each: about 830 more for each encoder past the first. The rows of one command buffer + a run (`waves`, `constant_private` and the two `sampling_distinct` rows) ran 952 to 1,166 more. + On an RX 7900 XTX (job m3-max-68607) the rise was 964 in `burst_2000` and 883 in `burst_160`; + with parts of the path put back to their form with no pieces (the step's scan for shared + resources, the room's ranking of what is ready, the scan as a group closes, the cut test where + an encoder opens, the rate kept for each segment as it retires), one or a few at a time, it was + 848 to 1,014 and 550 to 745, and with all of them 710 and 465: the cost is spread over the + path, in no one part of it. On the 3090 no row's time moved by 3% or more beyond its runs' + spread: `burst_160`, `burst_160_shared`, `burst_2000`, `burst_2000x5` and + `frame_5cb_from_idle` moved 0.2% or less, `bind_2000` 2.6% and `waves` 2.9%; the runs of + `frame_5cb`, `waves`, `constant_private` and the two `sampling_distinct` rows spread past 3% + within one build, so those rows decide nothing. +- On the Iris Xe (Mesa's ANV), in the harness row `two_queues`, a command buffer of a second + queue whose event wait the end of a command buffer of the first queue signals, committed right + after it, starts on the GPU 30.4 µs after the signaller's GPU end at the median, against 9.0 µs + with no pieces (jobs m3-max-68441, m3-max-68517, m3-max-68545 and m3-max-68608). Where the + waiter waits is not placed. In the same row, a command buffer of the second queue committed + every 16.667 ms beside the first queue's backlog of eight (three fills each, 22.5 ms on the GPU + at the median) completes 23.7 ms after its commit at the median, against 34.8 ms with no pieces + (jobs m3-max-68545 and m3-max-68608), and no other form that keeps Metal's order was found to + bring those late frames in. - On NVIDIA each submission pays the driver's latency per submission. The runtime submits each command buffer as soon as it can, so short command buffers committed back to back reach the GPU in several submissions: on an RTX 2080 (harness row `frame_5cb`: five short command buffers a