The 3090's fault at job 60124 left no named cause: at a loss, the rt
platform wrote one line naming the GPU, the Vulkan call and its result,
and nothing of the work that was on the GPU.
Each command buffer rt ends as in flight at its device's loss now writes a
line after the device's, naming the guest's command buffer by its object
id and the object ids of the first compute and the first render pipeline
state its encoders set, or none; a command buffer of the host's own says
so. A command buffer cut in parts writes one line however many of its parts
are lost. The first 8 write theirs, the next one that the rest are counted
only, and each is counted, rt-device-lost-in-flight.
The record is the cheapest that holds them. The decoder makes the guest's
names for a command buffer's work once, at its begin, and hands them to the
platform before any encoder (CommandBuffer::names_work, a no-op by default
that makes no Metal call), which keeps them on the command buffer and each
part cut from it. A walk keeps its first pipeline state of each kind in a
cell, read at each set, and notes them in the names with relaxed stores
before each commit of what it walked: a cut, a dealt chunk's commit, which
notes its chunks' firsts in their order, and the last commit. Nothing per
draw, and nothing reaches the guest: the line is a diagnostic.
What changes for the guest: an HEVC picture NVDEC answers failed once it ran
(its slice data damaged past what the parsers read) lands as NVDEC left it, its
command buffer completing as any, and the pictures after it decode from it, as
an H.264 picture NVDEC failed has. Before, its landing failed its command
buffer, which AppleGVA's HEVC path answers with kVTVideoDecoderMalfunctionErr
for that picture and every later one of the session.
Why: a Mac's hardware HEVC decoder hands such a picture on, as its H.264 one
does (measured with VideoToolbox on a MacBook Pro of 2019, macOS 26.7.1, on
the UHD 630: an HEVC P picture at 1080p whose last slice segment was cut to
half, and each picture after it until the IDR picture, came back with status
0 and an image). AnnexBDecoder::copy_failed_pictures now asks this for both
codecs, and its NVIDIA test cuts an HEVC P picture as it cut an H.264 one.
What changes for the guest: a host session's decode whose picture is one of
the stream's that does not decode no longer faults its command buffer. Such a
picture is one whose bytes do not read as H.264 or HEVC reads them, one that
predicts from a picture the decoder does not hold (a session or a seek that
starts at a P picture), or one after a picture that did not decode, before the
next I or IRAP picture. It now lands nothing: its command buffer completes as
any, its output keeps its bytes, and the session decodes again from the next I
or IRAP picture. This holds on VA-API and NVDEC, for H.264 and HEVC, and on
VA-API also covers a RASL picture the stream's random access skips, which
faulted there while NVDEC already landed nothing for it. A stream the decoder
does not take, an avcC or hvcC record's error, and the hardware's or the host
API's errors still fault.
Why: a Mac's hardware decoders answer each such picture alone and decode on
(measured with VideoToolbox on a MacBook Pro of 2019, macOS 26.7.1: H.264 with
no error, HEVC with kVTVideoDecoderBadDataErr or ReferenceMissingErr and no
image). Before, a guest boot on a Radeon 780M counted 85 decode faults
("a reference frame is missing", "PPS 4 has not been received", "no I picture
has decoded since a picture that did not decode") for H.264 streams started at
a P picture or with a damaged header, and an HEVC picture that faulted would
end AppleGVA's session with kVTVideoDecoderMalfunctionErr from that picture
on. The codec errors say which are one picture's (is_picture_error), and NVDEC's
error keeps them apart (Error::Picture), still reported as bad data.
The device's imports of the guest's pages into the host GPU can outlive its
release: rt frees them on a thread of its own once no GPU work uses them, and
the release of the last device keeps the GPU device for the process when its
wait runs out. So the memory map's host memory stays mapped, and is not
unmapped, mapped anew or discarded, until the process exits (the header's
RvgMemoryRange and memory_map, docs/api.md, and reims-vgpu's MemoryMap).
QEMU's side does not change: the machine holds its RAM backend until QEMU
exits (hw/core/machine.c:1216), and the VMs reims-ctl makes discard no guest
RAM: no balloon, free page reporting, virtio-mem or memory hot-unplug, and
their RAM is a shared mapping, which KSM does not merge.
A cached surface's device cache could hold the pages as they were mid-write
with no refill ever asked: the bundle recorded the surface's unlock seed only
as a commit first named a generation, so a fill the bundle never saw (a
present's, the first fill a block owes, a block named again) made while the
CPU held its read-write lock stood until the next lock. Such a present also
left the record to be made after the unlock, which then never asked.
The kext now writes each generation's refill record into the block's header
itself, as it caches the block and at each read-write lock, before the
generation, with the surface's unlock seed then (RgfxSurfaceRefill.hpp,
which the bundle shares). The first commit, in any process, once the unlock
seed has moved past the record's carries RGFX_SURFACE_USE_REFILL and settles
it; a commit while the lock is held or being taken asks nothing and leaves it
owed. For the host: a use after each read-write lock's unlock now carries the
flag, including the first use of that generation; the host ignores it where
the cache holds an older generation, as before, so a generation never filled
mid-write costs no extra fill. The record is one 64-bit word written by
compare-and-swap, so a holder never writes over a newer generation's record.
The bundle now names read-only anonymous memory unchanging where its maximum
protection has no write, the kernel answers it SM_PRIVATE at a shadow depth of
0, and mach_vm_page_info's VM_PAGE_INFO_BASIC answers its object's count as 1
at depth 0 with the region's object id (kRgfxAnonymousPrivate). The kext takes
such a block (kRgfxPagesSoleHolder, 1 << 3, where it sets
kRgfxKextFeatureSoleHolderPages, 1 << 20) and marks its SURFACE_PAGES
RGFX_SURFACE_PAGES_UNCHANGING without COPY_ON_WRITE, so the host reads its
pages once, as the view is imported. On P2's guest (macOS 26.7.2, the Windows
mini) the 4K block over such memory was copied whole at each commit that used
it.
A wire holds no reference, so the count leaves out wires for writing taken
while the memory was writable. The kext knows its own: it refuses the block
(kIOReturnNotPermitted) where, once its pages are wired, a writable block of
its own in the table or an in-place surface block covers a page of them, or a
block of writable memory is being made (writableMakes), and the bundle then
asks a read-only block, why RGFX_PAGES_WHY_REFUSED. The check sorts the
block's runs and walks every writable wire's segments under contextLock, once
per such make. What is left is a write another driver started before the app
removed write for good, still landing after the make.
The clause is on for every guest kernel, with no release gate. The facts it
rests on, read in xnu's published source at each tag from macOS 11.0.1 to
26.5, osfmk/vm/ lines:
xnu- cnt pid rid fake prot upl clamp iopl walk id
7195.50.7.100.1 19154 19264 14459 19126 6172 6459 17037 9030 14915 1209
7195.60.75 19074 19184 14406 19046 6156 6459 16984 9030 14862 1209
7195.81.3 19074 19184 14413 19046 6157 6459 16984 9030 14869 1209
7195.101.1 19119 19229 14290 19091 5915 6457 17020 9010 14749 1190
7195.121.3 19158 19268 14329 19130 5916 6457 17059 9010 14788 1190
7195.141.2 19158 19268 14329 19130 5916 6517 17059 9070 14788 1190
8019.41.5 19330 19440 14493 19302 6007 6551 17227 9137 14952 1190
8019.61.5 19330 19440 14493 19302 6007 6551 17227 9137 14952 1190
8019.80.24 19330 19440 14493 19302 6007 6551 17227 9137 14952 1190
8020.101.4 19330 19440 14501 19302 6003 6543 17247 9143 14960 1188
8020.121.3 18885 18995 14245 18857 5918 6541 16960 9131 14704 1168
8020.140.41 18945 19055 14305 18917 5909 6542 17019 9135 14771 1168
8792.41.9 19527 19637 14780 19499 5939 6701 17519 9294 15246 1166
8792.61.2 19538 19648 14791 19510 5939 6753 17530 9346 15257 1167
8792.81.2 19538 19648 14791 19510 5939 6753 17530 9346 15257 1167
8796.101.5 19669 19779 14872 19641 5926 6750 17650 9273 15338 1164
8796.121.2 19669 19779 14872 19641 5926 6750 17650 9273 15338 1164
8796.141.3 19738 19848 14911 19710 5940 6774 17695 9297 15377 1164
10002.1.13 19897 20007 15074 19869 6032 6791 17854 9316 15540 1163
10002.41.9 19910 20020 15087 19882 6032 6771 17867 9296 15553 1165
10002.61.3 19910 20020 15087 19882 6032 6771 17867 9296 15553 1167
10002.81.5 20023 20133 15121 19995 6041 6771 17980 9296 15587 1167
10063.101.15 20254 20364 15180 20226 6098 6774 18210 9299 15646 1355
10063.121.3 20357 20467 15247 20329 6123 6774 18308 9299 15714 1355
10063.141.1 20359 20469 15249 20331 6125 6774 18310 9299 15716 1355
11215.1.10 20139 20249 14984 20111 5692 6843 18096 8188 15442 771i
11215.41.3 20139 20249 14984 20111 5692 6843 18096 8188 15442 771i
11215.61.5 20501 20611 15230 20472 5759 6817 18384 8162 15693 765i
11215.81.4 20507 20617 15236 20478 5765 6817 18390 8162 15699 765i
11417.101.15 20646 20756 15393 20617 5804 6766 18487 8111 15856 765i
11417.121.6 20694 20804 15441 20665 5843 6781 18535 8129 15904 766i
11417.140.69 20703 20813 15449 20674 5841 6777 18546 8124 15913 766i
12377.1.9 20960 21070 15518 20931 5974 6988 18734 8331 16004 776i
12377.41.6 22004 22114 16433 21975 6174 7198 19709 8562 16933 807i
12377.61.12 22037 22147 16463 22008 6204 7203 19742 8567 16963 808i
12377.81.4 22109 22219 16534 22080 6275 7209 19813 8573 17034 808i
12377.101.15 18688 18805 13571 18677 5743 7659 16128 8765 14068 824i
12377.121.6 18686 18803 13569 18675 5722 7659 16126 8765 14066 824i
cnt vm_map.c, vm_map_page_range_info_internal: the top object's count,
less the query's own reference to 12377.81.4, read before it after
pid there: the id, VM_KERNEL_ADDRPERM to 10063.101.15, ADDRHASH after
rid vm_map.c, vm_map_region_recurse_64: the region's id, VM_OBJECT_ID
id vm_object.h (i: vm_object_internal.h): VM_OBJECT_ID, the low 32 bits
of pid's macro in each tag
fake vm_map_page_range_info_internal: a footprint query's count of 1 and
an id of no object (task_self_region_footprint)
prot vm_map.c, vm_map_protect (its preflight from 12377.101.15): no
protection the maximum lacks
upl vm_pageout.c, vm_map_create_upl: no write UPL where the entry's
protection lacks write; from 12377.1.9 through vme_allows_upl_write,
whose test is at 6786, 6986, 6991, 6997, 7413 and 7413
clamp vm_map.c, vm_map_remap_extract: a share's maximum is the source's at
most, which memory entries take through vm_map_copy_extract
iopl vm_pageout.c, vm_object_iopl_request: the UPL keeps the object with
no reference of its own
walk vm_map.c, vm_map_region_walk: the count less one while paging, so
the share mode alone leaves it in doubt
Later releases are checked by test: guest/bundle/tools/sole_holder_probe.c,
which the lane gate's info phase (item sole-holder) and Ambrosia's
check-boot.sh (check sole-holder) run on each guest they boot, reads the count
as 2 with a memory entry or a second mapping holding the memory and 1 once it
goes, sees a footprint query answered otherwise, the kext's writable wire of
memory whose maximum lacks write refused, a sole holder's block made, and
refused while a writable block of the kext's covers it. A release where it
fails is a red leg. The kext's tests cover the wiring and the runs' sort and
search, and the bundle's a sole holder's block named and refused.
design.md's no-copy buffers section and dgpu-oracle.md Q38 said a render
pass that stores or resolves into read-only memory fails its command buffer
with a page fault, as the M3 Max's does, and Q38 described the earlier
platform's Linux runtime and MoltenVK on macOS. On the rt platform, on every
host, the pass completes, its stores and resolves dropped with the copy's
other writes, as the 5300M and the UHD 630 complete one over read-only pages,
and is counted at the pass, rt-copied-store-outs, where the M3 Max faults it;
accuracy-ledger.md's read-only-pages-written row says so already.
Q39 described protection options the platform no longer keeps: rt builds
none (rt-unbuilt-protection), and a command buffer with them runs as one
without, which no Mac answers for encoders made under options 2 or 0x10. Its
type-9 draw is refused and counted, not a death.
What the guest observes changes. Before, where the host's video landing found
no blit encoder for its copy of a picture's staged planes into the output's
device caches (on the rt platform, an encoder metal2vulkan-runtime refuses),
the landing failed: the decode's value was signalled, and the command buffer
that waits for it completed failed, with Metal's internal error, which the
guest's video driver answers as a decode error (HEVC:
kVTVideoDecoderMalfunctionErr).
Now the copy is skipped, as the decoder skips whole a pass the platform makes
no encoder of (4b7975b882, decode::cmdbuf's unmade): the caches keep their
bytes, the picture lands with them, its value is signalled and its command
buffer completes as any landed picture's, not counted as a failure to land. rt
counts the refusal under rt-refused-<kind>, as before; the process's first
skip has a line. No new degradation code.
An encode's copy of its source out of the caches keeps its answer: no blit
encoder fails the frame (RGFX_VIDEO_ENCODE_FAILED), since a skipped copy would
hand the encoder the staging buffer's earlier bytes, another frame's or what
the buffer held when it was made.
No test held the old failure. The new tests:
a_copy_into_caches_the_platform_makes_no_blit_encoder_for_is_skipped (no copy,
signalled, completes as landed, the next picture copied as any) and
a_source_whose_copy_out_has_no_blit_encoder_fails_its_frame, which pins the
encode's answer.
NVIDIA's driver (620.70.06) keeps its own disk cache, nvidia/GLCache in the
user's cache directory, only for a Vulkan instance made while that directory
exists, and never makes it. A walk's cold boot started QEMU with a HOME made
wholly empty: Mesa's drivers and the runtime made .cache only after the
instance, so the boot left no NVIDIA cache and the next one started without
it. A user's HOME has .cache (scripts/install-ctl.sh makes ~/.cache/reims-ctl),
so a boot standing for a user's first one keeps an empty .cache in its HOME.
Measured on an RTX 2080 and an RTX 3090 with a probe of our own.
Anonymous memory read SM_PRIVATE is not provably unchanging: the region walk
takes one from the object's reference count while paging on it is in
progress (osfmk/vm/vm_map.c:16002-16005), and a wire holds no reference
(vm_object_iopl_request, osfmk/vm/vm_pageout.c:8331; upl_destroy, 5683-5685),
so a driver's wire for writing taken while the memory was writable, our own
kext's for a writable block among them, still writes its pages after the
maximum protection lost write, under a count of one. A once-made copy would
then be wrong for the block's life. Such memory is read-only again, why not a
file, and its blocks are copied whole at each commit as before.
What stays unchanging is SM_COW at shadow depth 0, with no write in the
maximum protection, which is sound against wires too (xnu main as read on
2026-11-20):
- such a pending copy is vm_object_copy_quickly's of an object whose copy
strategy is still symmetric (osfmk/vm/vm_object.c:3586-3605), and a wire
makes its object's strategy a delayed copy (vm_pageout.c:8404-8423), so the
object was not wired before the copy;
- a wire through either side after it resolves that side's pending copy
first, shadowing it (vm_map_create_upl, vm_pageout.c:7140-7188), as a write
fault does (vm_map_lookup_and_lock_object, vm_map.c:14866-14897) and a share
does (vm_map_remap_extract, vm_map.c:18314-18396), so the other side's writes
and wires land in a copy of its own.
What the host sees: blocks of anonymous memory SM_PRIVATE no longer carry
RGFX_SURFACE_PAGES_UNCHANGING; those with a copy pending carry it with
RGFX_SURFACE_PAGES_COPY_ON_WRITE. The bundle's classification line drops the
private clause. The tests hold both.
A no-copy buffer over anonymous memory the process mapped read-only, with
no write in its maximum protection, was a read-only block not unchanging
(why 1, not a file): the host copied its pages whole into its copy at every
commit that used it. On the Windows host's 4K desktop that is a 4K block of
ImageIO's (share mode SM_PRIVATE, ref 1, shadow depth 0), 7.93 ms and
31,007 KiB a present.
The bundle now names two share modes of such memory unchanging, read from
xnu's main as of 2026-11-20 (osfmk/vm/vm_map.c's vm_map_region_walk,
16088-16098; the modes' values osfmk/mach/vm_region.h:129-130):
- SM_PRIVATE, the object held by the region alone; a share of it takes no
protection past its maximum (vm_map.c:18037-18058, 18733-18734), and
VM_PROT_COPY maps a copy in its place (vm_map.c:5832-5905);
- SM_COW at shadow depth 0, a copy pending on the region's own object
(vm_object.c:3586-3605; vm_map.c:12727, 14046, 18604), where the other
side's writes go to a copy of its own (vm_map.c:14866-14897,
18314-18396), marked copy-on-write.
A depth of 1 or more, and every other mode, stays neither, why not a file.
SM_PRIVATE's one doubt is documented: the walk takes one from the object's
reference count while it pages (vm_map.c:16002-16005).
What the host sees: such blocks now carry RGFX_SURFACE_PAGES_UNCHANGING
(and _COPY_ON_WRITE for the pending copy), so the host reads their pages
once, as the view is made, instead of at every commit; the GPU's writes
there are dropped as before. The bundle's classification line counts the
two new clauses. The wire, kext and host docs say so.
The b357 merge's Windows leg failed the C harness's link: the build hit a
kache entry for reims-vgpu-c's cdylib that holds the DLL but not
libreims_vgpu_c.dll.a, which a test-only change leaves unrelinked. The
merge harness now relinks the crate past kache where the archive lacks it.
The docs of POOL_ADDRESSES, PRIVATE_BLOCKS, IMPORT_ADDRESSES and
MANAGED_AT_COPY, in wire.rs and the header cbindgen makes of it, and their
sections in design.md, said what "the Vulkan platform before" the runtime did.
That platform is gone. The host picks those addresses now only on a platform
whose blocks have none, the testkit's (pool::addresses, HostBlocks), and that
platform is not offered MANAGED_AT_COPY: the docs say so. IMPORT_ADDRESSES also
said a read-only block's copy drops the GPU's writes as each command buffer
completes; a copy of changing pages is written whole at each commit that uses
it instead, so the doc cites the ledger's read-only-pages-written entry.
surface_pages.rs, design.md, dgpu-oracle.md and the bundle cite the entry
`read-only-pages-written`, which the ledger lost when the old platform's rows
went. It now says what the rt platform does with memory whose GPU writes Metal
drops: a copy of its pages, the pages never written; a GPU write stays visible
until the next commit that uses a copy of changing pages, or the next
completion of a command buffer that can write a copy of unchanging pages, where
Metal drops it at the write; a render pass over such a copy completes with its
stores dropped, where the M3 Max faults it (rt-copied-store-outs); and a pinned
bit-24 buffer in a block that is no such copy is written (rt-no-copy-read-only).
rt's translator refusals (rt::Error::Translation) were counted only under
rt-refused-translation, with one first line for all of them, which printed the
translator's error as it displays and debugs: no feature apart from another,
and its location and symbol, names of the guest's functions.
Now the boot diagnostics' refusals line counts each by the feature it refused,
Translation-<feature> (metal2vulkan's Feature's variant, as
Translation-DivergentInterpolation), or by the translator's error's variant
where it refused none (Translation-Cancelled). The first of each name writes
its line in the refusal-detail form, with the feature, what it needs and the
attachment it is tied to, and no function's or symbol's name. The degradation
count stays one code, rt-refused-translation: no new degradation kind.
Diagnostics only; nothing the guest observes changes.
What the guest observes changes. Before, at ENCODER_BEGIN_RENDER, _COMPUTE or
_BLIT, an encoder the platform answered none for (on the Vulkan platform, a
pass metal2vulkan-runtime refuses, as a 4x BGRA8Unorm_sRGB resolve it builds
none of, seen twice in a Mac walk) raised an op fault: the command buffer's
message failed, its CB_COMPLETE carried an internal error, and none of the
buffer ran.
Now the pass is skipped whole, as a pass that names an object whose create the
host refused already is (OpenEncoder::Skipped): its ops are dropped up to its
end, the encoders after it run, and the command buffer completes RGFX_CB_OK. A
Metal app's sends to a nil encoder do nothing and fail no command buffer. rt
counts the refusal under rt-refused-<kind>, as before; the decoder logs the
process's first skip of each encoder kind once. No new degradation code.
No test held the old fault. The new test,
a_pass_the_platform_makes_no_encoder_of_is_skipped_whole, sends a render pass
the platform refuses as a gap and compute and blit passes it answers nil for,
twice each in one buffer, and checks that no op of theirs reaches an encoder,
the encoders after them run, and the buffer completes OK.
A test's end kept a weak hold of each rt platform the test used and let go
of the device of each one it could still upgrade. An Arc's last drop takes
the strong count to zero before the value's drop runs, so a platform whose
last hold was another thread's (a decoder's event-wait watch, a VA call
thread) failed the upgrade while its drop, and its let-go of the device,
still ran on that thread beside the process's exit. On an RTX 3090 a
cmdbuf test printed ok and died of SIGSEGV, the event-waits thread inside
vkDestroyDevice while the main thread ran libEGL_nvidia's exit handler
(measured from its core, 1 of 2440 tests under the suite's load); the 780M
saw the same test die after ok.
The end now holds each platform strongly to the let-go, which waits for
the device's other handles, tears the device and its instance down on the
end's thread, and leaves the platform no device for a later drop to tear
down. drop_last, the VA tests' wait for the platform's other holds, is no
longer needed and goes. A new test leaves a platform's last hold to a
thread nothing joins and checks from an exit handler that the device was
torn down before the exit; the weak end fails it.
Nothing the guest or the host sees changes: this is test code.
On rt, newArgumentEncoderWithArguments: and a function's
newArgumentEncoderWithBufferIndex: were an unbuilt piece
(rt-unbuilt-argument-layout). The host answered ARGUMENT_LAYOUT as refused,
the guest's encoder was nil, and a kernel then read through an argument
buffer whose words nobody wrote. On a guest's probe the RX 550 read zeros,
and the 780M faulted on the null pointers and timed out its gfx ring.
What changes for the guest: both calls now answer metal2vulkan's layout.
That is ArgumentBufferLayout::from_descriptors for descriptors, and
Function::argument_buffer_layout for a function's argument buffer, the
layout the function's translation reads. Every argument kind maps to the
core kind of the same name, nested layouts with their holders. Where Metal
makes no encoder, the call still answers nil, now counted under
rt-refused-metal; the translator's own failures are counted under
rt-refused-translation.
The unbuilt piece and its ledger row go. The tests read
tests/shaders/argument_buffers.metallib. sum_args answers 16 bytes,
aligned to 8, pointers at 0 and 8, from the function and from descriptors.
mixed_args lays out a pointer array, a constant, a texture and a nested
argument buffer. On the Vulkan platform, both kernels read back the words
written at those offsets.
Walk A on the 2080 at metal2vulkan 9ea53f7acd booted the same guest twice,
with rt's cache directory empty and then kept. The planner closed the
two-step make and the early create reply on these numbers: a second boot's
makes in the benchmark's first load cut sum 442 ms against 4124 ms, so cold
makes are a first boot's cost. docs/qemu.md keeps VM measurements.
The NVIDIA crate keeps the first runtime it is opened with in a static for
the process's life (nvidia::wait's RUNTIME), and with it the rt platform the
test handed it: that platform is never dropped, so no last drop races the
exit there. rt_test_end::drop_last at the NVDEC and NVENC tests waited for a
hold that never ends, and 6 of 6 failed its 30 s bound on an RTX 3090. Drop it
from them; the VA-API tests, whose video threads do end, keep it. The module
docs and docs/lessons.md now say so.
A test that hands its platform to the video crate leaves the threads of
what it made there (a VA display's call thread, an NVDEC or NVENC
session's) holding the platform after the test returned. Where the last of
them ends as the process exits, its drop destroys rt's instance and closes
the Vulkan loader beside the exit's handlers, and with NVIDIA's driver
installed beside another the exit then runs code of libEGL_nvidia.so.0,
unmapped by then: on the Iris Xe, graphics::vaapi's tests of writes into
dma-buf caches printed ok and died of SIGSEGV in 3 of 9 processes
(measured with LD_DEBUG=files and their cores).
rt_test_end::drop_last waits until the test's own hold is the platform's
last and drops it on the test's thread; each video test of the rt
platform ends with it. Nothing the guest or the host sees changes.
iHD's decodes write their render target Y-tiled whatever the linear import
says (U30, measured on the Iris Xe), so its target check fails every kind and
its pictures reach the device's caches by its video processing alone, into
each cache's surface, whose planes lie as iHD's runs write them. The docs
said those pictures were copied by the runtime device's GPU on iHD, which the
Linux open never made; they now say which way each layout takes.
A copy of read-only memory kept a base, compared every page with it at each
commit that used it, and at completion compared again to drop the GPU's
writes. The owner's rule is no compare-and-skip on read-only copies: memory
that is not provably unchanging is copied whole at each commit that uses it.
What the guest sees: the GPU's writes to read-only memory are still dropped,
as Metal's are, but now at the next commit that uses the memory, when its
bytes are written into the range again, not at the completion of the command
buffer that wrote them. A command buffer that writes read-only memory still
in flight when another commit uses it has those writes overwritten. The
writable memory and the writable shadows keep their merge, unchanged.
On the host (rt, copied.rs): a dropping copy keeps no base, copies all of its
pages at each commit, does nothing at completion, and no longer holds its
command buffer's handlers back. Counted for each kind (writable, read-only,
unchanging): rt-copied-*-commits, the bytes (writable-compared-bytes,
read-only-copied-bytes, and restored-bytes, as before) and rt-copied-*-sync-ns,
and the read-only commits and bytes by the block's why
(rt-copied-read-only-why-N-*), which the surface pages' import hands the
copy.
In the bundle (RgfxMemoryShadow): a read-only shadow keeps no agreed copy and
is copied whole at each sync. The process's commits, write-backs, bytes and
time for each kind are logged as "RGFX: memory shadows, totals" within a
minute of a change.
Read-only memory under a no-copy buffer lies over a copy on rt wherever the
GPU cannot import it as it is, and every commit that uses the copy compared
all of its pages with their base. Much of that memory is a file's pages on
the guest's read-only system volume, which nothing can change while the
buffer lives, so the compare buys nothing there.
What the guest sees: the device offers feature bit 31, UNCHANGING_PAGES, with
READ_ONLY_PAGES, and the kext takes it (kext feature 1 << 19). At a no-copy
buffer's make over read-only memory, the bundle asks the guest's kernel once
whether the range is one file-backed region whose maximum protection has no
write (a shared mapping, or a private one whose maximum was lowered), whose
every page is the file's own, on a volume mounted read-only (proc_pidinfo's
fsid against getfsstat; no path is opened). Such a block is the app's own
memory, as before, marked RGFX_SURFACE_PAGES_UNCHANGING (and
_COPY_ON_WRITE); the kext's wire of a private mapping makes the process's
copy, as a Mac's does. Any other read-only block carries why not in its
flags' bits 8 to 11, which the host only counts.
What the host does: an unchanging block's copy is filled once, as its view is
made, never compared at a commit, and written again whole at the completions
of the command buffers that can write it, which drops the GPU's writes as
before. The views' summary counts the other read-only blocks by why, and
each texture over one (read-only-pages-textures-why-N, with one line per
format, size and why).
A private mapping whose maximum protection still has write is not provably
unchanging, since its process could raise its protection and write its copy:
it stays a plain read-only block, why "writable max protection".
Moves both metal2vulkan revs from 5004f224a7 to 9ea53f7acd, 9 commits further
on its development branch, named checked by its job m3-max-59486. The lock is
unchanged: no manifest changes in the range, and it still carries no source
lines for the metal2vulkan packages. The range changes no API this tree calls:
it adds Feature::DivergentInterpolation and four Metrics fields, and deletes
DriverWorkaround::InterpolationNeedsTheWholeQuad, which nothing here names.
On rt, for the guest:
- Divergent interpolation is refused on every device (f3b9e0253a). A fragment
function that reads an interpolant at a sample or an offset
(interpolate_at_sample, interpolate_at_offset) outside its first block, or
after a discard_fragment in it, is refused by the translator as
Unsupported::not_implemented(Feature::DivergentInterpolation), where Metal
makes it: the render pipeline state's creator answers its NSError, counted
under rt-refused-translation, as the translator's other refusals are. Before,
rt lowered the shape on every device, and RADV's sample and offset reads
there read garbage where the quad's helper invocations had left. The same
reads in the first block, before any discard, are made as before.
docs/accuracy-ledger.md lists the refusal with rt's.
- A looping fragment function's sample-qualified varyings are read at every
sample a pipeline of the device may have, before the loop, on every device
(f3b9e0253a); rt read them inside the loop, where the helper invocations of
a partly covered quad have left. The workaround that keyed this on RADV's
release was set by nothing since the driver-fact tables went, and is
deleted (7aa9abf911 re-pins its runtime sources' hash).
- SEMANTICS_VERSION goes from 2204 to 2205, so rt's shader and pipeline caches
miss once more: the first run on each host translates its pipelines again
(2258522299 re-pins the old render key at it).
- Metrics::held_starts and Metrics::held_start_gap_nanos (3d93acd6be): the
sends of a group a queue held behind its three submissions in flight, and
the GPU's nanoseconds from the latest end of the work submitted before each
to its own first start.
- Metrics::pipeline_creation_nanos and Metrics::translation_nanos (33cdabd1fd,
9ea53f7acd): a pipeline's make split between the driver's
vkCreate*Pipelines calls and rt's calls into the translator (its reads of a
kernel's inputs and partition and of a render variant, its lowerings, links
and plans), failed calls included; the cache digests count none.
- The four counters change nothing the GPU runs, or when. The next commit
writes them in rt's part of the 10 s summary.
- The event-wait deletion (a075319ea1, no semaphore wait submitted for an
event's value) came with the pin before, at 5004f224a7; c919913869 corrects
rt's docs after it and drops a check for waits no segment has any more.
Nothing more changes for the guest.
- c0e1b47df5 and 96d335ef46 are rt's own tests: its layouts ledger keeps each
image's steps in queue order, and an imported-alias test follows the
compositor's order. Nothing changes for the guest.
rt binds a heap texture at its absolute place in the block's memory, so a
Private heap the guest pins must start at a multiple of every alignment the
GPU answers for a heap texture. The guest pins at 256 KiB from its block's
first byte; the test checked three shapes on the GPU it held.
The test now sizes each SDK pixel format with four usages as 1D, 2D, 2D
array, multisample, multisample array, cube, cube array and 3D textures, of
one level and of every level, and fails where the GPU asks more than the
guest's kHeapAddressAlign, or more than a heap of its own starts at. It
places a texture of each alignment answered at offset 0 and at the alignment
in a heap pinned in a known block at the guest's alignment and in a heap of
its own, and in a heap pinned on the old 32 KiB granule checks that rt's
refusal is counted apart, as rt-refused-heap-texture-place. A GPU whose
images ask more than 256 KiB then fails the checks before a boot meets it.
Measured largest on 2026-11-20 at rt d83fb05: 256 KiB on the RX 7900 XTX and
the RX 550, 64 KiB on the Radeon 780M and the Iris Xe, 16 KiB on the M3 Max
(KosmicKrisp), 1 KiB on the RTX 2080 and the RTX 3090. None is above the
guest's pin, so neither the device's answers nor the guest change; the
module doc records the numbers.
The rename of metal2vulkan-rt to metal2vulkan-runtime lengthened each mention
by five columns, and 43 lines of comments, docs and string literals ran past
the tree's 100 (the C API's two paragraphs were rewrapped in a16076ff37). Each
moves its last words to the next line of its paragraph, cascading where that
line runs over in turn; no word changes. A string literal moves words only
across its backslash-newline continuations, so every string reads as before:
each file's comment words, code tokens and decoded strings were compared
before and after, all equal. No log line, message or test changes.
Moves both metal2vulkan revs from d83fb05624 to 82e7c39216, 65 commits on its
development branch, named green by its checks (m3-max-59311). The runtime's
crate takes its published name there (9a1c8fe6dc): metal2vulkan-rt 0.0.0 is
now metal2vulkan-runtime 0.2.0, its library metal2vulkan_runtime. The
dependency key, the crate's paths (each still `as rt`), the lock's entry and
the docs, comments, log lines and scripts that named the crate follow it. The
rename changes no API.
On rt:
- A command buffer waiting for a shared event's value whose signal is
submitted is Scheduled as it is submitted (4730af16e7): its scheduled
handlers run on the submit thread then, and its queue's later command
buffers are no longer held behind it. A wait for a value that neither the
host set nor a submitted signal promises stays held, Committed, as before
(counted in Metrics::event_holds, fb4b77048c). GPU order and completion are
unchanged. The docs that said rt's completion thread runs a held command
buffer's scheduled handlers now say its submit thread does.
- Copies over buffers are tracked by the memory a buffer lies in, never its
id (7e38a29b69): a texture over one buffer sees a draw through a texture
over another buffer over the same bytes, in one command buffer and across
a held group.
- A kernel that reads buffers through an argument buffer's pointer members,
or through a gpuAddress the CPU wrote into a constant buffer, now makes
(3cdca62567, c0403a1c98); the translator refused it (IdentityDomains).
- A refused kernel input names its kind (98895eb6d2, 1c26e1dc54):
Gap::KernelInput { kind }, so the refusal's text, in the log and in the
NSError's description, carries the kind. It is still counted as
KernelInput.
- Memory goes back sooner. The release of a texture or block that an unsent
upload holds sends the upload at once (0277c68696). A texture longer than
a 16 MiB block has its block to itself and gives it back at its release
(61949e8ba4). Every free of device memory on a normal path is made by the
block-maker thread, and counted against the submits it meets (4c808ffa6d,
09735ad792). New gauges tell texture blocks apart from the consumer's
Private takes (b3f6c859dd).
- ComputePipelineState::dispatch_variant, the key of the VkPipeline a dispatch
runs (82e7c39216), which this tree does not call yet.
- The translator's old path is deleted (0b94d919d9 to 16c831165d): its
profile comes from Vulkan queries alone, with no policy switches and no
driver-fact tables. SEMANTICS_VERSION goes from 2201 to 2203 and
RUNTIME_VERSION from 2540 to 2541, so rt's shader and pipeline caches miss
once: the first run on each host translates its pipelines again.
The rest is metal2vulkan's own: its conformance declarations and ledger, its
generated documents and the tests of each change. The NSError texts the guest
receives, and the comments of the wire header and the guest's sources that the
prebuilt kext sets and the option ROM record, keep the old name here; commits
of their own change them.
design.md said host device addresses never reach the guest (section 6 and the
handles paragraph). On rt a pin lies at the guest's pick only where a block the
host knows holds its range; any other pinned buffer is made at the driver's own
device address, which the guest's GPU work then sees in place of its pick, and
the platform counts it (rt_platform::buffer, "A pinned address"). Both places
now say that. Docs only.
On the rt platform a dispatch's first use of a shape (its threadgroup size,
threadgroup memory lengths and grid) makes the kernel's VkPipeline on the walk's
thread, and the buffer's commit, with its process's wait for it, waits for that
make.
As a queue's service thread begins a buffer with a compute encoder, its
pre-pass (graphics::decode::prepass) reads the dispatches through the
message's views of the table and hands each shape not handed before to the
compile pool, one compile a shape, which calls the state's prepare_dispatch
while the walk goes on: rt makes the VkPipeline at the size the dispatch
gives, and lowers nothing. A dispatch then finds its pipeline made, or waits
for the one thread making it. It is bounded: a compute state's entry
remembers the last 64 shapes handed, a buffer hands 32 at the most, and the
pool runs these makes on all its threads but one, after every library and
pipeline create.
The walk waits for none of it. Right after the walk and commit, before the
message lets go of anything, the pre-pass is closed: the shapes no thread took
are dropped, and the walk's thread waits for those being made, so a compute
state the guest destroyed during the walk is still let go of where its view
closes, and the indices it gives back go back in the same order. Each wait is
counted (dispatch-prepass-waited, -wait-ns, -wait-max-ns), and the first of
each walk end (committed, refused, faulted) is logged.
Nothing the guest or the host sees changes: prepare_dispatch reports nothing,
and each dispatch's results and errors are decided in the walk as before. The
tests on the fake platform hold that each buffer completes as before, and that
a make the walk never reaches ends before the buffer's views close.
docs/conventions.md names the one exception to "compiles run only inside the
wait that needs them".
A take of a piece of its own length now blocks only the guest call that
asked, but that call still waits for the host driver's allocation of its
length: on the 2080, 139.5 ms of a 547 MiB take's 271.5 ms wait for its
piece, and on the RX 550, 64.4 ms of 65 ms. Those are the measurements from
before the pool's change; the next gate walk measures them again.
A take that grew the pool was carved only once the host said its piece was in,
and its worker zeroed it after that, so the host's add and the zeroing ran one
after the other on the take's path: on the 2080's gate walk the zeroing of
context 39's 560320 KiB take took 22.78 ms, and a 256 MiB add took 2.3 ms on
the 780M (11-19).
Now the pool's thread carves the take at its piece's first byte as it places
the piece, before it asks the host's add, and the take's worker zeroes the
carve while the host maps the piece; the take is still answered only once the
host said the piece is in. The zeroing's time counts as the take's zeroing
(pool-take-wait-zero-ns), and only the rest of its wait for the piece as its
growth (pool-take-wait-growth-ns and the pool-take-waited line), so the wait
codes' test checks the growth with the zeroing.
For the guest: a take that grows the pool is answered at its own piece's first
byte. Before, it took the first fit once the piece was mapped, which under a
race could be bytes another take freed meanwhile, or, with another context's
take carved first in the new piece, a further piece of its own.
A take that fits no piece waited for its own piece on the pool's one thread,
which served every ask in turn: the headroom's 16 MiB blocks from rt (each up
to 72 ms where rt's maker makes one), then the take's own block, and a piece
going back blocked the thread until its holds and the host's remove were done.
On the 2080's gate walk, context 39's take of 560320 KiB waited 271.54 ms for
its piece, of which 139.5 ms was rt's allocation of its block; the rest was
the wait behind that thread's other work and the add.
Now the take's worker takes the block of its own length from the source, with
the pool's lock let go of, so only that take waits for its allocation. A new
thread, reims-vgpu.graphics-pool-ahead, takes the blocks of the pool's own
asks (the headroom and the host's pool_grow). The pool's thread places the
takes' blocks before the taker's, and gives a piece back a step at a time: it
asks the host's remove once no hold is left and gives the block back once the
host removed it, waiting for neither, with the 1 s warning kept.
For the host: pool_add and pool_remove stay on reims-vgpu.graphics-pool, one
at a time, in the order the pieces are placed, each add before its remove.
A take's block may now be placed ahead of headroom blocks asked before it,
so the order of the adds, and the pool offsets the guest's takes get, can
differ under a race from before. The new tests fail on the code before this
(job m3-max-58851): another context's take, the headroom and a give-back now
go on while a take's own block is being made.
FEATURES_LO bit 9 was listed as reserved in design.md and is now
IMPORT_ADDRESSES_LATER. A guest that takes it beside IMPORT_ADDRESSES:
- gets a pages block's SURFACE_PAGES answered before the host makes the
block's view and its import, at gpu_address 0;
- makes its buffers over the block at gpu_address 0, and the host places each
at the view's address plus its offset;
- asks for a buffer's address with a new ring-0 query, PAGES_BUFFER_ADDRESS
(0x23d, RgfxPagesBufferAddress), answered by an RgfxPagesAnswer.
Why: on Iris, rt's import of a 17 MiB block of 4244 runs took 15.96 ms of
the block's 16.19 ms answer, and the guest's call waited for all of it. With
this bit, the import runs on the host after the answer is given.
This commit alone changes nothing for a guest: the host offers no new bit
yet, and no kext takes it. The header is cbindgen's (cargo xtask header).
cutdel's WIP 9 renames rt_platform/swapchain.rs's "No device recovery, no
drawable fetch" to "No device recovery", with the drawable fetch gone; the
ledger's device-loss row cited the old heading.
cutdel's newest tip deletes vaapi.rs's crop_extent with the old
platform's copier; the route's text named it as where the crop is
fitted. The crop is still the CPU copy's, so the sentence keeps that
and loses the name.
The cutdel branch deletes VulkanPlatform, metal2vulkan-runtime and the rt
feature, so RtPlatform over metal2vulkan-rt is the only platform. These
docs still described the old one: its answer policies, its exact
switches, MoltenVK on the Mac, its in-place guest memory, its records
cache, its device recovery and its Metal-answer tests.
- conventions.md: the guest-memory-in-place rule is replaced by the rt
rule (rt allocates GPU memory, the device maps its blocks into the
guest, textures sync at the guest's events, and there is one VkDevice
per process). The degradation codes are now rt-unbuilt and rt-refused,
and the deleted codes are dropped.
- accuracy-ledger.md: restated for rt, which has no switches. It keeps
the device's own arithmetic notes (tagged as measured before rt), the
19 unbuilt pieces and rt's refusal kinds, and device loss.
- api.md, README.md: REIMS_VGPU_EXACT, _CENSUS_DIR and _TRACE_DEGRADE
are gone, and STRICT now covers running out of memory only. The let-go
and the quiesce describe one platform.
- architecture.md, development.md, testing.md, qemu.md: KosmicKrisp in
place of MoltenVK; RtPlatform, rt_window and RtBlocks in place of
VulkanPlatform, the old window sink and HostBlocks; no Metal-answer
comparisons and no opt-in GPU-fault tests.
- lessons.md: the four lessons about deleted code only (the Metal
comparison after MoltenVK, the runtime's shadows, device recovery and
the in-place check) are dropped. The lessons that still bind mark
their deleted names.
- video/vaapi.md, graphics-kext/design.md: the GPU plane copy and the
compositor mirror are marked as gone.
- AGENTS.md: only the Vulkan platform's "Where things are" row changes.
A released block's device cache was dropped on the surface worker under its
block's key, and so were the views and the SURFACE_PAGES and BUFFER_OVER_PAGES
jobs, on the worker's four threads. A video session's caches go together at its
end: on Windows each is a Direct3D 11 target pair whose drop flushes both
immediate contexts under the plane draws' lock, 6 ms at the median and up to
100 ms under that contention. On the UHD 630 the held pass's 240 pairs kept all
four threads busy, and the next session's first SURFACE_PAGES, taken 15-19 ms
after its open and done in 0.02 ms, waited 512-586 ms for a thread to post its
answer; the guest's first copy took 516-600 ms.
The caches now go on a worker of their own, reims-vgpu.graphics-let-go-<i>,
each block's in its order: at a BLOCK_RELEASE, and once a block is named again
without a cache, whose drop ran inline on its ring-0 lane before. Their drops
answer nothing and no job waits for them, so a pages job no longer waits behind
them. The Linux arms' caches, VA-API's dma-buf imports and NVDEC's, go the same
way through the same let-go. A view's drop stays on the surface worker under
its block's key, as its mapping may go back to the idle pool the block's next
SURFACE_PAGES takes.
The planner measured the copies on the M3's walk: while apps opened, from
24% to 152% of a 1080p frame's bytes; in steady animation, under 1%. On a
Mac the guest's pages reach the GPU by host pointer, and that kind of import
has no handover that keeps an image's bytes, so the platform copies them.
Linux hosts import through dma-bufs where the pages lie in one, and an
in-place form there is being built.
docs/known-issues.md's Mac section becomes "On a Mac", with the macOS 26
floor and this as its two parts. Windows is named as a fact of the code:
rt_platform/buffer.rs's import_pages takes the pages by pointer on every
host but Linux's dma-buf path (buffer.rs:1483-1491); the copy amounts are
measured on the Mac only.
docs/known-issues.md and install-ctl.sh's warnings said that on a Mac with
no KosmicKrisp, macOS 15 or earlier or a mesa without the driver, VMs get no
GPU. They do not start: the library's device has no GPU device to open
(reims-vgpu's GraphicsDevice::with_platform refuses with HostResources), so
rvg_graphics_device_create refuses, and QEMU's reims-graphics-pci fails its
realize, which ends QEMU before the guest runs. reims-ctl gives every arm64
VM that device, and arm64 VMs are what a Mac runs.
The doc's heading and paragraph and the installer's two warnings now say the
VMs do not start.
The cutover makes the rt platform the library's platform, and with it some
things a user meets that the README did not say: on a host of several GPUs
the VM takes a discrete GPU over an integrated one, untimed, so a host whose
integrated GPU is the faster one gets the slower card; three open bugs of 4K
H.264 video on a Windows host; the host memory the guest's Shared pool holds
beyond the VM's RAM, with its 64 MiB headroom and 5 s release delay; and on a
Mac, Mesa's KosmicKrisp, which Homebrew builds only on macOS 26 and later.
docs/known-issues.md says each in the user's voice, with how to pick the
other GPU through reims-ctl's --gpu or --env, and the README's Beta note
links it in one sentence.
The pool asked its source for 64 MiB pieces. metal2vulkan-rt's unit is 16 MiB:
a take of up to a unit lands in a unit rt's block maker made ahead, with no
Vulkan call, while a longer take makes an allocation of its own length on the
pool's thread and rt frees it as one call once it has been idle 250 ms. A
driver may hold the device's submissions for the whole of such a call, longer
the longer it is: on an RTX 3090 a free on rt's slow path held a submit 72 ms
for 64 MiB and 20.6 ms for 16 MiB, and rt's ALLOCATION_LEN records a 16 MiB
Shared allocation holding one 3.3 ms at the median and one of 256 MiB 51 ms
(measured).
A piece the pool asks for itself is now one unit, BLOCK_LEN, read from rt
(MemoryClass::Shared.block_len()). The headroom keeps the bytes it kept, 64 MiB
(HEADROOM), as four empty pieces: the pool asks a unit for each piece the
headroom is short, counting the asks its thread has yet to serve and the one it
serves, and gives back only the empty pieces above the lowest 64 MiB of them. A
take longer than a unit still has a piece of its own length.
What the host sees: pool_add and pool_remove carry 16 MiB pieces where they
carried 64 MiB ones, four adds at the guest driver's take of POOL where there
was one, and, as the guest's use grows and shrinks, up to four times the adds
and removes for the same bytes, each piece a mapping of its own (QEMU: an
unmergeable RAM region, a KVM memory slot in each address space).
What the guest sees: a block's offset in the pool, and its GPU address where
the guest took POOL_ADDRESSES, follow the 16 MiB pieces. Blocks that shared a
64 MiB piece now lie in up to four, and a take longer than 16 MiB, which fitted
the old piece, has a piece of its own past the headroom's.
The tests that held the one 64 MiB piece count the headroom's pieces, and
a_piece_is_one_rt_unit pins the unit, the headroom's bytes and the long take's
own piece.
The owner ordered the cutover: the library's platform is RtPlatform, over
metal2vulkan-rt, from this commit on. The rt feature of reims-vgpu-vulkan,
reims-vgpu and reims-vgpu-c is now on by default, so `cargo xtask dist`,
`make`, the installers' builds and QEMU's link all make every handle on
RtPlatform. Every test set that builds those crates with their default
features now runs rt's tests where it ran the old platform's.
For the guest everything the device answers and draws now comes from rt:
pipelines through rt's translator, memory from rt's pool, surfaces and imports
through rt's paths, on the host's Vulkan driver on Linux and Windows and on
Mesa's KosmicKrisp on a Mac. The old platform, VulkanPlatform over
metal2vulkan-runtime, still builds without the feature until its code is
deleted, which comes next. Anything wrong on rt is fixed forward.
fce2381013 tells the guest of a drawn picture's decode before its draw, so a
player that holds each 4K picture no longer waits for the draw between its
decodes. Measured on the Intel UHD 630 (Vulkan driver 101.2145, Mesa 26.2.7's
vaon12), 2026-11-20, in two exclusive boots of a macOS guest with it and two
of the same tree without it, four held passes of each file a boot:
- held 4K HEVC played at 57.5 to 69.8 fps with it, against 27.9 to 44.3;
- held 4K H.264 at 89.1 to 127.6 fps, against 62.8 to 121.7.
check.js matched 240 of 240 frames in each of its four checks a boot on both
trees. What is left of a held picture's time is the driver's decode, which
the entry said the device cannot shorten.
docs/video/bugs.md gave U28 to two upstream bugs. The first, iHD and
radeonsi decoding nothing of a 4096x4096 H.264 picture, keeps U28: D25,
devices.md, vaapi.md, lessons.md and h264.rs cite it. The second, radeonsi's
decodes writing an imported surface only within the bytes its planes as
declared span from the luma plane's first byte, becomes U29, with the two
comments that cite it (the VA crate's target.rs and the arm's tests).
Comments and docs only.
On the rt platform on Windows, a picture whose output's planes lie in a
cache's surface over Direct3D 11 textures lands by a draw from the texture
the driver decoded it into. The landing waited for the decode, drew, and only
then did the guest hear of the frame: a command buffer of the decode alone
posted its CB_COMPLETE at its platform end, behind the session's signal. A
player that holds each picture keeps one decode in flight, so each picture
took the decode, the draw (4.4 to 5.2 ms of a 4K HEVC picture on a UHD 630)
and the guest's own work in turn (docs/video/bugs.md, B96).
The landing now tells of the decode done between its wait for the decode and
its draw, as the VA-API arm's video processing on Linux does as it issues its
copy. What changes for the guest: such a command buffer's CB_COMPLETE goes as
the decode is done, in its queue's order, with GPU times of 0, while the draw
runs. Nothing else moves. The session signals the decode once the draw is
done and the platform holds what it wrote, and the buffer's end, its surface
timeline and every read of the output wait for that signal: a command buffer
of another queue that uses the output (a blit or copy from its texture or its
buffer among them), a decode into it, a lock's download and a present. No
reader sees the picture half drawn. A draw that fails falls back to the CPU's
copy, still before the signal; a picture that fails to land after its
CB_COMPLETE fails the session's next decode in its stead, counted as
video-landing-failure-carried, as on Linux.
No test held the old order: the drawn landing needs vaon12 and a decode. New
tests: a session posts a picture's completion at its decode-done tell and
signals the decode only once the rest of its landing is done; and a blit of
another queue from the output, its texture's texels and its buffer's bytes,
copies only behind its wait for the decode's buffer's end, which that buffer
signals only behind its wait for its session's value. The tests of a reader
on another queue, a decode, a download and a present after a completion at
the decode hold for the draw as for the copy.
A large surface's whole-extent shape had its block taken ahead, on a worker
pool of its own after its SURFACE_PAGES answer, so that the ring could place
the shape's image in it instead of taking a block at the make. On a 3090 walk
(the desktop, a browser and a 3D benchmark), no placement into a block taken
ahead saved a make: 33 images placed so at 2648x1618 took 1.47 ms each,
against 1.21 ms for the 8 of that shape made with a block taken at the make;
2 at 3648x2038 took 1.64 ms against 1.67 ms; and the two shapes whose makes
took longest were never placed so. 54 blocks were taken ahead (1755 MiB), and
19 of them went back unused (1141 MiB).
The take ahead, its worker pool (reims-vgpu.graphics-shape-blocks-<i>),
ApiPlatform's shape_block and placed_shape_image_in, rt's ImageBlock, and
their codes (rt-shape-blocks-ahead*, rt-shape-image-makes*) are removed. A
new shape's image is made on the thread that asks for it: it is placed in a
block taken at its make where its fill copies more than zeros, and is the
platform's own otherwise, as before the take ahead. The guest sees the same
values.
The device choice now passes over a device a display's window cannot present
on, so with KosmicKrisp's manifest where Homebrew's mesa puts it the default
platform opens MoltenVK. docs/qemu.md and install-ctl.sh's comment said it
timed KosmicKrisp as the faster and took it; they now say it passes it over,
with the M3 Max boot that shows it (m3-max-57194: 16 of 16 checks, the
full-screen Metal app at 60 fps with 600 frames and none dropped), and keep
the earlier numbers as what it did before. mesa stays out of what the script
installs, as the default platform does not use it.
metal2vulkan's development b676eda182 refused a colour render target made with
no texture index. The blit seam's tests made theirs directly with the runtime and
failed on every rt device, but they are ignored on macOS, so only the Linux and
Windows legs of the pin's batch could see it. The lesson says how to find such
tests before a pin's batch.
install-ctl.sh's comment said the default platform takes the first GPU of
its kind the loader lists. It times each GPU the loader lists and takes the
fastest (device_choice.rs), and a boot measured what that does when Homebrew's
mesa puts KosmicKrisp's manifest where the loader reads it: on the M3 Max the
default platform took KosmicKrisp, on which a display's window cannot present,
and check-boot's full-screen Metal app ran at 30 fps with dropped frames and
failed, where on MoltenVK it runs at 60 fps with none dropped.
The comment now says so, and docs/qemu.md records the boot beside the rt
build's, which passed all 16 checks on the KosmicKrisp the install links.