Commit Graph
4297 Commits
Author SHA1 Message Date
Anees Iqbal fd0dba2af0 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-12 00:14:41 -08:00
Anees Iqbal 5f55875d99 RUNTIME_VERSION 2090: a no-copy buffer's posted import release holds the device as a holder's, so the program's last drop tears the device down
The commits before this one. When a no-copy buffer's import was released with only a keep-alive
waiting for the free, HostImport::drop posted the release to a handler thread
(Device::let_go_elsewhere), and that release held program handles of the device (the import's, the
posted completion's, the keep-alive's exported pages' and its dma-buf imports'). The program's
drop(device) was then not its last: the last went on the handler thread, which waits for nothing,
so the drop returned with the VkDevice alive and its teardown was left to the process's exit. On
NVIDIA that is the documented exit race (a driver worker faulting at
libnvidia-glvkspirv.so+0x363a8 while libEGL_nvidia's exit handler runs): a 5080 test process
exited 139 after in_place_check::the_in_place_check_imports_its_dma_buf_pages_as_dma_bufs passed.
The posted release now holds holders' handles (Device::held_for_release,
Placement::hold_dma_buf_for_release), so the program's last drop waits for it, and the device is
torn down on the program's thread before the drop returns, as the docs' remedy says.

Verified (potluck jobs, on the branch):
- RTX 3090 (um870, exclusive), 20 rounds of 8 processes of the dma-buf test, base and fix in
  alternation (m3-max-19612): base exited 139 in 3/160, every one at libnvidia-glvkspirv+0x363a8;
  the fix in 0/160. Before the fix the drop returned with the device alive in 80/80 runs on the
  3090 (19471), 31/32 on lavapipe (19493) and 12/12 on the 780M (19473).
- tests::teardown_threads::a_keep_alive_s_posted_release_leaves_the_device_to_the_program_s_thread
  fails 12/12 without the fix and passes 12/12 with it (lavapipe, 19543); the dma-buf test now
  asserts the device is gone after its drop (8/8, 19603).
- lavapipe runtime suite 2281 passed, 0 failed (19621); fmt, clippy plain / m2v_gpu / m2v_cpu_icd
  and rustdoc (19619).
Not yet: the 5080 before/after (b5080 entry exitseg-exitseg-ab-000551).
2026-11-12 00:13:46 -08:00
Anees Iqbal 6913b212e0 Runtime docs: a posted import release's own handles are holders'; the 3090's count of live devices after the drop
Which handles of a posted host-import release are holders' (the count's, the import's, its
dma-buf imports' where it alone holds them), where the comment said every one but the
keep-alive's own; and the RTX 3090's measurement (80 of 80 drops returned with the VkDevice
live before the fix, m3-max-19471) beside lavapipe's and the 780M's. Comments only.
2026-11-12 00:13:38 -08:00
Anees Iqbal e5a5f36b5d Runtime: a posted import release holds its dma-buf imports' device as a holder's too
What: where a no-copy buffer's import goes in a release posted to a handler thread (a keep-alive
alone waiting for its free), the dma-buf imports its pages lie in (dma_buf::DmaBufPages, held by
the placement) now hold the device through a holder's handle as well, where the placement alone
holds them (Placement::hold_dma_buf_for_release, memory.rs; DmaBufPages::hold_for_release).

Why: with the import's own handle a holder's (the commit before), the dma-buf test's device drop
still returned with the VkDevice live in 12 of 12 runs on lavapipe (potluck m3-max-19543): a
backtrace of the program's last drop (m3-max-19590) showed it on metal2vulkan-handlers, in
drop_in_place<DmaBufPages> inside drop_in_place<Imported>, the posted release.

How verified: the following runs, in the report.
2026-11-12 00:13:37 -08:00
Anees Iqbal 0b34c86444 Runtime: a keep-alive's posted import release holds the device as a holder's, so the program's last drop waits for it
What: a no-copy buffer released with a keep-alive alone posts its import's free and the
keep-alive's drop to a handler thread (HostImport::drop, buffer.rs). That release held program
handles of the device (the import's own, the posted count's). Now each is a holder's
(Device::held_for_release, device/holds.rs), which the program's last drop waits for as it waits
for the in-place check and the warm pass. dma_buf::ExportedPages, the check's dma-buf pages and a
device test's keep-alive, holds its device the same way.

Why: the 5080 load run's SIGSEGV at exit after
tests::in_place_check::the_in_place_check_imports_its_dma_buf_pages_as_dma_bufs passed. That test
drops its two no-copy buffers over a dma-buf (each with a keep-alive) and then its device. The
device's drop was not the program's last: the posted releases' handles were, on the handler
thread, which waits for nothing; its teardown then ran there while the process exited, and the
exit hook left the device to the process's end (exit_guard). A device live at the exit on NVIDIA's
driver is the known fault in libEGL_nvidia.so's exit handler (daf963ab80). Measured with prints at
the base (f34408bcea): the test's drop returned with the VkDevice live in 31 of 32 runs on
lavapipe (potluck m3-max-19493) and 12 of 12 on the Radeon 780M (m3-max-19473), the last program
drop and the teardown on metal2vulkan-handlers, closed by the exit.

How verified: new device test
teardown_threads::a_keep_alive_s_posted_release_leaves_the_device_to_the_program_s_thread holds the
posted release in the keep-alive's drop and drops the device: the VkDevice must be gone
(WorkCounts' live count, 0) and torn down on the program's thread as the drop returns. The
dma-buf test now asserts the live count is 0 after its drop. Runs and the negative control are in
the following commits' messages and the report.
2026-11-12 00:13:37 -08:00
Anees Iqbal e4546a6d1e Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-11 23:32:57 -08:00
Anees Iqbal 06fd49b221 RUNTIME_VERSION 2089: the queue-switch check's gate opens on the GPU, so no round waits on its host while another device is destroyed
The commits before this one. A queue-switch round submitted its first batch waiting on the GPU for
a gate its host signalled only after the second batch's vkQueueSubmit returned. On NVIDIA that
second vkQueueSubmit and another VkDevice's vkDestroyDevice in the same process never returned:
- RTX 5080 Laptop (615.71.09), beside the runtime suite: recorder_slots timed out at 1201 s, and the
  dma-buf leak probe's exit waited on the same submission section (gdb stacks, nv5080reg);
- RTX 3090 (620.70.06): managed_copy_device's recovery test hung after the device was made again,
  the old generation's vkDestroyDevice against the new generation's round (gdb stacks, nvxid);
  1 of 13 copies hung without the fix (m3-max-19330), 0 of 13 with it (m3-max-19329), both
  exclusive on gem10's 3090.
Each round now submits an opening first, fills of the check's scratch buffer that signal the gate
as they complete, so every batch it submits completes with no further call of the check's thread.
A round whose gate had opened before its batches were in is late, counts for nothing and doubles
the opening's fills (at most 1024).

Tests: tests::queue_switch_gate holds a round between its submissions, and once all are submitted,
and waits on the host (at most 20 s) for the batches' timeline values; they cannot complete under
the host-signalled gate. zeroed_start (test-only) paces its busy work without the target's fill and
says where the making's time went.

Verified at the branch: the 3090 recovery runs above. Lint m3-max-19481 and lavapipe m3-max-19482
(66942365f6), and the gate tests' pre-fix vs fix runs on the 3090 (19452) and the 5080, ride the
checks after landing.
2026-11-11 23:31:58 -08:00
Anees Iqbal 755c8753ee Tests: the queue-switch gate tests keep only the ones that fail without the fix
The driver-call tests (another device made and dropped, 64 MiB of each memory type allocated
and freed, dma-buf imports, each beside a held round) did not show the deadlock before the fix:
the device-drop test held between the submissions passed with the host-signalled gate on the RTX
5080 at every build tried, and under the runtime suite's load the device-drop tests failed with
the fix (another device's making and teardown took longer than 25 s), so they say nothing about
the gate. What stays holds the round between or after its submissions and waits for the
batches it submitted, which with a host-signalled gate cannot complete while the round is held.
The dma-buf helpers of export_after_dma_buf go back to private.

The module docs of the check and of the tests name the hangs seen with the host-signalled gate:
the RTX 5080's beside the suite, and the RTX 3090's recovery (tests::managed_copy_device), whose
stacks showed the old VkDevice's vkDestroyDevice and the new one's check in vkQueueSubmit.
2026-11-11 23:31:48 -08:00
Anees Iqbal 140a5613fe Queue-switch check docs: a submission check's wait after a refused call is for its fence submitted alone
Since RUNTIME_VERSION 2088 the submission checks no longer wait for their queue to idle after a
refused call; they submit their fence alone and wait for it, bounded. The module docs said a
wait for idle; they now name the fence, which signals once the queue's earlier work completed:
with the gate opened on the GPU every batch of a round completes with no more work of the host's,
so that wait ends too. Docs only.
2026-11-11 23:31:48 -08:00
Anees Iqbal 6873b6e3c0 Tests: a held queue-switch round's submitted batches complete while it is held
The queue-switch check's earlier gate was a timeline the host signalled after
the round's last submission, so a round held between or after its submissions
left its batches waiting on the GPU for a signal only the held thread could
make. The new tests hold the round at both places and wait on the host, for at
most 20 s, for the timeline values its submitted batches signal: with the gate
opened on the GPU by the round's opening they complete. The check records those
values for the device tests as each hold passes (QueueSwitch::signalled).

Not yet run: the build and the runs on an RTX 3090 and the RTX 5080 follow.
2026-11-11 23:31:48 -08:00
Anees Iqbal 29e4e78e58 Test: zeroed_start reads the making's CPU time from the thread's CPU clock
What: the split of new_texture's time takes the thread's CPU time from CLOCK_THREAD_CPUTIME_ID
around the call alone, and its run-queue wait from /proc/thread-self/schedstat; blocked is the
rest of the call's wall time.

Why: schedstat's run time is updated at the scheduler's ticks, so the first runs at 5f6bfc09ee on
the 5080 read more CPU time than the call's wall time (2.78 ms on a CPU for a 2.21 ms making).

Verification: not yet run at this commit; 5080 runs follow.
2026-11-11 23:31:48 -08:00
Anees Iqbal 9d68fcdc3a Tests: the queue-switch gate also holds a round once its last batch was submitted
What: a test-only hold of the queue-switch check once a round on one VkQueue made its last
submission (QueueSwitch::submitted), and each queue_switch_gate test (another device's making
and teardown, memory allocated and freed on the device, dma-buf imports on the device) at both
places: between the round's two batches and after the last.

Why: the hung check's thread sat inside a vkQueueSubmit of its round, so its batches may both
have been pending; a hold after the last submission puts the calls beside that state.

Verification: not yet run; the 5080 and 3090 runs with and without the gate fix follow.
2026-11-11 23:31:48 -08:00
Anees Iqbal ae7bac688c Tests: the queue-switch gate holds a round beside memory made and freed and dma-buf imports on its device
What: tests::queue_switch_gate now holds the check's round between its two batches'
submissions beside three kinds of driver calls on a thread of their own: another device's
making and teardown (as before), 64 MiB of each memory type allocated and freed on the checked
device, and a scattered udmabuf imported dedicated to nothing as each type the driver lists for
it on the checked device (Linux, where /dev/udmabuf opens). Each must return in 20 s while the
round is held. export_after_dma_buf shares its udmabuf and raw import helpers.

Why: on the RTX 5080 (615.71.09) the other device's teardown went in 137 ms beside a held round
at every commit from d0f800ddd0 to 43d2308170 and at the fix's parent (b5080 entry
nv5080reg-gate-220403), so that test alone does not tell the fix from its absence. The leak
probe's hangs were imports on the checked device itself, so the test now holds the round beside
such calls too.

Verification: not yet run; the 5080 runs with and without the gate fix follow.
2026-11-11 23:31:48 -08:00
Anees Iqbal 837f36dd9a Test: zeroed_start says where the Shared texture's making spent its time
What: the ZEROED-START line now splits new_texture's time on its thread into time on a CPU,
time waiting on a run queue for one, and the rest (blocked: a lock, the GPU or the kernel), from
Linux's /proc/thread-self/schedstat ("unread" elsewhere), and lists the Vulkan objects the making
made on its thread (churn_counts::this_thread_makings).

Why: in the 5080 round at 43d2308170 the making took 12.15 ms with fills queued; alone on the
5080 it takes 1.3 to 2.1 ms (four runs at 43d2308170 and d0f800ddd0) and under the suite's load
2.3 to 50.9 ms (five runs at 43d2308170, the busy work still Scheduled as each returned). The
split tells a making that waited (blocked) from one that waited for a CPU under the load, which
the assertion alone (the busy work not Completed) cannot.

Verification: not yet run at this commit; 5080 runs under the suite's load follow.
2026-11-11 23:31:47 -08:00
Anees Iqbal 9bd8fa37a0 Test: zeroed_start's fill pace leaves out the target's zeros and takes the fastest of three probes
What: the test now uses its 256 MiB target once (one fill, waited for) before it measures the
fills' pace, and measures that pace three times, taking the fastest.

Why: since RUNTIME_VERSION 2074 (1249910772, the fill queue) a new Private buffer's zeros of
1 MiB or more run on NVIDIA's copy engine, in a submission the buffer's first batch waits for. The
test's one probe was that first batch, so it timed the zeros too, behind whatever held the copy
engine. In the 5080 round at 43d2308170 (beside the runtime suite) the probe read 58 ms a fill,
so the test queued 25 fills, which ran in under 0.5 ms each and completed before the 12.15 ms
making of the Shared texture returned; the assertion read that as the making waiting for them.
Alone on the 5080 the probe read 0.72 ms a fill at 43d2308170 and 0.50 ms at d0f800ddd0, and
under the suite's load (20 minutes, 24 tests at once) 1.2 to 12.5 ms at 43d2308170. Other work
on the GPU only slows a probe, so the fastest of three is the closest to the fills' own pace.
The product's behavior is unchanged.

Verification: not yet run at this commit; runs on the 5080 under the suite's load and on a 3090
follow.
2026-11-11 23:31:47 -08:00
Anees Iqbal 24f233db8b Queue-switch check: open each round's gate on the GPU, never from the host
What: a round of the queue-switch check now submits an opening first, on its first VkQueue:
the check's scratch buffer (4 MiB, device-local where the buffer takes it) filled `repeats` times,
each fill after a barrier on the ones before, signalling the gate timeline as it completes. The
round's two timestamp batches wait for that value, as before, so the GPU still holds both before
it runs either. The host no longer signals the gate (no vkSignalSemaphore). After the last
submission the check reads the gate: a round whose gate had already opened is late, counts for
nothing in the medians, and doubles the openings' repeats (up to 1024). Each submission of a held
round signals its own fence (three now), and the held step takes the loader word from before the
first submission.

Why: the old round submitted its first batch waiting on the GPU for a gate the host signalled
only after the second batch's vkQueueSubmit returned. On the RTX 5080 Laptop GPU (NVIDIA
615.71.09) beside the runtime suite, a gdb stack of the hung recorder_slots test showed the test
thread in another device's vkDestroyDevice and the check's thread in its round's second
vkQueueSubmit, the first batch waiting for the host's signal: neither returned (the test timed out
at 1201 s). The dma-buf leak probe's hang ("a buffer's making for 150 s") ended with the exit
waiting on the same submission section (queue_switch_check.rs:542 at 43d2308170). With the gate
opened by a submission made before any batch waits for it, every batch the check submits
completes with no further call of the check's thread.

The between hook of the device tests now holds a round after its opening and first batch, before
its second batch (tests::device_recovery, tests::queue_switch_gate). tests::queue_share_device
prints the check's late rounds (a test-only count).

Verification: not yet run at this commit; the queue_switch_gate test before and after this
commit, the queue-switch device tests and the three 5080 regression tests follow on the 5080 and
a 3090.
2026-11-11 23:31:47 -08:00
Anees Iqbal ab730bd240 Test: a device dropped while another's queue-switch round is held between its submissions goes
On the RTX 5080 Laptop GPU (NVIDIA 615.71.09) beside the runtime suite, tests::recorder_slots
hung 20 minutes: gdb showed the test thread in vkDestroyDevice of one device while another
device's queue-switch check sat in the vkQueueSubmit of its round's second batch, the first
batch waiting on the GPU for the gate the check's thread signals from the host after that call.

This test holds a round between its two submissions (QueueSwitch::between) and makes and drops
a second device on another thread meanwhile: the teardown must end while the round is held.
It prints QUEUE-SWITCH-GATE with what the teardown took. Not yet run.
2026-11-11 23:31:47 -08:00
Anees Iqbal 314cf11021 Test: icon_mips drops the uploaded leg behind a 256 MiB fill
The fill had completed by the time the sampling command buffer was
committed, on the M3 (m3-max-19440) and on lavapipe (19432), so the leg
never ran behind a command buffer in flight, as its name said. The held
legs keep that case: their command buffer waits for an event the host
signals after the sampling commit, and its status there is Committed.

Verified: run on the M3 and lavapipe in the jobs named in the report.
2026-11-11 23:20:47 -08:00
Anees Iqbal 031080050d Test: icon_mips's uploaded legs behind a command buffer in flight, and trilinear
The calls behind a window server's icons: a Managed 128x128 RGBA16Float
texture of five levels and ShaderRead usage, made with nothing
uploaded, then each level by one replace_region with bytes_per_image 0,
after the context's earlier command buffers were committed and possibly
still in flight, before the one that samples them.

The uploaded legs now commit a command buffer on the queue before the
uploads: one held in flight by a wait for an event the host signals once
the sampling command buffer is committed, or one filling 256 MiB. The
status of that command buffer at the sampling one's commit is printed.
Each icon is also drawn through a trilinear sampler into a target of
level 1's size, so its implicit level of detail is 1, as a dock half
the icon's size samples it.

Verified: run on the M3 and lavapipe in the jobs named in the report.
2026-11-11 23:20:47 -08:00
Anees Iqbal b1c1860b47 Test: icon_mips reads each target at its own size
A target of a level's size was read back at level 0's size, past its
edge, which the blit refuses.

Verified: run on the M3 and lavapipe in the jobs named in the report.
2026-11-11 23:20:47 -08:00
Anees Iqbal 226798f967 Test: icon_mips's uploaded legs print the host texel copies each round
Shows whether each level's replace_region ran as a copy on the host
(VK_EXT_host_image_copy) or through a submission, the path the draw and
the blit then read.

Verified: run on the M3 and lavapipe in the jobs named in the report.
2026-11-11 23:20:46 -08:00
Anees Iqbal e0a00704e2 Test: icon_mips, levels only the CPU writes, sampled through samplers pinned to each level
A window server's dock icons are Managed 128x128 RGBA16Float textures
of five levels and ShaderRead usage alone, each level written by the
CPU, which its draw samples at levels 1 to 4. If a draw sampled other
texels than a blit reads (two copies of a Managed texture, an upload
reaching one of them, or a view the draw binds), the icons would draw
wrong while every level reads right by a blit.

The new legs make 21 such textures a round, Managed or Shared, before
the command buffer that samples them or while it is open, and upload
each level's own colors by replace_region. That command buffer draws
every level of each through a sampler whose least and greatest level of
detail are the level's, into a target of the level's size. Each target
and each level read by a blit must hold what was uploaded.

Verified: run on the M3 and lavapipe in the jobs named in the report.
2026-11-11 23:20:46 -08:00
Anees Iqbal 2a7579adc4 Test: icon_mips, an icon's levels after a storage form, a later-commit form or a recycled image
A window server samples a 128x128 icon at levels 1 and 2 when it draws
a small dock. If a storage form switch, a swapped-out image or a
recycled image carried only level 0, those levels would read zero or
another texture's texels.

The test writes a 128x128 RGBA16Float texture of every level, with its
left half one color and its right half another at each level. It writes
them four ways: rendered per level sampling the texture itself (in
place, or through the copy), generate_mipmaps after a render of level 0,
and replace_region per level of a Shared texture. Then one of four
events: none; a fetching pass over level 0 committed alone, so the M3
gives the texture its storage form at that commit; the same with the
switch riding a later commit; or, before the icons, textures of the
same making with the colors swapped, completed and dropped, so the icons
take their parked images. Levels 0 to 2 are then sampled through a draw
into a target of each level's size and read back by blits. Counts print
the storage forms taken, the images recycled, the swapped-out images
forgotten and the read forms.

Verified: run on the M3 and lavapipe in the jobs named in the report.
2026-11-11 23:20:46 -08:00
Anees Iqbal f83ac1f93c Test: lone_fetch's surface made again over its pages after its renderer's texture went
A surface rendered by one process's texture and then opened by another
that never rendered it reads only what reached the surface's pages. If
any of the runtime's images (a fetch scratch, a shadow, an image in
place, a storage form) kept the rendered texels and never wrote them
back, the new texture would read the bytes from before.

The new legs check this. Each round a new no-copy buffer over the host
pages and a texture over it are rendered by the lone passes and
completed. The texture is dropped, and its buffer too, or kept while the
next one is made. A new buffer and texture over the same pages are then
sampled, and the pages are checked by the CPU. Each round prints the
pointer imports made, the import releases posted, the textures moved in
place and the images recycled, to show which path ran.

Verified: run on the M3 and lavapipe in the jobs named in the report.
2026-11-11 23:20:46 -08:00
Anees Iqbal f34408bcea Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-11 23:14:46 -08:00
Anees Iqbal d010ed576d RUNTIME_VERSION 2088: after a refused call the submission checks wait for the queue through a bounded fence, not vkQueueWaitIdle
The commits before this one. After a call refused among several, the submission checks waited
for their queue with an unbounded vkQueueWaitIdle (Objects::idle), so a submission that never
completed held the checks, and the device's teardown behind them, for good. They now reset their
fence, submit it alone (a vkQueueSubmit with no VkSubmitInfo signals once all earlier work on the
queue completed) and wait for it as for any check submission: past STALL (10 s, 2087) the checks
stall, announced, and leave their objects to the teardown. A refused fence-alone submission is
retried every 100 ms until STALL.

Verified (potluck jobs, on the branch): the new test
work_before_a_refused_call_that_never_completes_stalls_the_checks_and_the_teardown_returns fails
with the unbounded wait put back ("the checks never ended" at 12 s, lavapipe m3-max-19348) and
passes on lavapipe (19334: settled 2.002 s, teardown 2.003 s) and the M3 (19410: 7/7, settled
2.064 s). Lint (19422).
Not run: the 3090, the full suites.
2026-11-11 23:13:50 -08:00
Anees Iqbal 9a9b8ab39b Test: the refused-call stall test allows a use of one call before the stalled one, each with its relay mark
On the M3 Max (MoltenVK 1.4.2, m3-max-19393) the hold fell before a merge round's call of the
infos, which completed, so the checks made 9 calls from the hold on a device that relays its
queues' failures: that call and its mark, the four calls apart and their mark, and the fence
alone and its mark. lavapipe, which relays nothing, made 6.
2026-11-11 23:13:40 -08:00
Anees Iqbal edaca2d4bc Submission checks: the wait for the work before a refused call is bounded as any, and its test
Objects::idle waited for the first VkQueue to idle (vkQueueWaitIdle, no bound) after a call refused
among several. It now resets the fence and submits it alone after that work (vkQueueSubmit with no
VkSubmitInfo: the fence signals once all work previously submitted to the queue completed), then
waits for it as for any check submission: past STALL the checks take it as stalled, announced, and
the teardown handles its objects as any stalled submission's. A submission of the fence alone the
driver refuses is made again each 100 ms until STALL passed, then stalls.

Test: work_before_a_refused_call_that_never_completes_stalls_the_checks_and_the_teardown_returns
(the stall test's body shared): the next submission of several calls has its first info wait on a
timeline semaphore nothing signals and its second call answered VK_ERROR_OUT_OF_HOST_MEMORY unmade
(Injected::refuse_second); one submission of the fence alone follows, the checks stall at the 2 s
bound, the sink hears it once, nothing is recorded, and the device's drop returns after the bound
with its VkDevice live.
2026-11-11 23:13:40 -08:00
Anees Iqbal e300ac324c Submission checks: the wait after a refused call is a submission of the fence alone, bounded as any (test to come) 2026-11-11 23:13:39 -08:00
Anees Iqbal 2d7943d1bd Test: icon_coverage's device clears an unstored DontCare second colour, Metal's answer
The odd icons load their RG16Float second colour DontCare and never
store it, and the test expects Metal's answer there: zero wherever a
fragment reads it. The runtime gives that answer by default only on a
driver measured to clear such a load no slower
(DriverFact::UnstoredClearNoSlower; the M3's MoltenVK and RADV on the
780M). Elsewhere it hands the driver DONT_CARE, announced as
dont-care-unstored-load. On lavapipe that left the right half of those
icons' second colour holding an earlier texture's texels from the second
round on: 20 of 72 icons wrong in every form. The wrong texels were the
right half's middle and bottom rows, which read the second colour before
any draw writes it; the left half, which the mark writes first, was
right.

The device now takes UnstoredDontCarePolicy::Cleared, which is the
default's path on the M3, so the M3 renders as the guest's default does,
and Metal's answer on lavapipe.

Verified: under the default policy, 20 of 72 wrong on lavapipe with the
per-row profile above (probe jobs m3-max-19279 and 19282); under
Cleared, 0 of 72 (m3-max-19279). This commit's runs are in the jobs
named in the report.
2026-11-11 23:12:27 -08:00
Anees Iqbal 7039d79e8d Test: icon_coverage checks each icon by iterating the icons
Clippy (needless_range_loop) refused indexing the icons with a range
loop under --cfg m2v_gpu and --cfg m2v_cpu_icd. The loop now iterates
the icons with their indices, which checks the same icons in the same
order (the vector holds ICONS of them).

Verified: it was the only lint left under both cfgs (job m3-max-19113,
'due to 1 previous error'); the rerun is in the job named in the
report.
2026-11-11 23:12:27 -08:00
Anees Iqbal 925ea24bba Test: icon_coverage with the content pass's draws testing the stencil
The M3 run of 81bc1992a0 (m3-max-18770): 12 of 12 legs right; variants
made 1/0/0 a round, no host step, no pending-pipeline split, no draw
dropped. A form now clears the content pass's Stencil8 to 0 and tests it
across the split: the mark writes 1 over the left half, the first
coverage draw passes where it is 1, the second where it is not, so a
stencil lost between the pass's instances (or on a scratch path) shows
as a coverage draw run in the wrong half. Not yet run.
2026-11-11 23:12:27 -08:00
Anees Iqbal 8f6fa1a5eb Test: icon_coverage with states made new each round, and pipeline counts
The M3 run of f8a73b3916 (m3-max-18743): 10 of 10 legs right, 6 render
pass instances an icon (3 interlocked splits), 48 storage forms a round
from round 1. A restarted window server is a new process that makes its
states anew and draws each first in its first passes: a form now makes
every round's states, sampler and queue new on the same device (Private
bitmaps, and bitmaps over host pages with padded rows). Each round also
prints the variant pipelines made, host steps recorded, splits for a
pipeline still being made and draws dropped while one was. Not yet run.
2026-11-11 23:12:27 -08:00
Anees Iqbal a3682c838c Test: icon_coverage renders each icon's content, then copies its bitmap out
reims's per-pass diag (boot dd-1): the restarted window server draws
each icon's content in passes of many draws over a Private RGBA16Float
target loaded and stored, beside a fresh RG16Float second colour (Clear
or DontCare, stored DontCare) and a Stencil8, some draws fetching and
writing the second colour and some the first; then each bitmap is a
pass of one draw that samples the content into a texture over guest
bytes (Clear/Store) beside a fresh RG16Float and Stencil8 loaded and
stored DontCare. The test now draws that: the content pass adds a draw
that fetches and halves the first colour between the two coverage
draws, and the bitmap pass samples the content texel for texel into
the bitmap, which the CPU reads. The kept-second-colour form clears
every icon's second colour, as a driver's DontCare may keep the last
icon's there. Not yet run on a device.
2026-11-11 23:12:26 -08:00
Anees Iqbal 8d8651525c Test: icon_coverage's passes accumulate into the second colour
The M3 run of the earlier form (m3-max-18721, all ten legs right) split
no pass for interlocked writes: its only fetching draw read the second
colour and wrote the first. reims's per-pass diag (boot dd-1) shows the
restarted window server's multi-draw passes interleave plain draws with
draws that read and write the RG16Float second colour. The pass now
draws the mark, con_fetch_coverage over the middle rows (reads colour 1,
writes both), the flag, con_fetch_coverage again, and a read of colour
1 over the bottom rows: each coverage draw leaves colour 1 out of its
subpass, so the pass splits around it. Not yet run.
2026-11-11 23:12:26 -08:00
Anees Iqbal b7e4af171d Test: icon_coverage over bytes whose rows a linear image may not take
Icons over a buffer's bytes or host pages with rows 64 bytes past their
texels, as a surface's rows lie: MoltenVK's linear image lays rows one
after another, so such a texture is shadowed (refused pitch), as the
guest's icons over its buffers were (host_texture_shadows_refused_pitch
in reims's restart window). The threaded and own-command-buffer legs
over host pages take the padded rows. Not yet run.
2026-11-11 23:12:26 -08:00
Anees Iqbal 2c20f3f84e Test: icon_coverage prints the shadow and linear merge counts
Shadowed textures, linear merges recorded and shadow copies per round,
beside the instances, interlocked splits and storage forms: the icons
over a buffer's bytes may render through an image of the runtime's and
merge back. Not yet run.
2026-11-11 23:12:26 -08:00
Anees Iqbal 7607f364af Test: icon_coverage in the restarted window server's pass shape
reims's small-texture diag (boots pd-1, pd-2) gave the shape of the
passes a restarted window server draws in its first second: an icon of
128 to 224 pixels a side, ShaderRead, ShaderWrite and RenderTarget,
over a buffer's bytes the CPU reads, cleared and stored; a new RG16Float
second colour of RenderTarget usage alone, cleared or loaded DontCare,
stored DontCare; a Stencil8 of the same size, DontCare both ways. The
test now renders that: 128x128 icons, odd icons' second colour loaded
DontCare (Metal's answer there is zero), the fetch over the middle rows,
the icon's clear below them on the right, and the CPU reading the bytes
of icons over a buffer or host pages. Not yet run.
2026-11-11 23:12:26 -08:00
Anees Iqbal aec28c6289 Test: icon_coverage over a buffer's bytes and over host pages
Three more legs: the icons as textures over a Shared buffer's bytes,
and over host pages a no-copy buffer imports (one command buffer, and
four threads), as a surface's texture lies. Not yet run.
2026-11-11 23:12:26 -08:00
Anees Iqbal d9d4098cb8 Test: icons in a two-colour pass that fetches its RG16Float second colour
A 32x32 Private RGBA16Float target loaded DontCare and stored, beside a
RG16Float second colour cleared to the icon's own value and stored
DontCare: a mark into both colours, a draw that fetches the second
colour into the first, a flag into the first. On a device that fetches
through the pixel interlock the pass runs as three instances; on the M3
the second colour's first pass renders through a scratch and takes its
storage form at a commit. Four forms: one command buffer, one each with
all open before the first commits, one each on four threads, and one
second colour kept across icons and rounds.

Not yet run.
2026-11-11 23:12:26 -08:00
Anees Iqbal d75920d584 Keep-alives test: no-copy buffers announce no shared-in-system-memory; a copy announces copied-host-pages
a_buffer_inside_an_import_holds_a_deallocator_given_no_keep_alive (RUNTIME_VERSION 2083) expected
shared-in-system-memory on a device without unified memory, as a test's first Shared buffer of the
default CPU cache mode forces it (runtime_lane::shared_kinds). Its buffers are no-copy buffers over
the caller's pages, and the runtime announces that kind only of memory it allocates for a Shared
resource (Device::degrade_system_memory: new buffers, descriptor buffers, exported memory, heaps),
never of an import of the caller's pages, which cannot move to device-local memory as the notice's
advice says. So the test failed on every discrete device that imports the pages: the 5080 and the
3090 lanes of pin 44 (m3-max-19277; 'not announced: [SharedInSystemMemory] (counts
{HostDeallocatorDelayed: 1})'). The runtime is right; the test now expects no first-occurrence kind.

Its other branch, where the device does not bind the narrower buffer inside the wider one's import,
expected nothing announced while its doc says the buffer is a copy of its half there, which
announces copied-host-pages (CopiedBecause::OverImport): it now expects that kind.

Verified: see the landing report (3090, lavapipe and M3 lane runs, lint).
2026-11-11 22:56:25 -08:00
Anees Iqbal f8d1908461 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-11 22:44:27 -08:00
Anees Iqbal 1b8b1fe898 RUNTIME_VERSION 2087: a submission check whose fence never signals stalls at 10 s, and the device's teardown returns
The commits before this one. The submission checks' thread waited for each fence with no end.
On the RTX 3090, with several processes making devices at once, the driver at times never
completed a check's submission (the same runs logged Xid 69, 32 and 13), and the device's
teardown waited behind the thread for good (SubmitChecks::stop). A self-check must not end a
program's work (AGENTS.md rule 2). Now a wait past STALL (10 s) takes the device as lost for the
checks: nothing is submitted again, unanswered verdicts are Unchecked for the device's life,
nothing is recorded, and the sink hears metal2vulkan-submit-check-stalled (Info). The teardown
waits up to STALL more for the stalled fence and releases it once signalled; if it never signals,
DeviceShared::drop leaves the VkDevice to the process's end (the VkInstance kept alive with it). The
checks' report gains the longest wait. The video interop tests run alone on Linux
(.config/nextest.toml); HOWTO notes the 3090's Xid 69/32/13 under concurrent device makes.

Verified (potluck jobs, on the branch): the new test
tests::submit_check_device::a_submission_that_never_completes_stalls_the_checks_and_the_teardown_returns
fails without the bound ("the checks never ended" at 12 s, lavapipe m3-max-19084) and passes on
lavapipe (19181: settled 2.003 s, teardown 2.002 s), the RTX 3090 (19109) and the M3 (19146). 3090
stress, 8 processes x 6 rounds: 5 of 48 check submissions never completed, each announced after
10.0 s, every process ended (before: one process hung until the 90 s kill, 18786). Lint at the tip
(19179).
Not run: the full suites; the 3090 at the rebased tip itself (code equal to 370931db27).
Open: the queue-switch check's waits (nv5080reg) and Objects::idle's vkQueueWaitIdle are unbounded.
2026-11-11 22:43:29 -08:00
Anees Iqbal d3a347a1e1 Submission checks: the stall bound's measure; Xid 13 in the host note
On the RTX 3090 (NVIDIA 620.70.06), eight processes of the extra-queues test at once, 6 rounds
(m3-max-19109, the bound built in): 5 of 48 processes' checks met a submission that had not
completed at 10 s, each announced, its verdicts Unchecked, and every process ended (95 of 96 exit
0; the one exit 101 is the process of an Xid 32, whose own wait on its extra compute queue's fence
failed). Every other process's longest wait for a check submission was 1.3 to 12.0 ms; lavapipe's
0.05 ms (m3-max-19057). The same run logged Xid 13 (a compute class c7c0 exception) in one more
process, with no channel-ID allocation failure in the kernel log around it.
2026-11-11 22:43:20 -08:00
Anees Iqbal 430ab46902 The video interop tests run alone on Linux; a host note on the RTX 3090's pushbuffer errors
On an RTX 3090 behind a Thunderbolt 3 bridge (NVIDIA 620.70.06, Linux 7.3.3), six processes of
tests::video_interop::extra_queues_are_made_or_reported_and_the_video_features_enabled at once
(job m3-max-18786) met Xid 69 (class c797, offset 0x1b0c SET_REPORT_SEMAPHORE_D, ErrorCode 0xc,
data 0x2001c00d, itself a valid method header: the GPU read the method stream one word short) in
one process and Xid 32 (intr0 0x40000, PBENTRY) twice in another, 37 ms apart; two copies' empty
submission on the extra compute queue failed its fence wait, and one copy's submission checks
waited on their fence with no end. No PCIe error was logged then. The faulting processes of the
first report (um870, m3-max-18368) were video_interop tests too.

What was ruled out: every runtime VkQueue use holds that queue's lock (the queues audit), and a
probe that tracked each thread inside vkQueueSubmit, vkQueueWaitIdle, vkQueueBindSparse and
vkDeviceWaitIdle per VkQueue saw no two threads on one queue in 240 processes of the same shape
(m3-max-18977: 10 variants x 4 rounds x 6 copies: checks off, merge off, import tax off, no extra
queues, no video extensions, the test's submissions off, the validation layer). None of those
240 met the Xid either, so the variants decide nothing; 1 of the 18 earlier processes did.
Recorded as a host note (HOWTO.md), and the four tests run alone on Linux (.config/nextest.toml),
so no other process makes a device beside theirs.

Not run: a check that running alone avoids the error (it is too rare to show in a short run).
2026-11-11 22:43:20 -08:00
Anees Iqbal 7c5a452dac Submission checks: a submission that never completes stalls them at 10 s, and the teardown returns
The submission checks' thread waited for each of its fences in 100 ms slices with no end. On the
RTX 3090, with six processes making their devices at once, the kernel logged a pushbuffer error
(Xid 69, Xid 32) and one process's checks waited on their fence for good, its device's teardown
behind them (SubmitChecks::stop waits for the thread). An accuracy-free self-check must not end
a program's work (AGENTS.md rule 2).

Now a wait past STALL (10 s) takes the device as lost for the checks: nothing is submitted again,
what had not answered is Unchecked for the device's life, nothing is recorded, and the sink hears
metal2vulkan-submit-check-stalled. The stalled submission's fence and command pool stay pending,
so the thread leaves them to the teardown, which waits up to STALL more and releases them once the
fence signalled; where it still has not, the teardown leaves the device and its instance to the
process's end (as the exit path does) instead of a vkDeviceWaitIdle that would never return. A
step held whole lets go of the loader word without waiting for the relay mark of a stalled use.
The checks' report now gives their longest wait.

Test: a_submission_that_never_completes_stalls_the_checks_and_the_teardown_returns injects a
submission whose first info waits on a timeline semaphore nothing signals, with a 2 s bound; the
checks settle at the bound, the sink hears it once, nothing is recorded, and the device's drop
returns after the bound with its VkDevice still live; then the test signals the semaphore.

Not yet verified: build, lint, the test runs (to come in the following jobs).
2026-11-11 22:43:20 -08:00
Anees Iqbal 5479d8e547 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-11 22:42:54 -08:00
Anees Iqbal e0314da1c2 RUNTIME_VERSION 2086: a copied host buffer copies in again when a batch waits out an event its commit came before
The commits before this one. A copied host buffer (one whose pages the device can't import) copied
the caller's pages in at commit, before any batch was submitted. A command buffer that begins
with a wait on an event the host signals later, committed before that signal, so read the pages
from before the CPU's writes that the signal publishes; Metal reads them after the wait. The
commit now notes the batches that wait for an event value not yet reached, and submit_batch
copies those batches' copied buffers in again once their wait is met, with no command-buffer lock
held (command_buffer/copies_again.rs; counted: WorkCounts::copied_copy_ins_after_waits). A command
buffer with no such wait copies in exactly as before. Shadows over plain imports were already
ordered after the wait, and over logged pages a command buffer with an event wait already copies
every row.

Also test-only coverage of the guest window server's fetch shapes, from the Dock icon hunt:
waited_reads, lone_fetch (single-colour fetching passes, overlapping layers, host-page targets, a
pair of textures over one surface through two buffers, in flight on a second queue), icon_levels
and fetch_composite.

Verified (potluck jobs, on the branch): waited_reads' copied leg reads 3 of 6 wrong with the
copy-in-again call removed (M3 19227, lavapipe 19236) and 0 wrong with it (3 copies in again, one
per waiting command buffer); copied-no-wait copies 25,165,824 bytes over 6 commits in both, 0
copies in again. At 84b6b4295b: lavapipe 76/76 (m3-max-19273), M3 71/71 (19280); clippy plain,
m2v_gpu and m2v_cpu_icd, rustdoc, fast_paths, api_surface, api_signatures and published_crates
(19274).
Not run: NVIDIA, RADV.
2026-11-11 22:41:50 -08:00
Anees Iqbal 84b6b4295b Copied host buffers copy in again as a batch waits out an event its commit came before
A commit copies into each copied host buffer the bytes the CPU changed in
its pages, before any of the command buffer's work is submitted. A batch
that waits for an event runs its commands only once the event reaches
the value, and on Metal those commands read the pages as they stand
then. So a CPU write made after the commit and before the host's signal
(or before a later command buffer's signal) never reached the copy, and
the waiting command buffer read the bytes from before it.

The commit now notes, before its copy in, the batches that wait for an
event value not yet reached (CopiesAgain::unreached, from each event's
timeline). When the scheduler submits such a batch, which it does only
once the wait is met, submit_batch first copies in again
(copy_in_again): the copies the command buffer reaches, as at the
commit, take the CPU's changes since. This runs with no lock of the
command buffer held, since a copy over logged pages waits for the log's
publication. A batch with no wait, or whose every wait was already
reached at the commit, copies nothing more. The new counter is
WorkCounts::copied_copy_ins_after_waits.

The same mechanism serves a reader held by an event across queues: the
signal of a batch submitted while a copy is live is seen only at its
completion turn, after the merge back. The FAST-PATHS gap that listed
event-ordered reads across queues as stale now says the held reader
copies in again; that case is expected from the code and not run.

Docs: copied.rs (Coherence, the two-memories bullet, copy_in),
dirty_pages.rs (stamps), HOWTO (copied host buffers), FAST-PATHS (cost
row and gap), api_signatures.tsv (the new field).

Verified: waited_reads in the jobs named in the report. The copied leg
fails at cae2e24b4d and passes here; the no-wait copied leg makes 0
copies in again.
2026-11-11 22:35:50 -08:00
Anees Iqbal 388c2c0d14 Test: reads after a wait for the host's signal take the bytes written before it
A command buffer committed before the CPU writes the host pages it
reads, whose first command waits for an event the host signals once the
write is made, runs its commands after the wait on Metal, so it reads
the written bytes. The new waited_reads legs check this over three homes
of the pages: a plain import, an import whose memory is logged
(dirty_pages.rs), and a copy where the import gate refused
(copied.rs). Each reads through the buffer and through a shadowed
texture over it. A fourth leg runs the same rounds over a copy with no
wait, and prints the bytes each commit copies in, for the cost check of
the fix that follows.

From the code, the copy's copy-in is taken at the commit
(command_buffer/mod.rs, copied.rs Coherence), before the wait. So the
copied leg is expected to fail until it is fixed. The log type of
dirty_pages_device is shared with the new test.

Verified: run on the M3 and lavapipe in the jobs named in the report.
2026-11-11 22:35:49 -08:00