The key in the global domain is for AppleGVA's AMD flow, which only x86-64
macOS runs: the arm64e shared cache of macOS 27.0.1 holds no image with the
key's name. An arm64 guest's global domain is now left as it was, and its
AppleGVA file is kept as before. design.md's routing item says what each
file gets: a key already true leaves the file untouched, an absent file gets
a fresh XML plist of the key alone, and an edit keeps every other byte (XML)
or every other object's bytes (binary).
Safari plays H.264 through WebKit's GPU process, where VideoToolbox runs
AppleGVA in the process itself rather than in VTDecoderXPCService. That
process's sandbox denies it /Library/Preferences/com.apple.AppleGVA.plist
(the kernel logs deny(1) file-read-data) and lets it read the global domains,
so AppleGVA there never saw gvaForceAMDKE, found no Intel GPU, and every
H.264 video in Safari decoded in software: each 4K60 frame written by the
guest's CPU and uploaded, and loop seams of about 550 ms where HEVC's, on the
hardware, take about 190 ms.
RgfxGate now keeps the key in /Library/Preferences/.GlobalPreferences.plist
too, the global domain for every user, which CFPreferences searches after an
application's own and the sandbox lets the process read; the same edit as the
AppleGVA file's keeps every other key and object. Measured on the guest
(macOS 26.6.1, RTX 5080, boot m3-max-14279): the same 4K60 H.264 page in
Safari decoded in software with the key in the AppleGVA file alone, and after
`defaults write` put it in the global domain, a new GPU process's AppleGVA
forced the AMD flow and NVDEC decoded the clip's 980 pictures, none failed.
A leg that held gem10's RTX 3090 and named no device ran its Vulkan tests on
the Radeon 780M, the library's measured pick kept in the tests' cache, and the
device cache's planes test passed there and failed on every leg that pinned
the 3090. docs/lessons.md now says how a test process picks its GPU, how to
pin the held card, and how to spot a run on another one.
The aligned byte puts a cache's first plane where an image over its memory
may start, but on the RTX 5080 metal2vulkan makes each exportable buffer its
own dedicated allocation, to which it binds no image, so the NV12 and P010
planes' textures over NVDEC's caches stay shadows wherever the byte lies.
Measured in a 4K60 bar boot: their shadows' cause moved from the texels
sharing a line to the exported memory's, and their count stayed (1424 at
development, 1586 with the byte). The docs said they lie in place; they now
say where that holds.
aligned_byte named a surface's first plane's byte only where it lay off a
multiple of 256 bytes, a figure of the runtime's that our code repeated
(ALIGNED_BYTE_MULTIPLE). It now names the byte wherever the plane starts
past the surface's first, and the platform places it on its own boundary:
on the Vulkan platform the runtime's multiple of 256 bytes
(BufferDescriptor::with_aligned_byte), the largest linear image alignment
measured (RADV's 256 on an RX 550, 128 on an RTX 5080 Laptop GPU). A plane
256 bytes in is now placed by the runtime rather than left to the buffer's
own start; where the buffer starts on that boundary the memory is the same.
For the guest nothing changes: the same answers and the same bytes in its
pages. The asked cache's test now has the platform place a plane 256 bytes
in (an_asked_cache_places_its_first_planes_byte).
NVDEC lands each 4K picture in an exportable device cache, and the guest's
decode names R8 and RG8 textures over its planes 32 bytes into the surface,
as CoreVideo lays them. NVIDIA's linear images need 128 bytes there and
RADV's 256, so every such texture was a metal2vulkan shadow, its plane
copied in before each command buffer's use (1114 of them in one boot of the
5080's 4K60 bar at development). The host now places the cache by the layout
a cached or deferred block's SURFACE_PAGES carries on a device that asks
nothing (CacheLayout::FirstPlaneAt): the surface's first plane's byte goes on
a multiple of 256 bytes of the cache's memory (BufferDescriptor::
with_aligned_byte), as an asked cache's already did, on the exportable route
(new_exportable_buffer_of_length takes the byte, made as BufferDescriptor::
exported_as OpaqueFd) and on a plain cache's (new_buffer_of_length_aligned,
declaring nothing else). A layout that does not lie in the surface's bytes
is logged and places nothing. The copies between a cache and its pages are
unchanged: only the ask's layout makes them take texels alone.
For the guest nothing changes: the same answers and the same bytes in its
pages. On the wire, CACHED and DEFERRED SURFACE_PAGES may carry the layout,
64 to 200 bytes, compatible both ways (the kext's commit before this).
The tests: on Linux, an exportable cache of a 4K NV12 frame made with the
byte takes both planes' textures in its memory (Buffer::
texture_placement_with_iosurface_plane answers NotHostPages; made without
it, both were shadows, printed); the NVDEC landing test lands its pictures
32 bytes into such a cache through CUDA's mapping at the export's offset; a
cached block's layout places its cache alone, a deferred block's alike, a
first plane at the first byte, a layout past the bytes and none place
nothing, and the copies stay whole; the graphics crate hands a cached
message's layout to the host.
On a device that keeps its own memory (SURFACE_CACHE, no ask), the host
made each device cache with no knowledge of its surface's planes, so a
cache's first byte sat where the runtime put it and CoreVideo's planes, 32
bytes into their surface, sat 32 bytes off every linear image's alignment:
the 5080's NVDEC plane textures were metal2vulkan's shadows, copied in at
each command buffer's use. The bundle already gives the kext each block in
place's layout; the kext now forwards it on a cached block's SURFACE_PAGES,
a deferred block's and a cached block's pages named at its ask, as an ask
carries it (rgfxPagesCarryLayout, with its unit test). A device that
answers asks gets no layout with its cached blocks, as before.
The wire's docs say a CACHED message may carry the layout at
RGFX_SURFACE_PAGES_LAYOUT_OFFSET, by which the host places the cache alone
and answers as with none. The messages grow from 64 to 200 bytes, and it
is compatible both ways: a host before this reads a layout only with
ASK_CACHE and ignores the tail, and an older kext sends none.
The Asahi experiment booted macOS 27.2.1 under KVM with 84f164fff's
Ambrosia module and arm64e kexts to all 14 of check-boot's checks, and
again on a QEMU built without the ISV=0 emulator commits, with no data
abort. Our module's ECAM read was the emulator's first case only before
8e7e0aa71. Replace the earlier 12-of-14 note.
The arm64 boot check now covers 27.2.1 beside 14.6.1 to 27.0.1. 27.2.1 boots
only on Ambrosia's development (0e6489b on), not on 0.1.1, and the docs say so,
with the pass on the M3 Max under HVF and its control on the set without
27.2.1's swap layout.
VA-API's zero copy kept a guest buffer's import by the mapping's identity
and the frame's size and format alone. One mapping can hold several buffers
of one size: macOS 26.7.2's HEIC decodes (Preview opening a desktop picture,
Freeform's welcome) write each tile of a grid image into one surface at the
tile's own offset. Every tile after the first found the first tile's import,
so its frame was written over the first tile's planes, the check that
declines a luma plane off a page's start on iHD was skipped, and the guest
showed the other tiles as zero YUV (green) on the Iris Xe.
The import is now kept by the place and pitch of the buffer's planes as well:
core's DeviceImports takes a variant of the backend's own type, compared
whole. What changes for the guest: each tile's frame lands in its own planes,
or is copied by the CPU where the driver takes no import of them. The new
VA-API test writes two buffers of one memory, stacked and side by side, and
failed with the old key on the Iris Xe.
vendor/qemu's bd5ac1ce to 3892a92f, the Asahi Linux experiment's next four
patches for vmapple under KVM on an arm64 Linux host. KVM refused macOS's
pointer authentication calls with x1 to x3 zeroed, where HVF and TCG write x0
alone, and XNU keeps x3 of GET_DEFAULT_KEYS, so launchd died of a pointer
authentication failure; QEMU now answers them as HVF does. KVM's data aborts
with no instruction syndrome, such as the option ROM's ECAM read, got an
external abort; they now go through the ISV=0 emulator HVF used, moved to
target/arm/isv0-mmio.c, in a strict mode that leaves the abort where QEMU has
no device. HVF's calls to the moved emulator are unchanged.
docs/qemu.md's "Beside a build" gives the M3 Max's numbers: metal-app at
60 beside 16 spinning processes, 22.5 to 24.4 beside 64 and 13.4 beside 128
with the vCPUs at the default QoS, the guest's own sleeps up to 1.9 s late
while a host thread on a 60 Hz grid kept every tick, and 59.9 beside 64 with
5658f96c's user-initiated vCPUs, a frame later than on an idle host.
docs/lessons.md says how a gate's slow metal-app beside a build reads, and
how to tell the guest's CPU from the device's refresh.
vendor/qemu's 5658f96c starts each HVF vCPU thread at the user-initiated
QoS. At the default QoS, a build's, a vCPU running the guest's work is one
CPU-bound thread among the build's and gets a share like each of them: on
the M3 Max beside 64 spinning processes, an arm64 macOS 27.0.1 guest's own
timers fired up to 1.9 s late and a full-screen Metal app in it presented 22
frames a second, against 60 alone. A host thread sleeping on a 60 Hz grid,
as the device's refresh thread does, kept every tick under the same load.
The arm64 gates on the M3 run beside potluck's builds, and one boot's probe
ran at 39 frames a second beside a full-core cargo build for that reason.
HVF is built on macOS alone, so Linux's QEMU is unchanged.
Under KVM on an arm64 Linux host the kernel serves PSCI, so a secondary CPU
macOS powers on starts from KVM's reset state: arm_set_cpu_on() never runs,
cpu-on-copies-pauth-keys never copies the boot CPU's pointer authentication
keys, and every secondary hangs on a PAC-corrupted return (seen by the Asahi
Linux experiment, M2 Pro, macOS 27 at -smp 4).
vendor/qemu (steelbrain/reims-vgpu) gains three commits, from that
experiment's patches:
- 570daa78 target/arm/kvm: kvm_arm_forward_psci_cpu_on() has KVM pass PSCI
CPU_ON (SMC32 and SMC64) to QEMU through KVM_ARM_VM_SMCCC_FILTER (Linux 6.4),
whose KVM_EXIT_HYPERCALL starts the target through arm_set_cpu_on() and then
hands KVM its reset state and power state;
- da466bd8 hw/vmapple: calls it under KVM when -smp is above 1, fatal where
the kernel has no filter;
- 5093524e hw/vmapple: under KVM its CPUs get pmu=off and PSCI 1.1, which
macOS's ApplePSCI takes (it refuses 1.3), so the command line needs neither.
All of it is behind kvm_enabled(): under HVF and TCG nothing changes. docs/
qemu.md's branch table has the row.
Every build, test, boot and copy on the shared machines has run as a
potluck job since 11-05, and the job's lease is the lock: --gpu holds a
GPU, --exclusive gives a timing run the whole machine. gpu-locks.sh and
metal2vulkan's maclock took lock files potluck never sees, so a run under
them could still share a GPU with a potluck job.
AGENTS.md, the boot section of docs/qemu.md, the video checks, the cost
benches' docs and the oracle README now name potluck's lease. The
conformance scripts take no lock of their own, and lane-gate runs its
tests under its job's lease. A build holds no GPU: it builds in a job
without --gpu, and the tests run in the same workspace holding one.
The owner keeps the pin 36 scroll result as a to-do in the orchestrator's
notes, not in docs/qemu.md: it records an open fix, not a fact of how QEMU
or the VMs run.
Pin 36 landed on the owner's word with one 12.7.6 scroll block measured
and the second, with 26.7.2's, stopped, to be fixed forward. Its block
showed 3 rAF gaps of 100 ms or more against pin 30's 2, 30 of 50 ms or
more against 17, and 28.7 presents a second against 29.6, each gap on block
makings' direct compactions on the runtime's block-making thread, mostly of
68 MiB image-pool blocks. docs/qemu.md records the measurement, what pin 35's
exportable fill did before it, and that the rest is metal2vulkan's to fix.
Graft 0.1.0 (commit bb884fe, release zip sha256 2bea380e) is Graft's first
public release: bundle id ai.aneesiqbal.graft, serving only
ai.aneesiqbal.ReimsGraphics and ai.aneesiqbal.RgfxGate, with a C++17 SDK tool,
graft-kext, that consumer.mk builds from source with Xcode's clang++ in place
of the Python SDK. Its zip, copied by its own tools/vendor.py with the record
of all 156 files, puts Graft's source tree, the two kexts and the SDK in
guest/graft; the kexts sit at guest/graft/Graft.kext and Graft-arm64e.kext,
with no built/ any more, so the set's staging, its Graft check and the lane
gate read them there. The only binaries are the two kexts. AGENTS.md now says
guest/graft is Graft's release as vendor.py copies it.
RgfxGate depends on ai.aneesiqbal.graft 0.1.0, Graft's compatible version.
Graft hands an arm64e route's original back as a void * holds a function
pointer, discriminator 0, so RgfxGate keeps each AMFI original in a void * and
converts it to its mpo type at the call, which re-signs it; a typed variable
written through a void ** would authenticate with the type's discriminator and
fault. The static_asserts on the wrappers' discriminators stay. Graft's kernel
side refuses by name where it could have panicked, among them an arm64e AMFI
slot not signed with its operation's discriminator and a donor table that
differs from the live vtable.
set-check checks the prelinked collection with graft-kext check-prelinked,
which takes prelink.py's arguments and exit codes. Graft reports a bound
consumer as "bound: imports and vtables committed;" and either waiting for the
device or "activation gate open on the device nub"; the lane gate's graft-bind
passes only on the open gate, since only then does IOKit start ReimsGraphics.
Graft's own id moves in stage-config.py and docs/qemu.md, check-boot marks a
panic report naming ai.aneesiqbal as ours, and msi-appload posts its
measurement notification under the new prefix.
The prebuilt sets are rebuilt from these sources in their own commit.
The owner moves our reverse-DNS names from com.steelbrain to ai.aneesiqbal,
keeping each name's last part: ReimsGraphics, RgfxGate and the Metal bundle
(reims-graphics) take the new prefix. Graft 0.1.0 pins these new consumer ids
and refuses the old ones, so this lands with its adoption. What the guest sees
changes with it: the kexts' bundle ids, the Graft gate property
(ai.aneesiqbal.ReimsGraphics.graft-bound) and the registry root's
GraftClient.ai.aneesiqbal.* keys. The boot checks match the new names.
The prebuilt sets are rebuilt in the adoption batch, on Graft 0.1.0.
docs/qemu.md still said a pass waited on Graft 1.3.0's vtable synthesis.
The configuration passes every check on the four releases since 11-09 (jobs
m3-max-12987 and 12993 on development 58a5bf9df).
check-boot gains two checks. amfi-refuse runs a copy of /usr/bin/true signed
ad hoc with com.apple.rootless.install, which AMFI must kill (exit 137) with the
guest up: its kern.bootsessionuuid read 5 s later is the login's. The refusal
passes through RgfxGate's signature hook, whose wrong prototype panicked a
26.6.2 guest on exactly this run until 618f3644d, so this is that fix's test.
ax-matrix fails on any "not able to set accessibility matrix" line in the
boot's log, which ReimsGraphics' colour filter scale (041af6766) took from 2 a
boot to 0 on all four releases. Both ran as a gate step by hand until now.
amfi-refuse runs last of the guest's checks, after every read of the boot's
log, since a failure can take the guest down.
Ambrosia's development is now its public tree (0.1.0). Its image is
target/ambrosia.bin after `make` (built/ is gone), and the graphics driver
interface's guides are docs/graphics-drivers.md and
docs/how-to/write-a-graphics-driver.md (notes/ is gone). check-boot.sh's
usage, its missing-image message, the interface header's comment and
docs/qemu.md name the new paths.
QEMU's reims-graphics-pci now sets the config's guest_arch from its target
(vendor/qemu c2fb9b92): RVG_GUEST_ARCH_ARM64 where target_aarch64(), the
vmapple machine's qemu-system-aarch64 that boots arm64 guests on Ambrosia,
and RVG_GUEST_ARCH_X86_64 for every other target. The device is
target-independent code, so it asks at run time.
What the guest sees: an arm64 guest's MTLDevice answers
isFramebufferReadSupported with the host GPU's answer, yes on MoltenVK,
RADV, ANV and NVIDIA, where it answered no; CoreAnimation then reads its
blends' destination through framebuffer fetch and stops drawing the menu
bar black. An x86-64 guest's answers are unchanged.
arm64 guests drew WindowServer's menu bar, and some widgets, 100% black.
CoreAnimation compiles framebuffer fetch into its generic shader by
isFramebufferReadSupported, and that shader blends against the fetched
destination whatever the answer. The device answered no to every guest,
so the destination was the AIR's NaN. Metal on the M3 Max writes the same
NaN for that pipeline and its buffers, so the translation was right; the
answer was not one an Apple silicon Mac gives.
The x86 Macs split on it (AMD 5300M no, Intel UHD 630 yes, measured again
today), and x86 guests keep the AMD answer, which keeps their frameworks
off the platform's costly fetch. So the answer now follows the guest:
- The C API's RvgGraphicsDeviceConfig gains guest_arch (RvgGuestArch:
RVG_GUEST_ARCH_X86_64 0, RVG_GUEST_ARCH_ARM64 1), its second version: a
host built before it, whose struct_size ends before the field, serves an
x86-64 guest; any other value is RVG_ERR_INVALID_ARGUMENT. The Rust API's
GraphicsConfig gains GuestArch alike.
- The device-info blob answers isFramebufferReadSupported with the
platform's answer for an arm64 guest (yes on MoltenVK, RADV, ANV and
NVIDIA, which fetch through the pixel interlock), and no for an x86-64
guest as before.
What the guest sees: an arm64 guest's MTLDevice answers
isFramebufferReadSupported yes where the host GPU fetches, once the host
names the guest arm64 (QEMU, next commit). An x86-64 guest's blob is byte
for byte what it was. On ANV and NVIDIA a pipeline that fetches an
attachment of a format the runtime does not fetch there (R8/RG8 sRGB, and
on NVIDIA the packed 16-bit formats and RGB9E5) is answered nil, relayed.
page-count failed a 15.6.1 boot under TCG on homelab-um870-1 as "booted
again": its kern.boottime read { sec = 1794272590, usec = 959702 } at the
login and the same second with usec 294291 after the Metal work. macOS
corrects its boot time as its clock settles, more so under TCG, so one boot
can read two. kern.bootsessionuuid is set once each boot and changes only
then, so check-boot compares it instead and no longer reads kern.boottime.
check-boot waited 180 s for the desktop under TCG, 3 times HVF's 60 s,
while SSH and every guest command get 5 times their HVF limits. On
homelab-um870-1 a 27.0.1 boot with our configuration took its SSH login at
105.6 s, then showed WindowServer and Dock but not yet Finder when the 180 s
ran out, and its end screendump shows the whole desktop with Finder's menu
bar. A guest busy after its login is slow to start Finder under TCG as it is
slow to answer SSH, so the desktop gets 300 s, the same 5 times.
check-boot waited on the guest's SSH with logins limited to a 5 s connect
and 10 s in all, at either speed. Under TCG a guest busy after its login can
take longer than that to send sshd's banner and finish the key exchange, so
27.0.1 on a Linux member sat at its desktop with no login landing in 300 s.
Each login's limits are now slowed as every guest command already is.
Under TCG the emulated CPU sets the rate WindowServer composites at:
27.0.1 on a Linux member submits about 14 frames a second and drops 63 of
142, which report.py's bar of a tenth lost reads as a failure of our device.
Pacing is judged under HVF only. Under TCG metal-app now passes on an OK
probe with frames presented and at most 3 answers missing; its drops and
rates stay in the line, unjudged.
So those drops can be read, every metal-app line now also gives the host's
display flips during the probe's call and their rate: WindowServer's own
presents, the rate the probe's frames can reach the display at. A probe that
drops while WindowServer composites as fast as it submits is ours to look at.
QEMU's reims-graphics-pci passed the library no RAM map on macOS, where
HVF's guest RAM has no file behind it, so a Mac host copied every surface
and no-copy buffer of an arm64 guest. The device (QEMU ff604cc8) now gives
every RAM range in pages of the host's size there, with an fd of -1; the
library views it by mach_vm_remap, which shares the pages HVF maps into the
guest. A Mac host offers the guest RAM features only to a guest that takes
PAGES_16K, so an x86-64 guest on a Mac reads what it read before, the new
bit aside, and its surfaces are copied as before. Linux is unchanged.
A host whose page is 16 KiB, a Mac, can map guest RAM for its GPU only in
whole pages of its own, and an x86-64 guest's runs are 4 KiB pages, so a
Mac host offered no feature over guest RAM to any guest: every arm64
guest's surfaces and no-copy buffers were copied, and WindowServer spent
most of its updates merging no-copy buffers' shadows.
The wire gets feature bit 34, PAGES_16K: the guest's runs of guest RAM are
whole 16 KiB pages. A host whose page is 16 KiB offers it where it maps
the guest's RAM, and offers its features over guest RAM only to a guest
that took it: FEATURES_LO and _HI, and DEFERRED_BUDGET, read them from the
DRIVER_FEATURES_HI write that takes PAGES_16K, a write may take them from
then on, letting PAGES_16K go lets them go, and a reset hides them. Until
then every register reads as from a host that maps no guest RAM, with
PAGES_16K offered beside.
The arm64e kext writes DRIVER_FEATURES_HI with PAGES_16K first, reads the
offer again, and takes from that. The x86-64 kext never takes it and reads
the offer once, so an x86-64 guest on a Mac reads what it read before, the
new bit aside. No host offers PAGES_16K yet.
27.0.1's guest runs Setup Assistant after its login, and its full-screen
window covers present_probe's: the probe's frames are never shown, so it
reports presented=0 with every frame dropped, which read as our device
failing to present. check-boot now reads, just before the probe, whether a
Setup Assistant process runs; a probe that then falls short fails as unread,
naming the process and its pids, with the probe's line kept beside it. A
probe that passes still passes. A covered fixture no longer looks like a
device failure.
A TCG boot on a Linux member passed windowserver-metal with "WindowServer
none, Dock none, Finder none": every desktop poll ran out of time and
printed nothing, and the check took the empty reading for a desktop with
no "none" in it. A reading of two pids and a trailing "none" passed too.
The desktop is now up only once all three read as pids, and no poll that
answered is "unread". The same empty-reading pass hid in amfi-map (a log
query that timed out counted as no denial) and page-count (panic reports
and the kext's count lines unread read as none, and kern.boottime unread
at the login passed): each now fails as unread.
Under TCG `kmutil showloaded` was cut off at 120 s and every desktop poll
at 20 s, so each command in the guest, and the probes' own alarms and
copies, now gets 5 times its HVF limit there.
On arm64 a window maps whole 16 KiB pages, and refused every span of a
surface's block or the scanout that was whole 4 KiB guest pages alone: a
27.0.1 WindowServer's 1920x1080 RGBA16Float plane (0xfd3000 bytes) and others
were "not mapped in: 0xe00002c2", so it never reached their blocks. Every
caller of mapSpan and unmapSpan now passes the span of whole window pages
(rgfxWindowSpanLength): a surface block's runs start past that span
(rgfxSurfaceRunsFrom), the scanout's grant is rounded to it, and a block's
write-combined split in the block's rounding leaves the block write-back
(rgfxWindowWriteBackPart). Every block is whole window pages, so the pages a
span adds are its block's own.
On x86-64 a window page is 4 KiB and every length was a 4 KiB multiple, so
each span is as before; the kext's code differs, not what it maps. The arm64
region test checks the layouts on 16 KiB pages, with the refused sizes, and
that every mapSpan and unmapSpan call passes a span.
WindowServer never called set_digital_out_mode on any of the four releases
(Ambrosia m3-max-12149: no "N timing modes" line, current mode 16383 x 16383,
every SkyLight size 0 x 0, IOSurface creation failing with e00002c2).
QuartzCore's IOMFBDisplay::update_framebuffer_locked reads an internal
display's TimingElements and ColorElements only when there are more than one
colour mode or at least two timings (read from 14.6.1's and 27.0.1's
QuartzCore). The paravirtual display publishes three colour modes. Ours
publishes one 8-bit colour mode, which is the only format the device scans
out, and the device lists one mode. With one of each, WindowServer adds its
placeholder mode, sets no mode, and takes the display's size from
get_display_size and get_display_area. Both answer from the class's display
size fields, which held 0 x 0 until a mode was set.
So start_hardware now sets the preferred timing, the first one
publishMobileModes lists, the same way set_digital_out_mode does: SET_SCANOUT
first, then the class's size fields in its gate, then DisplayWidth,
DisplayHeight and DPTimingModeId. The class's start calls start_hardware
last, so the size is there before WindowServer opens the framebuffer. When
WindowServer does pick a mode, set_digital_out_mode still sets it.
rgfxMobileStartTimingId picks the timing, and mobile_modes_test covers it.
This is arm64e code only, so the x86-64 kexts are unchanged.
An arm64 WindowServer found the display but no mode: "current mode (16383 x
16383)", preferred 0 x 0, a mode list of one 0 x 0 scaler mode, and every
swap without a surface (Ambrosia 12100, 14.6.1 to 27.0.1). It reads a
display's modes from the framebuffer's TimingElements and ColorElements,
which Apple's paravirtual display publishes and ReimsGraphics did not, and
sets one with SetDigitalOutMode, which the class answers kIOReturnUnsupported.
The display now publishes them as the paravirtual display does, as
IOAVFamily's own elements (withData and withCapabilities, IDs and Scores at
the elements' offsets, a timing's colour modes by setColorElements): a timing
for each mode the device lists, with the x86 framebuffer's reduced blanking at
the device's rate, the preferred one first and scored highest, and one 8-bit
colour mode, ID 100. IOAVFamily joins graft-arm64e.json as a third library,
anchored on IOAVVideoTimingElement; IOMobileGraphicsFamily depends on it on
every release, so it is loaded at the bind. set_digital_out_mode takes the
colour ID, then the timing ID, as WindowServer passes them and the
paravirtual display reads them; it shows the mode by SET_SCANOUT, as x86's
setDisplayMode does, and publishes DisplayWidth, DisplayHeight and
DPTimingModeId. Any other pair keeps the class's kIOReturnUnsupported.
The framebuffer also publishes IOMFBScalingLimits, at 1 each way rather than
the paravirtual display's 4: the device shows layer 0's whole surface and
scales no layer by its rectangles. CursorPlane stays unpublished while no
swap's cursor layer is shown. GetBlock 0x40 stays the class's: no paravirtual
release overrides get_block, and WindowServer then sets a published mode.
mobile_modes_test checks the element layouts against each release's
IOAVFamily (14.6.1, 15.6.1, 26.6.2, 27.0.1), the timings' values, order and
scores, and the IDs set_digital_out_mode takes; legacy_overrides_test adds
set_digital_out_mode's slot on each release. x86-64 code is unchanged: all
of it is under __arm64e__ or in the arm64e declaration.
Our Config.cpio now names Graphics > DisplayNode, which Ambrosia 8f2655b and
later turn into /arm-io/reims-display0 before the kernel starts. An older
Ambrosia ignores the key, as it ignores every key it does not know, and the
guest boots as before: ReimsGraphics attaches its node too late for
WindowServer's count, so WindowServer stays headless.
IOMobileFramebuffer.framework counts an arm64 guest's displays from the
display-subsystem children of /arm-io once in a process, and WindowServer
counts before our kexts load from the auxiliary kernel collection, so it
counted none and ran headless. Ambrosia's Graphics > DisplayNode places
/arm-io/<name>, with only its name and that device_type, where the module
drives a display, before the kernel starts.
Our configuration's bundle now names reims-display0, the node ReimsGraphics
uses as display 0's. stage-config.py adds the key with the kexts' entries, not
config.plist, so the module's bundle alone gives no node and no process waits
30 seconds for a framebuffer service that nothing publishes.
The arm64 display's guests panicked when WindowServer first asked for the
frame info. IOMobileFramebufferUserClient::s_supported_frame_info calls
supported_frame_info through IOMobileFramebuffer and authenticates the slot
with IOMobileFramebuffer's discriminator, 0xbd70. Our synthesized vtable's
slot was signed with Legacy's, 0x7dc3: Legacy's own table signs the four
pure methods IOMobileFramebuffer declares (set_notify_tag_mask_gated,
supported_frame_info, factory_portal, executeFactoryConfigurations_gated)
with its own redeclaration's discriminators. Those four slots are the only
ones where Legacy's table and its bases' differ, on 14, 15, 26 and 27.
Graft 1.3.2 signs each synthesized slot with the discriminator of the most
base handed table that covers it, and refuses the display bind unless every
superclass's table is handed. Ambrosia now exports IOMobileFramebufferService's
and IOMobileFramebuffer's vtables beside Legacy's; each is defined in
IOMobileGraphicsFamily in every arm64 Boot KC from 12 to 27.0. Graft 1.3.0
and 1.3.1 look up only Legacy's table by its symbol, and ignore the others.
On 27.0.1 WindowServer died 17.7 s in, in our descriptor validation, at
CoreAnimation's create_surface_with_properties. The bundle checked every
texture descriptor by the x86 Macs' rules, while in an arm64 guest the
device answers an Apple family, and CoreAnimation asks such a device for
what an Apple GPU makes: an XR10 format where it answers
supportsExtendedXR10Formats (read from 27.0.1's QuartzCore), and
Memoryless textures. The x86 Macs lack both.
oracle_texdesc on the M3 Max under 27.0.1, at the device's, a heap's and a
buffer's creators, measured the Apple GPU's rules: the same words and
order, but it has every format the x86 Macs lack except Invalid, D24S8
and X24S8; answers nil for two-plane formats and Unspecialized; makes
multisample BGR5A1 and RGB9E5, depth and multisample textures in Shared
and Managed storage, and Memoryless ones, in a Private heap too; makes 2
and 4 samples but not 8; and over a buffer answers nil for every
compressed format. Where the device answers Apple7 (rgfxAppleGPU) the
bundle now takes those rules; elsewhere they stay the x86 Macs'. The
test runs every descriptor case under an Apple GPU against the M3's
answers, and the doc records them (Q24).
A validation death also writes Metal's words and the descriptor to the
unified log: WindowServer's stderr is kept nowhere, so the boot showed
only that the validation ended it.
A thread that waits for a command buffer to be scheduled (waitUntilScheduled)
now asks the host for the buffer's CB_SCHEDULED. The bundle posts the new
SCHEDULED_ASK (0x303, the buffer's id and seqno) on the buffer's queue's ring,
after the buffer's message, where the device word holds SCHEDULED_ASK (feature
bit 33, FEATURES_HI bit 1: every host offers it, the kext takes it). Where the
buffer would have got its record at its take had it asked for its CB_SUBMITTED
(it waits for no event, follows no deferred copy of a device cache, is behind
no held buffer of its queue, and no buffer before it on its queue owed its
record as it was begun), the host's queue thread issues the buffer's ticket in
the commit order and posts the record as it takes the ask, before the walk and
the platform's submission; the ticket goes back at the buffer's commit. A
buffer already committed gets its record at once, with no ticket. Any other
buffer is scheduled as before.
What the guest observes: waitUntilScheduled of such a buffer returns once the
host takes the ask, where it returned only after the host's walk, commit and
submission of the buffer. During a live window resize on the 780M host the
guest's GPU process waited there 349 times for 291.5 ms over 50 s, 1.3 to
1.5 ms a wait, against Metal's 0.05 to 0.2 ms. A buffer the process sends after
the record, on any queue, is committed after the waited-for buffer, as after a
CB_SUBMITTED, so a walk held on one queue holds up the process's other queues
only once a thread has asked to wait for it. A buffer that is never waited for
keeps its record to its scheduling and holds nothing up.
Tests: a_waited_buffer_is_scheduled_before_its_submission,
a_held_walk_holds_up_its_process_s_other_queues_only_once_waited_for,
an_ask_of_a_buffer_that_waits_for_an_event_changes_nothing,
a_scheduled_ask_reaches_the_host_only_where_the_guest_took_it, the bundle's
test_waiting_asks_for_its_scheduling and the kext's feature word; the features
test reads bit 33 offered; a_walk_held_in_a_draw_holds_up_no_other_queue is
unchanged.
The deadlock bfc3e18f2 fixes had no test and no earlier round that showed
it, and its only sign in a boot was a desktop that stopped with no fatal
line: the lesson says what decides the kext's lock order and how a spindump
shows the next one.
Graft 1.3.0 signs each inherited slot of the arm64e display's synthesized
vtable with the live parent's pointer-authentication discriminator. Our
arm64 firmware, Ambrosia, measures those discriminators from the Boot
kernel collection and hands them over in the device tree, but only for
the vtables its configuration names. Without that, Graft refuses the bind.
Our config.plist named none, so every boot that bound ReimsGraphics ran on
a local configuration that named the vtable.
Our configuration now names __ZTV25IOMobileFramebufferLegacy under
Kernel > ExportVtableDiscriminators. stage-config.py keeps every Kernel
key but Add, so make config-bundle carries the key into Config.cpio, and
make bundle carries it as well.
arm64 macOS 11 to 13 are not supported for now (owner, 2026-11-09): macOS
13.6 offers the reims-graphics device no MSI, and the kexts have no INTx
path. AGENTS.md's statement of support, the design's arm64e set and
docs/qemu.md's boot check now name macOS 14 as the first arm64 release, and
the boot check's releases are 14.6.1, 15.6.1, 26.6.2 and 27.0.1.
A 2 MiB slab of a process's own pages was a superpage the slabs' thread
asked for ahead of its take. Asking still stalled the process: the kernel's
search for a contiguous 2 MiB runs in vm_map_enter with the task's map
interlock held and the new entry locked exclusive (public xnu-12377.101.15
vm_map.c), so any walk of the map past it waits. Tailspin on an 8 GiB
macOS 26.7.2 guest on the Radeon 780M host: WindowServer's slabs thread was
in cpm_allocate while its main thread, making a texture over a layer's image
in a live resize, waited in mach_vm_region behind it, and Safari's page drew
no frame for 179 ms. No thread placement avoids that, superpages run out
minutes after a boot anyway, and the held one cost up to 38 MiB across the
19 processes that map the bundle.
So every slab of the process's own pages is plain pages, taken by the take
that needs it, as it already was once superpages ran out. The superpage
call, its record in the kext and the VM-guard tool go.
What changes for the guest: the kext no longer answers selector 12
(Superpages) nor sets kext feature bit 8; both lived only between the kext
and the bundle, which ship together, and reims_graphics_wire.h never had
them. The host sees the same pages blocks as a guest out of superpages
does: HEAP_OVER_PAGES and BUFFER_OVER_PAGES over plain pages' runs.
The guests for every x86-64 release a change to the guest's kexts boots are
on homelab-um870-1, 14.8.9 and 15.8.2 among them since they were copied from
msi-laptop: the list says which, at what path, how the copies were checked,
and what a boot of them holds.
A take of a slab asked the kernel for its superpage on the thread that took
it, and the kernel's search for a contiguous 2 MiB (cpm_allocate) runs on
the asking thread, given or refused. Sampled with tailspin on an x86-64
macOS 26.7.2 guest on the Radeon 780M host: WindowServer's main thread,
making a texture over a layer's image as a window moved, was in that search
in two samples 100 ms apart, and Safari's page drew no frame for 151 ms.
Now the slabs' background thread (RgfxSlabs::run) asks for one superpage
ahead (RgfxPagesSlabSource::prepare), at its start and after each slab of
the process's own pages, while the guest's superpage record is open. A take
of a 2 MiB slab uses the superpage held, or takes plain pages at once; no
thread that takes a slab asks the kernel. A process holds at most one
superpage it does not use. A dedicated slab larger than 2 MiB is plain
pages, as every slab was once the kernel ran out minutes after a boot; the
superpage module's several-superpage path is no longer reached by the
slabs.
The slab tests step the thread's work where a superpage is to be held, and
test_pages_source_asks_on_its_thread_alone runs the thread and checks that
every superpage ask came from it, not from the taking thread.
bf7d61a94's ReimsGraphics counts a surface's pages through mach_vm_region over
kernel_map and, inside IOKit's pageable maps, IOIteratePageableMaps: strong
imports whose arm64e path has never run. check-boot.sh gains page-count, read
after the boot's Metal work: it fails where the guest booted again during the
run (kern.boottime moved since the login), wrote a panic report in it (marked
where it names our kexts or the count's calls), or stopped answering. Its line
carries the host's last count of IOSurface device caches (made, deferred,
carrying pages, refused) and the kext's own count lines (counted, not counted).
Zero deferred while caches get made, no count line, or no count that counted
is printed as a check-boot: finding: line under the verdict, not a failure:
each is a result to report, not a fault in the path.
The region count deferred nothing on any release: IOKit maps a pageable buffer
into the kernel inside one of its pageable maps, a submap of the kernel's, so
mach_vm_region on kernel_map found one 512 MiB region with nothing to count
(SM_EMPTY) around the mapping, and the region rule refused it. Measured on
11.7.11 (20G1443) with a diagnostic build, serial on.
When the kernel's map shows such a region around the mapping, the count finds
the pageable map that holds it through IOIteratePageableMaps (kpi.iokit, every
release checked, x86-64 11.7.10 to 26.7.2 and arm64 13 to 26) and walks the
mapping's regions there, under the same rule: they must be the mapping exactly.
The callback answers KERN_FAILURE for a map that does not hold the address, so
IOKit never makes a map for it, and a walk that finds none refuses the count.
For the guest, fresh surfaces defer again: on 11.7.11 253 of 253 caches
deferred, WebContent 1622 -> 121 MB, guest wired 2631 -> 1121 MiB.
set-check let a weak import through when OpenCore bound it to 0, but 0 at link
time is not 0 at run time: the kernel rebases the word by the collection's
slide, and the kext read the result as a definition and called it on 11.7.11.
No word tells an absent weak import from a present one under OpenCore, so the
check now fails on any weak import in the set; a name some release lacks is
bound through Graft, which binds it to gOSKextUnresolved. The lessons entry
says so, and that set-check proves a kext links and injects, not that it runs.
The fresh test called IOMemoryDescriptor::getPageCounts(resident, dirty,
swapped) through a weak import, and on 11.7.11 every boot panicked at the
first fresh-surface test. OpenCore binds the absent symbol's word to 0, then
the kernel rebases it by the collection's slide, so the kext read
0xffffff8040000000 plus the slide as a definition and called it (WindowServer,
page fault in rgfxSurfaceLocksFresh, caught on serial).
The kext now maps the surface's memory read-only into the kernel's map for the
count and walks the mapping's regions with mach_vm_region's
VM_REGION_EXTENDED_INFO. That walk counts each page resident or compressed or
paged out (pages_swapped_out), measured on 11.7.11 against each page's
disposition with the pages in the compressor and on swap. mach_vm_region and
kernel_map are strong imports from com.apple.kpi.unsupported, which every
release kernel checked exports (x86-64 11.7.10 to 26.7.2, arm64 13 to 26),
so one route serves every kernel and both architectures.
The counts count only where the regions are the mapping exactly
(rgfxRegionPageCounts, tested). A region past it, a gap, a pager's memory or a
region with nothing to count refuses the count, so the rule can only refuse a
deferral. For the guest, macOS 11 to 15 defer fresh surfaces again, as 26
does, and no kernel calls an unbound word. A count's time is logged when it
is the longest yet, and for the first large surfaces.