With /sys/kernel/mm/lru_gen/min_ttl_ms above 0, the kernel kills a process
where it can't keep the pages used in the last that many milliseconds in
memory, even while RAM is free (the kernel's multigen_lru.rst, "Thrashing
prevention"), and a VM's QEMU can be the one killed. CachyOS's kernel sets it
to 100. Measured on hosts here at 100: kswapd invoked the global OOM killer
with most RAM free, killing a compiler with 19 GiB free on um870, and making 19
of a day's 22 OOM kills on ms01. An hour of builds beside a VM on um870 killed
no QEMU.
The installer and reims-ctl doctor now read the file, and above 0 they say
what it does in one line. On a terminal they offer to write 0 with sudo, and
they show the systemd-tmpfiles line that keeps it at 0 after a restart.
Without a terminal they only tell. VMs run either way, so doctor doesn't count
it as a failure.
Tested in mount namespaces on um790, where the file was a root-owned copy
holding 100 or 0: the installer without a terminal, and on one answering y and
n; then doctor the same ways. Each wrote 0 only on a y, said nothing at 0, and
left the host's own file at 100.
After an update, an x86-64 VM made by an older reims-ctl stayed on apple-gfx
with the ported drivers in its OpenCore image, and its user had to make the
image again, drop those drivers and switch its graphics by hand. Its settings
name no graphics: master's reims-ctl never wrote them.
reims-ctl now keeps a record of the migrations it ran, migrations.toml in its
config directory. Its first run after an update (the restart from the interface,
or any later command) runs migration 1 once, on each stopped x86-64 VM whose
settings name no graphics: it saves reims-vgpu as the VM's graphics where the
macOS on its disk runs the device's drivers (macOS 26.4 or later), and apple-gfx
where it doesn't, then makes the OpenCore image again for them, presenting the
same Mac, and keeps the old image beside it as <image>.pre-migration-1. Each
VM gets one line, which the interface shows first and a command writes to
stderr, after a line saying reims-ctl is updated. A running VM is migrated at
its next start. A VM that can't be migrated stays as it was, and its line says
why and names the manual command. A VM whose settings name graphics, set by
its user or by a reims-ctl that knew the device, keeps them.
A start of a VM on reims-vgpu whose image holds other builds of the device's
kexts than this reims-ctl carries now makes the image again with these, so a
later update of the kexts reaches the guest without a manual step.
Measured on um870: master's reims-ctl (1fe0acb68) made two VMs on copies of a
26.7.2 disk, one patched to read as 15.7.2, both on apple-gfx with the ported
kexts. After the update, reims-ctl list moved the first to reims-vgpu and kept
the second on apple-gfx, both images made again without the ported kexts. The
first then booted to its desktop on the 780M with the five kexts loaded and no
fatal line.
a_texture_over_a_copied_surface_reads_another_ones_writes_as_metals was ignored
because metal2vulkan cd511955f7 made each buffer over the same bytes a copy of
its own, so a write through one texture over a surface reached the other's copy
only after its command buffer completed. The runtime at the pin (6b4b4b0692)
joins copies of the same bytes as it joins imports, and the test passes on
MoltenVK with every import refused: the runtime copied the surface's pages, and
the read through the second texture matches Metal's, in one command buffer and
across queues by event.
The read through the second texture also runs in a command buffer of another
queue, committed first and waiting for an event the write signals after its
blit, which Metal orders as one memory too. Past the gate the read's copy is
filled at its commit, before the write was even committed.
A texture over a surface reads what a blit through another texture over the
same surface wrote in the encoder before, as Metal's does. In place the runtime
imports the surface once for both buffers under them. Past the views' gate on
Linux each buffer over the surface is a copy of its own, which the second test
reproduces on macOS by refusing every import at a gate of the test's: it is
ignored until metal2vulkan joins copies of the same bytes as it joins imports.
A command buffer committed in parts answered the guest GPU times from its
first part's start to its last part's end. The GPU waits between parts for
the host's walk of the next, so that span held the walk: game_6000's frames
answered a gpu_p50 of 5.4 to 8.5 ms on the RTX 5080 against under 1 ms before
car 12's split, so a game or engine that scales its work by GPU time saw a
GPU about 7 times slower than it is. macOS's SkyLight and QuartzCore read
GPUStartTime and GPUEndTime too. On both x86 Macs one long buffer spans its
encoders' GPU time summed (the previous commit's measurement).
What the guest sees: a buffer committed in parts answers its first part's GPU
start, and that start plus its parts' GPU time summed (each part's end less
its start) as its end, never past its last part's end, where parts that
overlap on the GPU sum to more. A buffer committed whole answers as before.
a_buffer_s_outcome_is_all_its_parts and
a_buffer_walked_long_is_committed_in_parts_with_one_outcome expect it.
The summing is 3e974a4a6's, which anchored the span at the last part's end;
this anchors it at the first part's start, which the GPU reaches soonest
after the commit, as a Mac's buffer starts 0.08 to 0.40 ms after its commit.
The day's journal on the RX 550's host names the processes behind every UVD
fault and ring timeout: each was one decoding jpeg-check.sh's grey cases,
development's engine or a diagnostic build. 10 faults, and 3 ring hangs the
kernel ended by resetting the GPU with VRAM lost, so a guest's grey JPEG on
development could reset the host's GPU. The engine that refuses grey made
none in 792 starts, each decoding the trial's 32x32 grey image. The module
doc and U25 say so.
rustfmt wraps the lines the batch's commits left long, and clippy's
wrong_self_convention asks a from_ method to take no self: Rows::from_even,
a Copy value's widened copy, is to_even. The trial's chroma pairs are read
by as_chunks, as clippy's chunks_exact_to_as_chunks asks. Nothing the code
does changes.
An output read in strips, past udmabuf's limit, was read in bands from
the first row of the guest's region. Strips::read refuses a band that
starts on an odd row, where a 4:2:0 strip's first chroma row would
split, so a copy of a region from an odd row of such an output failed as
a malfunction (read from the code; the JPEG gate's odd crops are of
small outputs, read whole).
Each band is now read from the even row at or above it, and is 2 rows
shorter where the region starts on an odd row, so that what is read still
fits the strip. write_band takes the region's rows from within that read.
The bands' rows in the destination stay as they were, so the chroma rows
the destination takes are the whole read's: the unit test now writes in
bands from an odd row as well as from an even one, through strips and
through offsets, and compares with the whole write.
The JPEG engine made every decode's vaEndPicture on the decoding thread.
Each decode is its context's first picture, in which radeonsi may wait for
the GPU (U24): on an RX 550 (Polaris 12's UVD, Mesa 26.2.6), with the
compute rings that take the process's work held by the tests' spins, the
call waited 1.22 s in drmSyncobjWait, until the GPU was done, and the
decode then returned as decoded, past its 50 ms deadline, with the
driver's lock held all along (jobs 4555, 4562). So the held tests of the
compute rings failed there (job 4534).
The decode now ends its picture through render_decode, as a new H.264
decoder's first picture is: on the display's call thread, by the decode's
deadline. Past it the decode fails as stalled, and the engine stalls with
its context and surface kept until the GPU is done, as for its other waits.
The conversion's held test takes the display's other calls as the decode
stalled: they fail by their deadline while its first picture holds the
call thread, and go on where it waits on the memory's dma-buf.
For the guest: where the driver waits for the GPU in a JPEG decode's
vaEndPicture, as on Polaris's UVD with the GPU busy, the decode fails by
its deadline (kIOReturnDeviceError) instead of blocking past it, and the
display's other calls each fail by their own deadline meanwhile instead of
waiting inside the driver. Elsewhere nothing changes but that the call is
made on the display's call thread.
The tests of a held GPU (va::wait::held) spin on a flag in host memory the
GPU reads and writes uncached, VK_AMD_device_coherent_memory's
DEVICE_UNCACHED_AMD. RADV gives the RX 550 (GFX8) no such memory, so each
test's setup panicked there: 7 of the VA-API host's 10 tests failed on
development (job 4229). In host-visible memory the GPU's caches kept the
spin's start from the host until it ended, and the host's flag from the
spin, nontemporal accesses too (measured, 2026-11-07).
On such a GPU the spin is now timed: it holds its ring for SPUN_AT_MOST by
the GPU's own clock, whatever the host does, and the host learns it has
begun from a timestamp the queue writes just before it, once the work ahead
of it is done, read with vkGetQueryPoolResults. A test lets it go by
waiting for it to end. On the RX 550 a timed spin held its ring for
30,000,000 ticks in 1.1999 s, at the device's timestamp period (job 4478).
A GPU with neither the memory nor timestamps and a host query reset has no
spin, as NoSpin::Unheld says, and the held tests say so and end.
The JPEG engine took every sampling its VA driver lists as decoded right.
On an RX 550 (radeonsi on Polaris 12's UVD, Mesa 26.2.6) the driver lists
grey, and its decode of grey into a Y800 surface writes a luma none of
whose samples are the stream's, so the guest got a wrong picture for every
grey JPEG: the 14 grey cases of jpeg-check.sh failed (job 4315), and
ffmpeg's VA-API decode of grey on that GPU is wrong too (job 4318).
At start the engine now decodes a flat 32x32 JPEG of each listed sampling,
as a guest's decode would be made, and checks its samples. A sampling
whose trial decodes wrong is refused as unsupported, as one the driver
does not list, and left out of the backend's answer of what it decodes.
No other route decodes grey right there. Into NV12 surfaces of the
driver's, copied out by a run, grey decoded right for some streams and
wrong for others (jobs 4470, 4496): 3 of jpeg-check.sh's 14 grey cases
wrong, 15 more grey streams of cjpeg's and jpegtran's all wrong, and the
trial's luma not written at all. So that route is not taken.
For the guest: on a driver whose trial decodes a sampling wrong, its
JPEGs are refused as unsupported streams (kIOReturnBadMedia), where they
decoded wrong before. Where every trial passes, as on the RX 7900 XTX and
the Radeon 780M, nothing changes.
Core's JpegDecoder now answers what its backend decodes at all
(JpegDecodes: the samplings and the largest picture): VA-API's the
samplings its driver lists and its largest size, NVIDIA's the four it
measures at any size. The guest hears of it only through the refusals it
already got, so nothing it sees changes.
The conformance suite's jpeg-check reads it. A stream outside the answer
that a case asked to decode now passes when refused as UnsupportedStream
("refused as answered"), and fails when it decodes; inside the answer every
refusal fails, as before. jpeg-check.sh's last line counts the passes, the
refused as answered among them, and the failures.
On an RX 550 (radeonsi, Polaris 12) the driver lists 4:2:0, 4:2:2 and grey
up to 4096x4096, so 19 cases failed on development (job 4315): every 4:4:4
one, and the 16384-wide 4:2:2 case. Each was the engine refusing a stream
by the driver's own answer.
A cached block named again over the same pages kept its device cache and
forgot the cache's generation, so the cache was filled from the pages only
at the next command buffer that named the surface (RGFX_OP_SURFACE_USE). A
texture over it that a buffer reached through an argument buffer with no
useResource:, which no RGFX_OP_SURFACE_USE names, read what the cache held
before the naming. Metal leaves such residency to the app and faults it.
The cache is now filled from the pages at the naming, as of the CPU's
generation in the block's header then, after the copy of what a buffer wrote
of it into the pages, as edb0c436a fills a new cache at its make. A buffer
still walked that uses the cache has the fill made in its finish, as a use's
fill is. The next named use of that generation fills nothing more, and one
of a newer generation fills again. The caches' log line counts these fills
with the make's.
What the guest sees: a surface reached only through an argument buffer reads
its pages as they were when its block was named again, not the cache's older
bytes. a_block_named_again_keeps_its_cache_filled_from_its_pages and
a_block_named_again_behind_a_walk_is_filled_in_its_finish expect it; the
first no longer waits 10 s for a copy between its two namings.
After an update from its interface, reims-ctl runs the new binary in its place,
from the path std::env::current_exe gives. On Linux that path comes from
/proc/self/exe, which names a binary replaced since the process started as
"PATH (deleted)": the update's cargo install --force had just replaced it, so
every restart failed with "run .../reims-ctl (deleted): No such file or
directory", though the update itself had worked. macOS gives the path itself,
and restarted.
The restart now runs PATH, where the update installed the new binary. Measured
in a scratch install on um790: master's reims-ctl updating from its interface
printed that error; on the M3 the same update restarted.
a47f0b613 made a SURFACE_PAGES wait for a released block's device cache to
land in the same pages, noted at the release's ask. Ring 0's lanes are per
block, and a BLOCK_RELEASE is carried out on its context's lane. Where that
lane was behind a slow message when the kext gave up its 10 s wait for the
release's answer and made the surface's new block, the release had not been
asked yet, no copy was noted, the new block's SURFACE_PAGES went first, and
the old cache's copy could land over what the new block's buffers wrote.
The lanes now keep each block's last SURFACE_PAGES marked cached, until a
block's SURFACE_PAGES over its span, and a SURFACE_PAGES that lists runs
waits for each context's lane through its last BLOCK_RELEASE not yet carried
out of such a block whose runs share a page with its own, both blocks' runs
read out of the region as it is handed. The host's wait for the copy, at
most 10 s, then sees the release's copy. That cap stays: a reset drops a
copy not yet made, and an unbounded wait would hold the block's lane past it.
What the guest sees: a SURFACE_PAGES over pages of a cached block whose
release is still behind its lane is answered after that release is carried
out. a_block_s_pages_wait_for_a_cached_block_s_release_over_their_pages
fails on the lanes before this.
Since 4c0248b29 the Vulkan platform answers a library the runtime refuses for
a gap with the refusal as its NSError, and such a function nil, where it used
to die. Core took the library's NSError as Metal's own refusal of the IR, so
the function was nil to Metal, and the state naming it then ended the process
one create later, as Metal aborts at a descriptor with no vertex or compute
function: on apple-gfx, any translation gap an app's library hit still ended
QEMU (the WebGPU code-30 and Godot bitreverse deaths of 11-03). A function
nil for a gap reached the registration's assert instead.
What changes for the guest and the host, on the Vulkan platform: a library or
function the platform refuses for a gap now raises the function lookup's
failure, as IR over a page-table hole does (8e4c8bc45). The state that names
it is never made, so the exec or info that names the state faults, as where
the platform refuses the state itself for a gap. Nothing is cached, so each
lookup asks the platform again. Metal never refuses there, so the Metal
platform, the suite and the pins see nothing new: Metal's own refusal of the
IR is still nil to Metal, and Metal's nil function still reaches the assert.
The platform tells core: core's platform::device::note_relayed_gap, which the
Vulkan platform's relay_gap calls on the creator's thread, and
relaying_gaps, which core reads it with around the library and function
creators. FakePlatform's Step::Gap scripts it.
a_state_naming_a_function_refused_for_a_gap_is_never_made locks the pattern
for the compute, render and tile forms.
reims-vgpu's display follows its window, which always opened at 1920x1080,
and reims-ctl refused any other resolution for a VM on it. A person who wanted
a larger or smaller desktop resized the window at every start.
QEMU's reims-graphics-pci now takes a resolution property, WIDTHxHEIGHT, the
window's first size (the library's window config mode_width and mode_height).
reims-ctl passes the VM's resolution there where it is not 1920x1080, which
leaves a QEMU built before the property working at the default, and its TUI
shows the field for reims-vgpu. host stays refused there: it names no size.
Measured on a KDE Wayland desktop of 3840x2160 at 2.1x, 1829x1029 points, with
a macOS 26.7.2 guest: 1280x720 opened the window at 1280x720 points and the
guest ran 2688x1512; 2560x1440 and the default opened it shrunk to fit, at
1744x981 points, the guest at 3662x2039.
vendor/qemu moves to the commit that adds the property.
It was ignored since 11-03, when metal2vulkan c8a0481cf8 ran nothing for a
command naming a released buffer in an ICB it replays on the host. The pin
16 runtime (6b4b4b0692) runs it, reading zero as from a buffer resident for
reading: 3 of 3 with --run-ignored on the Radeon 780M (job m3-max-4282).
A VM switched from reims-vgpu to apple-gfx or VMware SVGA kept the OpenCore
image made for reims-vgpu, and OpenCore loaded the guest's kexts with no device
of theirs: on apple-gfx with a macOS 26.7.2 guest, ReimsGraphicsLoader and
RgfxGate loaded, and RgfxGate installed its Metal bundle in /Library/GPUBundles
and set AppleGVA's gvaForceAMDKE at every boot.
Setting the graphics now makes a new image for them where the VM is stopped
(set --graphics, and the TUI's edit); while it runs, its next start does. A
start of a VM whose image loads the kexts on other graphics makes a new one
first, so a VM switched by an older reims-ctl follows too. The new image
presents the same Mac.
reims-ctl can't change the guest's files. The new image's note reads the
guest's Data volume and, where gvaForceAMDKE is set, says that it changes
nothing off reims-vgpu's device (measured on apple-gfx: VideoToolbox reports
no hardware decoding or encoding with it and without it) and how to remove it:
sudo rm of the file RgfxGate made, which it makes again if the VM goes back to
reims-vgpu. Not defaults delete: it leaves an empty binary plist, which
RgfxGate never edits again. The Metal bundle stays, as SIP keeps root from
removing it.
a_crash_during_the_exec_completes_four read the completion's status as the
exec returned, which the crash's order does not promise: the crash signals
the GPU token, which wakes the FIFO thread, before the completion's token. It
failed once in 4736 tests in job m3-max-4026. The exec returning before its
completion runs is what the code does and what
the_exec_reply_drops_gpu_token_then_token_then_the_task records; making the
exec wait for the completion instead deadlocks that test, whose completion
waits until the exec has returned (jobs m3-max-4104 and m3-max-4105 hung).
The test's completion now takes 50 ms, so the late completion comes in every
run, and the test waits for it before it reads the 4: with the old read it
fails every run (10/10, job m3-max-4177), and with the wait 0/200 at 48
threads and 0/1000 at 64 (job m3-max-4163).
a_context_s_create_waits_behind_no_other_context_s_backlog failed twice in 200
runs 48 at a time on ms01 (job m3-max-3956), with the take order a3b8aa8d2
records: [1, 1, 1, 1, 1, 2]. Context 1's four running compiles sleep 100 ms
from the same release, and all four ended before any thread took the next.
Context 1 then had no compile running, as context 2 had none, and the tie went
to the one ahead in the turns: context 1, which its last take had put at the
back before context 2 joined. Context 2's create so waited past a second
compile's end, where the module doc says it waits for at most the first; with
one thread it always did. The cause a3b8aa8d2 gave, a thread put off between
its take and its start note, is not what the runs showed, and its 260 runs
were 220, besides 520 pinned ones.
A context now goes to the back of the turns as a compile of it ends too, so a
context whose compiles all ended before the next take goes behind one that
waited through them. Where the running counts differ they decide as before.
Which context's compile a thread takes next is the pool's own; a guest sees
only when each create's reply comes.
The new test runs one thread, which reaches the tie at every end: it takes the
contexts 1, 2, 1, 1, where before the change it took 1, 1, 2, 1.
a_context_s_create_waits_behind_no_other_context_s_backlog failed once in
the Linux check of reims-vgpu's tests on an Iris Xe host (job m3-max-3843,
0.21 s), and passed in 260 runs alone or 48 at a time. It read the order the
compiles started in, which each compile notes when its job begins, after the
thread took it and passed the test's gate. A thread put off between its take
and that note lets the compiles other threads took after it note theirs first,
so context 2's create, taken fifth as the first compile ended, could be seen
starting later than fifth. In 0.21 s the test can fail at no other assertion:
the create finished about two compile times after the release, under the
three the time check allows.
The pool now keeps, in tests, the context of each compile it takes, in the
order it takes them, and the test reads that order. Nothing changes outside
the tests.
The device answers a QUEUE_CREATE once it has made the queue's rings and
started its service thread, and tells the host of the queue before it
answers (Host::queue_made); the service thread then has the decoder make
the queue's handle. A present kept only the writers that named a queue the
decoder held a handle for, so a present whose writer was the first buffer
of a queue created just before, taken while the service thread had yet to
make the handle, dropped that writer and showed the surface before the
buffer that draws it had run.
The decoder now hands the present every writer slot that names a buffer,
and the present queue, which knows each queue from Host::queue_made to its
destroy, its context's close or the device's reset, keeps those of a queue
it knows: a writer of a queue the host does not hold holds nothing, as it
did.
What the guest observes: a present whose writer names a buffer of a queue
whose create was answered, while the host has yet to make that queue's
handle, is now shown once that buffer finishes, as it is once the handle is
made; it was shown at once before. Nothing else changes.
Found as
a_completion_across_a_reset_shows_no_present_of_the_rebooted_guest_early
failing under load (13 of 200 runs at 48 at a time on 16 CPUs): a trace of
each failure showed the rebooted guest's present carried out on the
presents' lane before the new queue's service thread made its handle, the
reset long done. Test:
a_present_waits_for_a_writer_of_a_queue_whose_handle_is_not_yet_made, with
the queue's service thread held before it hands on the create, failing
before.
The kernels' cut to one place a pixel is worked out ran a 4:2:0 window's
both planes through write_word's loop over the word's block, inside
scaler_transform. On the Radeon 780M that made 720p BGRA to 720p 420v
slower (docs/video/scaler.md recorded 0.26 to 0.31 ms). The old
both_planes, whose loop over a chroma row's two luma rows has a constant
count, is unrolled by the driver into two copies of a pixel's work that
run side by side. Put back inside scaler_transform, it was as fast as
before, but it grew that kernel from 21,524 to 31,216 bytes of code,
which every transform's making would pay for.
So both_planes gets a kernel of its own, scaler_transform_both_planes,
which non-adaptive dispatches of both planes take (Biplanar8,
Biplanar16). scaler_transform keeps its code. The making ahead
dispatches eight kernels, and the probe of first transforms has a 4:2:0
destination.
On the 780M, six alternated processes of each build: GPU time 0.230 to
0.206 ms at the median, the other benches within their spread. The
making ahead went from 274 ms to 298 cold, and the new kernel's own
making takes 27 ms. Its outputs are the same arithmetic in the same
order; the whole suite passes (113 of 113).
Since x86-64 VMs moved to reims-vgpu's own GPU device by default, a VM whose
settings name no graphics, as every VM saved before the switch, ran that device
whatever its macOS. Its drivers, the guest kexts reims-ctl puts in the OpenCore
image, load only on Darwin 25.4 to 25.99.99, macOS 26.4 and later, so an older
guest booted with no GPU, and nothing said so.
reims-ctl now reads which macOS a VM holds: from the disk, through the APFS
container's Preboot volume, whose <volume group UUID>/System/Library/
CoreServices/SystemVersion.plist names the release and build (macos.rs, a
read-only reader of what macOS writes there: the latest checkpoint, the object
maps, the Preboot volume's tree); or from the offline installer reims-util
downloads, whose build it now keeps, or the online one's macOS number. The
build's number and letter give the Darwin version, compared with the set's
bounds.
- create decides the graphics from the download's or the given disk's macOS
and saves it by name, and makes the OpenCore image for it: an older macOS
gets apple-gfx and an image without the kexts, and create says why. A
--graphics reims-vgpu given for an older macOS is kept, and create says the
guest has no driver for it.
- A VM whose settings name no graphics, or whose macOS isn't known at create
(a new disk with an installer of the user's), gets them at the first start
that finds macOS on its disk, saved by name and said: apple-gfx on an older
macOS, reims-vgpu on 26.4 and later. The TUI's start says it in its status.
- A start of a VM set to reims-vgpu on an older macOS warns, naming
reims-ctl set NAME --graphics apple-gfx; a disk reims-ctl can't read (a qcow2
with a backing file) warns likewise where the VM runs the default.
- command, show and list show the graphics a start would save.
- The TUI's edit form keeps none where the choice is left at the default, and
its create form passes the default as none given, so both follow the macOS.
- qcow2 images with an external data file or extended L2 entries are refused
rather than misread.
The help texts and README say the default is reims-vgpu on macOS 26.4 and
later and apple-gfx on an older macOS.
rustc warned (recursion_depth_exceeding_limit, a future hard error) as
new_images and detach_backing dropped an Obj<PredicatedEncoder>: Obj's bound,
like core's Handle, asks every platform object to be Send and Sync, and the
proof walks an encoder's command buffer, its predication and the runtime
objects that holds, 141 to 150 levels deep (rustc warns at a limit of 140, not
at 150). The depth is that of the objects' fields, fixed by their types, and
the library and the other crates over the platform already take 256 for it;
these two tests now do too.
On a host of 4 KiB pages, a heap of 3 pages rounds up to Metal's 16 KiB page, past a
view of 3 pages; and a region slab's heap is its class's slab size, not 2 MiB.
A HEAP_OVER_PAGES over a pages block of more than one run is now a heap over
the block's view, where it was refused. A block of one run, a superpage, keeps
its heap over the guest's RAM as before.
The guest's slabs are 2 MiB superpages, which the kernel runs out of minutes
after a boot (measured on an x86-64 macOS 26.7.2 guest on the 780M host: 19
for a process at boot, none three minutes later). Every Shared buffer then lay
in the region, which the guest maps uncached and an AMD host applies: stores
ran at 13 MB/s. The bundle now makes such slabs of plain pages, many runs, so
the host holds their heaps over the view a BUFFER_OVER_PAGES lies over.
Making the view maps a page per run, so a HEAP_OVER_PAGES that makes it is
carried out on the surface worker as a BUFFER_OVER_PAGES is, its context's
later messages waiting for it. The heap lies over the block, whose release is
refused while it lives, and a context's close lets go of its objects before
its views, so the view outlives the heap.
The region's memory changed with the previous commit: the design's Decided 5,
docs/qemu.md and the C API's doc of rvg_graphics_device_region (and so the
header) said it was private anonymous memory on every host.
The reims-graphics device's region (BAR 2) was private anonymous memory,
which RADV imports by pointer as amdgpu userptrs: amdgpu then walks every
page of every such import the device holds in each submission. Measured on
the Radeon 780M (RADV of Mesa 26.2.6, Linux 7.3.1), an empty submission took
6.9 us with no imports held, 90.7 us with 256 MiB of pointer imports in 4
pieces and 171 us in 128 pieces, against 12.2 and 66.8 us for dma-buf
imports of the same pages.
The Vulkan platform now gives the device its region as a shared mapping of
a memfd of its own (RegionMemory, over OwnMemory), registered in the backing
table, so RADV, which refuses a pointer to file pages, imports dma-bufs of
the blocks' pages through every import's dma-buf source, as it imports the
guest's RAM. A device that takes the pointer (NVIDIA, MoltenVK) imports it
as before. Where the platform gives none, or on macOS, the region is the
private anonymous mapping it was. The guest sees the same bytes.
SDL's cursor is the process's. With two displays' windows open, window B's
refresh (its guest changing its cursor, its layout changing, the pointer
leaving it) set the host's arrow while the pointer was over window A's image,
and A kept the arrow until the pointer crossed its image's edge. Now a window
sets, hides or shows the cursor only while it has SDL's mouse focus; the
window the pointer enters sets its own at its enter event, as before.
features.md gets the multi-display entry, guarded by a test of the rule and a
manual walk on a VM with two displays.
Whether x86-64 macOS has a driver for reims-ctl's virtio-sound-pci had never
been checked by a boot. A macOS 26.7.2 guest booted on reims-ctl's q35
command answers it. AppleVirtIOSound binds the device, and Core Audio makes
it the default output and input. Played sound reaches QEMU, and with the
pipewire backend it reaches the host's default sink. Safari's Media Source
player plays to the end with audio. With audio off, every Media Source
stream that has an audio track fails with MEDIA_ERR_DECODE, and a video-only
stream still plays. The ICH9 HDA controller has no guest driver and plays
OpenCore's boot chime alone.
The command already gives x86-64 VMs working audio, so nothing in it
changes. The module doc and docs/qemu.md now give these results in place of
the "unchecked" note.
census.rs said the census is written at the process's exit (atexit). On Linux
with the GNU C library, metal2vulkan's exit guard ends the process at once with
_exit when the driver still runs the runtime's work as the process exits, and
the exit handlers registered before the guard's last registration do not run.
The guard registers again after later calls of its own, so the census's
handler is among those skipped where one of them came after it. Say so, and
what the file holds then: the writer's last write.
The test that pin 16 added still named the vulkan feature, which the
Linux build without features no longer sets: there it compiled out,
where every other Vulkan-platform test now runs. It takes
cfg(vulkan_platform), as its neighbours do.
Only the backend's macOS code writes log lines, and on any other host the
crate builds and offers nothing, so every Linux build of the workspace warned
that `log` was unused (cargo's `unused_dependencies`). It now sits with the
backend's other macOS dependencies.
`DisplayRead::at_screen` is test-only, and only the Vulkan platform's read
tests call it, so a macOS test build without the `vulkan` feature found it
unused and `cargo clippy --workspace --all-targets -- -D warnings` failed
there on development (3c1d7b635). It is now built where those tests are,
under `cfg(all(test, vulkan_platform))`.
On Linux the Vulkan platform is the library's only one, yet reims-vgpu and
reims-vgpu-c refused to build without their `vulkan` features (a
compile_error!), and the code behind it did not compile either: a
default-feature Linux build of the package failed. A crate that does not
build in a feature setting is a failure, so the platform is now unconditional
on Linux.
- reims-vgpu's new build script sets `cfg(vulkan_platform)` on Linux, and on
macOS with the `vulkan` feature, declared for check-cfg. Every
`feature = "vulkan"` gate in the crate is that cfg; the gates of "macOS or
the feature", true on every target the library builds for, are gone.
- The Vulkan platform's dependencies are not optional on Linux; on macOS they
stay the feature's, optional, so the Mac's default build is as before.
- reims-vgpu-c makes every handle on VulkanPlatform on Linux whatever its
features; the compile_error!s go.
Behaviour is unchanged on both OSes: on macOS every cfg answers as the
feature did, and on Linux as the builds with the feature did. The docs and
comments that said Linux needs the feature say it no longer does.
Each vkEnumerateInstanceExtensionProperties call has the Vulkan loader load
and ask every driver its manifests name, and unload one that makes no
instance. ash's read makes two calls, one for the count and one for the list.
On a host with NVIDIA's driver package but no NVIDIA GPU, NVIDIA's library
reads the PCI configuration of every PCI device at each call. That resumes
every runtime-suspended device, 0.25 to 0.7 s a call (measured on a host with
an RX 550 and a 780M). A process that made the platform's device made 13 such
calls and took 7 to 10 s to start, against 0.05 s without that manifest.
The window probe and the hardware-GPU list now read the list with one call
into room for 64 extensions, and ask again with twice the room while the
loader answers VK_INCOMPLETE. That takes one of the window probe's three
calls out of every process. The runtime makes the other ten, and it can take
them out the same way. The list read is the same as before.
The decoder's cost tests read the suite's committed metallibs through
CARGO_MANIFEST_DIR as cargo set it at build time. A nextest archive run on
another host, as the 5080's runs are, kept the build host's path, and the
tests died on a missing file. They now read the variable cargo and nextest
give the test as it runs, as the C crate's tests do, which an archive run's
workspace remap points at that host's tree.
Pin move 16: metal2vulkan development b10227d09f..6b4b4b0692 (179 commits),
RUNTIME_VERSION 1784, SEMANTICS_VERSION 1979. What changes for the guest:
- DevicePointSize is announced at a draw that rasterizes points alone
(e1c3821e23). On ANV, whose points end at 255 pixels, draws of lines and
triangles by a state whose vertex function writes [[point_size]] died in
strict mode, and were relayed by default. They now draw silently.
- A visible-function reference links to a definition of another type by
position, as Metal links it (85685b7941). MPS's stitched reductions, in
Geekbench's Background Blur and Face Tracking, link where they died at the
runtime's Signature refusal.
- A FloatRGB9E5 vertex attribute is pulled on every device (e9b236a978). sRGB
and blue-first read-write textures in an argument buffer are held through
their alias (3d5bb02ba0).
- A mipmapped sampler's minLod clamp is past every last level, not FLT_MAX
(a988acb096). A precise division's 0 / 0 gives the NaN the profile promises
(e4cebcc1a7).
- A heap texture's YCbCr filter is noted where its handles and sampler reach a
filtering one (b37276fa4c). A two-plane format's 2D array view, the luma
view, announces no filter notice (38681dd59f).
- A compute descriptor's thread maximum is refused as Metal refuses it
(fe1436ab00).
- Encoding costs less per draw: a render encoder's core is kept for the next
encoder, with per-draw memo and use-list cuts.
The runtime's kinds are the same 235 at both commits, so answer.rs places
nothing new. Cargo.lock is unchanged: the runtime's dependencies are the same,
and the lock keeps its metal2vulkan source lines stripped.
Adapted here:
- stage_threads reads DeviceProfile::emulates_mesh_shading, and the identity's
argument-buffer sampler count is DeviceProperties::
max_argument_buffer_sampler_count, in place of our copies of those rules.
- The guest RAM's import takes DirtyPages' new wrote_runs and wrote_runs_as. It
stamps every run of a batch under one fence, the same pages each run's own
report stamps.
- New tests: the decoder links a stitched call of an extra argument as Metal
does, and a state that sizes its points draws lines and triangles silently
on every device.
- On MoltenVK, own_format_views_are_metals and
constexpr_samplers_sample_as_metals run again:
- The luma view's 10-bit linear samples announce nothing and read Metal's
bits.
- 503's (4:4:4) linear constexpr samples announce ycbcr-filter-not-exact,
and read within one step of Metal's grid for the format, 1/2048 (half a
step measured).
reims-ctl told every x86-64 VM to set METAL_ERROR_MODE once macOS is installed:
in its install steps, after create, after an eject and in the TUI's create
message. That was measured on apple-gfx, whose guests' icon service ends as it
starts without it. On reims-vgpu's own device, the x86-64 default, a macOS
26.7.2 guest without the key comes up with its Dock and icon services running
and no crash report (a Radeon 780M host, 11-07), so users of the default were
sent through Recovery for nothing. runtime::needs_error_mode now gates every
one of those messages on apple-gfx, and README step 3 and docs/qemu.md say
which device needs it.
Two of gpu::fill's Metal tests failed on the M3 Max (macOS 27.0.1): for a
colour in a format Metal packs no colour in, Metal wrote 80 ef 0b 82 02 00 00
00 42 a2 3d fe 01 00 00 00 where the tests expected the bytes of the colour
fill before it.
Metal packs no colour there. It fills the 16 bytes of the calling thread's
stack where its packing writes a colour. Sent right after another colour
fill, with no call between them, it writes that fill's texel. Sent right
after a call that set the stack below to one byte, it writes that byte.
Both were measured from a plain Objective-C process and from the test
binary. The tests sent through the Metal platform, and in a dev build
objc2 checks the method before each send. That check left the encoder's
class and the selector there as pointers: the bytes above are those two
addresses (measured). So the tests were reading our own build's stack. It
held the earlier fill's texel when the tests were recorded.
The tests now send Metal's two fills by objc_msgSend itself.
metal_fills_a_colour_it_packs_none_in_with_its_stacks_bytes (renamed) pins
both measured answers for every format in LEFTOVER_FORMATS and
UNPACKED_FORMATS. leftover_colours_fill_an_earlier_colours_bytes_as_metals
compares ours, after the earlier fill in the same encoder or in an earlier
one, with Metal's fill sent right after another. Across an encoder's end,
Metal's stack holds other bytes, and the runtime holds the command buffer's
last packed texel: one answer of that envelope. The AMD 5300M and the
Intel 630 (macOS 26.7.1) raise NSInvalidArgumentException at every colour
fill, so they give no other answer to match.
Nothing the guest or the host sees changes. The module's docs and
docs/lessons.md say what was measured.
A screendump at 3662 x 2039 came out sheared, and the library's read of the
display was the first suspect: a row length taken from the wrong width or
stride anywhere between the guest's rows and the read would shear it the
same way. The cause was QEMU's PPM writer, but nothing tested the Vulkan
platform at such widths, where rows of 4-byte pixels padded to 64 or 256
bytes leave a stride that is not width * 4.
These tests read the display at modes 3662, 1831 and 1001 pixels wide on
the Vulkan platform: the scanout with rows of width * 4 bytes and padded to
64 and 256 bytes, through no colour, a matrix and a post-gamma ramp; a
presented IOSurface with rows padded to 64 bytes, shadowed and in place,
with no colour and through a matrix; and render passes over an IOSurface
plane over guest pages at such widths, which leave the rows' padding as it
was. color_matrix is built for the Vulkan platform's tests too.
Cargo warned of three on Linux: reims-vgpu-core's bitflags, which no code of it
reads; the workspace's proptest, which no crate names; and the VideoToolbox
backend's codec crate, which only its macOS module reads. The first two go,
and the codec crate becomes a macOS dependency of the backend.
With --skip-qemu and no QEMU installed, the installer warned, installed
reims-ctl, and stopped at __record-install, whose --qemu refuses the empty
path it was given: no install record, no reims-util, and an error that did
not say what to do. Every VM runs on QEMU, so --skip-qemu now ends at once
where none is installed, before it builds anything, saying to run the
installer without it.
A QEMU kept from an older checkout runs on a QEMU source and a library this
checkout may have changed since. Its build's directory names its commit, so
the installer now compares that commit's QEMU source and library inputs
with HEAD's, and warns, saying what to run, where they differ, where the
checkout lacks that commit, or where GPU_ARM picks the other arm. A change
to reims-ctl alone, which --skip-qemu is for, warns of nothing.