Commit Graph
729 Commits
Author SHA1 Message Date
Anees Iqbal b7572e8312 📝 Record which usage bits a texture answers and ends the process at [ci skip]
Q36 holds oracle_surftex's sixth and seventh rounds on the M3 Max, the AMD
5300M and the Intel UHD 630: the atomic bit and 0x8 left out of every
texture's answer, the formats the atomic bit takes, and the usage bits
Metal's validation ends the process at.
2026-11-13 16:44:56 -08:00
Anees Iqbal 9cb5693ab5 📝 Measure what crosses an x4 link per present [ci skip]
On an RTX 3090 or RTX 2080 behind an x4 or Thunderbolt link the walk ran 20 ms
of GPU time a present, against 2.8 ms on the RTX 5080 Laptop GPU, and moved 25
to 44 MB a present across the link. Device-cache fills and downloads were the
same on all three, so they don't explain it. The extra bytes go from the GPU
to the host: the window's swapchain is the runtime's GPU's, and where the
compositor runs on another GPU each window present moves a LINEAR copy of the
window's image (29.75 MB at 3648 x 2039) across the link. The window presents
0.93 times for each guest present, so each carries a new frame. The 3090's
link moves 1.83 GB/s from the GPU from any queue family, and NVIDIA presents
only from its graphics family, so neither another present queue nor the copy
engine would help. Only fewer bytes per present would.

The swapchain module's doc records that platform fact. design.md (Decided, 14)
records the walks, the link's and the compositor GPU's rates, and how much the
guest's frames change a present (6.27 MB of 29.7 MB on average, measured with a
build that is not landed, steelbrain/x4link-damage at 32bfa734c). It lays out
two routes for the owner to choose between, neither built: the window shown by
the compositor's GPU from a copy of the changed tiles, or from the presented
surfaces in place in guest RAM. For each it gives what is measured and what is
not, what it touches, and its fallback.
2026-11-13 16:44:31 -08:00
Anees Iqbal 459e76e6af 📝 Record what in-place surfaces cost on discrete GPUs [ci skip]
Decided 14 gains two items. The first is the measurement of surfaces in place
first on a GPU of its own memory (steelbrain/routeb, unlanded) against
development at b615cec64, one walk per GPU on an RTX 5080, an RX 7900 XTX, an
RTX 3090 and an RTX 2080. The GPU then reads the layers it composites across
its link at each present: at 16 GB/s it costs a 5080 3x the GPU time and 6% of
the presents, the XTX is level, and the two x4 links saturate at 1.6 to 2.4
GB/s with the steps' presents three to nine times fewer. In place first also
took RADV's shadows off most of the video's frames.

The second is a proposal, not built: every surface in place first and a device
cache only once the guest's use shows a surface re-read unchanged, counted on
the host, promoted through a kext notice, undone at a CPU write, with every
guest-visible value kept. Its runtime side, moving a no-copy buffer and its
textures into device memory at the same GPU address, is metal2vulkan's.
2026-11-13 15:41:19 -08:00
Anees Iqbal e617b1a999 🐛 Keep no-copy buffers and function tables NonVolatile
Metal's no-copy buffers answer NonVolatile to every purgeable state they are
told, on the M3 Max, the AMD Radeon Pro 5300M and the Intel UHD 630 alike
(oracle_bundle purgeable.kinds), as views, textures over buffers and heaps'
resources already do here: the host backs none of them with a purgeable
allocation of its own. The bundle's no-copy buffers kept the state told.

A visible function table answers NonVolatile on the M3 Max and the Intel 630,
where the AMD 5300M keeps the state told; the bundle answered the AMD's (2,
then 3 when asked). It now answers the M3's and the Intel's on every guest.

What the guest sees: setPurgeableState: on a no-copy buffer or a visible
function table answers NonVolatile, whatever was set before, and isPurgeable
answers NO. Every other resource keeps the state told, as before. The oracle
doc records the measurement (Q35), and both guest sets are rebuilt.
2026-11-13 14:24:45 -08:00
Anees Iqbal 0ab4ed4c11 📝 Say how the GL renderer's settings decide GL's provoking vertex [ci skip]
gl_cases' provoking-line-last fails in arm64 macOS 27.0.1 guests on the M3
Max and passes on the M3 Max itself. The renderer picks per-vendor settings by
the device's vendorName, then by Apple7 and Apple5, and only its Apple and
AMD settings send setProvokingVertexMode: to the encoder. Under the others it
reorders a triangle's vertices itself and leaves a line's first vertex
provoking. Our device answers the host's vendor, "AMD" for any other, and no
Apple family, so its guests take NVIDIA's settings, or Intel's on an Intel
host. The x86 Macs measured take the same: the Intel 630's Metal GL renderer
fails the same case, and the 5300M's Metal device is not of the class AMD's
settings need. The M3 Max sends the setter at every case (traced).

The same settings send GL_POINT polygon mode as setTriangleFillMode: 2, which
the M3 Max and the 630 draw as the triangle's vertex points. The Vulkan
platform has no such mode, so a guest given Intel's settings would die on it.
2026-11-13 14:01:39 -08:00
Anees Iqbal e50601af41 📝 Record the xHCI completions and usb-host's off-loop alt setting [ci skip]
docs/qemu.md's table of the branch's QEMU changes gains 3d04e62f and
926fc8dc (each command's own Command Completion Event) and 78b3270c (no
usbfs call on a device while it sets an alternate setting), and the USB
passthrough section the before and after boot of 78b3270c (m3-max-26476):
the output interface's alt-0 calls no longer stall QMP.
2026-11-13 13:11:55 -08:00
Anees Iqbal 75629b2f32 📝 Record what Metal's base answers under the M3 Max's profile [ci skip]
The arm64 guest's device answers the x86 Macs' feature profile, 10002,
where the M3 Max answers 10. oracle_profile measured what Metal's base
device answers under each: under 10 it answers 123 members the device
leaves to it as an Apple GPU's, memoryless targets, tile memory, sparse
textures, Metal 4 queues and mesh commands in indirect command buffers
among them, which the host's GPU lacks. So the profile, and the tiled
texture SPI WindowServer asks under 10002, stay as they are until the
device answers those members itself.
2026-11-13 13:05:57 -08:00
Anees Iqbal 674370fdc2 📝 Record the M3 Max's answers to the rest of the x86 rules [ci skip]
Q34 gains the answers arm64rules2 measured on the M3 Max under macOS 27.0.1:
the depth/stencil queries, ids and words the arm64 guest now takes, and
those the M3 gives as the x86 Macs do (a state's resourceIndex and
uniqueIdentifier, dynamic library refusals, a dylib's exported function,
texture addresses, the indirect command read-back), so they stay as they
are.
2026-11-13 13:02:55 -08:00
Anees Iqbal 1b7ce9c948 🐛 Keep the device's event BH to QEMU's exit
vendor/qemu moves to baa655fe. reims-graphics-pci's teardown deleted the BH
that the window's input and the cursor's callbacks schedule, right after
the library's release, and set it to NULL. A window callback already
running on the window's thread as the release closes the window, or a
cursor callback of a device thread the release's 5 s bound left running,
then scheduled NULL and ended QEMU with SIGSEGV at its quit. The BH now
stays to the exit and drops the events it finds once the console is
closed. Read from the code; no run reached the crash.
2026-11-13 12:38:11 -08:00
Anees Iqbal 99d927a987 📝 Record the desktop over a timed Metal app as a trap [ci skip]
Apple's Modern Rendering sample ran 8% slower on the RTX 3090 in each run
after 843056209, with WindowServer at 6 times the render encoders, and the
commit was blamed. The runs' desktops differed: an active window with a glass
sidebar lay over the sample, which the harness never brings to the front, and
WindowServer drew twice the command buffers at three times the encoders. One
build read 4.74 frames a second with the Finder window over the sample and 5.18
with the sample in front, so the lesson says how to spot the next one.
2026-11-13 12:21:54 -08:00
Anees Iqbal 1b7d9ab609 🆕 Count the control ring's full spells, waits and dropped VBLANKs
Every process's ring-0 answers, the present answers and the display's events
share the one control completion ring. When it had no room, a VBLANK was
dropped silently (the guest sees no event for that refresh) and the posts that
waited left no trace, so no boot could say whether the ring ever filled.

The device now tells its host of each kind (Host::ring_degraded,
RingDegradation): a full spell at its first post that found no room, a post
that waited once it goes on, and a dropped VBLANK. It logs each kind's first
at warn, which the library's logger writes once per kind and counts after.
reims-vgpu counts them by code (answer::count_kind) into the degradation
counts line: control-ring-full, control-ring-post-waited, vblank-dropped.
Diagnostics only: what the guest sees is unchanged.
2026-11-13 12:20:14 -08:00
Anees Iqbal 7fc3deed4e 📝 Record the device's QMP and BQL waits as a lesson [ci skip]
QMP's screendump held every QMP monitor while the display read it waited
for never ended, and the teardown's release under the BQL waited for a
route call that took the BQL. Both are traps of the same kind: a host call
that waits on device work while holding what other parties wait for. The
lesson says how each showed and how to spot the next one.
2026-11-13 12:10:36 -08:00
Anees Iqbal 1cb207d09e 🐛 Release the device at QEMU's quit with the BQL let go
vendor/qemu moves to 104d7b18. route_doorbell, which the library calls on
its ring-0 and control threads as a command queue is made or ends, takes
the BQL, and the teardown at QEMU's quit held the BQL across the library's
release of its last device, which waits up to 5 s for those threads: a
route call waiting for the BQL at that moment held the quit for 5 s and
left the GPU device to the exit (commitpath2's teardown race). The release,
and nothing else of the teardown, now runs with the BQL let go: the route
call takes it, finds the routes the teardown closed, and returns. Routes
still change only under the BQL, before the queue's create or destroy is
answered. QEMU's commit lists each callback that can run in that window
and what it finds. No C API change: the library already allowed either.
2026-11-13 12:10:36 -08:00
Anees Iqbal 6f4ff80cd2 🐛 Answer a QMP screendump within 3 s of the display read it waits for
vendor/qemu moves to 17098f76. A screendump waits for the console's read
of the display, which waits for its draw on the GPU, and QMP runs one
command at a time on every monitor: a GPU that never answered the read
(NVIDIA's Xid 109 on the RTX 2080 and RTX 3090, 11-12) left every QMP
monitor without an answer to the quit, so reims-ctl and the harnesses,
which drive VMs through QMP, lost the VM. A read still under way 3 s after
its start is now late: the screendump waiting for it, and every update
until the read ends, is answered with what the console shows, the frame of
the last read that ended or QEMU's placeholder where none has. A read that
ends within 3 s is waited for as before, so a screendump on a GPU that
answers still shows the frame the display shows. 3 s leave reims-ctl's
viewer, which waits 5 s for a QMP answer, 2 s of margin.
2026-11-13 12:10:36 -08:00
Anees Iqbal e5bcaf123d 📝 Record an Apple GPU's answers where x86 rules differ [ci skip]
dgpu-oracle.md gets Q34: what the M3 Max under macOS 27.0.1 answers, with no
validation layer, where the bundle took the x86 Macs' rules for an arm64 guest,
measured on 11-13 by oracle_surftex's fourth and fifth rounds and
oracle_bundle's new cases, its argbuf.ds.* and oracle_mesh's icb (m3-max-26136,
26149, 26152, 26237, 26239): textures over a surface, views, Shared heaps,
linear alignments, depth textures over a buffer, depth/stencil states in
argument buffers, mesh indirect command buffers, option bits 17 to 19, the
IOSurface buffer and tiled texture SPI, and the register's x86
respondsToSelector verdicts the M3 answers otherwise (50 of 67). Each row says
what an arm64 guest's device now answers. Q9 and Q20 point there; the probes'
README names the new cases, and the device's comment on rgfxAppleRules names the
rules it now covers.
2026-11-13 12:10:36 -08:00
Anees Iqbal c178927136 🐎 Check argument overlaps without following the entry's body
Batch 41's overlap check (1fc43b257) runs at every newFunction with constant
values whose arguments may overlap. It ran rgfxAirSpecialise, which runs the
module's initialisers and then follows the entry point's body twice, with the
values and blind. The check reads only the initialisers' globals: each
argument's predicate, index and count. The body passes were 99.5% of its cost.
For VideoToolbox's VTMTSComputeFunction, which its pixel transfers make for
every tile of a HEIC decode, a specialisation took 35.6 ms against 0.19 ms for
the initialisers alone (measured on the M3 Max, macOS 27). The guests' heic
step slowed from 6-7 ms a tile to 52-104 ms on every GPU.

rgfxAirConstantGlobals runs the initialisers alone, through the same
Specialiser and the same reading of its memory that rgfxAirSpecialise uses for
its globals. RgfxOverlappingArgumentError takes its globals from it. The
answers are unchanged, and test_overlapping_arguments_refused_as_metal still
compares each against Metal's. A new shell test counts the bodies followed over
sixteen makes each of a function that is made and one that is refused, with the
same values: none.
2026-11-13 11:19:22 -08:00
Anees Iqbal f40f2d9e92 📝 Say design.md's device is the one lane, for both guest arches [ci skip]
The Goal still called the device "a second lane beside the Apple paravirt
lane", and Decided 1 kept arm64 guests on that lane. The paravirt lane was
deleted on 2026-11-07, and since 2026-11-08 arm64 guests from macOS 14 take
the device's arm64e set on Ambrosia (Decided 13). The Goal now describes
the device as it is; Decided 1 stays as the record it is, with a dated line
saying what superseded it.
2026-11-13 11:10:26 -08:00
Anees Iqbal 1c88f72c8e 📝 Drop design.md's comparison with the apple-gfx lane [ci skip]
The surface-pages passage said the host maps a surface's guest pages "as the
apple-gfx lane maps guest memory". That lane is gone, so the comparison names
nothing a reader can look up; the map QEMU gives is the whole statement.
2026-11-13 11:10:26 -08:00
Anees Iqbal 4fea044105 🔥 Delete run_vmapple.sh and the tour that drove it
run_vmapple.sh booted a Virtualization.framework guest on vmapple with
apple-gfx and AVPBooter, all three gone: make qemu builds no aarch64 QEMU,
apple-gfx left the library and QEMU, and AVPBooter no longer boots on
vmapple's layout. vm_drive.py ran its tours through it, and vm_ocr.swift
served vm_drive.py alone. The window's walk, their last user, boots on
Ambrosia since ea18b7f17; arm64 guests boot as docs/qemu.md, "arm64
guests", says.
2026-11-13 11:10:25 -08:00
Anees Iqbal 80a97ebef9 🐛 Sync a surface copy again once a CPU write lock is let go
A copy of an IOSurface synced at a commit while another process's CPU held
the surface locked for writing copied the pages half written, and kept them:
IOSurface moves the surface's seed at a read-write lock, not at its unlock,
so the seed the copy recorded was already the one the finished write leaves,
and nothing synced the copy again until the next lock.

IOSurface keeps a second seed, the unlock seed, which unlockSurface moves at
each read-write unlock (and a GPU write moves with the lock seed), so the two
differ while a CPU holds the surface locked for writing; IOSurface itself
reads them so, and the Mac's GPU families (IOAcceleratorFamily2, IOGPUFamily)
import its getter. The device cache's op 3 is no unlock: IOSurface calls it
inside the lock, after op 2, and calls nothing at the unlock (read from
IOSurface's code in macOS 26.7.1's KDK).

The kext answers a surface's two seeds (SurfaceSeeds, selector 13, kext
feature 1 << 10, set only where IOSurface exports getUnlockSeed, which the
kext references weakly). A copy synced while the two differ records the
unlock seed in its header with a mark, and each commit that uses it asks
the kext again until the unlock seed moves, then syncs once more. A copy
synced with no write lock held asks nothing, so a commit costs what it did.
A named GPU write records its seed and clears the mark, as its seed already
stood over a CPU's write held meanwhile. The surface copies report counts
the uploads made mid-write and the asks.
2026-11-13 11:10:25 -08:00
Anees Iqbal a8a54ad6fc 🐎 Keep heap colour textures compressed where Metal does
exact_policy forced HeapCompressionPolicy::Uncompressed on every device. On the
Iris Xe (ANV, the one driver whose compressed images may keep their texels
apart from their bytes) that gave a guest's Private heap render targets an
uncompressed image and cost them the driver's fast clear: a guest's clear of a
2048x2048 RGBA8Unorm render target in a Private heap took 146.9 us of GPU time
against 28.6 us now (25.8 to 28.7 us for one in memory of its own), and a copy
of it 294.1 us against 148.2. The platform now takes the runtime's default,
Compressed. REIMS_VGPU_EXACT=all still takes the uncompressed form
(exact_answers()); no other name does.

What the guest sees change, on the Iris Xe alone:
- heapTextureSizeAndAlignWithDescriptor: answers the compressed image for a
  colour texture Metal keeps losslessly compressed (allowGPUOptimizedContents,
  no ShaderWrite, PixelFormatView or ShaderAtomic usage, 16 texels or more a
  side) whose image is 64 KiB or more: its alignment moves from 0x1000 to
  0x10000, its size kept (0x1020000 bytes for that 2048x2048 render target).
  A smaller one keeps the uncompressed image a 4 KiB alignment holds, and its
  answer (0x4080 at 0x1000 for a 64x64 BGRA8Unorm texture). The x86 Macs
  answer 4096 (UHD 630) to 65536 (Radeon Pro 5300M).
- Such a texture in a Private heap is the driver's compressed image, so a
  write through a buffer or texture over its bytes may leave its texels as they
  were. Metal's compressed texture shows no such write as written either: an
  M3 Max reads opaque magenta in drawn content a buffer fill over its bytes
  covered. Heaps over the guest's pages (Shared heaps, the bundle's slabs) take
  an image over the pages under either form.

heap-texture-compressed moves from DIES to the relayed precision kinds, with
that M3 measurement as its reason: Metal's own answer there is not one value,
so a strict run no longer dies where the Iris keeps Metal's compression.
Other drivers keep the optimal image they took before under either policy.

Cold boots of macOS 26.7.2 and 14.8.9 on the Iris (desktop, Finder, Launchpad,
Mission Control, Safari, Maps) logged no fatal line, and their apps made no
such texture: only the guest microbench that measured the clears did.
2026-11-13 10:36:40 -08:00
Anees Iqbal 95843e7838 ✅ Prove a route waiting for the host's lock holds up nothing
QEMU applies a doorbell route under the BQL before route_doorbell returns,
so a ring-0 thread may wait for the BQL inside the device. That is safe
only if the device calls the route functions holding no lock of its own,
and no device function a host calls under the BQL waits for a thread
inside one. The device module's doc now names each call site and what it
holds: a QUEUE_CREATE, OBJECT_DESTROY or CONTEXT_CLOSE on the context's
lane (a ring-0 thread or the control thread) after the queues' table and
the ended rings are let go, and a reset on the resetting thread after it
let go of ring 0, the display, the completion ring, the table and the
ended rings. QEMU's registers are lockless, and its reset holds the BQL,
which its route function sees. What a host calls under its lock waits at
most for the control thread's display message, a ring's take or post, or
the table; the last device's release waits for the threads at most 5 s.

the_host_s_lock_held_around_its_calls_while_a_route_waits_for_it_holds_up_nothing
gives the test host a stand-in BQL its route functions take: while a
create's route waits for it, the thread holding it reads and writes the
registers, rings ring 0's and the queue's doorbells and resets the device,
and a watchdog ends the process if any call never returns. The route the
create took goes once the lock is let go. The C API and api.md name the
control thread among route_doorbell's threads, and design.md says which
hosts offer DOORBELL_ASKS.
2026-11-13 09:50:12 -08:00
Anees Iqbal 28250f0bed 🐎 Route plain queue doorbells to KVM where the guest asks apart
Every command queue doorbell write exited to QEMU and ran the library on
the guest's vCPU, though only a buffer that asks for its CB_SUBMITTED can
be answered there; the rest need only the queue's thread woken. Measured
on the Radeon 780M host, a doorbell QEMU takes as an ioeventfd costs the
guest 8.9 us and one run through the library 13.4 us, of a 17.1 us
commit.

The device offers DOORBELL_ASKS (feature bit 43, FEATURES_HI bit 11): a
guest that takes it writes an asking buffer's doorbell with the ring's
id and RGFX_DOORBELL_ASKS (bit 0), and every other doorbell with the id
alone. The device then answers at the doorbell only an asking write, and
gives each queue an eventfd its thread sleeps on, which it hands the host
with the ring's id (route_doorbell, a new C API callback at the end of
RvgGraphicsCallbacks, its second version). QEMU adds it as an ioeventfd
matching the id exactly, so KVM wakes the queue's thread in the kernel and
the vCPU goes back to the guest with no exit; the asking write matches no
route and reaches the library as before. A guest without the bit sees
nothing new: every doorbell is answered as before, and no queue is
routed.

The device routes at most 128 queues (KVM holds 1000 devices on its MMIO
bus, and QEMU ends the VM where KVM refuses one); a queue past them, or
one the host refuses, keeps its doorbell on the write, logged once per
kind and counted. A route goes as its queue ends, before the destroy,
close or reset is answered, and QEMU drops it under the BQL before the
callback returns, so a queue made again over the same ring gets every
write. The thread drains the eventfd and walks its ring on each wake, so
coalesced writes take every buffer in ring order.

QEMU's side is vendor/qemu d81bcaac. The guest's side, the ROM's record
and both guest sets follow.
2026-11-13 09:50:12 -08:00
Anees Iqbal 8430562098 🐎 Hold textures, views and Managed creates with the destroys
A texture's create (TEXTURE_CREATE), a view's (TEXTURE_VIEW), a Managed
texture's and buffer's (MANAGED_TEXTURE_CREATE, MANAGED_BUFFER_CREATE) and a
Managed buffer's modified range (BUFFER_DID_MODIFY_RANGE) are messages no one
waits for, each its own Submit call: on the RX 7900 XTX host 8 to 13 us each,
812 of them and 8.8 ms a Vision process. SubmitBatch now takes them too, each
of its one size, checked as Submit checks it, a create for a context closed
since its check destroyed behind it (rgfxSubmitBatchSize). None names a block,
which spans_test keeps. The bundle holds them with the destroys and the
heap-placed buffers (RgfxSerializer::postUnwaited), in their order, posted
before anything else the process posts or asks of the kext and before any
command buffer it commits. A texture over an IOSurface still goes at once, as
a present of the surface waits for it, and so do the creates that name a block.

This changes what the guest sees under transport exhaustion only (the control
ring full for 5 s, or the device stopped), as 628b03fb3 did for heap-placed
buffers: such an object made then is answered as made, held, where its refused
post answered nil. Its refusal reaches the app where Metal's caller sees a
lost GPU's: the next post retries what is held and is refused in that same
call where the held are refused again; a create that needs the held gone to
make room is refused at once; and a commit that finds anything but destroys
held fails its command buffer, unposted, with MTLCommandBufferErrorInternal.
postHeldCreates already answered so for every held type; serializer_tests'
test_held_creates checks each kind on its own, and protocol_tests'
test_commit_behind_an_untaken_buffer_fails a texture through a commit. A
create the host refuses was answered by no one before, and is not now.
2026-11-13 09:01:40 -08:00
Anees Iqbal 170976bcae 🆕 Measure where Metal refuses arguments at one location
oracle_overlap makes functions whose arguments of one argument table take
overlapping locations under function constants, by every way of making a
specialised function, and prints each answer and error. The AMD 5300M and the
Intel 630 on macOS 26.7.1 and the M3 Max on macOS 27.0.1 answer the same: Metal
refuses such values where it makes the function, with one line per argument
that overlaps an earlier present one. The guest's bundle accepted them, so the
host refused the pipeline later instead. Q33 records the answers. [ci skip]
2026-11-13 08:43:21 -08:00
Anees Iqbal f1ffa96c22 📝 Record the rebase that reset a file and dropped a landed change [ci skip]
The ring 0 trace commit landed records.rs as it stood before the warm pass's
bound, so the bound and its tests went together and every check passed; only
an Iris Xe walk showed the warm pass never ending again. The lesson says how a
merge spots the next one: a changed file whose new blob equals an older one.
2026-11-13 08:22:37 -08:00
Anees Iqbal 55137c25f4 📝 Say why macOS 11's coreaudiod dies on a sound device of both streams [ci skip]
appwalk8's 11.7.11 walk lost coreaudiod in AppleVirtIOSound's ring code,
which read as a new fault in our virtio-snd. 11.7.11's plug-in frees an
input stream's ring under its four posted receive buffers, which the device
completes at RELEASE, so on one device of both streams any sound can kill
the daemon, on QEMU from before our capture changes too. reims-ctl's two
devices start no input stream for a sound. docs/qemu.md gives the boots and
the code read, and lessons.md the trap: a failure only the harness's device
config reaches is the harness's.
2026-11-13 07:43:32 -08:00
Anees Iqbal fc80b3d67d 📝 Give make qemu's ninja build its measured times [ci skip]
The Makefile's comment said a clean build through QEMU's Makefile took about
7 minutes. Measured on um870 (16 threads): 310 s at QEMU's -j1 against 59 s
at ninja's default, the same 1951 steps and the same binary. docs/qemu.md
keeps the measurement; the comment cites it.
2026-11-13 04:02:54 -08:00
Anees Iqbal 082fa9edd7 🐎 Build make qemu's QEMU with ninja at its own parallelism
make qemu built qemu-system-x86_64 through QEMU's Makefile, which hands
ninja -j1 where make was given no -j: a clean build ran one compile at a
time, about 7 minutes on ms01 and um790 (warmbound). The qemu target now runs
ninja itself, which builds at its own default parallelism, or at a caller's
-jN, and has meson regenerate build.ninja where a meson file changed, as
install-ctl.sh's build already relies on.

QEMU's Makefile also ran configure again where vendor/qemu's configure, its
meson options script, its Python dependencies or its VERSION were newer than
config-host.mak: the target's own check of when to configure now takes that
case too, so a submodule move configures as before. The binary built is the
same target's.
2026-11-13 04:02:54 -08:00
Anees Iqbal b0b7cd4834 🐎 Look for a lifecycle answer before sleeping for it
The device answers most lifecycle messages the kext waits for within tens of
microseconds of the post (a heap texture's size, a library's lookup, a
surface's pages: 60 to 110 us on the RTX 3090 host), and the answer then waited
for the interrupt, the work loop's wake and the waiter's, about 25 us more
(measured in a Vision request). postLifecycle now looks for its answer for at
most 150 us before it sleeps (RgfxAnswerLook.hpp): where the control
completion ring holds a record the work loop has not taken, it takes the ring
in the work loop's gate, as the work loop does, and else pauses the CPU. It
never waits for the gate (an IOCommandGate's attemptAction): the event hooks its
holder runs take the release table's lock and the pipe clients', which a
waiter's caller may hold, and only the sleep's deadline bounds that wait, as
before. The rest of the work loop's service follows at the interrupt the record
raised. Only a thread whose call waits for an answer looks, and only that long.
No answer or order changes. Tested by answer_look_test.


Measured, Vision cold request, RTX 3090 host (rts4, the branch without this
commit, against the branch with it; host load 3.0 and 5.4), first process /
second: a heap texture's size and alignment, 60 calls, 36.3/36.6 -> 26.2/25.3
us a call (its answer's leg after the post 12.7 -> 2.4 us); a library lookup
78.8/87.0 -> 52.0/53.1 us; a surface block's ask (its SURFACE_PAGES), 123
asks, 232/215 -> 173/178 us, 32.0/27.5 -> 25.3/24.1 ms. A pipeline create
whose compile outlasts the look is answered as before.
2026-11-13 04:02:31 -08:00
Anees Iqbal 628b03fb37 🐎 Hold heap-placed buffers with the destroys around them
A heap's buffer at an offset (BUFFER_AT_OFFSET, each small buffer of a slab) is
a create no one waits for, and cost its own kext call: 3079 a Vision process,
12 to 15 us each, 40 to 48 ms a process on the RTX 3090 host, between the
destroys, which broke each held run of destroys into one call of about 11.
SubmitBatch now takes BUFFER_AT_OFFSET too, of its one size, checked as Submit
checks it, and a buffer made for a context that closed since its check is
destroyed behind it, as Submit does (RgfxSubmitGate's rgfxSubmitBatchSize;
spans_test checks no message the batch takes names a block). The bundle holds
each buffer with the destroys, in their order, and a command buffer's commit
posts what is held before the buffer goes on its ring, as the host reads a
command buffer after the control ring's messages posted before it.

This changes what the guest sees under transport exhaustion only (the control
ring full for 5 s, or the device stopped):
- before, the buffer's create was refused there and the buffer was nil; now
  it is answered as made, held, as Metal makes objects on a GPU that is gone;
- before, a command buffer committed on a stopped device was never answered,
  and the run hung at its wait; now a commit that finds a buffer still held
  fails the command buffer, unposted, with MTLCommandBufferErrorInternal
  ("Discarded (victim of GPU error/recovery)"), the host's own recovery error,
  as the buffer may name it;
- the next post retries what is held and is refused where it is refused
  again, and a buffer that needs the held gone to make room is refused at
  once, holding nothing more.
Tested by serializer_tests' test_held_buffers and protocol_tests'
test_commit_behind_an_untaken_buffer_fails.


Measured, Vision cold request, RTX 3090 host (rts2, the destroys held,
against rts4, this commit and the next two; load 3.4 and 3.0): destroys and
heap-placed buffers together 62.0 -> 17.6 ms in the first process (3079
buffers and 294 destroy calls become 688 SubmitBatch calls), 51.6 -> 16.1 ms
in the second.
2026-11-13 04:02:30 -08:00
Anees Iqbal 7e8ea3c46f 🐎 Post a process's destroys in one kext call
Each destroy cost the guest a trip into the kext, and a post that found the
host's control thread asleep a doorbell's exit too: 14 us a destroy in a Vision
request on the RTX 3090 host, 3415 destroys and 68 to 70 ms a process, in runs
an app lets go back to back. The kext now carries SubmitBatch (selector 5,
feature bit 1 << 1): the bundle holds each destroy (RgfxRingWriter::postLater)
and posts what it holds in one call of at most 4096 bytes, before anything
else the process posts or asks of the kext (every IOConnectCall goes through
rgfxKextConn, which posts the held first), once the held fill a call, or 1 ms
after the first held. The kext checks each as Submit checks one, all before it
posts any, puts the runs on the ring under one hold of its lock with one
doorbell at most, and ends a queue's as Submit does. A texture over an
IOSurface goes at once: a present of the surface waits for its destroy.

What an object lay over goes back as its destroy is held, as it went back once
the destroy was posted: whatever takes it again is posted after the destroy,
so the host drops the object first, and every answer the guest reads (a heap's
usedSize, a new object's GPU address and resource id) is the one it read
before (shell_tests' test_held_destroys_change_nothing_seen). Where the kext
stops taking them (control ring full 5 s, or the device stopped), the rest stay
held; the next post retries them under its own bound and is refused only where
they are refused again. The one difference, under that exhaustion only: what
the held destroys lay over has gone back, so a heap's usedSize read during a 5 s
stall of ring 0 reads lower than before (design.md, "Destroys go together").

Measured, Vision cold request, RTX 3090 host (rts1 against rts2, load 3.6 and
3.4): destroys 69.6 -> 18.6 ms in the first process, 67.7 -> 14.7 ms in the
second; all kext calls 216 -> 162 and 188 -> 135 ms.
2026-11-13 04:02:30 -08:00
Anees Iqbal f7b7f1ca5c 🐎 Ask the runtime where textures lie before a surface's import
Two asks are answered before any view of a surface's pages is made: whether a
block asking for a device cache needs one before its view (CACHE with no view),
and whether a fresh block is deferred. Both read the runtime's in-place check
report as text, and recomputed how the runtime lays texels on the device's lines
and which check form a texel width takes. They saw the check's verdicts alone,
not the device's policy, a shader's writes of a width the check stores none of,
texels past the pages, rows that share bytes, or what the device's format and
limit queries refuse.

metal2vulkan 3bca3ce246 answers there:
Device::host_pages_texture_placement(backing, descriptor, plane, start,
length), the buffer's answer wherever the steps before an import or an image
decide it, made with no buffer, import or image. Both paths now ask it of each
plane, width and usage as the answer over a buffer does, through one
composition (pages_over), for each import a view may take: by pointer and as
dma-bufs where the device imports pointers, as dma-bufs alone on RADV. They
answer a cache only where every such import's answer is a shadow a cache holds
in place. In place, pending, or a refusal of every ask (HostPagesBacking,
BufferLength) leaves the pages to the view's buffer, which takes the cache at
the making's refusal as before: an in-place answer may still be a pitch, place
or dma-buf refusal that only the image or the import decides.

The view is told it starts at 0, which lies in the device's lines as any page's
first byte does where they divide a page; elsewhere the pages are left to the
import, as before. The fresh path takes the block's length for the buffer the
answer stands for. The report parser and its tests are gone; the one-dma-buf
checks of a plane's pages stay, as the runtime cannot see our source's limits.

What the guest sees changes only in speed: a block the after-import ask would
answer CACHE is answered so before a view is made for it, or deferred, and no
GPU result or device answer changes.
2026-11-13 02:25:24 -08:00
Anees Iqbal bca8c6e7f0 🐛 Give each VM's recording a sound device of its own
A recording made while an output played got nothing. On reims-ctl's one
virtio sound device of an output and an input stream, the guest starts the
input with each output and soon stops posting receive buffers, so a
recording that joins a playing output gets none, and QEMU has nowhere to put
the host's input. AppleVirtIOSound's HAL plug-in makes one Core Audio device
of each virtio-snd device and starts all of its streams together, posting
an input's receive buffers only at its start and as each completes while
its ring has room (read from its code). On a device started for an output,
nothing reads that ring.

reims-ctl now gives every VM a playback-only device at 0x7 (streams=1) and a
capture-only one at 0x8 (streams=1,input-streams=1, vendor/qemu 1422502b),
beside the HDA controller as before.

What the guest sees: two "Apple Virtual Sound Device"s, the default output
and the default input, where one device was both. Measured on a macOS
26.7.2 guest on homelab-um790's Radeon 780M, one cold boot each way (job
m3-max-24761, docs/qemu.md "x86-64 macOS guests: audio"). With the two
devices, a 10 s recording 20 s into a 50 s play got 117 receive buffers and
the host source's live audio in each second. On the one device the same
recording got no buffer, 2 s of older samples and 8 s of zeros. An output
alone no longer starts the input, and the host's source stays suspended
through it. A QEMU built before 1422502b refuses input-streams, so this
reims-ctl needs the QEMU its installer builds (install-ctl.sh without
--skip-qemu, whose warning names a changed QEMU).
2026-11-13 02:07:25 -08:00
Anees Iqbal aabd8a97a2 📝 Rewrite the comments that named apple-gfx's objects [ci skip]
Comments named apple-gfx's core objects, gone with it: the detach heap and
buffer's temporaries, the PGResource kinds core passed as resources, and a
lesson's detach buffers and the testing.md tables and suite cases it cited.
They say now what an aliasable range serves (the gathered alias of a
surface's pages, and the tests' stand-in for guest memory), what a
ResourceRef holds (the three kinds the decoder resolves a guest's object ID
to), what the remap module's reports and holds cover without the
temporaries, and the lesson's rule with the boot that showed it.
2026-11-13 02:07:25 -08:00
Anees Iqbal 39dd1213ca 🔥 Delete heaps over address ranges, which nothing reaches
The wire, the C API and the guest's bundle never ask for a heap or buffer
over address ranges. The decoder passes no ranges to new_heap or new_buffer:
it makes device-placed heaps (HEAP_CREATE) and heaps over the guest's memory
in place (HEAP_OVER_HOST_MEMORY, HEAP_OVER_PAGES, through
new_heap_over_host_memory). The C API makes no Metal object, and the bundle
refuses a buffer descriptor that names address ranges. tests/address_ranges.rs
was their only caller.

Deleted with them: Platform's AddressRangeArray, HeapDesc's address_ranges
(HeapDesc is no longer generic), the testkit's model of ranges, Backing's
record of the guest's pages under a heap (made_over, in_pages, meets_pages,
over_guest_pages) with Kept::Copied's pages, the write tracking through a
heap's pages that read it, and the inexact-heap-layout relay of a multisample
texture Metal keeps losslessly compressed, which only such heaps reached.
gather_or_nil stays: buffers over a surface still gather its pages.

The tests that made heaps over address ranges to stand in for the guest's
pages make them over host memory now, as the decoder does
(resource::tests::heap_over and heap_at): the heap-texture, placement and
heap-layout tests, and the write test, whose heap buffer and texture now lie
in no memory a surface's write check looks for, as a heap over host memory's
did before. The test of a heap over less than its granule and the multisample
death test went with the path they tested.

What the guest and host see: nothing; no call reached what is deleted. A heap
over host memory still relays a multisample lossless texture as its notice
alone, as before, and does not die of it in strict mode (ledger).
2026-11-13 02:07:25 -08:00
Anees Iqbal f09f58266e ⬆️ Build on metal2vulkan 3bca3ce246's runtime
Pin 66 moves metal2vulkan from be1e8bb311 (RUNTIME_VERSION 2195,
SEMANTICS_VERSION 2077, ARTIFACT_FORMAT_VERSION 515) to 3bca3ce246 (2208,
SEMANTICS_VERSION 2081, ARTIFACT_FORMAT_VERSION 515). It carries:
- half values held at 16 bits, half division and sqrt at 16 bits, and
  multisample ShaderWrite images listing their views (2196, SEMANTICS 2078
  and 2080);
- matmul2d of 8-bit floats into float (2197, SEMANTICS 2079);
- a completed command buffer's last host-import frees handed to the free
  thread, so NVIDIA's frees no longer hold submits (2198);
- runtime images whose parts no copy writes, a new buffer's zeros and the
  runtime's attachment images where DontCare stays DONT_CARE starting at
  zero in one fill (2199-2201);
- a Managed buffer's modified range copied in by the GPU as the submission
  runs, with no CPU copy at the commit (2202): on the RTX 3090 Geekbench's
  compute geomean goes from 2.11x native to 1.34x;
- a surface depth or stencil texture's usage shadow copying its plane's own
  aspect, and an X32_Stencil8 view's shadow no longer copying depth bytes
  into the stencil (2203);
- the draw merge passes holding their counts in u32 words, which ends the
  RTX 3090's Xid 109 hang in Apple's Modern Rendering sample (2204);
- a large kernel's whole grids run on its partial-threadgroups variant,
  one pipeline per threadgroup size (2205, SEMANTICS 2081);
- a device recovery carrying indirect command buffers, visible function
  tables and argument encoders, and freeing the lost device's live
  buffers once it comes to rest (2206);
- a merged execution with no whole chunk drawing an empty first draw
  (2207);
- a texture's placement over host pages answered before their import, with
  no image made (2208, Device::host_pages_texture_placement).

The runtime's DevicePolicy gains managed_copy_in, whose exact form,
ManagedCopyInPolicy::AtCommit, copies the range on the CPU at the commit
as the Radeon Pro 5300M keeps it. REIMS_VGPU_EXACT names it like every
other exact form, and docs/accuracy-ledger.md gains its row; without the
name, `all` would set a field no name sets and the exact names' test
fails. No degradation kind or runtime gap changes. ArgumentEncoder::device()
now returns the device by value, which nothing here calls; WorkCounts gains
fields, Problem gains HostPagesBacking, and CompiledFunction two accessors,
which nothing here matches on or calls yet.

What the guest sees changes: a CPU write to a Managed buffer's range after
its command buffer's commit may now be read by it, as on the UHD 630;
Apple's Modern Rendering sample no longer hangs the RTX 3090 (it draws, at
about 200-290 ms of GPU a frame, metal2vulkan's next fixes); a recovery
keeps indirect command buffers, function tables and argument encoders; a
surface depth texture's shadow holds the right aspect. The device's answers
do not change.

Cargo.lock keeps its lines.
2026-11-13 00:47:27 -08:00
Anees Iqbal a579ecf831 📝 Say a walk shares the host's CPUs with other jobs [ci skip]
An after-walk on the 780M lost frames through six steps while another
lane's full build ran on the host, and a walk alone matched the before-walk.
Record the trap and how to spot it; correct the ask count in the lesson
before it (2125 of 2126 asks were answered in place).
2026-11-13 00:03:57 -08:00
Anees Iqbal 81ec160d7f 📝 Say a check's verdict answers less than the making refuses [ci skip]
The cache ask answered from the runtime's in-place check alone, so the
making's own refusals (pitch, place, reach) left 428 surface textures as
shadows on a Radeon 780M walk. Record the trap and how to spot the next one.
2026-11-13 00:03:57 -08:00
Anees Iqbal c7acae16a7 🐎 Ask the runtime where a surface's textures lie for its cache
A block that asks whether its IOSurface needs a device cache was answered
from the runtime's in-place report, parsed as text: the check's verdicts
alone. What only the texture's making decides never reached the answer: rows
at a pitch no linear image of the GPU's takes, a place or import no image
takes, texels past the pages. Such surfaces stayed over their pages, and each
of their textures was the runtime's shadow, copied in at every command
buffer's first use and merged back after its writes.

A probe walk on the 780M (um870, macOS 26.7.2, m3-max-24453) logged 428
surface textures refused for pitch, over 110 blocks answered in place: RADV
lays a linear image's rows at multiples of 256 bytes, CoreAnimation's are
multiples of 64 (3904, 3552, 640) and CoreVideo's 1920 and 1984. A device
cache, laid out at the GPU's pitch, holds them in place.

The answer over the view is now the runtime's own placement for each plane
(Buffer::texture_placement_with_iosurface_plane, the making's decision):
a texture over the plane that only reads, and one that takes every access.
The layout gives no texel width, so each plane is asked as each of Metal's
widths its rows' texels divide into. It takes a cache where no width lies in
place, none is pending, and some width's texture is a shadow a cache holds
in place. A texture the device makes no image in place of over any memory
(its format and usage, more levels than one) leaves the surface over its
pages. The two paths that answer before any import keep the report's
verdicts until the runtime answers there too.

What the guest sees changes only in speed: more surfaces take the device
caches they already took where the verdicts refused.
2026-11-13 00:03:56 -08:00
Anees Iqbal 9237884cf5 📝 Record that QEMU captures only while the guest posts buffers [ci skip]
What boots m3-max-24488 and m3-max-24579 measured on um790 with vendor/qemu
9a03bc4c: the input voice runs about 1.07 s per output and the host's source
stays suspended while the output plays on; a recording alone runs the capture
from START to STOP with no backlog; a recording started during an output gets
no buffers posted by the guest, as before; and how a boot answers the guest's
microphone prompt.
2026-11-12 23:46:16 -08:00
Anees Iqbal ff837ae87d 🔥 Delete the detach and replace machinery no call reaches
Since apple-gfx's detach and replace went on 11-07, nothing the guest or the
host reaches calls a buffer's or heap's detach_backing or replace_backing, or
the runtime's rebind_bytes_no_copy behind them: the device's wire has no op for
them, reims-vgpu's decoder never calls them, the C API has no entry for them,
and the guest bundle's RgfxHeap raises an unrecognized selector at
detachBacking and replaceBackingWithRanges:readOnly:, as Metal's base heap
does. Only tests called them.

Deleted with them: the trait methods and the testkit's, the backing's detached
state, its registry of detached objects, held deallocators and kept contents,
the per-command-buffer parts and the submission check every commit set for
them, and EncodedUseRebound's death, which no rebind can reach now (the
runtime's kind stays placed, and a failure of that kind would die unanswered).
tests/detach_backing.rs goes; its heap-over-address-ranges cases, with Metal's
recorded heap answers, move to tests/address_ranges.rs. reach.metal's comment
named the deleted file, so its metallib is compiled again (the bytes this
Xcode writes; the record changes for reach alone).

What the guest and the host see: nothing changes. The device still answers
supportsResourceDetachBacking as before: that answer is the guest's, and
changes only with boots.
2026-11-12 23:10:01 -08:00
Anees Iqbal a9581c934e 📝 Record when a guest takes none of its PipeWire input [ci skip]
Measured on um790 (m3-max-24213, m3-max-24300): the 26.7.2 guest starts its
virtio-sound input stream with every output stream and posts receive buffers
only for its first 0.73 s, so a play longer than about 25 s fills QEMU's
PipeWire capture ring on a host with a default source. What QEMU 8abc8492
says then, once and as a count, and what it said before, a line per cycle.
2026-11-12 21:53:15 -08:00
Anees Iqbal 7b92865a0b 📝 Say why a pages join may trust a VM object id [ci skip]
The join of a no-copy buffer to a live pages block compares the memory's
VM object id, which the kernel may hand to a new object once the old one is
freed. The join is sound because the kext's wiring of a live block keeps the
object, and a test fake that holds nothing lets the id come back: both remap
tests failed now and then on the M3 Max on 2026-11-12 until their fakes held
the memory (149fc57c8, 927e954de).
2026-11-12 21:46:32 -08:00
Anees Iqbal 645477e64e 📝 Record the unshare posted behind a later share [ci skip]
The kext posted a let-go's BLOCK_UNSHARE after its lock, and a later share or a
share of the span given out again went ahead of it on the device. The lesson
names how the next such pair shows.
2026-11-12 21:25:55 -08:00
Anees Iqbal 34efdc631a 🐎 Ring a walking queue's doorbell only for a buffer that asks
While a queue's service thread walked a buffer on its own thread, it marked
the ring as it marks it before it sleeps, so the guest rang the queue's
doorbell for every buffer it published meanwhile: a VM exit that answered
nothing for a buffer that does not ask for its CB_SUBMITTED, in two of three
commits of a back-to-back run on a 26.7.2 guest (11.9 µs a doorbell on a
780M host). The thread now marks the ring walking (consumer_idle 2,
RGFX_CONSUMER_WALKING), for which the bundle rings only for a command buffer
whose last op is its ask, which the doorbell's write may answer; the thread
takes the rest after the walk, as before. A bundle that rings only for 1
rings for none during a walk, and its asking buffer is answered at that take.

What the guest sees: consumer_idle reads 2 during a walk, where it read 1.

Measured with commit_split, before and after in one job each, cold boots of
26.7.2 on um870 (m3-max-23492, m3-max-23493):
- RTX 3090: a back-to-back commit 15.8 -> 2.2 µs (median), doorbells 0.57 ->
  0.30 a commit, 22.5 -> 20.2 µs a buffer over 100,000 buffers; a commit's
  CPU time in encode_probe's cb.commit 19.6-21.2 -> 15.3-15.7 µs.
- Radeon 780M: 44.5-46.5 -> 44.7-45.3 µs a buffer, bound by the host's
  submits; doorbells 0.66 -> 0.54 a commit, the rest of them posts that wait
  for room; cb.commit's CPU time 19.6-20.2 -> 18.4-18.9 µs.
An idle queue's single commit rings as before (16.4-17.4 µs on both).
2026-11-12 19:06:13 -08:00
Anees Iqbal a4b6ade41b ⬆️ Build on metal2vulkan 63232a93ee's runtime
Pin 62 moves metal2vulkan from 0c0cdf0b12 (RUNTIME_VERSION 2165,
SEMANTICS_VERSION 2064, ARTIFACT_FORMAT_VERSION 509) to 63232a93ee (2176,
SEMANTICS_VERSION 2072, ARTIFACT_FORMAT_VERSION 512), the golden tables
and the authored compile census re-blessed. It carries:
- a device recovery carrying the textures of new_texture (made new, their
  contents lost; those over carried buffers keep their bytes), binary
  archives and dynamic libraries, compute, tile, render and mesh pipeline
  states (made again from what their creations compiled; a bind of one
  whose making failed is refused, RemadeAfterRecoveryFailed), sampler
  states, Private buffers in exportable memory (over their own memory,
  not zeroed), and no-copy heaps with the buffers and textures placed in
  them (2166-2170, 2173, 2174, 2176);
- every batch the lost generation still holds failed as GpuRecoveryVictim
  in commit order, and a queue's new place running its handlers only after
  the old place's, so no command buffer committed around a recovery waits
  for good (2172);
- a Managed buffer's didModifyRange bytes reaching only the command buffer
  that committed them and later ones, on a device whose memory is not the
  host's (2171);
- a rate-mapped pass recorded at the host step drawing each command that
  is safe to fan out once, with a copy per region it touches, where it drew
  it once per region (SEMANTICS 2072, RUNTIME 2175; REIMS_VGPU_EXACT's new
  name rate_map_regions keeps every draw region by region, and the
  accuracy ledger has its row);
- a 16-byte vector access placed at its address unless its offset is
  proven a multiple of 16, as Metal places it: a float4 read through a
  float pointer only 4-byte aligned read k floats low (Geekbench 7 Metal's
  workload 302 softmax rows) (SEMANTICS 2069), and the reach of a pointer
  through a base not yet reached kept unknown (SEMANTICS 2070), which
  6164d3a66a's tree took as reached and so refused 124 MPS NDArray kernels
  of an Iris Xe's pipeline records that 0c0cdf0b12 made;
- flat simdgroups, the rate map's fan-out variant, generic pointers and
  matmul2d's macOS 27 runs (SEMANTICS 2065-2068, 2071).

The runtime's objects answer their device as an owned handle of the
generation serving them, not a borrow: six call sites here take a
reference to it, and two fence devices drop a clone that is now one.
No degradation kind changes. RuntimeGap gains RemadeAfterRecoveryFailed,
which a bind answers as it answers MadeBeforeRecovery.

What the guest sees changes: after a device recovery, pipeline and
sampler states, exportable Private buffers and no-copy heaps made before
it serve again, and command buffers committed around it complete; Managed
buffers' modified bytes on a dGPU reach only their own and later command
buffers; rate-mapped passes take far less GPU time; and kernels reading
16-byte vectors at addresses not 16-aligned read what Metal reads. The
device's answers do not change.

Cargo.lock keeps its lines.
2026-11-12 18:55:13 -08:00
Anees Iqbal 831ce5ef41 ⬆️ Build on metal2vulkan 0c0cdf0b12's runtime
Pin 61 moves metal2vulkan from 1125fb62d2 (RUNTIME_VERSION 2149,
SEMANTICS_VERSION 2062, ARTIFACT_FORMAT_VERSION 508) to 0c0cdf0b12 (2165,
SEMANTICS_VERSION 2064, ARTIFACT_FORMAT_VERSION 509). It carries:
- the chunk gate on RADV and ANV: copies by runs no longer meet the
  runtime's Invariant over chunks an object's own import holds; on the Iris
  such copies are staged on the CPU (2157, 2158);
- address pools made before a recovery taking new buffers after it (2159),
  and an object's device() its generation again, so destroying objects of a
  lost generation through it no longer crashes (2164);
- a process limit on the SPIR-V words of large pipeline makings (2160);
- draws, dispatches and ICB replays whose pipeline is still being made held
  until it is, never dropped (2161, 2162);
- a rate-mapped pass's work submitted in pieces of bounded size, big draws
  cut into index ranges, so no submission nears amdgpu's 2 s job timeout or
  NVIDIA's context-switch timeout (2163);
- IOSurface plane textures taking their buffer's padding_unobserved, so the
  Iris's tile textures lie in place (2165);
- the resident-set search emitted as a loop alone (SEMANTICS 2064), and the
  host-import gauges split into releasable and held-for-good.

Here: the two dropped-while-making degradation kinds leave the answer
layer's list and docs, the accuracy ledger's row says the command buffers
wait, the GPU-times doc names a rate-mapped pass's pieces, the recovered
sink's test runs again, and the generation test holds the device handle it
took before the recovery, since fences are now carried across it.

What the guest sees changes: no draw or dispatch is dropped for a slow
compile (its command buffer completes later), rate-mapped frames no longer
hang the 780M's ring or an NVIDIA GPU, and small buffers made after a
recovery are made. The device's answers do not change.

Cargo.lock keeps its lines.
2026-11-12 17:15:32 -08:00
Anees Iqbal 641be0cec1 🐛 Answer a waiting screendump as QEMU's quit closes the console
With 8de552e91's bounded wait for a display read, QEMU's quit after an
RTX 2080's Xid 109 went past the device's teardown and then hung in
monitor_cleanup (fix-2080, m3-max-23203): a QMP screendump waited for the
update the stuck read was for, closing the console woke it not, and the
quit waits for the QMP dispatcher the screendump holds.

vendor/qemu e829b256 marks the console's update done before closing it, so
a waiting screendump is answered with the console's last frame. What the
host sees: such a screendump now returns at the quit, where it never did,
and the quit goes on; a quit with no screendump waiting is as before.
2026-11-12 16:38:38 -08:00
Anees Iqbal 73b79f7e61 🐛 Quit a VM whose display read waits for a GPU that stopped answering
QEMU's quit hung for good after NVIDIA's Xid 109 (a context switch timeout)
in Apple's Modern Rendering sample, on an RTX 2080 and an RTX 3090: a
screendump's read of the display waited for its draw on the GPU, which never
finished, and the teardown at the quit waited for the read under the BQL
(thread_pool_free), so QMP's and HMP's quit both needed SIGKILL.

vendor/qemu 32a9f9a9 waits for the read at most 5 s, the bound the
library's release of its last device waits for its own threads, and past it
keeps the device to the exit, as a VM whose shutdown pauses it does. What the
host sees: such a quit now ends; a quit with no read under way, or one that
ends in time, is as before. docs/qemu.md says what was measured, including
that a pending screendump holds every QMP monitor while HMP, the vCPUs and the
guest go on, and docs/api.md the quit that keeps its device.
2026-11-12 16:38:38 -08:00