dgpu-oracle.md Q38 records oracle_readonly's runs on the M3 Max (macOS
27.0.1) and the dGPU oracle's Radeon Pro 5300M and UHD Graphics 630 (macOS
26.7.1), each shape with its class: agreed, divergent or outside the
envelope, and the x86 finding that bit 24 does nothing there. The accuracy
ledger's read-only-pages-written row, the writes module's docs, the command
module's note on read-only store faults and design.md's no-copy buffers say
what the platform now answers: a store-out faults as the M3 Max's does, every
other GPU write completes with its write dropped, a CPU write lands where the
pages are writable, and a depth StoreAndMultisampleResolve into such memory
still ends the process until metal2vulkan completes it.
A kernel's write() of a texture over memory the process maps read-only
(Metal's private option bit 24, a no-copy buffer or heap the runtime makes
over a copy of the pages on Linux), and a blit's copy into such a texture,
ended the process where they were encoded (kept_write), as what Metal does
there was read as unmeasured. metal2vulkan measured both on the M3 Max,
macOS 27.0.1, plain Metal (probes/readonly_gpu_writes.m; the runtime's
read_only_view.rs): a texture over such memory takes a kernel's write() and
a blit's copy into it, out of a buffer or a texture, nowhere; each completes
with no error and leaves the pages as they were. The runtime's copy drops
those writes too: a texture over a copy lies in the copy's memory, or is a
shadow of its bytes, and each batch's completion writes back over every byte
the GPU changed in a copy that drops writes (copied.rs), so a later command
buffer reads the pages' bytes.
What changes for the guest: such a dispatch and such a blit copy complete
with no error, their writes dropped, where they used to end the process.
predication.rs's kept_write_through asks texture_twinned instead of
texture_kept for a texture a kernel writes, bound or made resident for
writing, so only a surface's read-only memory the runtime twins still dies
there. encode_blit.rs sends a copy into a texture over memory the runtime
copies (copy_dropped: CopyBufferToTexture, CopyTextureRegion,
CopyTextureSlices and their options forms).
What stays a death, as nothing measured it: a draw's write of such a
texture, another blit's write of one (a fill, mipmaps, an invalidation),
and a CPU write of one.
Tests: texture_writes_into_read_only_memory_are_dropped runs a kernel's
write, a copy out of a buffer and a copy out of a texture into a texture over
a bit-24 buffer and one in a bit-24 heap over pages: each completes with no
error, the pages stay zeros, and a later command buffer reads zeros.
a_blit_into_a_read_only_buffer_is_dropped's copy into a texture over the
buffer now completes where it died. gpu/writes.rs's docs and the accuracy
ledger's read-only row say the same.
No boot: no walk has reached this path (no app in our walks writes a texture
over read-only memory).
A pass that resolved a multisample colour attachment into a texture over
memory the process maps read-only (Metal's private option bit 24), or kept a
depth attachment there by CustomSampleDepthStore, ended the process where it
was encoded, as what Metal does there was unmeasured. metal2vulkan has since
measured both on the M3 Max, macOS 27.0.1, plain Metal (m3-max-28796,
m3-max-28797): a colour MultisampleResolve into a texture over a buffer of
bit 24, and a depth attachment in a heap of bit 24 kept by
CustomSampleDepthStore, each by the descriptor's action or one the encoder
set, fail the command buffer with PageFault, as a Store there does. RUNTIME
2280 (pin 89) faults both itself (store_out.rs), and counts the fault toward
its queue's revocation.
What changes for the guest: those two shapes now fail their command buffer
with PageFault (3), the pass and the encoders after it running nothing, every
event signal firing, the pages unchanged, and the queue serving on until its
second fault, where they used to end the process.
kept_attachment and late_store let them through, and read_only_stores and
late_store tell the command buffer of the fault (faults_at_read_only_store),
as a Store there is told, so a command buffer that fails another way too
still dies at its commit. faults_over and faults_into name the store actions
that fault. A colour attachment's resolve texture over such memory, the
descriptor's, is marked Unsent::Copied while its store action is Unknown, so
a late MultisampleResolve into it faults.
The store-out shapes 2280 did not measure stay deaths where they are
encoded: StoreAndMultisampleResolve into such a texture (at the pass's
creation, or at its late store action), a depth or stencil resolve into one,
a resolve into a texture a late resolve setter named, a colour or stencil
attachment kept there by CustomSampleDepthStore, and a colour resolve into
such a texture that this platform drops because plain Metal leaves a texture
of that format untouched (now dying in read_only_stores, at the same
selector, where it died in kept_attachment before).
Tests: a_resolve_into_read_only_memory_dies becomes
a_resolve_into_read_only_memory_faults_its_command_buffer: MultisampleResolve
given at once or late faults and the queue runs on, while
StoreAndMultisampleResolve dies at renderCommandEncoderWithDescriptor: and at
setColorStoreAction:atIndex:. In
a_depth_store_into_read_only_memory_faults_its_command_buffer,
CustomSampleDepthStore at once or late, and Store, in a
heap of bit 24 over pages fault, the queue running on, and DontCare
completes. The read-only pass helper takes any pass (pass_line_on). The
module docs, gpu/writes.rs's and the accuracy ledger's read-only row say the
same.
No boot: no walk has reached this path (no app in our walks stores into
read-only memory).
A render pass that stores an attachment into memory the process maps
read-only (Metal's private option bit 24) faults its command buffer with
PageFault. This platform then made the commit of every later command buffer
of the process die (READ_ONLY_FAULTED), as Metal was read to fail them all.
Measured on the M3 Max, macOS 27.0.1, plain Metal, that reading was of the
probe's runs sharing one queue: one fault a process leaves the next command
buffer of the same queue Completed (m3-max-29110, twice, a process each), and
so do one on the same queue 100 ms on and one on a new queue (m3-max-28796,
m3-max-28797); four faulting runs on one queue fail every command buffer of
that queue after its second fault. That is the queue revocation the runtime
models in command_buffer/revocation.rs, measured on the same Mac: the
queue's second page fault or hang revokes it, every later commit on it
failing with AccessRevoked (4); other queues, and a new one, serve on.
What changes for the guest: a command buffer committed after such a fault
runs, where the commit used to end the process; the queue's second fault
revokes that queue, every later command buffer of it completing with
AccessRevoked, running nothing and signalling nothing; other queues run.
Since RUNTIME 2280 (pin 89) the runtime faults such a store-out itself, with
the same code, from the same pass on, every event signal firing
(store_out.rs), and counts it toward its queue's revocation. This platform
no longer commits the fault as failed (commit_failed of code 3): the command
buffer commits as any other, and the runtime faults it. The pass is still
told to the command buffer, now as a failure the runtime makes (the field
type_9 becomes by_runtime, holding type-9 draws' failures and these), so a
command buffer that fails another way too still dies at its commit as a
combination nothing measured, and is never cut into parts.
The executions of indirect command buffers in the encoders such a failure
runs nothing of stay unchecked at the commit, as they were while this
platform committed the failure. The same now holds for a type-9 draw's
failure, whose later encoders' executions were checked, and could die there,
though Metal runs nothing of them.
Tests: a_store_into_read_only_memory_fails_its_command_buffer and its late
store variant now see the next command buffer of the queue and of a new
queue run, the faulted one's blit after the pass not run and its signal
fired; read_only_faults_revoke_queues_as_metals holds the revocation at the
second fault, while a new queue runs and takes a first fault of its own
without revocation; a_command_buffer_failing_two_ways_dies_at_its_commit
gains the read-only cases and the first encoder that runs nothing. The
module docs, gpu/writes.rs's and the accuracy ledger's read-only row say
the same.
No boot: no walk has reached this path (no app in our walks stores into
read-only memory).
newBufferWithBytesNoCopy: over Shared memory the process maps read-only took
a slab copy that the bundle merged from the memory at every commit using it.
On macOS 12.7.6's WindowServer, which wraps clients' Core Animation backing
stores (VM_MEMORY_LAYERKIT, mapped read-only, 8-30 MB each) so and draws from
them every frame, that merge was 14.10 s of the commit path's 14.25 s over a 451 s walk, 130,850 MiB
compared, and its commit-to-post wait 2-6 ms a frame where 14.8.9's is
20-60 us (appwalk14, ms01's Iris Xe).
Where the kext makes a read-only pages block (RGFX_FEATURE_READ_ONLY_PAGES),
such memory now lies over its own pages: the bundle asks the block for
reading alone and makes its BUFFER_OVER_PAGES with Metal's private bit 24,
sent to the host alone. The buffer answers the app's options, without the
bit, as Metal's does; its contents, length, allocatedSize and GPU address
(the pointer's offset in its page) answer as before. Read-only blocks join
only read-only ones. Read-only Managed memory keeps its copy: the host's two
copies would write the CPU copy back to the pages. Where the kext gives no
block (a host without the bit), the copy stays.
What changes for the guest, beside the time: the GPU's writes to such memory
follow accuracy-ledger.md's read-only-pages-written row, as Metal's do, where
the copy kept them in the slab for later command buffers to read:
- a shader's store, a blit's fill or copy and a pass's visibility results
into it complete with their writes dropped, and later command buffers see
the memory as it is;
- a pass that stores an attachment there (Store,
StoreAndMultisampleResolve) fails its command buffer with
MTLCommandBufferErrorPageFault, where the copy let it complete;
- the CPU sees its pages unchanged, as before.
On Linux the runtime makes a bit-24 buffer over a copy of the pages today,
compared with them at each commit that uses it, so the per-commit compare
moves from the guest's process to the host's commit until metal2vulkan
imports such memory in place.
The shell tests that held "read-only memory never asks for a block" now hold
the new route: the ask for reading alone, the bit on the wire and not in the
buffer's options, and the copy where no block is given. Both guest sets are
rebuilt in the 📦 commit that follows.
A no-copy buffer over memory its process maps read-only cannot lie over its
own pages today: the kext refuses the pages block, and the host would lay a
buffer over it that takes the GPU's writes. So the bundle syncs a slab copy
of it at every commit that uses it. macOS 12's WindowServer wraps clients'
Core Animation backing stores, mapped read-only into it (8-30 MB each), that
way, and spent 14.1 s of a 451 s walk syncing them (appwalk14, 12.7.6 on the
Iris Xe). This makes the device and the kext ready to keep them in place; the
bundle takes the route in the next commit.
What changes on the wire:
- A new feature bit, RGFX_FEATURE_READ_ONLY_PAGES (bit 45, FEATURES_HI bit
13), offered wherever PAGES_BUFFERS is, and taken by the kext.
- A new SURFACE_PAGES flag, RGFX_SURFACE_PAGES_READ_ONLY (1 << 5), meaningful
with RGFX_SURFACE_PAGES_PRIVATE alone (else INVALID_ARGUMENT): the pages
block holds pages its process maps read-only.
- BUFFER_OVER_PAGES needs no new field: its options already carry
MTLResourceOptions bit 24 to the host, which hands it to the runtime as
memory whose GPU writes it drops (accuracy-ledger.md,
read-only-pages-written).
The host keeps every object over a read-only block from writing its pages: a
BUFFER_OVER_PAGES without bit 24, a HEAP_OVER_PAGES, an ICB_SLOTS_IN_PAGES
and a MANAGED_BUFFER_CREATE or MANAGED_TEXTURE_CREATE whose CPU copy lies over
one are refused, each logged as the guest error it is. The block's view stays
the writable mapping of guest RAM.
Where the kext took the bit, PagesBlock makes a block of read-only memory too:
it wires the pages with kIODirectionOut, which asks the VM system only for
read access, completes them for that direction at the unwire, and marks the
block read-only (rgfxPagesWiring). Without the bit it refuses read-only
memory as before.
Why a feature bit, though reims-ctl ships the host and the x86 set together:
the mark is where the host holds the line, not a hint. A process can post any
message on its rings, so a forged BUFFER_OVER_PAGES without bit 24 over a
read-only block would let the GPU write pages the process maps read-only, a
file's page cache among them. A host older than the mark ignores it, so the
kext makes such a block only where the host took the bit. The arm64e set also
reaches VMs through Ambrosia's config bundle, apart from the host. Old guest
sets never ask, and change nothing; a new set on an older host gets no block
and keeps its copy.
The header is regenerated, and the option ROM's record takes the header's
new hash (the ROM's bytes are unchanged); both guest sets are rebuilt with
the bundle's change, in the 📦 commit after it. Tests: the
header test, the peer and offer tests, a decoder test of what a read-only
block admits and refuses
(a_read_only_pages_block_holds_only_buffers_that_drop_their_writes), and the
kext's features and pages-block tests.
GpuDevice::new_command_queue_unshared's doc listed the device's blit and
exec queues and the process's frame queue, which no code makes since the
paravirt lane went, and left out the decoder's release queue and the window
mirror's queue, which do exist. It now names the queues made unshared today,
each with the reason its own doc gives: the window sink's and its mirror's
(on a present's path), the IOSurface device caches' transfer queue (presents
and cache-drawn frames wait for its fills) and the decoder's release queue
(no guest command buffer may hold up the signal of a closed context's
events).
design.md said the host logs each unshared queue at info on
reims_vgpu::graphics; since f75493990 the line is at debug on its own
target, reims_vgpu::graphics::queues.
What changes for the guest: newFunction now answers nil with
MTLLibraryErrorDomain 3 (CompileFailure) and Metal's own lines ("error:
buffer argument b has invalid location (<0,1>) in k\n"), by any way of
making the function, where function constant values put two present
arguments of one argument table at overlapping locations through
(a) a predicate or an index computed from a half constant,
(b) an index computed through a conversion between a float and an integer,
(c) a function table (visible or intersection) or an acceleration
structure (primitive or instance) at a buffer's location.
Before, newFunction made the function in those three cases and the
pipeline's create refused it later on the host (OverlappingArgument). Metal
refuses at newFunction (oracle Q33), and the bundle already did so for
every other case its AIR reader decides.
Why the bundle missed them: the initialisers' evaluator folded no half
constant's value; the compiler writes a float-integer conversion as a call
(air.convert.u.i32.f.f16 and the like), which it took as any value; and the
reader did not count a function table's or an acceleration structure's
location, whose table and word were not measured.
Q33's probe, oracle_overlap, gains eight functions (k_halfpred, k_halfidx,
k_fidx, k_sidx, k_vft, k_ift, k_pas, k_ias), measured on the 5300M, the 630
and the M3 Max (m3-max-28663, 28662, 28659). The three oracles agree on
every newFunction answer: function tables and acceleration structures take
locations of the buffers' table, with the word `buffer`; a half constant's
predicate and index, and an index through conversions truncated toward
zero (-1.5 gives -1), count as any other. One pipeline differs: the 630
refuses k_vft's compute pipeline where the table is called, its compiler
service dying (CompilerError 1, XPC_ERROR_CONNECTION_INTERRUPTED), while
the 5300M and the M3 make it. Making it stays inside what the x86 Macs
answer, so nothing here follows the 630 there; Q33 records it.
For the overlap check alone (rgfxAirConstantGlobals) the evaluator now
folds a half constant's value, rounds each half result to the nearest half
as LLVM folds a half, and folds air.convert of scalars between floats and
integers (a float to an integer only where the truncated value is in the
integer's range); the bodies' specialisation (reflection's used arguments)
still takes those as any value. The reader counts a function table's or an
acceleration structure's location in the buffers' table, and the check
names it `buffer`. test_overlapping_arguments_refused_as_metal compares
the eight new functions with this Mac's Metal for every value and way, and
checks the x86 Macs' words.
Still left to the host, written in Q33: an initialiser operation the
evaluator does not fold (vector or array elements, conversions of two
integers or of vectors, other calls), an air.buffer with no address space
(no form built writes one), and a function of a library Metal's link made,
which keeps no bytes.
The Vulkan platform refused a split while a unit of command predication
was open, and every compute encoder opens one, so a buffer of compute
encoders alone was never cut: Geekbench 7's Fluid Simulation commits
2,600 one-dispatch encoders in one buffer, and its GPU work waited for the
whole walk. A split now needs only no block open, no loop body being laid
down again and no unit an unbalanced record emptied
(Predication::cuttable). A unit open at the cut goes on in the next part
(Predication::go_on): its first dispatch type, work, indirect dispatch and
numbering carry over, so what Metal decides by the unit (an unbalanced
encodeEndIf after its work, a first indirect dispatch of another type)
dies where it would in the whole buffer. With no block open the GPU's skip
counter is 0, so the next part's counter, reset at its first step, stands
for the cut part's.
For the guest only timing changes, and where a walk faults after a part
was committed, that part's work has run, as for a buffer of render passes
(only invalid input reaches that).
dispatch_cost's fluid shape (1 buffer of 2,600 encoders of one dispatch,
M3 Max, MoltenVK, release, median of 5 runs of 6), through the decoder:
first take to completion 87.0 ms -> 34.8 ms; the walk's CPU 14.7 -> 8.8 us
a dispatch (164.2k -> 110.6k instructions), as the runtime's work for an
encoder grows with the encoders before it in its buffer. The small (64 x 5
encoders) and one-encoder shapes are not cut, and stay as they were.
Tested by a_unit_goes_on_in_the_next_part,
a_block_open_keeps_a_command_buffer_whole and the encode_compute dies and
goes_on cases across a split.
The design said the GL renderer's Apple settings need Apple7 and the vendor
"Apple". Its five settings records (macOS 27.0.1, arm64e) show Apple5's and
Apple7's are the same in every setting the renderer reads but the largest
point it draws, 16 pixels against 64, so Apple5 with a vendor none of AMD,
ATI, NVIDIA and Intel is the narrowest pair. The section now lists the
other settings the Apple records hold (the texture upload and mipmap path,
the seams on cube maps, the point clamp) and why the device claims neither:
Apple4's and Apple5's rows hold tile shaders, imageblocks and nonsquare tile
dispatch, which the device does not carry and the runtime refuses on every
device (its audit on an Iris Xe at metal2vulkan c796a88d6a: 26 of Apple5's
rows block), and the Apple settings send GL_POINT polygon mode as
setTriangleFillMode: 2, on which the platform dies.
Route 1's design notes described the CPU ordering the two GPUs and named the
sync-file export as the step still to take. The draw now waits for the
mirror's sync on the compositor's GPU, so the notes say how, and where the
window's thread still waits.
They record the walk pair on pin 83 that measured it, warm against warm, on
um870's RTX 3090 beside its 780M compositor and on um790's 780M beside its
XTX compositor: the render thread's wait a sync fell from 4.63 to 0.45 ms
and from 4.25 to 0.99 ms. Every sync went to the compositor as a sync file,
none after host copies, and rates and latencies held.
They also explain Mission Control's take-to-show median rising from 2.2 to
14.4 ms under route 1: its presents fall in two groups, those finished by
their take and those whose writers still run, and route 1 made the second
group faster (39.1 to 15.2 ms) and larger, so the median moved between them
while the mean fell from 18.2 to 10.0 ms. The GPU wait leaves both groups
as they were.
Where the guest took GUEST_TIMES, a queue's thread notes the host's clock as
it takes each buffer, before the gate, and as it comes back to the ring after
the buffer before it. With ring 0's clock offset (its bound read with
acquire, then the offset) it splits the buffer's time before the take:
encode (committed - made), post_wait (posted - committed), queued (behind
the queue's buffer before it, on the host) and transport (the doorbell, the
thread's wake and the ring), posted mapped to the host's clock. With no
offset held only encode and post_wait are given.
Each buffer's spans go to the host's trace as a cbguest event: queue, seqno,
the spans, the offset's bound, and held, the time from the take to the event,
so a reader places the take. Once a second a debug line of target
reims_vgpu_graphics::guest_times gives the buffers' count, each span's sum
and median, and the longest transport. Both are diagnostics: the device does
nothing else differently, and reads nothing of a guest that did not take the
bit.
The device's tests: a stamped buffer's spans reach the trace, alone and
queued behind a buffer the host holds; a buffer without the op, or a guest
without the bit, gives no event; with bound 0 there is no transport. The
module's own tests cover the spans' clamps and the line's window.
The host sees a command buffer only once a queue's thread takes it off its
ring, so the app's encode and the buffer's way to the host show as one span
with nothing pending on the host. This adds the guest's stamps that split it,
a diagnostic.
What changes for the guest:
- The device offers a new feature bit, RGFX_FEATURE_GUEST_TIMES (bit 44,
FEATURES_HI bit 12), and DRIVER_FEATURES takes it. The kext carries it.
- Where the device's word holds it, the bundle starts each command buffer's
stream with a new op, RGFX_OP_GUEST_TIMES (0x000e, 32 bytes): the guest's
clock as the buffer was made, as its commit was entered, and as its message
went on its ring. The last is written under the ring's lock, after the copy
and before producer is published; for a buffer in a block, into the block.
- After each VBLANK's reading of HOST_TIME the kext writes ring 0's new header
fields: guest_clock_offset_ns (0x18), then guest_clock_bound_ns (0x20) with
release, split out of reserved bytes. The host zeroes both as it initialises
a ring.
- The decoder walks the op as a no-op, so it changes nothing a buffer does,
and a host that did not offer the bit never sees it. Old guest sets carry
no bit, send no op and leave the fields 0.
The header is regenerated, both guest sets are rebuilt from the same sources,
and the option ROM's record takes the header's new hash; the ROM's bytes are
unchanged. The tests cover the op's and fields' layout (the header test, the
kext's vblank clock test), the bit's negotiation (the kext's features test,
the peer and memory-map tests), the stamps (the bundle's serializer and shell
tests) and the walk (a cmdbuf test, and the fuzz's streams). The host's
reading of the stamps is the next commit.
The design's route 1, the window shown by the compositor's GPU through a mirror
of the changed tiles, is built: the doc now says how the mirror is made, synced
and drawn, how the CPU orders the two GPUs until the runtime's sync file is
taken, and where it falls back.
It records the before/after walk on um870's RTX 3090, whose compositor is on its
Radeon 780M, against development at fe56cae17 on the same runtime: the link's
megabytes a present fell from 31.2 / 2.0 to 6.1 / 2.5 over the walk, the 3090's
busy time from 21.0 to 9.5 ms a present, the guest's rates held, and the render
thread waits 1.6 to 10.8 ms a present for the tiles' copy.
A prototype laid only the presented surfaces in place, with the window as
today, and walked the desktop on um870's RTX 3090.
About 169 MB crossed the link a present: 90.5 MB from the GPU beyond today's
34.8 MB window copy, and 78.8 MB to it. That is five times today's copy and
27 times what the frames change. The guest's presents over the walk fell
from 4324 to 1735, and the autoscroll from 45 to 9 a second.
The cause is the composite's own passes: the runtime's GPU renders and
blends WindowServer's frame into guest RAM over the link, loads included,
while the shadow counts stay flat. So the presented surfaces keep their
device caches, and route 1 is the route taken.
A cold `cargo xtask dist` typed into a bash terminal on CachyOS runs its
compilers at nice -4 (ananicy-cpp's rule for bash) against QEMU's nice 9, and
stopped the guest's Safari pages for up to 2.6 s with 8 vCPUs. In the stalls
the vCPUs waited on run queues while the device's threads were idle, and the
gaps were 2.4 to 28 times what the lost share accounts for.
Record the measurement in docs/qemu.md, with why nothing of ours moves it and
why reims-ctl's vCPU default stays: 4 vCPUs cut the worst scroll gap 3 times
but took 1.81 times as long for a CPU-bound guest on an idle host. Record the
nice -4 trap in docs/lessons.md, since a load started at nice 0 measures less
than a user's build.
The order of encoders' writes is all three Macs' answer (class 3), the bytes
past a plane's texels the Macs' divergent one (class 2). An arm64 macOS 27.0.1
guest on the M3 now answers the eight aliasing cases as the M3 does natively
(a64walk oracles step, m3-max-27485; before, m3-max-27484, the wide texture
was refused).
dgpu-oracle Q37 records oracle_surftex's aliasing cases on the three Macs: a
write through one texture over a plane reaches the next encoder's read through
another, tracked or behind a fence, on all three; the bytes past the plane's
texels are the surface's own on the M3 and the GPU's own on the x86 Macs. It
says which answer each wide home gives. Decided 14 in the device's design and
the oracle tools' list name the wide home and its copies.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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]
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.
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.
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.
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.
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.
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.
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.