The first form held idle blocks while the host reclaimed and no submission stalled in any arm
(potluck 10374, gem10's 780M: slowest commit_and_submit 0.08-0.24 ms pressed, 7-12 M pages
scanned by direct reclaim, kswapd none). A consumer's capture named the holder of its long
submissions: the runtime's own block making, a 64 MiB GTT buffer object's creation in direct
compaction under the VM root's reservation. So each arm now makes memory beside the submissions
in both phases, and the pressed phase first fragments the host's memory as a desktop's is: half
of it in the page cache from a sparse file, and 6 GiB of anonymous memory with every other page
given back, MemAvailable staying high.
Arms: the runtime's Private buffers (its blocks made ahead), raw 64 MiB and 4 MiB allocations of
the system heap's type, 64 MiB exportable as dma-bufs, 64 MiB of the carve-out, blocks made
before the phases, and nothing made. Each prints the submissions' and the makings' spread and
the host's reclaim.
(cherry picked from commit 0def7f69b78e2f4308d0d931cd65306bcf1acf10)
run() counted a run's vkBeginCommandBuffer calls from the device-wide commands_recorded count,
plus a primary its encoder took begun ahead. That count also takes the primaries other threads
begin ahead in spare command pools as their command buffers complete with no thread waiting
(spares.rs), whenever the GPU's completions come: a begin there that fell while a run encoded
made its begin_command_buffer 1 more than a run's, the draws_after_buffer_changes_* and
draws_after_texture_and_sampler_changes_* flake under heavy load.
A run's begins are now WorkCounts::encoder_command_buffers_begun's change over it, which only
encoders count: their own primaries (begun, or taken begun ahead), segments, continuations and
draws' secondaries, and no other thread's begins.
a_primary_begun_ahead_while_a_run_encodes_is_no_begin_of_the_run_s makes the race certain: a
command buffer on another queue waits for an event the run's encoding signals, then the
encoding waits until that command buffer's pool's primary was begun ahead (primaries_begun_ahead
moved), and the run must still count 1 begin.
(cherry picked from commit 791933cf21191521fa9ad24dd8ba811356cd689d)
exitcrash's submit_stalls change (051de6ce39) reads CLOCK_THREAD_CPUTIME_ID around each timed
signalling call on a device whose driver has SignallingSubmitsStallEvery1024 alone, and counts a
call as the driver's stall only where its thread spent STALL_NANOS of CPU in it. Beside other
work, waits of 1.3-40.8 ms with little CPU had been taken as the stall and moved the scheduler's
place off the real stalls, so none came due at an idle. The runtime changed, so RUNTIME_VERSION
1962. With it: the FAST-PATHS known gap for NVIDIA's exit fault (31cef63d20, trimmed to the gap
and its bound by 6962de9cdc), and submit_stalls_idle running frames until a stall is taken idle
or six periods of calls pass (26c06a4bca).
Verified (exitcrash): RTX 5080 Laptop, NVIDIA 615.71.09, b5080 entry exitcrash-stallfix2 at
e50d699573: submit_stalls_idle 7/7 (4 alone, 3 beside the runtime device suite at -j 6, 409
passing meanwhile), each taking exactly 1 stall idle; clippy -D warnings on the runtime, plain
and --cfg m2v_gpu, clean (job 11384). Here: the API-signature check, REFUSALS.md and
CONFORMANCE-COVERAGE.md regenerate unchanged, cargo fmt clean.
The 5080 check of the stall fix (b5080 entry stallfix-233857) passed alone
once of twice. The probe entry stallprobe2-010023 (aed3f80c65, every
signalling call of 0.5 ms or more with its count) shows why: with the
scheduler merging ready batches, 200 frames made 1686 to 1882 signalling
calls; the 32nd and the 784th stalled (the period's count is forgotten across
the device's uncounted uses of the queue before then), so the first stall
due idle was the 1808th call, past the end of the run that failed (1686
calls: two stalls on work, none idle). The runs that reached it took it idle
(the 1808th, an empty call, 2.7 and 3.6 ms of thread CPU).
The test now runs frames, on a driver with the stall, until a stall was
taken idle or the device's calls to its queues passed six periods (at most
2000 frames), and asserts as before; a driver without the stall runs its 200
frames and makes no empty submission. The product is unchanged.
Verification: pending (b5080 c entry).
(cherry picked from commit e50d699573d7b1e7a206ecec8ea7ec0cd60e1d03)
A known gap states what is true now and one bound; the evidence stays here. A correction to
d35c43feaf's message: the exit hunt stopped on the orchestrator's call, not the owner's word.
The evidence behind the line (NVIDIA 615.71.09, RTX 5080 Laptop GPU, Linux):
- exitcap-162601 (probe 7f851ced8c): 1 of 94 runtime children, each making a device on libtest's
test thread and returning with it kept live, took SIGSEGV after their test passed. The faulting
thread was an NVIDIA worker (libnvidia-eglcore into libnvidia-glvkspirv+0x363b2, address 0x18)
named after the ended test thread, while the main thread ran libEGL_nvidia's exit handler (an
ioctl in libnvidia-glsi). The runtime's 30-odd threads were all waiting, none in a section of
the exit guard or a making. A consumer saw the same fault twice in a suite of about 1900 tests,
in a test that keeps its device in a static.
- nvexit, a Vulkan program without the runtime (an instance, the NVIDIA device, one compute
pipeline, a return from main), beside the same 14-minute load of the runtime's device suite:
1550 runs, 0 faults. 1028 destroyed everything first (507 + 262 on the main thread, 259 on a
thread joined before the return); 522 kept the device live (263 made on the main thread, 259 on
a joined thread, whose two driver workers named after it still ran at the return).
(cherry picked from commit be87171f9ecb74c3b695ceb9501cc4435144728f)
The exit hunt stops here, on the owner's word, with the cause not found. What is known:
- exitcap-162601 (probe 7f851ced8c): 1 of 94 runtime children took SIGSEGV after their test passed
with the device kept live. In the core the fault is in an NVIDIA worker (eglcore into
libnvidia-glvkspirv+0x363b2, address 0x18) named after the ended test thread, while the main
thread ran libEGL_nvidia's exit handler (an ioctl in glsi). The runtime's 30-odd threads were
all waiting, none in a section or a making.
- nvexit, a Vulkan program without the runtime (instance, NVIDIA device, one compute pipeline,
return from main), beside the same 14-minute load of the runtime's device suite:
- exitcrash-nvexit-201854: 507 with everything destroyed on the main thread, 0 faults;
- exitcrash-nvexit-203651: 262 destroyed and 263 kept live, on the main thread, 0 faults;
- exitcrash-nvexit-thread-230656: 259 destroyed and 259 kept live, made on a thread joined
before the return, whose driver workers (named after it) still ran at the return, 0 faults.
The line goes where a user of the runtime reads open gaps.
(cherry picked from commit 5c6971ade39abb0ec1a92ad1c2a8fe80e112951e)
The 5080's submit_stalls_idle test failed in round 064's rt2 beside the runtime's device suite
(idle_submits 0, submit_stalls_idle 0, submit_stalls_on_work 20) after passing alone. A probe of
the queue's place (STALLPROBE counts and events, probe branch steelbrain/exitcrash-stallprobe
1227ec7423, entry exitcrash-stallprobe-225855) reproduced it 3 of 3 beside the suite and passed
2 of 2 alone:
- The driver's stalls came every 1024 counted calls (calls 760 and 1784 in every run) and spent
1998 to 3880 us of the calling thread's CPU, within 0.5% of their length.
- Beside the suite, 25 to 29 other calls a run took 1.3 to 40.8 ms but spent 8 to 884 us of CPU:
waits. Each, taken as the stall while the place was unconfirmed, moved the place off the
stalls (the second stall came 354 to 551 calls after the last wait), so no stall was ever due
at an idle (idles_due 0) and every one fell on work.
- The submit checks' uncounted uses forgot the place 114 times a run, alone and beside the
suite, all within the device's first ~120 calls, before its first stall: not the cause.
So a call is the driver's stall only where its thread spent STALL_NANOS of CPU in it
(CLOCK_THREAD_CPUTIME_ID read before and after each timed signalling call, on a device whose
driver has DriverFact::SignallingSubmitsStallEvery1024 alone; elsewhere nothing more is read and a
call's length counts as before). The fact's own doc already names the cost as the submitting
thread's CPU.
Tests: calls_that_wait_long_beside_other_work_are_no_stall models the failing run (a wait of
1.5 ms every 250 to 410 calls, 15 in 5000): taken by length it gives the failure's counts
exactly (20 on work, 0 idle, 0 empty); by CPU, 1 on work and every later stall idle.
a_long_call_short_of_a_stall_is_none now also holds a 10 ms wait with under 1 ms of CPU to no
stall. The device test's doc states its calls on the 5080 (about two periods, its batches
merged), not five. FAST-PATHS' row says what a stall is.
(cherry picked from commit 5c8295ac235da7492861bc255e7d53874bfaaac7)
Orchestrator review of 1ced2a372b: the two-unit bound was not keyed and had no direction. The
780M's halves lie only below the filter (job m3-max-11026: 274 one below, 9 two below, none
above), so the device truncates its blit's filter of a half, and the lane should follow the
notice that says the level is the device's filter.
A half now lies within one unit in the last place above the filter, as before. Below it, it lies
within HALF_BELOW_ULPS (2) where the run announced device-filtered-mipmaps, else within one. Each
RGBA16Float level prints how many halves lie one and two below and one above, and the most each
way. The 8-bit formats keep their one-code bound both ways. The lane's docs state the measured
rule.
(cherry picked from commit fbfc2f492dc4d0711e7efd30a443286d5d329dba)
On the Radeon 780M under RADV (development 1c7a75be62, job m3-max-11026), the_device_s_blit_chain_
filters_each_level_and_is_announced fails at an RGBA16Float cube's level 1. Of its 384 halves, 274
lie one unit in the last place below the bilinear filter in float of the level above and 9 lie
two below (0x3381 against 0x3383, for one); none lies above. The device's blit filters with its
own precision, which Vulkan leaves to it. generate_mipmaps announces device-filtered-mipmaps for
that filter and states no bound against Metal (rule 1: the device's filter is the answer). The
lane's one-unit bound was its own check that each level is the device's filter of the level
above, not a contract.
The lane bounds a half at HALF_BLIT_ULPS, two units in the last place, with the measurement that
sets it, and prints each RGBA16Float level's count at one and two units and the most. The
8-bit formats keep their one-code bound.
(cherry picked from commit 1ced2a372b2affb27e6877bca8f59057e227ec61)
The three commits before this are exitcrash's default-off diagnostic for the Iris GPU hang. a1's i915 error state
showed a command buffer's dynamic state freed and reused while its request ran: the runtime reset a pending command
buffer, by a path the capture can't name.
When METAL2VULKAN_PENDING_AUDIT=1 (or DeviceOptions::pending_audit), every place that frees or reuses a command
buffer's state reads the GPU's own timeline (vkGetSemaphoreCounterValue) and logs a finding, with a backtrace for
the first 8, where a submission carrying the command buffer may still run. Those places:
- vkBeginCommandBuffer, in both device tables, which covers primaries begun ahead;
- vkResetCommandPool;
- give-back of a pool to the spares;
- a resubmission of a pending command buffer not begun SIMULTANEOUS_USE.
Secondaries are carried by their primary's submissions. With the audit off, each site only tests an Option.
RUNTIME_VERSION goes 1959 -> 1960 and the runtime-sources pin is recomputed:
595f7c8a861556537f5fa0ca1fbfa2d1d8c61432af1ef5de40363510edebe3bb.
Verified at 1e1cb70eb2 (on f129a02989) by exitcrash, lavapipe:
- 11314: plain and cpu-ICD clippy clean; env_registry and api_signatures 7/7; pending_audit units,
pending_audit_device and spares 16/16.
- 11309, negative control: with the give-back check deleted, the device test finds [0, 0, 0, 0]. With it, the
deliberate early give-back finds the 2 command buffers the held batch carried, with the backtrace.
- 11309, false-finding probe: 233 runtime device tests with the audit on, 73 devices, 0 findings.
Not run on Iris; reims' a1-shape boots are the first ANV run. The cherry-picks onto 26f4338e93 were clean; this
tree is not yet built.
The early give-back of a pool whose batch waits on the GPU finds every
command buffer of it that batch carries: on lavapipe, two (m3-max-11295).
The test counted one. It now asserts at least one give-back finding, none
of another kind, and one line for each.
Verification (m3-max-11295, lavapipe on msi, at 9ca953912d): cpu-ICD clippy
clean; tests::pending_audit (7), tests::spares, event_vk_signal and
draw_again's begun-ahead test pass; the device test failed only on the
count ([0, 0, 2, 0] against [0, 0, 1, 0]); the negative control (the
give-back check removed) found [0, 0, 0, 0] and failed.
(cherry picked from commit c43afb86223b19c752606f00fddacb1d686dc03b)
A GPU hang on Iris (ANV) left a compute dispatch reading an interface
descriptor that another pass's viewport state had overwritten: the hung
command buffer's dynamic state went back to ANV's pool (a reset or begin)
while its request still ran. The path that freed it is not known yet. This
adds a diagnostic that finds it where it happens, against the GPU's own
timelines rather than what the host saw of them.
What it checks, where it is on (DeviceOptions::pending_audit, or
METAL2VULKAN_PENDING_AUDIT set, read at device creation):
- every vkBeginCommandBuffer made through the device's functions (Vk's
begin_command_buffer, in both the full and the exit guard's tables), a
primary begun ahead in a spare pool among them;
- each vkResetCommandPool of a spare pool, and each pool given back to the
spares, for every command buffer the pool made;
- each submission of a command buffer submitted before and not begun for
simultaneous use (ANV rewrites a chainable primary's tail at each
submission).
What carries a command buffer: a batch's submission (direct or held in the
scheduler's group) to its queue's timeline value; the device's own and the
staging queue's submissions to their timelines; a secondary through each
primary that executes it (Vk's cmd_execute_commands notes it, a begin of
the primary forgets it). A failed submission is withdrawn. Each check reads
the carrying timelines with vkGetSemaphoreCounterValue; a value not reached
is a finding, logged (id name metal2vulkan-pending-audit, Info) with the
thread, command buffer, timeline, counter and value, and a backtrace for the
first 8. Off, each site tests an Option; on, it changes no work.
Tests: tests::pending_audit (the ledger: timelines, latest value per
timeline, one read per timeline per check, secondaries through primaries,
withdrawal, unreadable timelines, simultaneous use), and the device test
tests::pending_audit_device: a command buffer held on the GPU by a wait for
a reserved event signal has its pool given back early (a cfg(test) hook);
the audit finds it once and says it; after the host signal, the next command
buffer's pool reset, the primary begun ahead and its taking are checked and
nothing more is found. env_vars.rs registers the variable with its cost;
docs/API.md and api_signatures.tsv carry the option.
Verification: pending (potluck jobs on lavapipe and Iris).
(cherry picked from commit 2c524391e70921596add39688daf761cbc20662f)
The two commits before this are ownpixel's doc-only fixes of five private intra-doc links that resolved to nothing,
a red in the round's privdocs leg (cargo doc --document-private-items with -D warnings):
- the runtime's three: memory.rs place_fresh, render/replay.rs Lowering::logged, texture.rs Self::alias_unbound;
- the translator's two: metal/format/mod.rs [`footprint()`], which was ambiguous with the private module of the
same name.
The runtime files are hashed, so the runtime-sources pin is recomputed:
126aa0da718d8e8b821ffd2b1691e722c1324c90a7d9ed432162c086e6af8c03. No behaviour changes, so RUNTIME_VERSION stays.
Verified at 35fae0e6ae by ownpixel, M3 11323: CI's loop (RUSTDOCFLAGS=-Dwarnings cargo doc -p <crate>
--all-features --no-deps --document-private-items) gives 0 errors for all six crates. The same loop on Linux
(11324) is pending.
crates/metal2vulkan/src/metal/format/mod.rs links footprint twice; under --document-private-items
the private module footprint makes both ambiguous, two errors in CI's 'Private intra-doc links'
step, which holds metal2vulkan at 0. footprint() names the function (M3 run 11315).
(cherry picked from commit 35fae0e6aea5077c3b4937b4a75b5f0269b38de9)
memory.rs named Pool::place, which exists only under cfg(test); place_fresh's doc now says what it
places itself. render/replay.rs named RenderLowering::logged, which is Lowering::logged.
texture.rs named alias_unbound without its type; it is Self::alias_unbound on Device.
The CI step 'Private intra-doc links (no new breakage)' holds metal2vulkan-runtime at 0 under
cargo doc --document-private-items -Dwarnings; these three made it 3 (M3 run 11293).
Verified: the CI step's loop over all six crates, recorded in the tip message.
(cherry picked from commit f4f5b5d554cfd83a5b8613fcd179a78597811aec)
Translation changed at b04d0a8a31 (SEMANTICS_VERSION 2001). Blessed on the M3
(s37-pl.sh bless, dv-golden).
(cherry picked from commit 5fa08158ff4adec91d216386fe9d44c9e3904c9e)
The two commits before this are ownpixel's fix of the lavapipe runtime-lane exit SIGSEGV.
- Cause: a VkInstance the program makes itself (Device::from_raw's adopted devices, the validation candidate
engine) registers the validation layer's ApplicationAtExit after the runtime's exit hook. Exit handlers run LIFO,
so the layer tore its per-device state down first, while runtime threads were still inside it.
- Fix: the new public metal2vulkan_runtime::program_instance_made() registers the hook again after a program's own
vkCreateInstance, and Device::from_raw calls it for an adopted device's instance.
- The new test checks the order directly, without relying on a crash: the program's handler must see
process_exiting() == true.
- The NVIDIA exit known gap is a different mechanism (the driver's own worker against libEGL_nvidia's handler, no
runtime section in progress) and stays.
RUNTIME_VERSION goes 1958 -> 1959, and the runtime-sources pin is recomputed:
a4bdf2ba5041a01ec31781e65adf27602dc005de13b85abb7cfd64559d64fed3.
Verified at 6f24b49f16 (on bb8c60238b) by ownpixel, M3 MoltenVK 11283:
- the negative control (adopt.rs at the base, an empty program_instance_made) fails with "the layer's handler ran
before the hook: hook_ran=0";
- with the fix, both cases pass 3/3;
- exits, presenting, heap_textures, view_reinterpretation and tests::exit_guard 87/87;
- gpu clippy clean.
Probe (M3, 20 child exits a case): no program instance 20/20 clean; a program instance with the layer aborted in
GetDeviceFromKey 2/20 and 3/20. Still running: lavapipe 11284 and rustdoc for the new links. The cherry-picks onto
67650c36a5 were clean; this tree is not yet built.
The row the bless wrote at 6f24b49f16 (M3 job m3-max-11283, scripts/api-signatures/signatures.py
--bless), and nothing else changed.
(cherry picked from commit 120e931514a3dc3b9366701671ba0b78b350416d)
What. A layer registers an exit handler as each VkInstance is created (the validation layer's
ApplicationAtExit forgets every device it knows), and exit handlers run in the reverse order of
their registration. The runtime registered its hook again after every instance it creates, but
not after one the program creates itself. Now:
- metal2vulkan_runtime::program_instance_made() (public) registers the hook again; a program
calls it right after its own vkCreateInstance.
- Device::from_raw registers it again once the device is adopted: the adopted device's instance
was the program's.
- The validation crate's own instance creation (candidate::platform create_instance) reports
each instance it makes.
Why. With such an instance made after the hook's last registration, the layer's handler ran
first at exit, and a runtime thread's call still in progress, or begun before the hook closed
the guard, ended the process inside the layer:
- A lane run in one libtest process on lavapipe (gem10, 9619020361) ended with SIGSEGV after
its 2060 tests. The core shows the main thread in the hook, waiting for sections, and two
predicated-loop threads (loops without bound, run on by design) inside the layer's
vkWaitForFences, calling through freed state.
- A probe on the M3 Max (MoltenVK, the validation layer from Homebrew) ran 20 child exits per
case, each child with a loop without bound running on:
- with no instance of the program's: 20 of 20 clean;
- with one made after the device: SIGABRT inside the layer in 2 and 3 of 20 (vvl's
GetDeviceFromKey, at the loop's next vkResetFences, vkWaitForFences or
vkDestroyCommandPool).
Test. runtime_lane::exits::an_instance_the_program_made_registers_the_exit_hook_after_its_layer_s_handler
(cases program_instance_exit and adopted_instance_exit). Each child:
- has a loop without bound running on (predication::loop_without_bound);
- makes its own instance and device with the layer (presenting::Adopted);
- registers an exit handler after the instance;
- then reports the instance, or has the runtime adopt the device.
The handler must find the hook already run (process_exiting), and the exit must be clean.
Docs: exit_guard.rs (the registrations and the hole left), the runtime README, the new
function's doc comment.
(cherry picked from commit 6f24b49f16d47a63bae2d3dde2422f570f9a7505)
The commit before this is sweep's fix of the coverage_chain red on the M3.
- Cause: a discarding fill uses its fetched coverage twice, once for the discard test and once for the colour. Its
body read the raster-ordered storage image, branched on the value, fenced, and read it again. Under GPU load on
the M3 the second read loses the colour output in 8x4 blocks.
- Fix: a storage-form colour input is read once, before the body (fragment::emit_entry, EmitCx::fetched), and every
use takes that texel, which is Metal's semantics (the function gets one value of the attachment).
- Translation changes on the interlock profiles (MoltenVK, RADV, ANV), so SEMANTICS_VERSION goes 2000 -> 2001.
RUNTIME_VERSION goes 1957 -> 1958 with it, and the runtime-sources pin is recomputed:
see crates/metal2vulkan-validation/runtime-sources.sha256.
- The golden tables are re-blessed on development.
Verified at the tip 3917662cbb (on df79c0a7df) by sweep, M3 MoltenVK 1.4.2 job 11274:
- coverage_chain A/B, 120 runs each under runtime-suite load: development's lowering failed 15, the tip 0.
- translator fragment, imageblock, helper-thread and fetch tests 149/149 with MSL compiles.
- lanes framebuffer_fetch, interlocked_draw_order, view_attachments, imageblock and runtime fetch 121/121.
The new test tests::engine_fragment::a_fetched_color_is_read_once_before_the_body asserts one read in the first
block on every interlock profile. Still to run: gem10 11275 (clippy, rustdoc, the suite, and the test failing
against development's lowering), and the XTX and 780M fetch lanes. The cherry-pick onto b60bab13e4 was clean; this
tree is not yet built.
What. A fragment function that fetches a color in the storage form (the
ordered pixel interlock's storage image of the attachment) reads that image
once per invocation, in its entry hook before the body (fragment::emit_entry,
EmitCx::fetched), and every use of the color input takes that texel. Before,
each use read the image again at the use.
Why. The coverage chain's discarding fill (dsx_coverage_chain's
chain_color_discarding) tests its fetched coverage for its discard, then
multiplies its color by it: two uses, so the body read the raster-ordered
image, branched on it, then fenced and read it again. On MoltenVK on the M3
Max (MoltenVK 1.4.2, macOS 27.0.1), while other work ran on the GPU, Apple's
GPU lost the color the function wrote through its output in whole 8x4 blocks:
runtime_lane::framebuffer_fetch::coverage_chain failed 4 of 60 runs (and 9 of
90, 12 of 90 in earlier batches). With one read, 0 of 60, whether the discard
demotes or is predicated; a form that read the image twice with no branch
between the reads also lost nothing (0 of 150). Metal hands the function one
value of the attachment, so one read is its semantics, and it keeps the
image's accesses in the interlock to that read and the writes at the returns.
Test. tests::engine_fragment::a_fetched_color_is_read_once_before_the_body:
chain_color_discarding reads the coverage's image once, in the first block,
on every committed profile that orders fetch through the interlock (two reads
without the change).
(cherry picked from commit 3917662cbbb5d214ceb7a4f8c8631a71679a2849)
The commit before this is ownpixel's fix of the Iris deallocator lane red under CompletionPolicy::Exact.
- Cause: an empty command buffer taken with no submission owes its completion turn to the thread that took it.
The scheduler made that turn at the end of `round`, after the round's submission handlers, and submit_at_commit
did the same. So a handler in the same pass, waiting for that command buffer's completion, waited 60 s.
- Fix: the owed turn is made before the thread runs or waits for a submission handler or check. That is the rule
of ad451a5334: a handler holds back nothing the runtime took for another queue.
Scheduling changes, which a stored runtime artifact can see. So RUNTIME_VERSION goes 1956 -> 1957 and the
runtime-sources pin is recomputed: 1ef99693110ba5ecc473862e3a456b2906480a1ec5d8699a457184a5eacc8fba.
Verified at the tip fcc20eec92 (on 9619020361) by ownpixel:
- lavapipe 11186 reproduced the red at the base 4/240 under load.
- lavapipe 11229: the negative control fails at 60.07 s ("the empty command buffer's completed handler never
reached the other queue's submission handler"); with the fix 5/5, runtime suite 1974/1974, stress 0/240.
- M3 MoltenVK 11228: the new test 5/5, touched suites 68/68, deallocator 10/10.
- lint 11227: clippy plain, m2v_gpu and m2v_cpu_icd clean; rustdoc clean.
Still running: Iris 11226, the device where the red was seen. The cherry-pick onto df79c0a7df was clean; this tree
is not yet built.
What. A command buffer that needs no GPU work is taken with no submission and, where its
VkQueue has no work in flight and no turn is under way, its completion turn is owed to the
thread that took it (Completion::turn_owed). The scheduler's thread made that turn at the end of
its round, after the round's submission handlers; a committing thread's pass
(Scheduler::submit_at_commit) made it after its handlers and its check. Both now make it before
them: round makes the owed turn after settling the storage-form switches and before Turns::run,
and the committing thread makes it after each pass, before AtCommit::let_go.
Why. A submission handler that waits for the completed handler of such a command buffer of
another queue, taken in the same pass, waited for a turn that only its own return let the thread
make. This is the Iris Xe red of
runtime_lane::host_memory::a_deallocator_returns_whatever_thread_submits_past_its_completion
under CompletionPolicy::Exact: its `after` is an empty command buffer, and where the fill before
it on its queue had completed by the time the pass took it, `after` read Scheduled for the whole
60 s that `holding`'s submission handler waited ("1 kernel submissions ... in 2 passes", every held
head count 0). Its completed handler then ran once that handler gave up. Reproduced on lavapipe
under load at 961902036: 4 failures in 240 runs of the test, four loops beside two parallel
runs of the runtime lane. Metal delivers a command buffer's completion to another queue's
handler that waits for it (the probe cross_queue_handler_waits, 30 of 30, as in ad451a5334).
Test. tests::unsubmitted::an_empty_command_buffer_completes_while_another_queue_s_submission_handler_waits_for_it,
under Exact and Grouped. With every queue idle, an opener holds the scheduler's thread in its
submission handler while an empty command buffer with a completed handler (first queue) and a
command buffer whose submission handler waits for that completed handler (second queue) are
committed, so one pass takes both. It also checks that all three were taken with no submission.
Without the fix the handler waits the whole SETTLE and the test fails.
Docs: the scheduler's module docs and round, submit_at_commit, the completion module's "No GPU
work" entry, add_submission_handler ("Keep it short") and the runtime README's handler entry.
(cherry picked from commit fcc20eec92e10a652bf81f38648086cdf6eb7452)
The commit before this is radvruns' fix for an inconsistency sweep found on RADV:
- Before: a no-copy buffer or heap over shared memory (a memfd mapping) whose pointer the device refuses was a copy
when it had no dma-buf source, but refused (Unsupported, HostMemory) when its source failed.
- Now: where the device refused the pointer and no dma-buf of the pages served (the source failed, or the device
refused its dma-bufs), the outcome is the device's refusal either way: a copy, announced and counted as
copied_host_buffers_device_refused. Rule 2: Metal makes a no-copy buffer over any page.
- Unchanged: misuse (Invalid, DmaBuf), the unpinnable path, a lost device, dma-buf-only imports, windows the import
alignment does not cover, and rebinds.
A stored runtime artifact can see the answer change, so RUNTIME_VERSION goes 1955 -> 1956 and the runtime-sources
pin is recomputed: 667a42b2147fda1812b456d20e37b897aee4eae3228ef69bfbe170a8e885000e.
Verified at the tip a30909d44a (on bb8c60238b) by radvruns:
- PHOENIX 11208: runtime tests 78/78; host-memory lanes 69/69. The negative control (development's
buffer_descriptor.rs) fails copied_device with Unsupported(HostMemory), and fails the lane.
- PHOENIX 11207: clippy clean, plain and gpucfg.
- M3 11230: clippy clean; rustdoc clean; runtime suite 1358/1358.
On RADV a no-copy buffer or heap over shared memory (a memfd mapping) made with no dma-buf
source is a copy of the pages since 3f69d1af77, but one made with a source that fails was
still refused (Unsupported, HostMemory): source_failure kept the dma-bufs' refusal unless the
pointer's refusal was the runtime's unpinnable one, and the caller marked it not the device's.
Metal makes a no-copy buffer over any page, and rule 2 lets only what Metal refuses or what
cannot run fail; the pages are readable, so the copy runs.
buffer_over_host_memory now carries whether the device was asked the pointer: where it refused
it (not_importable) and no dma-buf of the pages served either (the source failed, or the device
refused its dma-bufs, refused()), the outcome is the device's refusal, as with no source: a copy,
announced and counted as copied_host_buffers_device_refused. Unchanged: the unpinnable path
(copied as Failed), misuse (chunks that break the source's contract stay Invalid, DmaBuf), a lost
device, memory imported only as dma-bufs and windows the import alignment does not cover (no
pointer asked: still refused, as without a source), and rebinds (refused without a working
source, as before).
Docs: CopiedFor and CopiedBecause::DeviceRefused, the copied-host-pages detail and catalogue
entry (degradation.rs, docs/API.md), WorkCounts::copied_host_buffers_device_refused, copied.rs,
dma_buf.rs's refusals, HostMemory::with_dma_buf, imports_shared_host_pointers, the runtime
README and HOWTO section 6 and Copied host buffers.
Tests: copied_device's shared-memory test makes a second buffer, with a source that fails, over
pages of its own: on a device that refuses shared memory's pointer a copy counted as the
device's refusal, the source called once; elsewhere the pointer's import, no source called. The
runtime lane dma_buf_imports (renamed shared_memory_without_a_working_source_is_a_copy_and_
misuse_refused) expects the failing source's copy on RADV, over a view of its own.
Verified: cargo fmt only; the 780M runs (with a negative control on the base's
buffer_descriptor.rs) are dispatched next.
(cherry picked from commit a30909d44aec64136e29f57b5a5dacca8568d3bc)
Translation changed at 08652be54e (SEMANTICS_VERSION 2000). Blessed on the M3
(s37-pl.sh bless, dv-golden).
(cherry picked from commit 2c555cc89df2fed564b7c8007ee894849b3c04ad)
With the RGB9E5Float blends checked as the device's blend (job 11181, PHOENIX: no wrong
answers at either count), the lane reached its notice check on RADV for the first time and
failed there:
announced past [DeviceColorConversion, DeviceRoundedResolve, DeviceDenormals,
FastMathRewrites, DeviceTexelConversion, NativeNanEncoding]: [SrgbTexelDecode]
RADV holds R8Unorm_sRGB multisampled in its own format. The lane's reads of its samples go
through the device's sRGB decode and announce srgb-texel-decode, but the lane allowed that
notice only for a format held as its word. The allowance now covers an sRGB sample held
either way, wherever the device's sampler is not Metal's; read() already bounds the decode
alike for both.
(cherry picked from commit acc53ee20437d7532c109e9c26de374174098e9b)
The 780M lane's red (19 answers, all RGB9E5Float blends at 2 and 4 samples on RADV PHOENIX,
Mesa 26.2.6) is the device's own blend arithmetic: RADV hands its blend an RGB9E5Float source
whose channels and alpha are halves rounded toward zero (a value past 65504 as 65504), where
Metal blends the floats. Vulkan asks a blend for no more precision and range than the
attachment's, which a half meets. Rule 1: the device's native blend is the only form, so no
path computes Metal's bits; the blend already records and announces device-color-conversion
(ChannelWrite::Device for a blend of factors other than one and zero).
The model, run offline over the lane's inputs (the probe's generator) and Metal's table:
- Metal's words are the f32 blend over Metal's stored samples, truncated to the format
(32/32, 64/64);
- RADV's 11 failing sample words are the blend of halves rounded toward zero over Metal's
stored samples, truncated, in 10 of 11. The eleventh (4 samples, pixel 7 sample 3) blends
over a sample RADV's fill stored a code from Metal's;
- Metal's RGB9E5Float resolve is the crate-owned resolve's rule (f32 mean, nearest half,
mantissas rounded half up) in 64/64 pixels. RADV's 8 failing blend resolves are that rule
over the model's samples in 7 of 8.
The lane now, where the device is RADV and holds RGB9E5Float in its own format:
- checks each blended sample against that blend's word over the device's own stored sample,
within a code (half_blend);
- checks the blend's resolve within a code of Metal's resolve of the device's samples
(shared_exponent_resolve);
- prints how many of the samples' model words are not Metal's;
- requires device-color-conversion to be announced.
Elsewhere it keeps Metal's bound.
The note's declaration, API.md's entry and the comparison table's doc record the measured
size: 30 of 96 blended samples not Metal's, up to 33 units of the larger value's last
mantissa bit where the source passes 65504, and 7 where the half's alpha weighs a destination
far larger than the source.
Verified so far: the offline model above. The lane on PHOENIX is pending.
(cherry picked from commit 0fb6dcf07456cf7531021bb70fbe7eea64dadbb0)
The two commits before this are radvruns' fix of the 780M pull_model_interpolation red.
- Cause: on a perspective input read at a sample or an offset, RADV/ACO answers the pixel center's value
extrapolated along the quad's coarse derivatives, a first-order value. A model reproduces every miss within 0.005;
exact perspective matches Metal within 0.003.
- Fix (rule 1, the device's native interpolation): no v/w emulation. The measured fact
DriverWorkaround::PerspectiveReadsExtrapolated (MESA_RADV) makes stage_io record
PrecisionNote::ExtrapolatedInterpolation on structure alone: a perspective-qualified input read through
InterpolateAtSample/AtOffset, or a perspective smooth varying read at the coverage loop's sample.
- API.md's DeviceInterpolation and the FAST-PATHS row are corrected, from "within 1.5e-4" to the measured ~1.0 on
the lane's w = 1, 2, 4 geometry.
- The lane checks RADV against the first-order model.
SEMANTICS 2000 and ARTIFACT_FORMAT 497 come with the commits. This commit moves RUNTIME_VERSION 1954 -> 1955 for the
runtime's announcements and recomputes the runtime-sources pin:
8ae32d4765b4f41b760258dd704bedcbfc3453081f6c2273dac3e614fdde045b.
Verified by radvruns:
- gem10 PHOENIX 11157: lane 2/2, largest distance ~1.02, all within the model; the negative control without the
fact fails with the original "1700 values off".
- M3 11153/11187: clippy clean; focus 72/72; degradation 17/17. The full suite is 3395/3398, the three being
golden_hashes and the engine inventory's pm_linear rows, re-blessed on development.
- M3 11189: the negative control with the note emptied fails engine_pull_model and engine_coverage_loop.
The cherry-picks onto 9619020361 were clean; this tree is not yet built.
The fixture's .ll and .air.ll were regenerated from the MSL by scripts/regen-air-fixtures on
the M3 (Apple metal 32023.922, macOS SDK 27.2; TOOLCHAIN unchanged), and the air_input snapshot
was blessed over them (job m3-max-11153). That job also ran:
- clippy on metal2vulkan, the runtime and validation (plain and --cfg m2v_gpu): clean;
- the focused engine tests (98) and the runtime's degradation tests (17): pass;
- validation's comparison tests (9): pass.
The full metal2vulkan suite (3398) fails only these:
- golden_hashes, from the SEMANTICS_VERSION bump;
- the engine inventory's new pm_linear rows (llvm_as part 8, metal_as part 3).
Both are tables re-blessed on development.
(cherry picked from commit 02b6755308a71091e7957ac137b794270016a747)
On the Radeon 780M (RADV, Mesa 26.2.6) runtime_lane::pull_model_interpolation read 1700
values off Metal's, up to about 1.0 in lane 3. The lowered pm_offset is straight-line code (a
uniform offset, its move and clamp, InterpolateAtOffset per input), so no control flow is at
fault. Every miss is a perspective input's read at a sample or an offset; the no-perspective
inputs' same reads were Metal's. A model with the lane's own geometry gives the driver's form:
the pixel center's value extrapolated along the quad's coarse derivatives,
f(center) + (f(tr) - f(tl)) * dx + (f(bl) - f(tl)) * dy. It reproduced all 52 one-sample offset
misses within 0.004 and all 1061 four-sample sample and sample_id misses within 0.005, where the
fine-derivative form was up to 0.98 off. Metal's value plus that form's error (first-order less
exact) matched each of RADV's within 0.2 of the lane's device bound.
Vulkan states no precision for interpolation, so under rule 1 the device's interpolation is the
answer: no form computes it otherwise. The fix records it.
- DriverWorkaround::PerspectiveReadsExtrapolated, a measured row keyed on RADV
(driver_facts::DEFECTS, no vendor), as InterpolationNeedsTheWholeQuad is.
- PrecisionNote::ExtrapolatedInterpolation (extrapolated-interpolation). stage_io::plan records
it structurally: an interpolant with the perspective qualifier read at a sample or an offset,
or a perspective sample-qualified varying a looping function reads at each pass's sample
(InterpolateAtSample), on a profile with that fact. A no-perspective read, the pixel-center
form (offset 0), a center or centroid read and an absent interpolant record nothing.
- The pull-model lane: on such a device each perspective lane read at a sample or an offset is
held to the device bound of Metal's value plus the extrapolation's error, computed from the
lane's geometry (extrapolation_error), and the pipelines that read so, and those alone, must
record the note.
- The engine tests over every committed profile assert the note where the RADV profile reads a
perspective interpolant at a sample or offset, and nowhere else: pm_linear, a new fixture
function reading the no-perspective interpolant alone at a sample and an offset, must not
record it. The coverage-loop test asserts it for the looped perspective varyings on RADV.
- docs/API.md's device-interpolation entry and docs/FAST-PATHS.md's row no longer cover RADV's
sample and offset reads with the 1.5e-4 figure. The new entry and row state the form and the
measured size.
- SEMANTICS_VERSION 2000 (the RADV profile's pull-model and looping modules gain a note),
ARTIFACT_FORMAT_VERSION 497 (the codec gains the note), api_signatures blessed. The refusal
surface regenerated with no change.
The fixture's AIR companions for pm_linear come in the next commit, from the regen script on the
M3. The golden tables and the air_input snapshot are re-blessed on development.
(cherry picked from commit f4eb92a9bc4c099f9020fde2c2da40580514ec20)
The two commits before this are ownpixel's fix of round 064's rt1 red on the RTX 5080. The cause is that the 5080's
driver refuses an 8th live VkDevice in one process, deterministically (VK_ERROR_INITIALIZATION_FAILED at the 8th
make, alone and under load). The runtime already answered that refusal as Err; the test unwrapped it while holding
recorder::SLOTS = 8 devices. The test now takes the free recorder slots directly (recorder::take_free_slots,
compiled only for the device tests) and holds at most 3 devices. recorder/mod.rs is hashed, so the runtime-sources
pin is recomputed: 3ef374c57741e051d2568b6d2dfbc1d38e4d41375b44b04d9ed648b6d89ad133. The runtime's behaviour is
unchanged (the helper is test-only), so RUNTIME_VERSION stays.
Verified by ownpixel:
- the probe (steelbrain/recorder-slots-probe, not landed): makes 0..6 succeed, make 7 fails with -3, alone and
beside 12 looping test processes. Not memory: the process held 1.4 GB RSS at the refusal.
- the fixed test: 3/3 alone and 3/3 under load on the 5080, 3/3 lavapipe (11110), 3/3 MoltenVK (11109).
- plain and m2v_gpu clippy green (11066).
Measured on the RTX 5080 (b5080 entry ownpixel-slots-231316, probe branch
steelbrain/recorder-slots-probe 5edb022ecc): a process makes seven live devices
of sinks of their own and the eighth fails with VK_ERROR_INITIALIZATION_FAILED,
alone (beside one other entry) and beside twelve processes of device tests
alike; an instance is still made past it, and a device is made again once the
seven are dropped. The test as it was fails at its eighth slot device, before
the device past the slots; the test at 05cba8be17 passed three runs alone and
three beside the load there, and three each on lavapipe (m3-max-11110) and
MoltenVK (m3-max-11109).
Verified: cargo fmt; comments only.
(cherry picked from commit b3f25aca9dea87f141a1da6459e5dcd6eb66f8ce)
The test made one device per slot (recorder::SLOTS, 8) and two more, holding
nine at once, each of a message sink of its own (an instance and a device of
its own). On the RTX 5080 (round 064's rt1 at 32c3330694), beside the suite's
other device tests, a make took about 11 s and one of them failed with
VK_ERROR_INITIALIZATION_FAILED after 98 s: the test asked the driver for more
devices in one process than any other test or program does, which nothing
about the slots needs.
recorder::take_free_slots (test builds with a GPU cfg alone) takes every slot
no device holds, as a device takes one, each let go as its Slot drops. The
test makes a device to record and one to let go, takes the other slots, makes
the device past them (uncounted, as before), fills on it and on the counted
one, drops the idle device and the uncounted one, and makes one more, counted
in the freed slot: three devices at most at once, five makes.
Verified: cargo fmt. The build and the 5080 run follow.
(cherry picked from commit 05cba8be17f3663ac344f3bcf86e19b8bdbbffa0)
The eleven commits before this are sweep's fix for a scheduler hang under CompletionPolicy::Grouped (the default):
- The bug: a group held behind running work waited while a submission handler of another logical queue, which
waited for a command buffer in that group, ran on the scheduler thread. A probe on the M3 Max shows Metal
delivers across queues (30/30) and never within one queue (10/10).
- The fix: scheduler::holds_back_another_queue sends the held group before such a handler runs.
- DeviceOptions::assume_submissions_merge (doc-hidden, a test hook like fail_in_place_check) holds the device's merge
check, so the handler test checks the held group on every run.
- Under Exact (the lane devices') no group is held, so the Iris deallocator lane red is a separate, open cause.
- Two intermediate commits (from 2a43201e53 and d7065a11b5) do not compile alone; a bisect skips them.
Scheduling changes, which a stored runtime artifact can see. So RUNTIME_VERSION goes 1953 -> 1954 and the
runtime-sources pin is recomputed: 6bdfea21e45d0dbc47b4f86037e1ebeeefd23302ac877f0d5a9c1748b0667567.
Verified by sweep at bf62810259 (same content on an older base):
- XTX 11130: handler test 3/3 (X and Y in one submission, Y reached in ~440 ms); without the fix, Y waits 60 s and
the test fails; deallocator 10/10; plain and gpu clippy clean; api tables 11/11.
- lavapipe: handler 2/2, deallocator 5/5.
- 780M 11096: grouped, reached in 330/428 ms; without the fix, 60 s.
- M3 MoltenVK 11134: handler 3/3, deallocator 10/10 (MoltenVK never groups).
- Cost, 780M frame_costs_over_imports: identical before and after.
Still running: the tip on the development base (11155), the 780M (11148) and Iris (11131/11132). The cherry-picks
onto c79a468965 were clean; this tree is not yet built. api-signatures --check, refusal-surface and
conformance-coverage leave the docs unchanged.
What. A hidden test hook, as fail_in_place_check is: a device made with it takes
its merge check (submit_check.rs, Check::Merge) as Holds from its making, reads
and writes no record of its checks, and reports the merge's floors with
"assumed"; its import tax and follows checks answer as ever. Under
CompletionPolicy::Grouped its batches then wait in groups whatever the timing
measured. That is safe on every driver: one vkQueueSubmit of several
VkSubmitInfos, only the last signalling, runs correctly where the driver
submits them apart; it only saves nothing there.
a_held_group_goes_before_another_queue_s_submission_handler_runs makes its
device with the hook and asserts the merge held, so the held group is checked
on every run. Before, on the 780M one run of three read the merge check as
Fails (54.4 us in one call of four against 60.4 us apart) and the test then
passed without checking anything.
Correction to 8d04b2d15d's message: it said the deallocator lane test on the
Iris Xe hit the held-group wait. That claim was not verified, and it is wrong
for the lane. The lane's devices use DevicePolicy::exact_answers
(CompletionPolicy::Exact), so no group is held there. The scheduler change
stands for the default policy; this test fails without it (780M: Y's handler
waited 60.0 s for X, kept behind A and B) and passes with it (X and Y in one
kernel submission, X's completed handler seen after 331 and 428 ms). The Iris
lane red has another cause, under diagnosis.
api_signatures.tsv lists the field. Verified: to be built and run on the 780M,
the XTX, the Iris Xe, the M3 Max and lavapipe, with the scheduler change and
without it.
(cherry picked from commit bf62810259d89e10aa4d558abccbe65d5cf92967)
(cherry picked from commit 3535bee6612a6b831e7b0b843cf94634b83f3f56)
The handler test made its device with the lane's options, whose policy is
DevicePolicy::exact_answers: CompletionPolicy::Exact, under which no batch
waits in a group. So X was never kept behind A and B (on the XTX and the 780M
every batch went alone with two or more pending, none grouped, no group end),
and the test could not fail without the scheduler change. It now asks for the
default, CompletionPolicy::Grouped, as held_behind_running_work does.
The deallocator test runs under the lane's exact completion, so no group is
held there. Where the later command buffer's completed handler never reaches
the holding handler, the panic now names its status and what the scheduler did
since the opener's commit: kernel submissions, batches at commit, groups,
passes, and each reason it held a head back.
Verified: to be built and run on the XTX, the 780M and the Iris Xe, with the
scheduler change and without it.
(cherry picked from commit 5e8a173bffebe3fa98be5516b70758c7c9c704f4)
(cherry picked from commit 0f5f9c36c8194347618eadb8b3822ba91bc8b1c2)
11a7ae0109 did not compile: the module already has a Step (the event
scenarios'), E0428 in the M3 build. Test output only.
Verified: to be built in the device jobs that follow.
(cherry picked from commit 60d5093cd4a90e1702781664e67c4706d6ae1a6f)
(cherry picked from commit d08611c331344722764a2eaff2e7f1335fc3be01)
20a5e99f21 did not compile: in edition 2021 the mutex guard read in the
block's tail expression outlived the mutex the block owned (E0597, seen in the
M3 build). The steps' fields were read only through Debug, which the dead-code
lint does not count; each step now prints as a line that reads every field.
Verified: to be built in the device jobs that follow; test output only.
(cherry picked from commit 11a7ae01095e5281914f9b6a3bcade0104234c50)
(cherry picked from commit d7065a11b5f7f84084eafd0b79929c61d2282ae8)
On RADV (the XTX and the 780M) X goes alone where it should be kept behind A
and B; these counts say which decision sent it. Test output only.
Verified: builds (cargo fmt); the device runs follow.
(cherry picked from commit 20a5e99f21747d1ebe44323cb3179e76935bc93b)
(cherry picked from commit 2a43201e53e95bbae5d0ffe701d66af00f35fb8f)
What. a_held_group_goes_before_another_queue_s_submission_handler_runs's record now holds the
kernel submissions made, groups kept and batches grouped since A's commit, read once A was taken
in, B scheduled and X scheduled, and its printed line names them.
Why. On the RX 7900 XTX (RADV) the test found the queues sharing one VkQueue and the driver
merging, yet X was not kept behind A and B (kept 0), where the lane's behind_running_work keeps
its second command buffer there. Which step sent X decides whether the test or the runtime is
wrong; the line said only the end.
Verified: cargo fmt. The XTX run is a potluck job.
(cherry picked from commit 9da06ab3a435d48d4e1991af32e6b62c9f99e399)
(cherry picked from commit c4efae0678220c8cb886ba3622eff89d6d1416b9)
What. a_coverage_chain_through_fetch_keeps_every_block's line for each case now also prints, from
the device's WorkCounts around the case's pass: the render pass instances begun, the splits for
interlocked writes, for a barrier and for a memoryless write, and the draws dropped (still
making or unmade).
Why. The test still loses 8x4 blocks under load on the M3 Max (MoltenVK) in the cases with a
discard, after the split for interlocked writes. Whether the split ran in a failing case, and
whether a draw went missing, decides where to look; the line said neither.
Verified: cargo fmt. The run on the M3 is a potluck job.
(cherry picked from commit 94061430214bfa257f0eb64bfb76bed5aaa752e7)
(cherry picked from commit b2db90a08beda968daec04b4fd548d65b85ec5e3)
What. The probe's header now records its runs: on an M3 Max under macOS 27.0.1, 10 runs of each
case, a command buffer's completed handler reached another queue's waiting scheduled or
completed handler in every run, 7.6 to 9.3 ms after the wait began, b committed first included;
on one queue it never did, the 5 s bound in every run, the two handlers on one thread.
Why. The scheduler's rule for groups and submission handlers cites it.
Verified: the M3 job's output (10 runs of each of the four cases).
(cherry picked from commit 311a41620234505ec7b6d3f7d9dd893d3d0c1dba)
(cherry picked from commit fc26039e6145ba50b180a234cb1ba3d27073192c)
What. A pass that ends with batches held for one kernel submission keeps them held while their
VkQueue runs two or more earlier submissions (Group::keeps). It now sends them instead where a
submission handler the thread runs once its passes end (scheduler::round) is of a command
buffer of another logical queue (Metal command queue) than a batch held:
scheduler::holds_back_another_queue, over the round's handler list and the batches held with
their logical queues. The handlers of the held batches' own queue still keep the group held.
CommandBufferShared::logical_queue reads a command buffer's queue identity for it.
Why. A submission handler runs on the scheduler thread, and a held batch's handlers run as it
is held, before its group goes to the driver. Where two command queues share one VkQueue on a
driver that merges, a batch of one queue held and kept behind running work, and a batch of the
other queue with a handler that waits for the first one's completion joined the group: the
group stayed held until the handler returned, so the handler waited for work its own return let
go (the deallocator lane test on the Iris Xe hit it once, its handler waiting 60 s). Metal does
not do that: on an M3 Max under macOS 27.0.1 (probe cross_queue_handler_waits), a command
buffer's completed handler reached another queue's scheduled or completed handler that waited for
it in each of 30 runs, 7.6 to 9.3 ms after the wait began, b committed before a included. On one
queue it never did (the 5 s bound in each of 10 runs): Metal runs one queue's handlers one at a
time, so the runtime keeps the group there and promises nothing more than Metal.
Cost: a group mixing two queues' batches is no longer kept past a pass in which a submission
handler of one of them runs; it goes then, the batch that joined last included, in one
submission. Measured on a lane (frame_costs_over_imports, the guest's shape) in the runs that
verify this commit.
Docs: group.rs ("Kept while its queue runs earlier work", Group::keeps),
CommandBuffer::add_submission_handler ("Keep it short"), the runtime README's handler entry,
and FAST-PATHS.md's grouped-submission row.
Verified: cargo fmt. Build, clippy and runs (the previous commit's test, without and with this
change; the deallocator lane test as it was) are potluck jobs on the Iris Xe and the XTX.
(cherry picked from commit 8d04b2d15d3cb745363428fdc9acbbb9ca2eb868)
(cherry picked from commit 2cbd8a970905d931b7be39c92fbdd18d6024f62a)
What. A lane test, a_held_group_goes_before_another_queue_s_submission_handler_runs: on two
command queues, X is committed on the first behind running work (A, then B) and held; then Y on
the second, whose submission handler waits for X's completed handler. Where the two queues
submit to one VkQueue on a driver that merges (Iris Xe's ANV, RADV's single graphics queue), X
is kept behind A and B, Y joins its group, and the test asks that X's completed handler reach Y's
handler, that X was kept, and that X and Y went to the driver in one submission before Y's
handler began. A is made longer until it outlasts the handler's start, as
behind_while_a_runs does. Elsewhere X goes before the handler in any case and only the delivery
is asked. Nothing is asked of one queue: Metal never delivers there.
Why. On Metal (M3 Max, macOS 27.0.1, probe cross_queue_handler_waits) a completed handler
reaches another queue's scheduled or completed handler that waits for it, every run; the
runtime kept such a group held behind the handler, so the handler waited for work that only
its own return let go to the GPU. This commit holds the test alone: it fails until the next
commit's scheduler change, where the device groups and shares one VkQueue.
Verified: cargo fmt. Build, clippy and runs are potluck jobs on the Iris Xe and the XTX.
(cherry picked from commit b1560d73d9ba1ca68c511a1fcdbe0e5217468d41)
(cherry picked from commit 2c50ce4b83f36e6cda676c490a4ba1ffefb23318)
What. probes/cross_queue_handler_waits.m: a command buffer `a` with a completed handler and a
command buffer `b` whose handler waits at most 5 s for it, on two queues (b's scheduled handler,
b committed after a and before it; b's completed handler) and on one queue as the control. It
prints whether the completion reached the waiting handler, the statuses and the handlers' threads.
Why. The runtime's grouped submissions run a held batch's submission handlers before the group
goes to the GPU; whether a handler that waits for another queue's command buffer may hold that
command buffer back is Metal's answer to read first (the deallocator lane test on the Iris Xe).
Verified: it compiles (clang -fsyntax-only); its runs are a potluck job on the M3.
(cherry picked from commit f4dde7aa1aef5d6f31c5c1987f42a5af0b0017bd)
(cherry picked from commit 9846145176fd28a87eec55079778f5c6b9f091dc)
The commit before this is nvreds' fix of the mirror of the X32_Stencil8 bug. A Depth32Float heap texture over a
D32_SFLOAT_S8_UINT image presents no stencil, yet its copies took the image's stencil plane: they read the heap's
bytes after the texture's depth (at 16x16, the 256 bytes at 1024..1280) into that stencil and wrote them back.
texel_units now drops every depth or stencil aspect the pixel format does not present. That is one structural test
for X32_Stencil8 and its mirror. A format that presents every aspect of its image moves as before. Heap copies
change, which a stored runtime artifact can see, so RUNTIME_VERSION goes 1952 -> 1953 and the runtime-sources pin
is recomputed: 024636ce2d7c319e5f480b2bc34f665b46092ab83cd58d2ea877342402f97892.
Verified at the tip de0c2f3f27 (on 3dad05d1cb) by nvreds, gem10 11086:
- runtime unit tests heap|texture|stencil|depth 215/215; plain clippy clean;
- the new test fails at the base: Depth32Float took (DEPTH 0, STENCIL 1024), 1280 bytes where 1024 are its own.
No device lane reaches the path on a measured device (none is known to send Depth32Float to the combined image).
The cherry-pick onto 81f3419f6f was clean; this tree is not yet built. api-signatures --check, refusal-surface and
conformance-coverage leave the docs unchanged.