At the runtime's cutover every host makes a no-copy buffer over pages the
guest maps read-only over a copy of them, the Mac included, where today it
imports them in place. To know what that copy costs a guest, the decoder now
counts each such buffer it makes, once a boot, in the degradation counts'
line: `read-only-pages-buffers` (how many were made) and `read-only-pages-kib`
(their bytes' sum in KiB, rounded up).
A BUFFER_OVER_PAGES over a block the kext marks RGFX_SURFACE_PAGES_READ_ONLY
is the only such object: the bundle sends read-only Shared memory there with
bit 24, and a heap, an indirect command buffer's slots or a Managed object's
CPU copy over the block is refused. The count is taken there, in the decoder
every host shares, so it means the same on Linux, Windows and macOS.
The counts' line is where they go: docs/conventions.md lists every kind
counted since the process began there, not degradations alone (the rings'
`vblank-dropped` and `*-post-waited` among them), and says no count goes
elsewhere. On macOS the buffers are no degradation; on Linux and Windows the
runtime also counts their copies, with failed imports, under its own code.
answer.rs gains count_kind_by, which adds an amount to a kind's count.
Diagnostics only: no ring message, value or answer the guest sees changes.
The swapchain, the window's presenter, the display's sink and the window
system's extensions present on Windows too, through SDL's Win32 surface
(os/windows.rs's WINDOW_SURFACE_EXTENSIONS), but their docs said "either OS"
or named Linux and macOS alone. rust-toolchain.toml still named the Metal
platform, deleted on 11-07. caps.rs's table gave a host's naming of its
device by Metal's registry ID (open_device, a handshake) as the reason for
the stand-in; no host names its device so now, and the reason that holds is
that Metal's core count and driver sizes for that GPU are found by that ID.
Comments and docs only.
A loop of command predication that ran past the iterations laid down for
it set a flag in its command buffer's state buffer, and a completed handler
of the platform's own read the flag and ended the process. That handler ran
on the runtime's thread outside every refusal scope, so a guest whose loop
ran on, or anything that wrote the flag, ended QEMU. The state buffer is host
data the GPU writes, and after the runtime's cutover every byte on the device
is guest-writable.
The flags are now read where the runtime's own failures are read, once the
command buffer completed with none: by each completed and completion-seen
handler's read, and by status, error and waitUntilCompleted. An overrun is a
failure that is none of Metal's, dying where it is read, as the others do.
What the guest sees: inside the graphics lane's refusal scope, which every
guest command buffer's handlers carry, the read is refused and the command
buffer completes with status Error and an internal error (RGFX_CB_INTERNAL),
after its event signals and in its queue's order, and QEMU goes on. Each
such command buffer is counted once as the degradation
predication-loop-overrun. Outside every scope (the library's own tests) it
still ends the process, now at the first read of the completion.
The death test now dies at the wait, and two tests pin the refused
completion and a loop that ends within its copies.
metal2vulkan is replacing its runtime with a new crate that has one path
for every device. reims-vgpu's rules now say what that means here until the
cutover: the current runtime takes regression fixes only, from one lane at
most, and nothing extends its device tables, device checks or queue-sharing
policies. reims-vgpu builds its side of the new contract: runtime-owned
memory mapped into the guest, device-image textures synced at the guest's
events, and host-assigned addresses with one VkDevice per guest process.
At the cutover that replaces guest memory in place, which conventions.md
now says.
The pin rule now states what the owner set on 2026-11-17: the pin is an
exact commit on metal2vulkan's development, on the remote before ours is
pushed, and a regression it brings is fixed forward rather than routed
around by holding or rolling back the pin.
An encode's frame at 1080p and 8 Mbit/s goes to the guest as two or more
16 KiB VT_MESSAGE events. Two of them do not fit the control completion
ring's 32 KiB at once, so an encode filled that ring about once a frame:
control-ring-full and control-ring-post-waited 592 times in an arm64 26.6.2
boot's encode bench (potluck job m3-max-38178). A full ring holds back the
display's VBLANKs and the presents' answers while the guest encodes.
Feature bit 54, VT_RING, which the device offers wherever its host offers
VT_MESSAGES and the arm64e kext takes with it, moves those messages into
the VideoToolbox ring: a 2 MiB ring at region offset 0x20000, in the room
between the control completion ring's span and the guest's allocations,
which the kexts already map with the control rings. It is the device's
memory, so the kext wires none of the guest's RAM for it and frees nothing
at the service's stop or its unload. Each message there is followed on the
control completion ring by a 24-byte VT_RING event (0x40f) carrying the
ring's count through it. The kext takes the ring through that count as it
takes the event, so the messages keep their place among the control
ring's events. A message that finds the ring full goes onto the control
completion ring as before, after the VT_RINGs of the messages ahead of it,
and the spell is counted as vt-ring-full. A guest or host without the bit
gets VT_MESSAGE events as before.
What the guest observes: the feature bit offered with VT_MESSAGES, and the
host's messages in the VideoToolbox ring with VT_RING events instead of
VT_MESSAGE events, in the same order.
macOS 26's unified log shows an NSLog argument that is an object or a string
made at run time as <private>, so the bundle's diagnostics named nothing there:
RealityKit's usdz Quick Look preview logged "RGFX: <private>: no reflection
(<private>); answered nil" and no more. The bundle's Objective-C sources now
log through rgfxLogLine, which formats the line as NSLog does, logs it as one
public string on the bundle's subsystem at the default level NSLog used, and
writes it to stderr where NSLog wrote there too (the death checks read a
death's words there). bundle_log_check.sh fails a bundle that calls NSLog.
The library builds and tests on Windows now, so AGENTS.md says Windows is
being brought up on homelab-mac-mini-2018, with nothing shipped for it yet.
Checking a change gets a row for Windows-only code: the check's Windows
clippy, then the crate's tests on the mini through
scripts/internal/windows-tests.sh. The note on what the check covers off the
host's own target now names the Windows clippy. conventions.md's list of
per-OS files gains the Vulkan crate's os/windows.rs and the graphics crate's
unix/windows splits.
With the window on Windows SDL3's on the library's own thread, as on Linux,
the C API's thread rules name Windows beside Linux: the header (from
window.rs, regenerated), docs/api.md and the feature's note in reims-vgpu's
manifest. docs/conventions.md says Windows takes Linux's host-call catch.
On Windows the window is the SDL thread's, as on Linux: SDL3's Win32 window on
the library's own reims-vgpu.ui thread, its Vulkan surface made by the render
thread through SDL_Vulkan_CreateSurface (VK_KHR_win32_surface). SDL3 is built
from its pinned source release and linked statically, as on Linux. A Win32
window's messages go to the thread that made it, and SDL makes and pumps it on
the thread its video started on, the UI thread.
native/windows.rs holds what Windows adds: it names no compositor GPU, so the
window presents on the runtime's device. Its doc records what SDL does there
(read from SDL 3.4.18's code): the process declared per-monitor DPI aware,
sizes in pixels with the monitor's DPI as the content scale, and the keyboard
grab as a low-level keyboard hook on the UI thread.
Linux and macOS build what they built before.
A buffer walked in two ranges at once reached the GPU in two steps: the first
range's parts as they were cut, the later range's whole work only at the join,
since queue order puts it after the first range's last part. On um870's 3090
(26.7.2, Launchpad) that left 3.7 ms of GPU work after the walk's end
(m3-max-31226), and a split into any number of contiguous ranges keeps such a
tail.
The walk now cuts such a buffer at encoder ends into chunks of 4 KiB of ops or
more (about 31 for WindowServer's 125 KiB Launchpad frame, near the 36 parts
its walk on one thread cut) and deals them in turn: the lane's thread walks the
even ones and one helper the odd ones, handed over at once. Each chunk goes
into a command buffer of its own, made from an empty one on the same thread
(CommandBuffer::part). After each of its own chunks the lane commits every
chunk walked, in their order, as a part, waiting for the helper only for the
chunk it commits next, so the GPU is fed throughout the walk. A part goes
where the whole buffer could be committed then, as a cut does; at the walk's
end, once every wait of its commit is met. The last chunk's command buffer
carries the buffer's handlers, records and present, as before.
The chunks' command buffers are made before any chunk is walked, each only
while its queue holds room, as a cut's make is: a make waits while the queue
holds 64 uncompleted command buffers, and a dealt walk holds walked chunks
uncommitted while its commit's gate is closed, so a make inside the walk, or
one look at the room for every chunk while the lane's own walks and begins
make command buffers on the queue, could wait for room only its own commits
free, and the walk would never end. Where the room runs out first, or the
platform makes no command buffer for a chunk, the buffer is walked whole.
What wslat kept stays: the prescan's op set and its pin to KeptWhole; a part
that fails from an encoder on takes in every later chunk in their order
(fold); Whole fails the buffer, counted as two-ranges-kept-whole; a fault
answers the first faulting chunk in their order, nothing at or after it
committed; what each chunk saw written of laid-out caches goes to the buffer
in their order; chunks no helper started by the end of the lane's first are
taken back and walked as a whole walk goes on. The cbpar trace event gives
each buffer's chunks, and a new cbdeal event each chunk's walk, wait and
commit. The platform is unchanged; its doc comments name the deal.
Measured on um870's RTX 3090, 26.7.2 cold boots walking Launchpad (wlb7
m3-max-31913 before, wla7 m3-max-31914 after, same harness, fatal 0 each),
the two Launchpad samples: GPU work left at the walk's end 3.42/3.56 ms ->
1.61/1.74 ms p50, present take to shown 10.95/10.84 -> 8.69/8.82 ms p50
(p90 12.09/12.09 -> 9.19/9.55), refresh to shown 14.55/14.41 -> 12.47/12.56
ms, frames answered two refreshes late 9/3 -> 0/1.
A command buffer walked in two ranges at once has its later range in a
command buffer of its own; if the platform keeps the buffer whole at the
first range's end, the decoder cannot cut it there and fails the buffer at
its stand-in, where the serial walk would have run it. That must never
happen silently, and the prescan must keep out every op that leads to it.
The platform now says why it keeps a buffer whole: PartCut::Whole carries
a KeptWhole reason (an open encoder, protection options, an execution of
indirect commands, a command's progress, predication, a signal encoded
when scheduled, a buffer already committed), each with its code, from the
same list `splits` reads. A test on the Vulkan platform holds each reason
to the commit_part answer it gives.
The decoder's test pins the two lists together: for every reason, an
exhaustive match names the guest ops that set it, and the prescan takes no
buffer with any of them; the two reasons no guest op sets
(setProtectionOptions:, encodeSignalEventScheduled:value:) are held by a
check that no walk sends them. Where a buffer is kept whole anyway, it is a
degradation, two-ranges-kept-whole: counted in the degradation counts line
and logged once per reason per process (docs/conventions.md), its test
checking both over two buffers.
"Speed comes from what every run gets" says nothing is loaded by what an
earlier run drew. The runtime's pipeline records already keep, across a
host's processes, what Metal's own pipeline caches keep. The device's kept
pipeline answers now do the same across boots. Both hold only what the
platform or the device gave before, under the identity of what decides it,
and change no value the guest reads, only how soon it has it. The rule now
names them both and says neither is ever seeded for a measurement, so the
rule keeps its meaning.
A post onto a command queue's completion ring that finds no room waits, with
no bound, until the guest's process takes more. Nothing counted or logged
those waits, so a stall behind a full ring, on a thread that runs the
platform's handlers among them, left no trace in a boot's log.
The device now tells its host, as it does for the control ring, each full
spell of a queue's ring (queue-ring-full) at its first post that waits and
finds no room, and each post that waited (queue-ring-post-waited) once it goes
on. Their lines name the queue and the thread that waits, and the codes reach
the process's degradation counts. Diagnostics alone: no post changes.
A writable twin of read-only pages was made only for a surface's read-only
alias, and a file of zeros only for an alias's block past its ranges: both
went with the host-OS surfaces, which no production path has made since
110b53637. So import_view loses its twin argument, and with it the twins'
map (shown_at), their mappings in the views' budget, the notwin refusal and
its trace record. Read-only pages are given to the runtime as they are, and
the views' gate refuses them, so the runtime copies them, as before.
The dma-buf sources lose their files of zeros (Zeros), which only those
blocks' pages took, and the budget's claims their reach, as only a twin
reached into the headroom. An import's pages are made once, so its record
says whether that import is still being made rather than how many are. The
remap, budget, vm, files and host_ram docs, qemu.md, lessons.md,
architecture.md and conventions.md no longer describe the twins, the
stand-in or the IOSurface memory the library held; the measured facts about
what a remap under an import reads stay in remap.rs. ResourceAddressRange,
which only the surface aliases gathered, goes.
Nothing the guest or host observes changes, as no production path has made
an OS surface since 110b53637.
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.
The bundle's os_log lines go to a subsystem of their own since the change
before the sets. conventions.md names it beside the bundle's once-a-kind
logging, with what its NSLog lines keep, and the lesson on the unread
counter says what read it on 26.7.2 and 27.0.1, and that a probe of the
counter reads a resource's answers once its buffer is scheduled.
logonce's guest part landed with batch4 (beb91ccd4, f064fbf69): the kexts
log a repeatable failure once a boot per kind, the Metal bundle once a
process, and their summaries at most once a minute. Add that to the rule's
list beside the library's and QEMU's.
The library now writes each kind of warning once and counts the rest,
and writes every degradation's count at each reset of the device and at
the exit. The conventions say so, with the two lines a check reads the
counts from: "reims-vgpu: degradation counts: <code> <n>, ..." and the
logger's "lines repeated since the last count: ...", and that no line at
info fires on a per-event path.
The rule kept reims-vgpu-core still for the Metal product, which is deleted.
With the Vulkan platform the library's only one, core changes as the work
needs, under the same checks as the rest; the owner dropped the rule.
The Metal platform is gone (the commit before): AGENTS.md, README.md and the
docs now say the library carries out the guest's calls on the Vulkan
platform, on Linux and on a Mac over MoltenVK for development and tests;
that the display's shaders live in the Vulkan crate; that `cargo xtask
dist` writes target/dist-vulkan on every OS; and that the tests of the
Vulkan platform compare with Metal's recorded answers. architecture.md's
section 4.6 describes the answer layer and the macOS message layer in
place of the metal crate's. conventions.md keeps "core changes as little as
the Vulkan and Linux work allows" without its reason, the Metal product.
testing.md was the behaviour-lock suite's specification and the paravirt
guest ABI; it now says how the code is tested and keeps the Tags convention.
development.md's layout, tests and commands, conventions.md's examples and
the lessons and accuracy-ledger entries that cited the paravirt device, its
FIFOs or QEMU sections that are gone now describe the code there is.
This repository now holds libreims_vgpu, a Rust library that is the host
side of the paravirtualized GPU macOS guests drive, in place of Apple's
ParavirtualizedGraphics.framework: the library and its C API
(reims_vgpu.h), the PCI device's option ROM, QEMU's apple-gfx on that API
(vendor/qemu), the behaviour-lock suite that drives the C API as QEMU
does, and reims-ctl, the VM manager users run. README.md says what it is
and how it is laid out, and AGENTS.md how to change it.
Every file of the earlier tree is replaced. vendor/qemu moves to the
steelbrain/reims-vgpu branch of the same public repository.