The device answered minimumLinearTextureAlignmentForPixelFormat: with
linearTextureAlignmentBytes, the largest of every format's, for each format. On
a host GPU whose linear images ask more of larger texels that is too much for
the smaller ones: a Radeon RX 550 answers 256 bytes for texels of 1 to 4 bytes,
512 for 8 and 1024 for 16, and Geekbench's MPSImageGaussianBlur source, an
RGBA8Unorm texture over a buffer with rows of 7680 bytes, was nil against 1024.
What the guest observes changes:
- each format answer of the device info carries the runtime's alignment of
that format in its last two bytes (0x3e, `linear_alignment`, which were
zero): 0 where the runtime has none (compressed, depth and stencil formats)
or one past 65535;
- the bundle answers minimumLinearTextureAlignmentForPixelFormat: with the
format's own, and with linearTextureAlignmentBytes where the blob has none,
so the video output planes align to R8/RG8/R16/RG16's own answers too;
- linearTextureAlignmentBytes and deviceLinearTextureAlignmentBytes stay the
largest of every format's.
At four walkers, a buffer of Unigine Valley's GL queue waited for a free walker
8.6 ms at the median and 36 ms at the 90th percentile, with three to four
walking as each came. At eight it waited 0.03 and 0.05 ms, three walked at the
median and five at the 90th, and Valley ran at 24.5 frames a second where four
ran at 22.6 (1920 x 1080, RX 7900 XTX host, trace on; measured). The waits and
the commit order are untouched: only how many walks run at once changes, and a
lane still holds 64 threads at most.
The lane's function pointers and dynamic libraries copy the AMD Radeon Pro
5300M's and the Intel UHD Graphics 630's answers, and the oracle notes keep
what was measured and where our stack differs. Q29 records oracle_fnptr's
function pointer answers on both Macs and in the guests; Q30 its dynamic
library answers: which install names Metal loads (a library read from a file
alone), what a preloaded library links on each, the one message a compile of
source sends a dynamic library and who owns its answer, and the refusals.
An x86-64 guest's device made no dynamic library: newDynamicLibrary:error:
and newDynamicLibraryWithURL:error: were RGFX_UNSUPPORTED, so a kernel linked
against a dynamic library could not be made. The platform makes them and
links them (the commit before), and nothing carried them from the guest.
What changes for the guest: the device offers feature bit 40,
DYNAMIC_LIBRARIES (FEATURES_HI bit 8), on every host, and the kext takes it.
Where taken, ring 0 carries DYNAMIC_LIBRARY_CREATE (0x239: the dynamic
library's ObjId and its library's), answered by COMPLETE with its status, and
a COMPUTE_PIPELINE_CREATE ends with a run of RgfxPipelineLibrary records
(library_count, where reserved_5c was): each a dynamic library, preloaded
where it has no install name, else the library that install name loads. The
bundle's RgfxDynamicLibrary answers its library's install name and writes its
bytes to a file URL; newDynamicLibraryWithURL: reads the file in the guest's
process with the AMD Radeon Pro 5300M's and the Intel UHD Graphics 630's
answers (measured, macOS 26.7.1, oracle_urls and oracle_fnptr: a nil URL,
bytes that are no metallib, a library that is not dynamic, a missing file).
Metal reads the file each install name of a library made from a file names
when it creates a pipeline, and none of a library made of bytes or of source
(measured, both Macs, oracle_fnptr: the linked kernel's file makes its
pipeline, and the same bytes through newLibraryWithData: are refused). The
bundle reads them then too: every name the kernel's library, its linked
functions' libraries and these dynamic libraries name, from the executable's
directory, the loading library's or an absolute path, each sent by name. A
name that loads nothing, or that a library of no file names, refuses the
pipeline with the 5300M's CompilerError 2, beside a preloaded library or not,
so the host is never left to read a file of its own. A dynamic library's
install name is read from its metallib's HDYN NAME tag. Render stages carry
none.
A compile of source whose options name dynamic libraries reads each through
the private member airData, the one message Metal sends it (measured, both
Macs): the bundle's dynamic library answers its library's bytes, as Metal's
answers its file's, where it ended the guest's process with an unrecognized
selector before. The caller owns the answer, as it owns Metal's, which is a
new object at each call: the compile releases it, and an unowned answer ended
the guest's process with SIGSEGV after the compile.
supportsDynamicLibraries stays no in this commit; a later one answers it once
the guest's sets carry this bundle. supportsRenderDynamicLibraries stays no,
as the 5300M answers it.
The host knows bit 40 (KNOWN_FEATURES); the tests that probed an unknown bit
at 40 probe 41. The decoder's tests make dynamic libraries on the fake
platform and pass a run's libraries to the creator; the serializer's, the
shell's (the linkage reader, the routing and airData, a pipeline's loads and
refusals), the kext's and the members register's tests cover the guest's
side, and design.md describes the messages.
An x86-64 guest's device made no function handle or visible function table:
the bundle's members were RGFX_UNSUPPORTED and the device info held
supportsFunctionPointers at no, so an app took its fallback. The platform
makes them for a compute pipeline (the commit before), and nothing carried
them from the guest to it.
What changes for the guest: the device offers feature bit 39,
FUNCTION_POINTERS (FEATURES_HI bit 7), on every host, and the kext takes it.
Where taken, ring 0 carries FUNCTION_HANDLE_CREATE (0x236: the handle's
ObjId, the pipeline state's, and its function as an RgfxLinkedFunction) and
FUNCTION_TABLE_CREATE (0x237: the table's ObjId, the state's and its entry
count), each answered by FUNCTION_POINTER_STATE (0x40c: the status, and a
table's gpuResourceID, allocatedSize and resourceOptions), and
FUNCTION_TABLE_SET (0x238: a range of a table's entries, 0 a nil entry),
which is not answered and is carried out before any command buffer the
process posts after it. A compute pass binds a table at a buffer index
(RGFX_OP_COMPUTE_SET_VISIBLE_FUNCTION_TABLE, 0x201e) or a range of them
(0x201f), and an argument buffer holds a table by its gpuResourceID. The
bundle's RgfxFunctionHandle and RgfxVisibleFunctionTable answer from the
host's state; a handle of a function the state does not link is nil, as
Metal's is (RGFX_STATUS_NOT_FOUND), and gpuResourceID of a handle and
functionHandleWithName: raise the unrecognized selector the AMD Radeon Pro
5300M and the Intel UHD Graphics 630 raise (measured, macOS 26.7.1). A
table's allocatedSize and resourceOptions are the host's table's, inside the
two Macs' answers. A render pipeline's handles and tables stay unsupported,
with Metal's error. supportsFunctionPointers stays no in this commit: the
next one answers it.
The host knows bit 39 (KNOWN_FEATURES), so a driver's write of it is taken.
The decoder's tests make handles and tables on the fake platform and call
through them on the Vulkan platform; the serializer's, the shell's, the
kext's and the members register's tests cover the guest's side, and
design.md describes the messages.
A probe of our own for the dGPU oracle, oracle_ratemap: the layer counts a
device supports, its maps' and descriptors' classes and members, a map's
answers and parameter data, a triangle drawn through a map and decoded in the
shader, and the calls that may end the process, each in a child process. It
runs the same on the guest's device.
What the AMD Radeon Pro 5300M answers (macOS 26.7.1) is Q28 of
docs/graphics-kext/dgpu-oracle.md: its maps are the identity whatever their
samples, 16,472 bytes of parameter data aligned to 256, layer counts 0 to 2,
and the process ends at a map of no layers' creation, at a copy into a Private
buffer and at the physical-to-screen map past the layers. Where the M3's
compile (the platform's) answers otherwise, both bound the contract; the doc
says what the lane answers of each.
The x86-64 guest's device made no rate map:
newRasterizationRateMapWithDescriptor: was RGFX_UNSUPPORTED, and the device
info held the layer count at 0, so an app that asks for a rate map (Apple's
Modern Rendering sample among them) took its path without one. The platform
makes rate maps (metal2vulkan's runtime compiles Apple's map, rate_map.rs
there), and nothing carried one from the guest to it.
What changes for the guest: the device offers feature bit 38, RATE_MAPS
(FEATURES_HI bit 6), on every host, and the kext takes it. Where taken, ring 0
carries RATE_MAP_CREATE (0x233) and RATE_MAP_RESET (0x234), both
RgfxRateMapCreate (the map's obj_id, the screen size, the private mutability
where set, and the layers' RgfxRateMapLayer records with their samples),
answered by RATE_MAP_STATE (0x40a: the map's screen size, granularity, layer
count, mutability and parameter data's size and alignment), and
RATE_MAP_QUERY (0x235), answered by RATE_MAP_ANSWER (0x40b): a layer's
physical size, a coordinate mapped either way, or a copy of the parameter
data, which the platform writes where a buffer of the sender's lies before it
answers. A render pass names its map after its other records
(RGFX_PASS_FLAG_RATE_MAP, RgfxRenderPassRateMap). The kext admits the three
messages, waits for their answers, and destroys a create it timed out on. The
bundle's map (RgfxRasterizationRateMap) answers the host's state, asks the
host each answer that takes an argument, copies into a Shared buffer of ours
in place and into any other through a scratch buffer of its own, answers the
SPI's mutability, minFactor, resetUsingDescriptor: and formattedDescription:
(the words of Metal's base map, measured on the AMD Radeon Pro 5300M), and
ends the process where Metal's map does: at a copy into a Private buffer, and
at a coordinate map the host refuses (a map of no layers or of an empty
screen, a Mutable map not yet reset). The layer counts stay 0 in this commit:
supportsRasterizationRateMapWithLayerCount: answers no until the device info
answers the platform's.
The core platform's map gains screenSize, which the state answers.
New tests: the decoder's create, reset, queries and copy (decode/rate_map.rs,
on the fake and on Vulkan), a pass's map (cmdbuf.rs), the header's checks of
the new names, the kext's feature, gate and reply types, and the bundle's
messages (serializer_tests), map (shell_tests, its two deaths among them) and
pass record (protocol_tests).
oracle_rows ran on the 5300M, the 630 and the M3 Max: a surface made with no
rows named takes IOSurface's own 64-byte rows on the Intel Mac (192 bytes for
an RGhA surface 18 texels wide), whichever GPU's process made it, though both
GPUs align a linear texture's rows to 256; the M3 takes 128. So no Mac's GPU
sets the rows, and the rows a client names (CoreAnimation's, CoreVideo's)
stay its own. Q27 records the numbers; build.sh builds the probe and the
README lists it.
A new VM's disk was to move to NVMe if NVMe's disk waits on um790 stayed
within AHCI's spread. They did not: in six cold boots of macOS 26.7.2 from
reflink clones, two of the three on NVMe waited 7.76 and 13.67 s in their
first 150 s and no AHCI boot waited, though NVMe reached the desktop about
3.5 s sooner. New VMs keep SATA. docs/qemu.md records the numbers, where the
waits came from, and what is still unknown.
A queue's lane ran at most four jobs at once, and a job's thread stayed
counted through its wait to commit: its turn, its tickets in the commit order,
the buffers its COMMIT_ORDER names, a split of its context. So walks queued
behind threads that only waited their turn. In Unigine Valley at 1920x1080 on
the RX 7900 XTX host, the guest's main GL queue spent 65 of 150 s blocked for
a slot, 23 buffers waited behind the lane's four at the median, and a walk
started 177 ms (p50; 448 p90) after the host took its buffer; long walks
started 2.3 ms before their predecessor committed.
Now at most LANE_THREADS (4) of a lane's jobs walk at once, and a job waiting
for what commits before it does so in Lane::waiting, off that count: the lane
starts its next job on another thread meanwhile. The waits are the same calls
in the same places, so every commit, record and interrupt keeps its order;
only how far walks run ahead changes.
Threads stay bounded: a lane holds at most LANE_MOST (64) threads, as many
command buffers as the host's queue holds uncompleted whatever the guest's
queue count (QUEUE_CREATE carries none), and the device's budget of extra
threads is twice the host's cores plus 64, for one busy queue's buffers walked
ahead. A turn's passing wakes only the next turn's wait, not every waiter.
The new tests send more buffers than a lane walks at once behind a held walk,
on one queue, past LANE_MOST, and on a process's second queue behind an
answered buffer's ticket; each fails on the old lane, and checks that none is
committed before the held one and that the commits come in begin order.
The guest's device answered 256 bytes for
minimumLinearTextureAlignmentForPixelFormat: and the SPI
linearTextureAlignmentBytes and deviceLinearTextureAlignmentBytes on every
host, the Radeon Pro 5300M's and the UHD 630's answer, raising the
platform's wherever it was less. The answer describes the GPU: each Mac
answers its own (the M3 Max 16), and the runtime now answers the alignment
at which the host GPU's linear images hold a texture's reads, renders and
shader writes in place, at least the device's nonCoherentAtomSize, asking
the driver. The floor dates from when the platform answered Metal's 16 on
every host, and was chosen for RADV, which takes rows only at multiples of
256. The runtime answers that 256 on RADV itself now. NVIDIA's driver takes
a linear image in place only at its own pitch, the tight row rounded up to
128, so rows a guest lays out at 256 are the runtime's shadow wherever that
pitch is not a multiple of 256.
What the guest sees: its device answers the platform's alignment, the
largest of the formats a buffer backs: 128 on NVIDIA's driver, 64 on ANV
and 16 on MoltenVK, where it answered 256; 64 on lavapipe; and 256 on RADV
as before. Its frameworks lay out their linear textures' rows by it, and
its device makes a texture over a buffer at any offset and rows that are
multiples of it, where it answered nil to those off 256.
No guest reason held the floor: no doc comment or test named a framework
that relies on 256 (docs/architecture.md 17.2), and the oracle doc called
it a choice inside the envelope for the host's cost. Its test, renamed,
now holds the platform's 16 and 128.
The trap behind the pages block join's check: a cache kept by a process's
virtual address joined new memory to a block of old pages, and unit tests never
remapped an address.
Two traps the bundle's fixes came from: a reader whose conservative fallback
hid every OpenCL kernel's arguments (only a log line showed it), and Metal
reading a library URL by its path where Foundation's URL loading refuses a URL
of no scheme, which left Espresso with no kernel library.
A device cache keeps an IOSurface's guest layout, so a texture over it whose
rows miss the GPU's linear pitch is the runtime's shadow in VRAM, which no
count of the caches' own copies showed. The trap goes in docs/lessons.md
with the XTX walk's numbers before and after the rows were aligned.
CoreVideo names its pixel buffers' plane offsets and rows itself (the first
plane 32 bytes in, rows at its own alignment), and keeps them with IOSurface
answering 256 (iosmax in the walks m3-max-20076 and m3-max-20077). Such a
plane is placed on the GPU's alignment only in a device cache; over the pages
a texture the GPU's linear images cannot hold is the runtime's shadow. The
previous commit said the host always caches such a surface, which it does not.
The kext had IOSurface align the bytes per row it works out to the host GPU's
linear alignment, but left the plane offsets it works out at IOSurface's own
64 bytes. A GPU's linear image of a plane starts only where its memory
alignment allows: on RADV the driver refuses a DRM_FORMAT_MOD_LINEAR plane
off 256 bytes, and the XTX baseline walk (m3-max-19850) shows textures over
planes at offsets 32 and 256 of a page shadowed for it. The host's answer,
the runtime's minimum_linear_texture_alignment_for_pixel_format, is the
alignment of a texture's offset and rows at which the device's images hold
it in place (its memory requirements' alignment divides it).
What the guest sees: where the host answers linear_row_alignment above 64
(256 on RADV, 128 on NVIDIA), IOSurface aligns the plane offsets it works out
to it as it does the bytes per row, and IOSurfaceGetPropertyAlignment of
kIOSurfacePlaneOffset answers it. Planes a client places itself, as
CoreVideo's first plane 32 bytes into its surface, are as they were and take
a device cache at their ask.
What changes for the guest: a host whose GPU has memory of its own now
answers the device info's linear_row_alignment as a host whose GPU shares
the CPU's memory does, the runtime's minimumLinearTextureAlignmentForPixel
Format: of BGRA8 (256 on RADV, 128 on the RTX 3090 and 2080). The kext then
has IOSurface align the bytes per row it works out for a surface to it,
where it was IOSurface's own 64 bytes on such hosts, and
IOSurfaceGetPropertyAlignment answers it to the processes.
Why: a texture over a surface's bytes takes the GPU's own linear image only
at the GPU's pitch (RADV exactly round_up(row, 256), NVIDIA its own row's
pitch), wherever the bytes lie: in the surface's pages or in a device cache
of the pages' layout, which a discrete GPU's host keeps. At IOSurface's
64-byte rows those textures were the runtime's shadows, copied in at each
command buffer's first use (perf-scout F2). 256 and 128 lie inside what
Macs answer (64 on an Intel Mac, 128 on the M3; an Intel Mac's GPUs answer
256 for minimumLinearTextureAlignmentForPixelFormat:).
The fake device takes a knob for a GPU of its own memory, and a test holds
the answer there. The wire doc, the header and the kext's comment say the
answer is a host's whatever its GPU's memory; the guest sets and the ROM
record are rebuilt with the branch's last commit.
docs/qemu.md gains "x86-64 macOS guests: the disk on NVMe": the command line,
what Recovery 11.6 to 26.6.2 and installed 11.7.11 to 26.7.2 found on it
(measured 2026-11-12), and why the 10-27 report's Recovery found no disk: that
day's video kexts blocked Recovery's start on either controller. lessons.md
records the trap of blaming the controller a hang showed on.
From 8a585e7a76 the runtime samples a sampler's lodBias as the Mac the
device presents does: added to each sample's level of detail for an Intel
or AMD Mac, as the 5300M and the UHD 630 add it (dgpu-oracle.md, Q14), and
at 0 for an Apple Mac, as the M3 Max samples it. Our device presents the
guest's class (DeviceOptions::mac_class), so neither class's answer differs
from its Macs' any longer, and the inexact-sampler-lod-bias relay, its kind
and its ledger row go. A bias the device cannot take is the runtime's to
announce (capped-lod-bias). The state test no longer needs the relaxed
mode it ran its makes under.
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.
The VA-API hardware tests opened their displays on a runtime with no exit
gate, and one aborted at its exit after it passed. Say how to spot the next
test of the hardware that runs beside the driver's exit-time destructors.
The runtime's sampler descriptor holds a LOD bias since metal2vulkan's pin
47, and keys its states by the bias's bits, -0 as 0, as an M3 Max keys
Metal's. Until now the bias stopped here, so two samplers that differ only
in their bias were one runtime state, with one gpuResourceID, where Metal
makes two. Now each bias is its own state, and the guest sees two IDs as on
Metal.
The runtime samples every bias as an Apple9 GPU does, at bias 0, while the
x86 Macs' GPUs this device imitates add it to each sample's level of detail
(docs/graphics-kext/dgpu-oracle.md, Q14). So the inexact-sampler-lod-bias
relay stays, now saying the bias is taken and what still differs.
A page-load stall in an x86-64 macOS guest on um790 was traced to the host's
SSD. To find out whether any disk option reims-ctl could pass would avoid
it, cold boots of one macOS 26.7.2 disk compared QEMU's defaults with
aio=io_uring, a nodatacow image, cache=none and NVMe on two btrfs hosts.
On um790's DRAM-less Lexar, which now and then takes up to 2 s over a
single read, none of the options did better than the defaults, and three of
them did worse. On um870's 970 EVO Plus the defaults showed no stall.
NVMe reached the guest's SSH about 8 s sooner in three boots of four.
reims-ctl's disk arguments stay as they are; the numbers go in qemu.md so
the A/B is not run again.
The 847 ms rAF gap at Safari's page load (run 12101) was measured on a
qcow2 overlay over the shared VM's disk. Traced with QEMU's AHCI commands
and the host's block layer on homelab-um790-xtx-1, the overlay's guest
writes waited up to 1.96 s behind its first-write reads of the cold,
compressed base on btrfs and the SSD's occasional 2 s reads, where a
reflink clone of the same disk, as reims-ctl copies one, kept every write
under 28 ms. Guest flushes, the suspect, took at most 843 ms.
metal2vulkan gives a few answers the way the class of Mac a device
presents gives them (DeviceOptions::mac_class): what a new Private texture
reads before anything writes it, the encoding a GPU blit through a
texture Metal compresses writes, a half NaN clear's sign, and how far a
Clear load reaches past the render area in a pass of one layer without a
draw call. The library declared no class, so every device presented its
host GPU's: an arm64 guest on a Linux host got an Intel or AMD Mac's
answers, and an x86-64 guest on a Mac host Apple silicon's, the M3's
magenta fresh pattern among them, where the Intel UHD 630 and the AMD
Radeon Pro 5300M read zero.
A graphics device now tells its platform the guest's architecture before
it opens its GPU device (ApiPlatform::present_guest), and the Vulkan
platform declares the guest's class for every device of the process
(GuestArch::mac_class, present_mac_class): Apple silicon for an arm64
guest, an Intel or AMD Mac for an x86-64 guest. The runtime fixes a
device's class as it makes it and keeps one device per physical device
and options, so the class is the process's, fixed by its first
declaration, or left to each GPU where the options were read first; the
platform warns where it is not the guest's. QEMU makes every
reims-graphics-pci of a process for its target's architecture
(target_aarch64() in reims-graphics-pci.c), and rvg_graphics_device_create
is its first call into the library, so its guests get their own class.
What the guest sees change:
- An x86-64 guest on a Mac host (MoltenVK; development and tests only): a
new Private texture reads zero where it read Metal's fixed pattern (the
runtime fills it with zeros, WorkCounts::private_textures_zero_filled);
blits through a texture Metal compresses keep their bytes, but where
MoltenVK's own copies still rewrite RG11B10Float and RGB9E5Float; a half
NaN clear goes through half; a Clear load in a pass of one layer without
a draw call clears the whole level.
- An arm64 guest on a Linux host (TCG today, KVM on arm64 hosts later):
the reverse. A new Private texture Metal keeps compressed reads Metal's
fixed pattern (opaque magenta in RGBA8Unorm) and any other zero, where
it held what its memory held; the runtime writes the pattern as the
texture's first move, and announces fresh-pattern-zeroed where the
device cannot write it exactly. Blits through such a texture write the
canonical BGRA10_XR, RG11B10Float NaN and RGB9E5Float encodings, a half
NaN clear keeps its sign in a pass without a draw call, and that pass's
Clear load clears an uncompressed texture over the render area's 32x32
tiles.
- x86-64 guests on Linux and arm64 guests on a Mac: nothing; the host
GPU's class was the guest's already.
The device info is unchanged: Metal has no property for the class, and
both guests keep the host GPU's name and no Apple family, the lane's own
limit.
No test held the host GPU's class through a graphics device: every
reims-vgpu and reims-vgpu-c test passes unchanged on the M3 Max, where
the x86-64 guests' devices now present an Intel or AMD Mac. The Vulkan
crate's tests make their devices with no graphics device, so they keep
the host GPU's class, the M3's Metal their reference; ff4185d73, which
declared an Intel or AMD Mac for every device, broke three of them. New
tests: the guest's class decides the answers whatever the host GPU (each
architecture in a child process: a new Private RGBA8Unorm render target
reads the pattern for arm64, and zero or no fill for x86-64), and the
process's class is fixed by its first declaration.
A guest's samplers lost lodBias and reductionMode (macOS 26) on the way to
the host: SAMPLER_CREATE's extension, RgfxSamplerCreateExt, was on the wire,
but the bundle never sent it and new_sampler never read it, so every sampler
was made at bias 0 with weighted-average reduction. The guest's state cache
already keyed on both, so two descriptors that differed only there were two
guest samplers of one host shape.
The bundle now sends the extension with every create, on the posted and the
asked route. new_sampler sets the platform's reduction mode and its new LOD
bias from it, and leaves both unset for a create without one, which keeps
Metal's defaults. What the guest sees changes: a sampler of minimum or
maximum reduction samples that way, as Metal's does. The runtime's sampler
descriptor holds no bias yet, so a non-zero bias still samples at 0, and is
now relayed as inexact-sampler-lod-bias, with an accuracy-ledger row, until
the runtime takes one.
The header follows wire.rs's doc, the ROM's record that header (its bytes
are unchanged), and both guest sets are built again from these sources.
A Mac's display goes dark when the OS puts it to sleep (Energy Saver's timer,
pmset displaysleepnow) and lights with the desktop at its wake. The device kept
showing the last frame instead, so a sleeping guest looked frozen.
What changes for the guest: the device offers DISPLAY_POWER (FEATURES bit 37)
on every host, and a guest that takes it sends SET_DISPLAY_POWER (command 8,
a 24-byte RgfxSetDisplayPower of display and on, answered COMPLETE), a display
command the control thread carries out. A reset turns the panel on. Nothing
else the guest sees changes: presents are taken and answered, VBLANKs go on,
and modes and the cursor's image stay.
What changes for the host: while the panel is off, the device's window and
rvg_graphics_device_read_display (QEMU's console and screendump) show black,
and cursor_show tells the host the cursor does not show; at the wake both show
what the guest shows again. The display callbacks' order now covers the
display power commands (docs/api.md). QEMU's reims-graphics-pci needs no
change: its console reads the display through read_display.
The tests that pinned the offered feature words and the backlog's display
command range take the new bit and command. The option ROM is built from the
wire header, so its record takes the header's new hash; the ROM's bytes are
unchanged (sha256 749434f8...).
Past the headroom of the views' budget, a buffer or heap over guest memory
whose view lies in dma-bufs was copied rather than imported, as a driver that
imports by pointer needs the pages mapped from their files, a mapping a run.
NVIDIA's driver refuses the pointer of a view through dma-bufs, but takes the
pages one udmabuf holds through that dma-buf, as an allocation dedicated to the
buffer, which takes no mapping. So where a probe at the device's making finds
the device takes such a dma-buf, the gate lets pages one dma-buf holds through
(at udmabuf's defaults 1,024 runs and 64 MiB), and only an object of more runs
is copied there.
Measured on the RTX 2080 at the stock 65530, before made imports' views were
folded: once 24 scattered 16 MiB buffers had filled the budget, 160 scattered
2 MiB buffers were all imported (m3-max-17739). With the fold, the budget
rarely fills on NVIDIA in a desktop walk, so this is for heavier loads.
The probe's import is the process's first Shared dma-buf import. Before
metal2vulkan's RUNTIME_VERSION 2080 the runtime tried NVIDIA's host-mapped
system type first, which the driver refused, and every exportable device-local
allocation after that refusal lay in system memory: with the probe, boots on
the RTX 2080 and RTX 3090 logged the fallback and NVIDIA's mapping faults, and
three of four hung the GPU. At this runtime (bf442ceb9e), boots of the same
tree at 65530 logged neither the fallback nor a driver fault (RTX 2080
m3-max-19103 and 19104, RTX 3090 m3-max-19116).
Tests: past the headroom, a view of one dma-buf's pages passes the gate
uncounted and maps nothing, and one of more runs than one dma-buf takes is
refused and counted.
On a host GPU of its own memory the host made a Managed buffer as two buffers:
the platform's own Managed buffer, whose host copy it filled from the guest's
bytes at the create and copied each BUFFER_DID_MODIFY_RANGE's range into, and
whose GPU copy a blit copied back to the guest's bytes at each synchronize.
That held a third copy of every Managed buffer in host memory, the platform
buffer's host copy, and copied each range twice on the CPU's side.
metal2vulkan's runtime 2050 keeps a no-copy Managed buffer's two copies itself
on a GPU without unified memory: a GPU copy in device-local memory, with the
caller's pages its CPU copy, copied in at the make and at each didModifyRange:,
and out at each synchronizeResource: (its managed_copy module). So
BUFFER_OVER_HOST_MEMORY with Managed options, BUFFER_MANAGED_AT_OFFSET and
MANAGED_BUFFER_CREATE now make one no-copy Managed buffer over the CPU copy's
bytes on every host, as they did where the GPU shares the CPU's memory;
BUFFER_MANAGED_AT_OFFSET places no buffer in the heap any more.
BUFFER_DID_MODIFY_RANGE is the platform's didModifyRange: alone, still made
once the process's command buffers answered before it are committed, which
a_managed_range_is_carried_out_before_a_later_command_buffer and
a_managed_range_behind_an_answered_walk_holds_up_nothing_on_ring_0 hold; a
buffer's synchronize is the platform's own. gpu_copy, fill_gpu_copy, the
range's memcpy and the buffer arm of synchronize_managed are deleted, not kept
as a fallback: where the GPU's memory has no room for its copy, the runtime
lays the buffer in its bytes and announces it.
What the guest sees is unchanged: a Managed buffer is two copies on a host GPU
of its own memory and one where the GPU shares the CPU's memory, Managed
textures keep their two copies, and the device's answers and feature bits stay
as they were. The tests that held the two buffers on a discrete GPU now hold
one no-copy buffer on either answer.
The arm64 26.6.2 Dock lost a region of icons after an app quit whose edge cut
one icon in two, which read as that region's surfaces failing to upload. It was
WindowServer's damage rectangle redrawn from textures already wrong: every
IOSurface was in place on the M3 host, the bundle counted no upload, and the
loss followed the size the icons were drawn at, not their content. The lesson
says how to tell the two apart before chasing the copy path.
A no-copy buffer's or heap's view of scattered guest pages kept a mapping per
run of pages for as long as its import lived, as a driver that imports by
pointer needs the pages mapped from their files to pin them. On NVIDIA at the
stock vm.max_map_count the live imports' views filled the budget, and every
import after that was a copy: 11 of 24 scattered 16 MiB buffers on the RTX 2080.
NVIDIA's driver pins the pages as it imports them and keeps those pages. Once
the runtime's call that imports them returns, the view may be folded into a
dma-buf of the same pages like an idle view, and its mappings go back to the
budget. Each import site tells its record so, but only on a GPU that passed a
probe and on a device that does not release idle pointer imports. A second
import of an alias's view maps it from its files again until it is made too.
The probe runs where views are mapped from their files (NVIDIA, ANV on i915),
once for each GPU, driver version and kernel release: its verdict on the
GPU's own behaviour is kept in the library's cache, as the device checks
are. It first maps other pages over an import's view, which a GPU that kept
its pages must not read; only then does it fold the view, write the bytes
through the pages' own mapping, which the GPU must read, and run a GPU fill
both mappings must show. A first version folded before asking and lost the
device on the Iris Xe at every device's making (docs/lessons.md); the Iris
now refuses at the remap, with no lost device.
What the probe costs the device's making, over 5 makes each at metal2vulkan
842fd73b71: 26.7 to 33.0 ms on the RTX 3090 and 5.2 to 13.1 ms on the RTX 2080,
which pass it, and 16.5 to 17.5 ms on the Iris Xe, which refuses it; a kept
verdict answers in 0.05 to 0.09 ms. The Radeon 780M and RX 7900 XTX map views
through dma-bufs and run no probe, nor does a Mac. No run on those five GPUs
logged a lost device, a recovery or a GPU fault.
At the stock 65530 on the RTX 2080 (NVIDIA 620.70.06), a 26.7.2 guest's walk,
boots alternated with development's at metal2vulkan d0f800ddd0 (m3-max-18444 and
18503 against 18502 and 18504), copied 17 buffers and heaps over guest memory
where development copied 186 and 197: 16 of the 17 are cl_bw's 256 MiB buffers,
each more runs than the whole budget. The runtime's copied-host-pages count fell
from 370 and 392 to 34, and mb_probe's command buffer over its 192 buffers took
12 ms where it took 230 ms. Neither side logged a kernel fault of the driver's
or a fatal line.
Tests: a fold of a made import and an alias's second import; on a GPU that
folds, 100 rounds of make, fold, GPU check and release that end with the
file's pages unpinned (F_SEAL_WRITE) and the mappings back, and a folded
import that keeps its pages through a remap; elsewhere both say so and check
the fold stays off. The probe answers alike ten times, and a kept verdict
answers under its key alone.
A slab of the Metal bundle's own memory, 2 MiB of plain pages, reaches the host
as up to 512 runs of guest RAM, since the guest's kernel scatters 4 KiB pages.
The host maps each run of a view apart against a per-process budget of
mappings (vm.max_map_count, 65530 by default on Linux): on NVIDIA, views of
scattered pages, slabs' among them, used up the budget and the buffers made
after it were copies.
The kext now gives a slab's memory as physically contiguous 64 KiB chunks
(selector 12, PagesChunked, kext feature 1 << 8): it takes them zero-filled,
maps them into the process in order and makes the pages block of their runs,
so a 2 MiB slab is 32 runs at most. The memory is the block's: the slab's
release takes it, and the kext unmaps it from the process and frees the chunks
once the device has answered the block's release, or at the client's close. A
slab the kext gives no chunks for is plain pages, as before.
64 KiB is the size the kernel gives at once however long the guest has run. On
an 8 GiB x86-64 macOS 26.7.2 guest on the Radeon 780M host, 4,096 chunks in a
row took 0.033 ms each, and 0.036 ms each once 978 MiB of 4 KiB pages had been
taken, the slowest 0.74 ms, none refused. Of 128 runs of 2 MiB asked, the same
guest gave 28 quiet and 16 once memory had been taken, the slowest in 264 ms.
Measured with the chunked set against development's, each on its own boot.
On the Radeon 780M, an x86-64 macOS 12.7.6 guest (manypieces' m3-max-18395
against m3-max-18394), the host's copy-ins of guest pages fell from 632.8 to
0.9 million texels a second in a WebGL scene (gl3d), from 202.4 to 0.2 playing
1080p video in Safari, 96.4 to 4.7 scrolling, 84.6 to 22.2 in Maps, 31.8 to
8.1 in Launchpad and 21.7 to 1.1 in Mission Control; gl3d drew 39.5 frames a
second where it drew 34.1, the GPU 51.4% busy where it was 63.7%. The slabs,
WebKit's tiles, the WebGL drawing buffer and the video's BGRA buffer among
them, are now used in place there; what is still copied is no-copy buffers
over an app's own pages. On the Iris Xe, a 26.7.2 guest's walk (m3-max-18417
against m3-max-18418) peaked at 85,951 of QEMU's mappings where it peaked at
94,896, and scrolled and drew as before (58.8 and 58.7 frames a second
scrolling, 47.5 and 47.1 in gl3d); manypieces' Iris pair (m3-max-18398
against m3-max-18397) drew gl3d at 48.6 frames a second where it drew 43,
with the same copy-ins. An arm64 macOS 27.0.1 guest on the M3 Max under HVF
passed the arm64 gate's 15 checks with the arm64e set (m3-max-18496).
Tests: a heaped slab and a large Shared slab are the kext's chunks first, the
heap and the buffer over their block with no pages asked of the kernel; a slab
the kext gives no chunks for is plain pages; a chunked slab's memory goes with
its block's release alone, a plain one's pages after it. The user client's words
test holds selector 12, its feature bit and the chunk's size. make -C guest
test, prebuilt and prebuilt-arm64e on a Mac, and both sets committed here; make
-C guest prebuilt-check passes.
m3-max-17945 ran arm64 macOS 14.6.1 under TCG on the 780M with a cargo
build from scratch beside the whole probe. The probe's call took 121 s
against 53 to 62 s in quiet boots, and it presented half the frames a
second. Its main thread sat runnable after its exec, while the library's
command buffers stayed at 3.4 ms p99, and amdgpu's order-9 allocations
stalled metal2vulkan's threads 8 times for at most 0.06 ms each. The
lesson now says the build stretches the guest's side, not the device's.
A runtime change was judged to fix the 27.0.1 weather widget's white edge
strips on three boots a scorer read as clean. The scorer took pixels with
every channel at 240 or more as the defect, and the widget's strips are
Read against the region's own colours, the three boots were two combs and a
strip, and none of the 33 saved 27.0.1 screens was clean. The lesson says how
to score such a defect and to check a known-bad screen before trusting a clean
result.
Two of the four jobs the lesson cites ran their device on homelab-um870-1's
RTX 3090, not the 780M, as their exclusive lease listed the 3090 first. The
guest's storm and its spindumps do not depend on the host's GPU; the
library's command buffer times do, so the lesson names the GPU of each.
An --exclusive potluck job holds every GPU of its node, and its lease lists
them all, homelab-um870-1's RTX 3090 first. Taking the lease's first GPU put
three exclusive TCG runs on the 3090 in place of the 780M they were meant for
(m3-max-17679, 17862, 17863). The script now keeps a MESA_VK_DEVICE_SELECT
the run gives, names the GPU of a lease that holds one, and stops on a lease
of several, so an exclusive run must name its card.
Ten arm64 macOS 14.6.1 boots under TCG on homelab-um870-1 put the metal-app
probe in the guest's post-login launch storm, over 200 runnable processes
on 4 vCPUs. Its window was shown 2.1 to 8.1 s after it was ordered front,
or not within the probe's run. Spindumps over the probe's first 15 s found
WindowServer mostly idle and never waiting in our kext, and the probe's
launch waiting on system daemons that barely ran. docs/lessons.md records
that, the windowed probe's second boot, and docs/qemu.md now says what
m3-max-17111's probe showed: no frame, which was all it measured.
Under TCG on a quiet homelab-um870-1, arm64 macOS 14.6.1's full-screen
probe window was first shown 2.1, 4.4 and 8.1 s after it was ordered front
in three boots, and not within the probe's 11 s in a fourth, which dropped
all 245 frames and failed metal-app (m3-max-17482). The probe ran 3 to 4
minutes after QEMU started, while the guest's post-login launches kept over
200 processes runnable on its 4 vCPUs. Counting frames over a fixed time
from the window's start read that delay as a device that shows nothing.
present_probe -v SECONDS now renders while it waits up to SECONDS for its
window to be shown (its occlusion state turning visible, or a frame's
nonzero presentedTime), then warms up a second and measures. Its line gives
the wait as visible_s, or none. check-boot runs it with -v 60, and fails a
window not shown in that time as such. Without -v the probe measures as
before, so the lane gate's runs are unchanged but for the new key.
A TCG run left the device to the library's own pick of the host's GPUs, so
on homelab-um870-1 one ran on the RTX 3090 the job did not hold (m3-max-17037).
The script now names the lease's first GPU in MESA_VK_DEVICE_SELECT and
stops where neither a lease nor a selection is given.
metal-app under TCG passes only on frames shown within the probe's 10 s, so
CPU taken by other work on the host can fail it, as a build did for 14.6.1 in
m3-max-17111. Its line now gives the host's pressure over the probe (PSI for
CPU, memory and IO, direct compactions and reclaims), and docs/qemu.md says a
gating TCG run takes the whole machine (--exclusive --hold-line).
docs/lessons.md records why the probe stays full-screen at the status level:
a titled probe window started over SSH was never shown, and every frame
dropped, while WindowServer denied the probe the right to be in front.
The webgl11 lane's count walks read the guest bundle's resource-wait counter,
an os_log_debug line on OS_LOG_DEFAULT, through the unified log. On macOS
26.7.2 and 12.7.6 the debug stream dropped every line under a walk's load, and
on 26.7.2 the log store kept none: the system mode persists no debug lines, and
a per-process mode was refused. The zero was no reading at all. The entry says
what such a counter needs (a subsystem of its own, or the default level) and
how to spot the next one.
Q26's numbers came from the same probe under the lane's harness name; the
runs of guest/bundle/tools/oracle/oracle_complete.m itself (m3-max-17599 to
17601) agree on every answer, and their times replace the earlier ones.
A resource SPI answer the bundle took from an M3 probe right after a commit
was the answer before scheduling; Apple's GL renderer asks after the buffer is
submitted, where the Intel 630 and the M3 wait. The lesson says how the stale
read-back showed and how to spot the next such answer.
The resource SPI's isComplete and isWriteComplete answered YES, and its
waitUntilComplete returned at once, as an M3 probe measured right after a
commit. Apple's GL renderer on macOS 11.7.11 reads a drawable back with the
texture's waitUntilComplete after commitAndWaitUntilSubmitted, then a
synchronizeTexture: on a queue of its own and getBytes:. On a unified-memory
host that synchronize has nothing to copy and finished before the draw, so
about 2.5% of Safari's WebGL readPixels on a 780M returned the canvas as it
was before the draw.
What the guest sees now: once a command buffer that names a resource, or a
view of its memory, is submitted (commitAndWaitUntilSubmitted returned, or it
is scheduled), the resource answers isComplete and isWriteComplete NO and its
waitUntilComplete waits, until the bundle takes the buffer's completion and
has written back its copies; for any use. That is the Intel 630's answer once
the buffer is scheduled (macOS 26.7.1, oracle_complete, dgpu-oracle.md Q26).
The M3 answers the same, except isWriteComplete YES for a read-only use,
which arm64 guests do not get: it only adds waiting for readers, and the
register lists it as a gap. Before submission, and for a resource no buffer in
flight names, the answers stay YES at once, as all three Macs answer. The wait
ends at the completion's take, not behind an earlier buffer's handlers, as the
630's returns with the buffer still Scheduled; where no thread takes the
completions any more, waits end. A debug line counts the waits and the NO
answers.
The tests that held the old answers keep them for a resource no buffer in
flight names; test_resources_wait_for_their_buffers_in_flight holds the new
ones, with the draw's buffer unretained as the GL renderer's is, and
resource_tests holds a view's and a buffer texture's shared count.
Pin 39 moves metal2vulkan from 600b535875 (RUNTIME_VERSION 2046) to
101c809066 (2061), metal2vulkan's verdict sha (its merged-tree check
m3-max-17532). It carries:
- exit handlers run after the device's work, and work in a handler on
the exiting thread answers as on any thread (2054, 2056, 2061): the
NVIDIA 10 s exit and the M3's aborts in an exit handler are gone;
- NVIDIA's dma-buf imports: no double close (2053), a kind's first
imports one at a time with the learned form and type (2058);
- the compositor's unshared-queue hold under load (2052, 2059);
- a private logic operation drawn in the fragment function on MoltenVK
(2057), which fixes arm64 guests' GL logic operations there;
- separate depth and stencil textures' unstored DontCare loads follow
the DontCare policy (2047); far vertex fetches on lavapipe (2048).
What changes here:
- NativeLogicOperation (native-logic-operation), the device's logicOp on
a 10-bit attachment's own codes, is placed in DIES and relayed on
native devices (NATIVE_RELAYED, class (e)), as DeviceAlphaCoverage is:
the runtime's default off Apple's GPUs.
- VertexFetchMayWrap (vertex-fetch-may-wrap), lavapipe's wrapping
fixed-function fetch past 4 GiB, is relayed with the precision kinds,
as DontCareUnstoredLoad is: a policy's default whose exact form
REIMS_VGPU_EXACT's new name vertex_reach selects
(VertexReachPolicy::Exact), matching exact_answers(). The accuracy
ledger gains its row, and the unstored DontCare row now covers
separate depth and stencil textures.
Nothing a guest sees changes on the drivers we ship on by default:
both kinds were already relayed and counted outside strict mode. Every
API change in the range is an addition (metal2vulkan's api_signatures),
and Cargo.lock keeps its lines: metal2vulkan's dependencies are
unchanged.
The design doc said x86-64 macOS picks its default scale by the window's
width alone. That was measured, but it was not the rule. CoreDisplay starts
a built-in display HiDPI by its density, and any display by width where its
EDID is 32 inches or more. The framebuffer now answers to both: its display
is built in, and its EDID is a 1920 x 1080 display's at the screen's
density. The doc says so, with what was measured on 11.7.11 to 26.7.2.
lessons.md gets three traps. The 3800-pixel rule applies to built-in
displays too, which a first reading of the code missed. An EDID that stays
the same across window sizes stops the guest following the window. And a
mode the framebuffer keeps listing for a reader mid-change was restored on
a display resized to another size.
On a host GPU that shares the CPU's memory, the device answered
recommendedMaxWorkingSetSize with the platform's device-local memory, a share
of the host's RAM, which can be more than the guest's: guests of 8 GiB were
told 11864629248 bytes on a Radeon 780M and 24950464512 on an Iris Xe. No Mac
answers more than its RAM: a Mac's GPU that shares its memory answers a share
of it, from an Intel UHD 630's 0.023 (macOS 26.7.1) to an Apple M3 Max's 0.81
(macOS 27.0.1).
What the guest sees now:
- On a GPU that shares the CPU's memory (a Radeon 780M, an Iris Xe, an Apple
GPU under MoltenVK), x86-64 and arm64 guests alike: the working set is three
quarters of the RAM the host maps for the device, rounded down to 16 KiB, or
the platform's answer where that is less; about 6 GiB for a guest of 8 GiB.
maxBufferLength follows it by its rule (three quarters of the working set,
about 4.5 GiB), and so does the kext's VRAM,totalMB (the working set in MiB).
- On a GPU of its own memory (an RTX 3090 or 5080, an RX 7900 XTX), and where
the host passes no memory map: the platform's answer, as before, the card's
own memory, as an AMD Radeon Pro 5300M answers its own 4 GiB less 16 MiB.
The RAM is the sum of the memory map's ranges, so no C API value is added:
q35's map leaves out the 384 KiB below 1 MiB, and vmapple's under HVF adds its
firmware's 1 MiB and config's 64 KiB, both well inside Apple's range.
On an Iris Xe, a macOS 14.8.9 guest told 24950464512, 5726617600, 4278190080
or 1610612736 bytes did the same work over a cold boot and a Safari scroll:
the runtime's blocks, the page's frames and the presents.
Pin move 38: metal2vulkan 30cadd8dda..600b535875 (its round's go),
RUNTIME_VERSION 2034 -> 2046, SEMANTICS_VERSION 2032 -> 2034 (translations
are made again once), the submission check's CHECK_VERSION 6 -> 7 (each
device checks again on its first run). What changes for the guest and the
host:
- An attachment a pass loads DontCare and does not store, in a pass whose
draws reach it, is cleared where the driver measures that clear no slower
than its DONT_CARE load (MoltenVK on the M3 Max, RADV on the Radeon 780M),
so the draws read zero or the clear value, as an M3's do. On other drivers
it stays the driver's DONT_CARE load, announced dont-care-unstored-load:
answer.rs relays it with DontCareLoadTiles' kind (Metal keeps none of the
attachment past the pass), and REIMS_VGPU_EXACT=unstored_dont_care_loads
clears it everywhere (a new row in docs/accuracy-ledger.md, 3.2 us a
frame on the 5080).
- A tiled texture's take (the copy of a buffer's bytes behind a texture of
more than one level) makes every format's later levels, is taken again by
an encoding that re-encodes it, and is given back by a command buffer that
runs nothing (failed, dropped uncommitted, or left out), a re-recorded
segment keeping it; a heap texture's tiled route plans once with one
staging buffer (host allocations per newTextureWithDescriptor:offset:
75.25 -> 28.25 on the 780M).
- Small heaps take no pooled block ahead, and a device the driver refuses for
want of its resources is made again with one shared VkQueue, announced
least-queue-plan, a performance kind (the 2080 behind Thunderbolt makes 9
devices where it made 7).
- The device checks no longer remap pages under a live pointer import (the
follows check is gone, with Device::pointer_imports_follow_their_address);
an idle pointer import is released only where a held one costs every
submission (RADV, ANV on i915). no_copy_remap_linux.rs leaves a pointer
import unmeasured where the device releases idle ones
(Device::releases_idle_pointer_imports), as it did where imports followed
their address, and remap.rs's docs call what such an import reads after a
remap unspecified, as VK_EXT_external_memory_host does.
- WorkCounts count command buffers waiting behind another queue's on a shared
VkQueue; OpenCL-mode images reflect as the textures bound; a query-only
image slot binds a swizzled view unswizzled (CL_BGRA); a copy made after a
failed import names why in its notice.
The move touches no guest source, QEMU, firmware or reims-ctl, and adds no
kind to DIES, so what the platform ends the process on and what device info
answers are unchanged: the checks it reaches are the library's (the Mac's
xtask check and the Linux workspace tests on ANV, RADV and NVIDIA).
Known on NVIDIA at this pin, fixed in the next: a failed dma-buf import can
close a file descriptor twice (since pin 37), and a process exiting beside
CPU device work waits 10 s.
Since 18b642dab the guest's Metal device answered iosurfaceTextureAlignmentBytes
and iosurfaceReadOnlyTextureAlignmentBytes from the host's runtime, 128 on an
NVIDIA GPU and 256 on RADV, so that CoreAnimation would round its backing
stores' rows to what the host takes in place. CoreAnimation also refuses a
Metal texture of any surface whose rows or planes are not at a multiple of
that answer, and the surfaces other code makes keep their own rows. In macOS
26.7.2 guests on an RTX 3090 and an RTX 2080, WindowServer logged "Failed to
allocate MTLTexture from IOSurface ... Row bytes (5312) not 128 aligned" for
rows of 192 to 14272 bytes, and Safari drew pages blank and WebGL black on
every load (appwalk2 walks m3-max-16925, -17008). On a Radeon 780M, at 256, it
found Safari's 1080p and 2160p video frames without the proper alignment.
What the guest observes: the device answers 16 for both again, as Metal's
devices and the IOGPU base do, whatever the host's GPU answers. On RADV the
backing stores' rows go back to 64-byte multiples, so the runtime shadows
those 18b642dab moved in place (1399 textures over a cold boot and a Safari
scroll of macOS 11.7.11 on a 780M).
test_iosurface_alignments_divide_other_codes_surface_rows holds the answer to
the rows WindowServer refused; the member register lists both as Metal's. The
trap is in docs/lessons.md.
Bit 28's record was built from the Intel 630's renderer, measured on the
oracle. In our own guests, which properties the renderer sets on our device
had never been measured, and arm64 guests on the M3 lose gl_cases' logicop draw.
Each gl_cases case was traced in arm64 27.0.1 (m3-max-17093) and x86-64 26.7.2
(m3-max-17106). Every property the renderer sets to something other than
Metal's default is already in the record. The four it sets only to 0 change
nothing Metal draws, and it never sets the alpha test, clip distance mask,
clamp masks, point smoothing or amplification properties. The arm64 loss is
metal2vulkan refusing a logic operation on a device without Vulkan's logicOp
(MoltenVK), which the doc now states.
A no-copy Managed buffer over writable app pages was one copy on every host:
the bundle sent its BUFFER_OVER_PAGES with Shared storage, and its
didModifyRange: and a blit's synchronize of it, or of a texture over it, sent
nothing (e828db91b). Apple's OpenCL makes each default cl_mem such a buffer and
binds it to every kernel, so on a host GPU with memory of its own the kernels
read and wrote it across the bus in system memory. CL makes the calls Metal
requires of a Managed buffer: synchronizeResource: before a map, and
didModifyRange: after a map for writing (measured with cl_bw on a macOS 26.6.1
guest on the RTX 5080 host).
The buffer is now a Managed buffer over a Shared one, as the pages slabs'
large Managed buffers are: the BUFFER_OVER_PAGES buffer, still Shared, is its
CPU copy, and a MANAGED_BUFFER_CREATE over it, at an address of its own that
keeps the pointer's offset in its page, is the buffer the app gets. At its
release the Managed buffer goes first, then its CPU copy, then the pages
block. A device that makes no Managed buffer over a Shared one gives such
memory the shadow, as read-only memory has.
What the guest sees: the host's object for the buffer has storageMode Managed,
and the buffer's didModifyRange:, a replaceRegion: of a texture over it, and a
blit's synchronizeResource: or synchronizeTexture: of it or of such a texture
now reach the host. On a host GPU of its own memory the buffer is two copies,
as the AMD 5300M's is: the GPU sees a CPU write only after a didModifyRange:,
and the CPU a GPU write only after a synchronize. On a GPU that shares the
CPU's memory it stays one copy, as the Intel 630's is.
The shell tests that held one copy now hold the two messages, the ranges and
synchronizes sent, the release order, and the shadow where the device makes
no Managed buffer over a Shared one; the serializer tests hold the Managed
create's offset.