Commit Graph
1254 Commits
Author SHA1 Message Date
Anees Iqbal d554037543 🆕 Ask before a window's close turns the VM off
Owner 2905: closing the window to close the window should show a
confirmation. A close the person asks for (the close button, Alt+F4 or the
compositor's close, the taskbar's close, and on macOS the red button, the
menu's or the Dock's Quit, and an uncaptured ⌘Q while capture is on) cut the
VM's power at once: QEMU's handler powers it off with no ACPI.

What the person at the host now sees: while the VM runs, the close first
lets every key and button go in the guest, ends any capture, and asks in
the OS's own dialog over the window: "Turn off the VM?", "The VM turns off
at once, as if its power were cut. Unsaved work in it is lost.", with Turn
Off (destructive) and Cancel, the default for Return and Escape. Turn Off
does what a close did before. Cancel leaves the VM running and nothing held
in the guest. On Linux and Windows it is SDL's message box (zenity or X11's
own on Linux, a task dialog owned by the window on Windows), run on the
windows' UI thread; on macOS an NSAlert sheet on the window, which Quit
shows once, over the key window, for every window. With capture off, ⌘Q is
the guest's, and the menu's Quit and the close button ask.

Nothing asks where nothing is lost: once the host has been told, while the
device is released or QEMU quits, without a close callback, or where the OS
shows no dialog, in which case the close goes ahead as before. There is no
setting and no "don't ask again".

The decision stays in the window crate (close.rs), so the C API keeps its
shape (only the header's words for close change) and QEMU's handler is
unchanged: the close callback now comes after Turn Off. features.md's
Leaving entries carry the new behaviour and its guards.
2026-11-23 22:31:24 -08:00
Anees Iqbal df1eeb4e8c 🆕 Let a VM's windows never capture input
The owner asked for a VM whose window does not grab the mouse (owner 2893,
2895, 2900): capture stays the default, and a VM's settings can turn it
off.

With REIMS_VGPU_WINDOW_CAPTURE=0, which reims-ctl sets for such a VM, no
window captures, on macOS (AppKit's window and SDL3's) or on Linux and
Windows (SDL3's): a click into the image is sent to the guest but captures
nothing, so the window never takes the host's system keys, never grabs the
keyboard, never holds or locks the pointer and never holds its own size.
The pointer reaches the guest over the image alone, and outside it only in
a drag that began there, which ends in the guest. Keys go to the guest
while the window has the keyboard; on macOS that takes in ⌘ shortcuts, as
while captured, since nothing else could give the guest one, and the
window's menu stays in the pointer's reach. A game gets the absolute
pointer alone, which stops at the image's edge, since the guest's mouse is
driven only while captured. The title ends " — input capture off".

Unset, or any other value, capture is on as before. features.md gets the
register's "Capture off" entry and the switch, and the Capture entries say
where it applies; docs/api.md lists the variable.
2026-11-23 22:22:17 -08:00
Anees Iqbal 46f492f2c9 🐛 Name the Windows key Win in the window's title on Windows
The person at a Windows host saw the captured window's title say "press
Ctrl+Alt+Super to release": Windows keyboards have no key named Super. The
chord is SDL's GUI key with Ctrl and Alt, and on Windows SDL gives the left
and right Windows keys as that GUI key (VK_LWIN/VK_RWIN and scan codes
E0 5B/E0 5C to SDL_SCANCODE_LGUI/RGUI, read from SDL 3.4.18's code), so the
title there now says " — input captured (press Ctrl+Alt+Win to release)".
Linux keeps Ctrl+Alt+Super and macOS its ⌃⌥⌘.

The text is now capture::captured_suffix(HostOs), one string per OS, and
Capture::title_suffix takes the host's OS: each OS's file of native/ names
its own (HOST_OS on Linux and Windows, HostOs::MacOs in AppKit's input), so
no cfg spreads into shared code, and
the_title_names_the_release_chord_in_the_host_s_keys checks every OS's
string on every host, the Windows one included, which no test outside the
Windows mini reached before. features.md's capture entry, README.md and
the design doc name the Windows chord.
2026-11-23 22:05:56 -08:00
Anees Iqbal b60140eb00 🐛 Time a cut writer's handler from its last part's own GPU end
Diagnostics only: nothing the guest or the host observes changes. The
CB_COMPLETE of a buffer the walk cut into parts keeps its merged times.

A present's late-show line gave its last writer's CB_COMPLETE times as the
writer's GPU run. For a cut buffer those start at its first part's start and
end its parts' GPU time summed after that, before its last part's own end by
the GPU's gaps between parts, so "its handler entered N us after its GPU end"
counted those gaps as rt's wake, and a reading of the 5080 walk took 1,582 us
p50 for the host's share where the card's records gave 382 us.

The merge now lets the handler it runs read the last part's own GPU end
(split::last_part_end), and the completion's post carries it to the line
with the handler's entry (present::Handled). The line now says:
- for a buffer not cut, "on the GPU whole from ... to ...", and the handler's
  entry after its GPU end;
- for a cut buffer, its first part's start and its last part's own end, its
  parts' GPU time summed and the gaps between its parts, and the handler's
  entry after its last part's GPU end; where the platform gave the last part
  no GPU times, the entry against the present's take;
- where the handler did not say whether the buffer was cut, that the times
  are its CB_COMPLETE's, which for a cut buffer end the summed time after the
  first part's start.
Its clock tail adds the last part's GPU end and names the CB_COMPLETE's GPU
start and end as such. docs/lessons.md gets the reading trap.
2026-11-23 22:05:56 -08:00
Anees Iqbal d3fa8fe257 🐛 Give a texture over a drawn plane in another format its own shape
On Windows a video cache's planes are rt's imports of the Direct3D 11 textures
the host's video draws its pictures into, and since metal2vulkan b68b31b54a rt
imports each with no view format but the texture's element format, the plane
image's and that one's sRGB sibling. A guest texture over such a plane in any
other format of the texel's size (an R8Uint over the luma plane, say) asked rt
for a view it refuses.

Such a texture now takes the storage shape of its extent, an image of its own
that rule 1 and the fills keep current with the plane, as a texture over a
plain shape in another format already does, so rt is never asked that view. A
texture in the plane's format or its sRGB sibling is a view of the plane, as
before. The guest sees the same pixels: the other-format case is a counted
copy where rt would refuse the view, counted in the degradation counts line as
rt-shape-drawn-format-storage-<plane format>-as-<texture format>, the first of
each pair logged, and in the shapes line. Hosts other than Windows make no
drawn planes and see no change.

The plane shapes a surface over Direct3D 11 textures adds are marked drawn
(ShapeTable::insert_drawn_plane), which the decoder asks of the shape it found
(Caches::drawn_plane). docs/video/bugs.md D26 records the copy as a known gap.
2026-11-23 21:41:42 -08:00
Anees Iqbal a9ad88098c 🐛 Give arm64 VMs sound under KVM alone until HVF and TCG boot it
The arm64 sound devices were booted only under KVM, with a macOS 27.2.1
guest, and audio is on by default, so every arm64 VM on a Mac (HVF) or an
x86-64 host (TCG) took two virtio sound devices no guest had started there.
Under HVF and TCG the VM now has none, as before the devices came, until a
guest boots with them on each; the test checks both hosts.
2026-11-23 21:33:53 -08:00
Anees Iqbal d4a05d893f 📝 Say which hosts give arm64 VMs seven USB ports, and what was measured [ci skip]
From the review of the merged pull requests: the module doc gave either
machine seven xHCI ports, which vmapple has on Linux alone; docs/qemu.md named
vmapple.c's create_pcie as vmapple_create_pcie, and said the Mac's QEMU is
built without libusb, which install-ctl.sh does not ensure (libusb is an auto
feature). never_reset's doc read as if a VM stopped and started unreset had
been measured; the runs on file are a guest restart in one QEMU, and the docs
now name the stop and start as unknown.
2026-11-23 21:31:20 -08:00
Anees Iqbal 5021571a82 📝 Cite usb-host's reset-on-close at its commit on the QEMU branch [ci skip]
QEMU's pull requests 16 and 17 both started at 53e76630. The second one, usb-host's
reset-on-close, was replayed onto the first as b980d0f46d, the commit the
QEMU branch and vendor/qemu now hold. 7bc47014f4 is on no branch.
2026-11-23 21:09:28 -08:00
vintowareandClaude Opus 5.5 76b57729d7 🐛 Leave Apple's iOS devices unreset as QEMU lets go of them
An iPhone given to a VM was lost at the next start: as QEMU exited, it reset
the iPhone, and the next VM's guest asked it to switch its USB mode again
(vendor request 0xc052), after which it left the bus until it was plugged in
again. Across a guest reboot, where QEMU let go of nothing, the guest found
it in the mode the last boot set, asked no switch and drove it.

vendor/qemu moves to 7bc47014f4, whose usb-host gains reset-on-close, and
reims-ctl gives Apple's iOS devices reset-on-close=off beside guest-reset=off
(usb::never_reset, formerly keeps_its_resets), on the command line and over
QMP. Every other device keeps QEMU's defaults. A QEMU without the property
refuses the device, so reims-ctl and its QEMU come from the same commit, as
the install builds them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 21:09:28 -08:00
vintowareandClaude Opus 5.5 da076cd99e 🐛 Keep the guest's port resets from Apple's iOS devices
An iPhone given to a VM left the guest for good. QEMU's usb-host makes each
port reset the guest asks for a reset of the device, and a reset makes an
iPhone leave the bus and come back as a new device. On top of the mode switch
macOS asks of a new iPhone (vendor request 0xc052), which re-enumerates it
once, the guest's resets re-enumerated it again, and after the second mode
switch it left the bus until it was plugged in again.

Apple's iOS devices, the IDs usbmuxd's udev rule names, now get usb-host's
guest-reset=off, on the command line and over QMP, so the guest's resets never
reach them. The iPhone then re-enumerated once and the guest's own drivers
took it: usbmuxd its multiplexor, AppleUSBNCM11 its two network interfaces.
Every other device keeps QEMU's default. This changes x86-64 VMs given such a
device too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 21:08:26 -08:00
vintowareandClaude Opus 5.5 9d6ec349f5 📝 Record the iPhone passthrough boot with QEMU on the host [ci skip]
With usbmuxd off the iPhone and QEMU run on the host instead of the rootless
distrobox, the arm64 guest configured the passed-through iPhone and ran bulk
transfers on it, and QEMU followed each re-enumeration. Record that, what the
guest sends before the iPhone re-enumerates, how a udev rule keeps usbmuxd
off one iPhone, and that the container's QEMU lost every device once one had
gone. The measurements now name the trees they ran on as upstream has them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 21:08:26 -08:00
vintowareandClaude Opus 5.5 0b2f6a3110 📝 Record the arm64 USB passthrough boot on Asahi Linux [ci skip]
A macOS 27.2.1 guest under KVM on an M1 Pro, given an iPhone through
reims-ctl, lists the controller's 14 ports and the iPhone at 480 Mb/s on
port 3, and lets go of it when it is taken back. The iPhone stays unusable
there, since usbmuxd's claim makes each SET_CONFIGURATION fail with BUSY,
and QEMU in a rootless container never sees a device that re-enumerates,
which the lessons now say how to spot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 21:08:26 -08:00
vintowareandClaude Opus 5.5 560bcdb7e5 🆕 Give arm64 VMs the host's USB devices on Linux hosts
USB passthrough was refused for arm64 VMs, though nothing on a Linux host
keeps them from it: vmapple makes its own qemu-xhci with the keyboard and the
tablet, and QEMU's usb-host takes that controller's bus as it takes q35's.

An arm64 VM on a Linux host (KVM on arm64, TCG on x86-64) now takes the
devices reims-ctl usb and the interface give it, at start and while it runs.
They go on the machine's controller's bus, usb-bus.0, since the machine gives
the controller no id. On Linux its ports are raised to q35's seven with
-global, where QEMU's four put the second host device and those after it on
a full-speed hub. A Mac's command line is unchanged, and its VMs still take
no USB devices: reims-ctl lists them from sysfs alone. Its refusals now say
"USB passthrough is for VMs on Linux hosts". doctor checks usb-host and the
devices on arm64 Linux too.

The installer builds arm64 Linux's QEMU with --enable-libusb, which found
libusb by itself before, and offers the USB udev rule on every Linux host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 21:08:26 -08:00
vintowareandClaude Opus 5.5 78c2202380 🆕 Give arm64 VMs audio, on virtio sound devices
reims-ctl gave an arm64 VM no sound device, whatever its [audio] setting,
so a macOS guest found no output device. It now gives an arm64 VM with
audio on the same two virtio-sound-pci devices on the VM's backend as an
x86-64 VM (an output stream alone and an input stream alone), after the
GPU where QEMU puts them, and no HDA. The q35 devices keep their slots;
both machines make them through one function.

macOS 27's virtio PCI transport never started such a device: it spins on a
capability list QEMU links from high offsets to low, and a boot could stop
there. vendor/qemu moves to 5c42f3fce4, which links virtio-sound-pci's
capabilities in address order on vmapple, as 4a39ef8d54 does for
virtio-net-pci. That commit is steelbrain/qemu-reims-vgpu#16, which must
merge first.

On a macOS 27.2.1 guest under KVM on an M1 Pro, both devices reach
DRIVER_OK, Core Audio lists the default output and input, and afplay plays
on the host's speakers (docs/qemu.md, "arm64 guests: audio"). Refs #167.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 21:06:12 -08:00
vintowareandClaude Opus 5.5 9c91714b60 🆕 Boot arm64 macOS under KVM, and check its boot there
macOS's kernel sets up each GIC redistributor with a pre-indexed store,
`str w9, [x8, #128]!`. Under KVM it traps with no instruction syndrome
(ISV=0) into KVM's in-kernel vGIC, which neither KVM nor QEMU's ISV=0
emulator can complete, so an arm64 guest on an arm64 Linux host panics
early in its boot. firmware/ambrosia/kvm.plist holds an Ambrosia
Kernel > Patch that writes the same values to the same two registers with
plain stores. Its four instructions are once in com.apple.kernel in each
VirtualMac2,1 kernelcache from 13.6 to 27.2.1, so it sets Expect to 1: a
kernel they leave stops at Ambrosia with a named error.

reims-ctl adds the patch to an arm64 VM's bundle where the VM runs on KVM,
after the VM's own patches; HVF and TCG bundles are unchanged.
`make config-bundle KVM=1` adds it to our configuration's bundle, and
check-boot.sh -k boots that bundle under KVM, with HVF's limits and
judgements and TCG's memfd RAM, refusing a bundle without the patch.

Booted on an M1 Pro under Fedora Asahi Remix 45: reims-ctl restored
macOS 27.2.1, its first boot made the Data volume, and after finish-eacs
it reached Setup Assistant and the desktop (docs/qemu.md). check-boot.sh
-k has not run, as its guest probes build on a Mac.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 21:06:12 -08:00
Anees Iqbal cbdac3b3e1 🐎 Back guest RAM with huge pages at every THP setting
The prealloc of reims-ctl's memfd gets transparent huge pages only where
shmem_enabled lets a fault take one: advise (CachyOS's), always or within_size.
At never, upstream's default and most distributions', the guest ran on 4 KiB
pages and KVM mapped it 4 KiB at a time.

Move vendor/qemu to 53e76630, which collapses a shared file-backed backend's
RAM into huge pages with MADV_COLLAPSE once its prealloc has run and before any
device is realized, 2 MiB at a time. For shmem the kernel takes MADV_COLLAPSE
at every shmem_enabled but deny (read in Linux 6.13 and 7.3); at deny, or before
Linux 6.1, it fails with EINVAL, QEMU logs it in its one line and the boot goes
on as before. docs/qemu.md says what the collapse does at each setting, with
the boots on um790 that measured it.
2026-11-23 12:20:48 -08:00
Anees Iqbal f94107ffa7 🆕 Count handles dropped at rt's address while buffers run
A diagnostic only: nothing the guest or the host observes changes. On a platform
that places pins only in its blocks (metal2vulkan-runtime), an OBJECT_DESTROY
of an object made at the platform's own address, a pin it did not keep or none,
is counted under destroys-at-rt-address-in-flight-<kind> where a command buffer
of the object's context is posted and not yet committed, or begun and not yet
complete. The count is an upper bound on the handles let go of at an address a
running command buffer may still use, so a boot's counts line tells whether
that stale-address lead applies to this class of object at all.

It costs no new lock and nothing per command buffer or per create. The object's
unkept::Live records at its make whether it lies at the platform's address,
from the pin and address made already compared there; the destroy reads it in
the table lookup it already makes, and the context's queues posted and not
committed it already reads. Only for such an object does it take the context's
drain lock, alone, to read the holds the drain keeps.
2026-11-23 10:38:47 -08:00
Anees Iqbal a47f295910 📝 Say that a release waits for the command buffers begun [ci skip]
The design doc's BLOCK_RELEASE, POOL_GIVE and PRIVATE_GIVE answers, and the doc
comments of their handlers, said the answer follows the command buffers the
context committed. The code waits for the ones the decoder has begun for the
context (drain_context): a command buffer posted on a ring and not yet begun is
not waited for. Each place now says that. No code changes.
2026-11-23 10:38:47 -08:00
Anees Iqbal c27625e28c 📝 Record iHD's XYUV answer and the 4:4:4 route's cost [ci skip]
The Iris Xe run of the route's ignored test (m3-max-71683) answered what the
docs left open: iHD passes the XYUV trial at 64 bytes in whole rows, as it
does NV12 and P010, so a 1366-wide picture's rows of 5464 bytes go to the
CPU, and over 40 pictures, each byte-equal to the CPU's split, the GPU's
way took 0.57 ms of the calling thread's CPU time a picture (median)
against 12.1 ms for the read back and split.
2026-11-23 10:29:53 -08:00
Anees Iqbal 3d5ff13d0a 📝 Say how VA-API's 4:4:4 pictures reach the guest [ci skip]
The import check now tries XYUV beside NV12 and P010, and where it passes,
the graphics arm has the driver write a 4:4:4 picture into a scratch of its
device's and the device's GPU split it into the guest's surface; the CPU's
split through vaGetImage stays where it does not. The VA-API doc and the
device's design said the CPU split it always. They now say what the check
tries, what the arm does with its answer, and radeonsi's measured answer:
none, since its vaCreateImage refuses an XYUV image.
2026-11-23 09:50:52 -08:00
Anees Iqbal 4fba48b091 🔥 Remove the display's two mirror shaders, which nothing calls
displayMirrorTile and displayMirrorTileList, with the struct, constant and
helper only they used (DisplayMirrorFrame, display_mirror_threads,
display_mirror_tile_changed), were the window mirror's kernels. The mirror,
reims-vgpu's graphics/mirror.rs, was deleted with VulkanPlatform, and since
then no pipeline was made from either: the only name left was a test's check
that the platform's shader library is ours, which now names
displayPresentVertex, a function the display draws with.

The metallibs are rewritten by cargo xtask metallibs (only shaders.metallib
and its line in metallibs.toml change). design.md's route 1 says its kernels
went with it.

Nothing the guest or host sees changes: no pipeline, binding or result used
these functions.
2026-11-23 08:57:38 -08:00
Anees Iqbal 11df2e96f8 🎨 Key each of rt's refusals by its functions in one line at exit
The boot diagnostics' gaps and refusals lines count rt's refusals by kind
alone, and each kind's first line names one function, so a log of 500
PartialThreadgroups refusals named one kernel of them and left the rest
unnamed. A fix built on that kernel's cause could leave others refused,
and the next log would again name one kernel a kind.

The refusal-keys line, written at exit beside those two, counts each
refusal they count by its kind, the functions its site names (each by its
role, its library's hash and its index, never its name), and, of a
PartialThreadgroups, its grid and threadgroup, of a StorageElement, its
slot, pixel format, case and backing. It names the 64 keys of the most
refusals and the rest in one tail, keeps at most 4096 keys, is counted on
the refusal's path alone, and is not written without a refusal. A
diagnostic: nothing the guest observes changes.
2026-11-23 04:39:26 -08:00
Anees Iqbal 365b40e5bb 🐛 Run a kernel's imageblock at the size its encoder set
A compute encoder's setImageblockWidth:height: now reaches rt
(ComputeCommandEncoder::set_imageblock_size). A kernel with an explicit
imageblock runs each dispatch, direct or indirect, at the size the guest set
last on its encoder, and at 1 by 1 before the encoder sets one, as Metal does.
Before this the encoder dropped the size, and every such dispatch ran at 1 by 1
whatever the guest set: the kernel's get_width and get_height answered 1, and
its threads past the first cell reached past the imageblock.

A size rt refuses, a width or a height that is not a power of two (0 included)
or more than 1024 cells (Refusal::ImageblockSize), is counted as Metal's
refusal, rt-refused-metal, by the basis rt declares for it: Metal's validation
layer stops each such size at the call (measured on the M3 Max by
metal2vulkan's probe). The encoder's later dispatches run at the size set
before it. What Metal runs after such a size without its validation layer is
not measured. A size past 32 bits is Metal's refusal too, as the encoder's
other values past rt's 32 bits are.

The dispatch pre-pass reads the encoder's size beside its threadgroup memory
lengths and hands it to the compute state's make ahead and key: the platform's
ComputePipeline::prepare_dispatch and dispatch_variant take it now, and pass it
to rt's in place of the [1, 1] the pin commit passed. So the first dispatch at
a new size finds its pipeline made, as at a new threadgroup memory length.
Indirect command buffers run no kernel on rt (their records are draws, and a
compute encoder's execution of one is Metal's refusal), so no such path takes
a size.

Tests: mutdec_imageblock's extent at sizes set, refused and unset, direct and
indirect, on the GPU; rt's keys of an imageblock kernel's dispatches by size,
and one key whatever the size for a kernel with none; and the pre-pass's makes
ahead at each encoder's size. The kernel's metallib is in tests/shaders.
2026-11-23 02:48:08 -08:00
Anees Iqbal 649050cf96 ⬆️ Build on metal2vulkan development f8181e2a6c
Moves the runtime to metal2vulkan development f8181e2a6c. SEMANTICS moves from
2280 to 2286, so every host translates its guests' shaders again once;
ARTIFACT stays 592 and RUNTIME 2550.

What changes for the guest at this pin:
- A sampler bound with LOD clamps of its own (setSamplerState:lodMinClamp:
  lodMaxClamp:atIndex: and its vertex, fragment and range forms) samples with
  the bind's clamps, as Metal does, where rt refused the bind (Gap::LodClamps).
  Past 4,000 live clamp variants a bind is rt's Limit::LodClampVariants.
- A vertex function's slice and viewport index are stored as it writes them,
  and as 0 where it never writes them; rt refused such a function where it
  could not show the index the same at a primitive's vertices, or where the
  function never wrote it.
- A storage cube or cube array written or read by face translates.
- MSL 3.2 program-scope buffer bindings translate; other program-scope shapes
  are refused under their own features (Feature::ProgramScopeBinding is gone).
- A thread's array of buffer pointers indexed at run time translates in two
  more shapes.
- An argument buffer's command-buffer word is plain data, and a render state
  whose functions may reach indirect command buffers is made.
- A kernel with an explicit imageblock dispatches, where rt refused the
  dispatch; it runs at 1 by 1 for now, since the compute encoder still gives rt
  no setImageblockWidth:height: size. The next commit passes the guest's size.

For the host: a kernel keeps its first 8 pipeline variants and the 56 last
dispatched, so rt's memory for one kernel's variants is bounded, and
threadgroup memory lengths round up to 16 bytes in its keys.

The two calls into rt that changed take the imageblock size as a fourth
argument: the compute state's make ahead (prepare_dispatch) and key
(dispatch_variant), each passed [1, 1], Metal's size for an encoder that sets
none. The accuracy ledger's imageblock row and the compute encoder's docs say
what the guest sees at this pin.
2026-11-23 01:54:10 -08:00
Anees Iqbal 5b55fa65f0 🆕 Let an x86-64 VM's system disk be on virtio-blk
The owner asked for a virtio disk beside SATA and NVMe. An x86-64 VM's
settings (disk_controller = "virtio"), `reims-ctl set --disk-controller
virtio` and the edit form's Disk controller choice now take virtio, which puts
the system disk on QEMU's virtio-blk-pci at slot 6, the first slot no other
device takes, with SATA's drive options: no discard=unmap, whose TRIMs NVMe's
disk waits on btrfs follow, and no iothread. OpenCore's image and the
installer stay on AHCI, and new VMs stay on SATA.

Measured (job m3-max-70333, homelab-um870-1's RTX 3090, the library, QEMU and
guest set of aed8655a6): installed macOS 26.7.2 moved from SATA to virtio, on
a snapshot=on overlay of its disk, answered SSH 15 s after QEMU started, as
the same boot on SATA did (m3-max-70320), showed its desktop on Metal 3 with
ReimsGraphics loaded, and shut down with QEMU exiting 0 and no fatal line.
macOS's AppleVirtIO drives the disk, and Disk Utility names it Apple Inc.
VirtIO Block Media, which the install steps now give for a VM on virtio. The
help says that only an installed macOS 26 was tried there; docs/qemu.md has
the boot, and the NVRAM's saved boot device, which still named the SATA path.
2026-11-23 00:27:11 -08:00
Anees Iqbal 82d2c8449d 🆕 Answer supportsFunctionPointers with rt's answer on Vulkan
The guest now sees supportsFunctionPointers YES on every host on the Vulkan
platform, where it saw NO: the answer is rt's Device::supports_function_pointers,
which is true on every device and never chosen by vendor. Its compute
pipelines' function handles, visible function tables, sets and binds are rt's
(the previous commit), and the bundle's compileVisibleFunction: calls, which
Metal's library sends for MTLFunctionOptionCompileToBinary, now answer no
error. supportsFunctionPointersFromRender stays NO: rt makes no render stage's
tables. A kernel that reads a table through an argument buffer is still
refused (rt-refused-translation).

The bundle answers from the FUNCTION_POINTERS feature bit, which every host
offers, and this identity flag, so the guest needs no change. The identity's
tests now hold rt's answer, and design.md's list of the lane's own NO answers
names render pipelines' function pointers alone.
2026-11-22 23:35:32 -08:00
Anees Iqbal 22248237c5 🆕 Make compute function handles and tables on the Vulkan platform
The Vulkan platform made no function handle or visible function table
(rt-unbuilt-function-table): each create answered nil. rt now makes them, so
the platform carries them on rt:
- a compute pipeline state's handle of each function its kernel links (rt's
  function_handle), and none, Metal's nil, of any other function;
- visible function tables (rt's new_visible_function_table): gpuResourceID is
  rt's device address of the table's words, which the guest writes into an
  argument buffer itself; allocatedSize is those words in 4 KiB pages, as the
  Macs answer for small tables; resourceOptions is Shared, tracked (512);
- sets of one entry or many, a nil entry calling nothing; a set past the table
  is rt's refusal (Refusal::FunctionTableIndex, counted rt-refused-ours), and
  sets none of the entries;
- the compute encoder's bind of a table at a buffer index or a range of them,
  a nil table unbinding its slot.
A kernel that reads a table through an argument buffer stays rt's translation
refusal (rt-refused-translation), and render stages take no tables.

The device still answers supportsFunctionPointers NO, so the guest makes
none of these yet; the next commit takes rt's answer. Unbuilt::FunctionTable
and its code go. The rt platform's tests make tables, set and bind them, run
a kernel calling through them (nil entries, an unbinding, a set after the
encode) and refuse sets past the table; the decoder's test makes the guest's
handles and tables.
2026-11-22 23:35:32 -08:00
Anees Iqbal 0394ccfa2d 🎨 Answer a linear texture rt makes no over-buffer form of nil
rt makes no texture over a buffer but a 2D texture of one level, sample and
slice, or a texture buffer, and refuses any other shape there as its gap
(TextureOverBuffer). The Vulkan platform's linear entry
(newLinearTextureWithDescriptor:offset:bytesPerRow:bytesPerImage:) still asked
rt for those shapes, so each one-level Managed 2D array on unified memory
counted an rt-refused-gap before the decoder fell back to a texture of its
own: four in an x86 guest's browser WebGL page, one in the GL cases on RADV
and on ANV.

The platform now answers nil for those shapes without asking rt, and counts
nothing. The guest sees nothing new: the answer is the nil rt's refusal gave,
the decoder falls back to the same texture of its own beside the CPU copy
(logged once, as before), and a guest's LINEAR_TEXTURE_FROM_BUFFER of such a
shape is refused as before. The walks' counts lose the TextureOverBuffer
refusal.

on_vulkan_a_managed_2d_array_shows_its_cpu_copy now holds that the array is a
copy of its own and that no rt-refused-gap is counted, and a new Vulkan-crate
test holds the platform's answers: a 2D texture of one level made, a 2D array
and a 2D texture of two levels nil, with no refusal counted.
2026-11-22 23:30:52 -08:00
Anees Iqbal 3d53248877 🐎 Write NVDEC's 4:4:4 pictures into their surfaces on the GPU
NVDEC's 4:4:4 pictures were read back to the host and interleaved by the
CPU into the guest's surface. Now, where CUDA imports the device's
exportable buffers, CUDA copies each plane within the GPU into a scratch of
the decoder's. videoGather444 then writes them into a Shared buffer over
the surface's pages, and the pass is waited for. This is the route NVDEC's
4:2:0 pictures already take, which writes the surface in place.

The guest's surface holds the same bytes as before. Each picture written
this way is counted as video-pictures-gpu-gathered, and a session logs how
many at its end. A refusal before anything is written (no exportable
scratch, a plane off a 32-bit word, a plane past the surface or the
scratch, a failed pass) falls back to the CPU's interleave, and its reason
is logged once per decoder.
2026-11-22 23:13:08 -08:00
Anees Iqbal fa1636f312 🆕 Decode HEVC 4:4:4 at 8 bits on VA-API where the driver lists it
What the guest sees now: where the driver lists HEVCMain444 VLD with 4:4:4
render targets (iHD on Intel's Iris Xe), VideoToolbox's paravirtual
sessions of HEVC 4:4:4 at 8 bits are made, as on NVDEC. Where it lists none
(radeonsi), they are refused at their start with "VA-API: the driver has no
HEVC Main 4:4:4 decoder" in the refusal line.

The accelerator sends the range extensions' picture and slice parameters,
the base and Rext structures in the usual buffer types, and decodes into
XYUV surfaces. A frame is read back through vaGetImage and split on the
CPU into the surface's luma and Cb/Cr planes. The import check has no XYUV
answer, so no GPU route lands these pictures yet. hevc-check.sh decodes
x265's Main 4:4:4 streams where the driver lists the profile, and expects
the driver's refusal elsewhere.
2026-11-22 23:13:08 -08:00
Anees Iqbal e38755158d 🆕 Decode HEVC 4:4:4 at 8 bits on NVDEC
VideoToolbox's paravirtual decoders refused every HEVC stream outside Main,
Main 10 and Main Still Picture. At login, an arm64 macOS 26 guest opens a
tile session of an HEVC 4:4:4 stream at 8 bits (a HEIC image's), which was
refused.

What the guest sees now: where NVDEC lists HEVC 4:4:4 at 8 bits
(cuvidGetDecoderCaps, Yuv444 output), such a session is made and its
pictures land in '444v' or '444f' surfaces, by their range. Where the arm
declines it, the session is still refused at its start, and the refusal
names the arm's reason. 4:2:2, monochrome, 12-bit and deeper 4:4:4 streams
stay refused.

The codec crate parses the range extensions of the SPS, the PPS and the
slice header, each held to its range, and splits its check: the codec's own
refusals, then the arm's. NVDEC's pictures take the range extensions' pic
params, and its decoder writes three planes. The CPU interleaves them into
the surface's two planes. The tests that held the old refusal now hold the
new answer, and hevc-check.sh expects each refusal's own reason.
2026-11-22 23:13:08 -08:00
Anees Iqbal c332f2b155 ⬆️ Build on metal2vulkan development a8c1acc9a1
Moves the runtime pin from 75c3e49bd6 to a8c1acc9a1, on metal2vulkan's
development, in a commit of its own: 25 commits. The translator's semantics
version moves 2276 -> 2277 and its artifact format 591 -> 592, so each host
makes its cached translations again once.

For the guest:
- An upload into a Depth32Float texture, or into Depth32Float_Stencil8's depth
  (replaceRegion:, a Managed texture's upload, a blit copy from a buffer), is
  now the device's copy into the depth aspect, where it was refused before. A
  GL shadow-map compare over such a texture read 0 where 0.5 was uploaded, on
  every card, since the move to the runtime. Within [0, 1] a value is kept
  exactly, except that a device may store a denormal or -0.0 as +0.0. Outside
  [0, 1] it is the device's: RADV and ANV clamp it, NVIDIA keeps it, and Metal
  keeps it. The accuracy ledger has the row.
- A threadgroup load, store or atomic at a constant offset outside the arena
  (undefined in Metal too) is a zero load, no store, or an atomic that writes
  nothing and returns zero. 18 functions in 4 libraries that failed to
  translate now translate.
- Compute function pointers are built in the runtime. The device does not
  answer them yet, so no guest reaches that path.

For the host: the runtime's Gap::FloatDepthUpload is gone. Nothing of ours
named it except the blit module's doc, which now says what the copy does.
2026-11-22 22:53:36 -08:00
Anees Iqbal e023e877b3 ✅ Ban the file calls the test's sandbox cannot kill at
The files test runs the bundle's file calls under a sandbox that asks the
kernel to kill the process at each of the 97 file system calls some
WebContent list leaves out. Its utimes control ran to its end. Each of the 97
calls, made under that sandbox on macOS 27.0.1 (arm64, and x86_64 under
Rosetta), shows the kernel kills at 67 of them. It lets through the 30 that
write: links, owners, flags, times, positioned writes, extended attributes,
fsctl, ACL modes and snapshots. So the sandbox proves nothing about those 30.

bundle_files_check.sh now bans the bundle's imports of the library calls
that make those 30. The test's controls are the calls the kernel does kill:
setattrlist and open_dprotected_np. The test's, RgfxFiles.hpp's and the
lesson's text say what the sandbox covers, and the lesson adds how to spot
a sandbox that lets a call through.
2026-11-22 22:39:31 -08:00
Anees Iqbal 542ee78277 📝 Note that Foundation's file calls can trip an app's sandbox [ci skip]
The lesson of the 11.x WebGL kill: the bundle's earlier rule against
open(2)'s family sent its writes through Foundation, whose system calls
nothing checked, and WebKit's WebContent profile on 11 and 12 kills its
process at any system call its list leaves out. It says where the
profiles were read, what the bundle does now, and how to spot the next
one. The fopen lesson now says the bundle may import open itself.
2026-11-22 22:39:31 -08:00
Anees Iqbal bb22b845a7 📝 Record the copier at rows that end inside a word [ci skip]
The ignored VA test now copies every picture of the 1366x768, 854x480,
642x362 and 426x240 streams on the RX 550 and the 780M, equal to the CPU's
copy, where the copier before this branch declined them. Cold boots playing
such clips show the pictures land by the hardware in their caches' exported
surfaces on both GPUs, so no walk on these cards reaches the copier.
2026-11-22 21:25:18 -08:00
Anees Iqbal f5ac226627 🐎 Copy on the GPU a picture whose rows end inside a word
The GPU's copier declined a picture whose planes' rows are not whole 32-bit
words, an NV12 picture 1366, 854, 642 or 426 wide, its rows 2 bytes past a
word, and those pictures took the CPU's copy: the frame read back, copied
into staging and blitted row by row. On an RX 550, whose radeonsi imports
no CoreVideo layout in place, that is every picture of such a stream.

The copier now hands the kernel each plane with no margin (unit 0): a row's
last word takes the row's bytes and keeps the cache's others, by an atomic
AND and OR, so the cache holds the bytes the CPU's copy writes, as before.
It still declines a plane whose first byte or pitch is off a word, and now
a plane whose last row's last word would end past its buffer. Rows of whole
words, 1080p's among them, copy as they did.
2026-11-22 21:09:09 -08:00
Anees Iqbal 6d83a5d4f8 🆕 Name the stream on a paravirtual decoder's refusal
The arm64 guest's VideoToolbox sessions of a stream the host does not
decode were refused with a line that named no stream: b499's macOS 26
boot on the 780M opened a HEIC tile session at login, refused, and the log
did not say which profile it was. The refusal's warning now names the
stream: its codec, profile (HEVC's general_profile_idc, H.264's
profile_idc), chroma_format_idc, luma and chroma bit depths and coded
size.

Its degradation kind spells the shape in words, size left out, so the
first stream of each codec, profile, chroma format and depths in a boot is
written and the rest are counted (the logger cuts a kind at its first
digit). The guest is answered as before: nothing it sees changes.
2026-11-22 20:25:52 -08:00
Anees Iqbal b92b1ccb28 📝 Name the imageblock-size kernel input among rt's gaps [ci skip]
A compute pipeline whose kernel reads its imageblock's size is refused by
the runtime at its create (KernelInput, ImageblockSize), where Metal makes
the state. arm64 guests on macOS 15, 26 and 27 meet it once at login, and
the ledger of what rt refuses did not list it.
2026-11-22 19:57:03 -08:00
Anees Iqbal 412dde9937 🆕 Let REIMS_INSTALL_SKIP_HOST_CHECKS=1 skip the host checks
The owner asked for an environment variable that skips the installers'
checks of the host, in install-ctl.sh and in its Windows equivalent alike.

Set to 1, install-ctl.sh skips its checks of the host for the VMs it runs,
with the changes they offer to make through sudo: on Linux KVM, /dev/udmabuf
and its group, vm.max_map_count, MGLRU's min_ttl_ms, the USB udev rule and
the kvm group; on Windows the Windows Hypervisor Platform. install.ps1 skips
its step 2, the platform's check and its turning on as an administrator, and
the variable reaches install-ctl.sh in CLANG64's shell. Each script says once
what it skipped. Neither skips what the build needs or refuses: the host's
OS and architecture, the CLANG64 shell, paths with a space, the
dependencies, rustup, vendor/qemu and --skip-qemu's installed QEMU.

Unset, or anything but 1, both scripts do what they did. On a Mac the
variable changes nothing: the one check there for VMs, of the macOS release,
decides whether mesa, a dependency, is installed. Both scripts' headers
document it, and docs/qemu.md's Windows install section names it.
2026-11-22 19:07:31 -08:00
Anees Iqbal eb231e5ab9 🆕 Send the indirect stage-in region to rt, counted by its kind
rt at 2953064a1c has setStageInRegionWithIndirectBuffer:indirectBufferOffset:
as a call of its own, set_stage_in_region_with_indirect_buffer, which refuses
it as Gap::StageIn of kind IndirectRegion. The compute encoder sent the
command nowhere and counted it under rt-unbuilt-compute-command, as a form rt
had none of. It now makes rt's call and counts rt's refusal as every rt
refusal is counted: rt-refused-gap on the counts line, and
StageIn-IndirectRegion as a key of its own on the boot diagnostics' gaps line
(reims-vgpu: rt-diag gaps:, written beside every counts line), the name its
first refusal's line carries too. diag's refusal_name now names each
stage-in form StageIn-<kind>, so the two forms rt refuses as a compute state
is made, DynamicStride and IndexedStepRate, show by their form as well, where
before all three showed as StageIn.

For the guest: nothing changes. The command encoded nothing before and
encodes nothing now, and the encoder's stage-in region stays the one set
before it, or none. For the host: each such call counts one
rt-refused-gap in place of one rt-unbuilt-compute-command, and the stage-in
gaps show by their form on the rt-diag gaps line.

The compute encoder's test held the old count: it now expects
rt-unbuilt-compute-command at +1 (the indirect dispatchThreads alone),
rt-refused-gap at +1 and StageIn-IndirectRegion at +1. refusals_count_by_kind
checks each form's name and that each counts apart.

The compute module's doc of attribute strides said a kernel's [[stage_in]]
read through a layout of MTLBufferLayoutStrideDynamic takes the encoder's
stride and is refused. rt at 2953064a1c refuses only an attribute the kernel
reads with a thread-position step through such a layout (a constant step
reads no stride, and its state is made), and the doc now says so. The
ledger's rt-unbuilt-compute-command row drops the stage-in region, and its
gaps paragraph lists the three stage-in forms by their names.
2026-11-22 14:45:20 -08:00
Anees Iqbal b35bda90d1 🔥 Delete the pages views' grouping, which no platform turns on
The pages blocks' views were grouped into shared udmabuf files only where the
platform's VM answered HostVm::view_groups, and regrouped only where it
answered HostVm::regroup_limits. Since the old Vulkan platform went, no
platform answers either: rt's view imports are made at SURFACE_PAGES with the
import's own address, each view one import, and the planner ruled that
grouping does not come back in any part. The code only the testkit drove is
deleted:
- SurfaceViews::join_group, group_closed, seal, group_jobs and their types
  (Joined, Sealing, the forming groups, HandedOver, WaitsForViews),
  GROUP_WINDOW and GROUP_MEMBER_MAX, and the decoder's wrappers;
- decode/surface_pages/regroup.rs, the decoder's regroup_moves, and
  GraphicsControl's regroup_step, seal_group, group_key and REGROUP_KEY;
- HostVm::view_groups, group_views and regroup_limits with GroupLimits,
  GroupHold and ViewGroups, and the testkit FakeVm's answers to them;
- Buffer::rebind_no_copy, which only regroups called, its testkit impl and
  the two tests of its refusal;
- the grouping and regroup tests in graphics/tests.rs.

start_over_pages hands the over-pages job to the surface worker as before
grouping, and a context's close no longer drops groups first.

Nothing the guest or the host observes changes: no platform grouped a view,
so every view was already an import of its own. No degradation counts-line
code is dropped; grouping wrote none. The diagnostics that go with it are the
views log line's "imported as pieces of group dma-bufs" clause, the regroups
info line, the trace events regroups, regroup, regpass and regcand, and the
seal's and regroups' debug lines.

The surface_pages module doc and docs/graphics-kext/design.md now say each
pages block's view is one import, keeping the measured cost of an import a
submission; docs/lessons.md keeps both grouping lessons as traps, in the past
tense.
2026-11-22 12:53:21 -08:00
Anees Iqbal a6ce7fe2ad 📝 Say the slow answers' first-use waits count main pipelines' [ci skip]
first_use_waits_met sums the waits of every compute variant make rt keeps,
whoever started the make. Since rt's finish_pipeline, a compute state's main
pipeline is made by its finish, and a dispatch that needs it first waits for
that make in flight, or makes it itself: rt counts those waits as unfinished
waits, apart from the variants', yet they are variant makes, so the slow
answers count them too. The count is right for its code, the compute
dispatches' first-use waits; the docs said they were the variants' alone.
Say what it counts now, here and in conventions.md: the variants' waits and
the compute share of rt-first-use-unfinished-waits, a finish's make among
them, and that a draw's waits for a render state's main pipeline are not.
2026-11-22 10:37:21 -08:00
Anees Iqbal 97963584b8 🆕 Finish a pipeline's make with rt's finish_pipeline
The rt platform's state finishes, ComputePipeline::finish and
RenderPipeline::finish, now call rt's finish_pipeline: the driver's create of
the state's main pipelines, which rt's creators leave out since 951285e7a7, runs
on the device's compile thread after the create's reply and before its store.

For the guest: a pipeline create's reply no longer waits for the driver's
create of its main pipeline, as it did before the pin move; the store, and the
command buffers, indirect command buffer writes and function handle and table
creates that name the pipeline, still do, so its first draw or dispatch no
longer makes that pipeline on its queue's lane, as it did with the pin move
alone. Every answer the reply carries is made before the driver's create, so
nothing the guest reads changes beside timing. A finish rt fails is the create's
late failure, pipeline-finish-failed, as before: the pipeline is stored as made,
and a draw or dispatch that needs it makes it again, refused at its encode where
that make fails too; the accuracy ledger lists it.

A create whose destroy, context close or reset came before its finish began is
no longer finished: its pipeline is never stored, so the driver's create would
be wasted. A finish already running still ends. A keyed create skipped so keeps
its answer as its make answered it.

The counts line gains rt's new metrics: rt-finished-pipelines and
rt-finished-pipeline-ns, rt-first-use-unfinished-waits and
rt-first-use-unfinished-wait-ns, and rt-first-use-unfinished-wait-max-ns at its
highest over the process's devices. The ten-second rt summary says the finishes
and the unfinished waits, and the trace's rtmetrics event ends with the five
values. rt's failed_finishes is not folded: the device's pipeline-finish-failed
counts each failure at the platform's seam, where every platform's finish
answers (a raise or death in the platform's refusal scope too, which rt never
sees) and where the failure's guest-visible effect is decided, so the line
carries each failure once.

docs/conventions.md's stall rule names the reply ahead of the driver's create as
its second exception, and compile.rs's Order, the design doc and the rt
platform's pipeline docs say what the finish now does.
2026-11-22 10:37:21 -08:00
Anees Iqbal 506d193389 ⬆️ Build on metal2vulkan development 10f83b636d
Moves the runtime pin from 91fed9449c to 10f83b636d, on metal2vulkan's
development, in a commit of its own.

For the host: rt's pipeline creators now answer once everything that can
refuse is made, before the driver's create of the state's main pipeline
(951285e7a7), which rt's new finish_pipeline makes: a compute state's
tiles', square workgroups' or required size's pipeline, a render state's
triangle or patch class and the class its inputPrimitiveTopology names. The
rt platform's finish does not call it yet (the next commit does), so with
this commit alone a state's main pipeline is made at its first draw or
dispatch, on its queue's lane, or by the dispatch pre-pass's make ahead,
since dispatch_variant's made bit reads false until it is made. rt counts
such a wait as first_use_unfinished_waits. A driver's create that fails
there fails that draw or dispatch, where it failed the create before.

Kernels past the stage bound still make their main pipeline in the
constructor. A heavy kernel's driver failure at creation that is not a
stage-bound refusal is now its first dispatch's error, as for tiled and
square kernels.

The push window is min(maxPushConstantsSize, 256) for each device
(d9077dfa0d), where it was a constant 256 that the floor required. The floor
now refuses only a device below 128 bytes, so a device of 128 runs with a
window of 128. Every device we ran on passed the old floor, so it reported
256 or more, and its window stays 256. The translator's binder plan goes
(fd5fcca9b0, a7dd2e846e): rt never made one.

Nothing the guest observes changes beside timing: every answer rt gives is
fixed before the driver's create, and the reply, which waited for the whole
make, now waits for rt's part of it.

Added to rt's public items: ComputePipelineState::finish_pipeline and
RenderPipelineState::finish_pipeline, VariantStart::Finish, and Metrics'
finished_pipelines, finished_pipeline_nanos, failed_finishes and
first_use_unfinished_waits with its nanoseconds and longest, and
DeviceProfile::push_window. Removed: 595 of the translator's items, the
binder plan's, and the runtime's PrecisionNote::FloatSampleFilter and
HalfSampleFilter. Nothing of ours names any of them. SEMANTICS (2273),
ARTIFACT_FORMAT (591) and RUNTIME (2550) are unchanged, so warm caches stay
warm. metal2vulkan's Cargo.lock is the same at both commits, so the stripped
lock is.

The device docs that said the make leaves nothing to the finish now say it
leaves the driver's pipeline to it: rt_platform/pipeline.rs ("Its main
pipeline") and both platform finishes, compile.rs ("Order") and the graphics
design doc.
2026-11-22 10:37:21 -08:00
Anees Iqbal e9c55782bf 📝 Add the M3's queue priority answers to Q50 [ci skip]
Q50 measured a new queue's GPU priorities on the two Intel Macs only, and the
bundle's arm64 builds share the answers it took from them (1 and 2). The M3
Max under macOS 27.0.1 answers the same: oracle_prio's first lines, built for
arm64 and run on it in m3-max-68256, read GPU priority 1 and background
priority 2 on a new queue, and every readback after the sets as the Intel
Macs do. So Q50's queue answers are now class 3 on all three Macs, and the
bundle's arm64 answer is measured. The flag that stopped the probe after those
lines was not committed.
2026-11-22 10:16:32 -08:00
Anees Iqbal a4da706118 📝 Say what the host does with WindowServer's queues [ci skip]
design.md said WindowServer's queue runs at high priority where the host
driver offers queue priorities, and that an unshared queue is the one the
runtime's unshared_queue makes. Neither is what the code does. On the Vulkan
platform new_command_queue_unshared answers the platform's plain
new_command_queue, and the runtime submits every command queue's work to its
one VkQueue, which it makes at priority 1.0 with no global priority. So no
queue priority reaches Vulkan, and an unshared queue's buffers wait behind
every buffer submitted before them, as any queue's do. The runtime has no
unshared_queue at the pin, and the library has no Metal platform, which the
paragraph also named.

Docs only: no check reaches it ("docs and comments" in AGENTS.md).
2026-11-22 10:08:08 -08:00
Anees Iqbal 55e5dbef5b 📝 Say what the wire's queue priority field is
RgfxQueueCreate.priority's doc read "0 normal and higher higher", which runs
against Metal's order: a new queue's GPU priority is 1, and on an Intel 630 a
queue of a lower value runs first (dgpu-oracle.md Q50). It now says what the
field is: the bundle sends 0 for every queue, a guest's setGPUPriority: stays
in the guest, and the host reads none, so no queue the platform makes takes a
priority. Q50's note on the comment says it was changed.

reims_graphics_wire.h is regenerated with it (cargo xtask header). The header
is a source of the option ROM, so the ROM's record is rewritten with
make -C firmware prebuilt. The ROM's bytes are unchanged: its sha256 is
749434f87f562895548f60681cd4cd8bf6cc0d0e967ac2fea297674426709161 before and
after.
2026-11-22 10:08:08 -08:00
Anees Iqbal 92e20a326e 🐛 Answer a new queue's GPU priorities as Metal's queues do
For the guest: a new command queue now reads GPU priority 1 (getGPUPriority,
GPUPriority) and background GPU priority 2 (getBackgroundGPUPriority), where it
read 0 and 0. A new queue on the Intel 630 and the AMD 5300M reads 1 and 2
under macOS 26.7.1 (dgpu-oracle.md Q50), and RenderBox reads both back as it
sets up its queue. The setters and their readbacks are unchanged, and nothing
is sent to the host.

Q50's getters read no offset back, so the offsets' first values are not
measured, and they stay 0. Q50 also set the background priority only to 2, a
new queue's own value, so the bundle's readback of other background values is
unchanged and not pinned.

test_queue_priorities_read_back_as_metals runs Q50's readback sequence: a new
queue, setBackgroundGPUPriority: 2, then setGPUPriority: 2, a second queue's
setGPUPriority: 0, and the two offset forms.
2026-11-22 10:08:08 -08:00
Anees Iqbal 4761ee8f8f 🆕 Count how long the guest waited for its pipeline creates' replies
The planner reads the pipeline cache's effect on a boot by what the guest
waited, and nothing on the counts line said what the guest waited for a
pipeline create: rt-pipeline-creation-ns sums concurrent makes,
slow-answer-over-make is about rt's pool memory makes, and
rt-first-use-variant-wait* is the compute dispatches' variant waits.

The counts line now carries, for render, mesh render and compute creates
together, each create's wait from the host's take of it off ring 0 to its
reply's post: pipeline-create-replies, pipeline-create-reply-ns (summed),
pipeline-create-reply-max-ns (the longest),
pipeline-create-replies-over-16ms (16.7 ms or more, SLOW_ANSWER_NS), and
pipeline-create-waiting-ns, the span during which at least one create
waited: their union, so waits at once count once. A refused create, and one
destroyed or closed before its reply, which is still posted, is counted at
its reply like every other; one let go of with no reply posted ends its
wait there, in the span but not among the replies.

A diagnostic: nothing changes for the guest. Each create costs two reads of
the platform's monotonic clock under a lock of the device's own.
2026-11-22 09:43:42 -08:00
Anees Iqbal ff0f2ac817 📝 Say the wire's queue priority comment runs against Metal's order [ci skip]
Q50 found that a lower GPU priority value runs first on the Intel 630, and that a
new queue's value is 1. RgfxQueueCreate.priority's comment in
reims_graphics_wire.h reads "0 normal and higher higher", the opposite order.
Q50 now names that comment as found. The wire is not changed here: nothing reads
the field, and the bundle sends 0 for every queue.

Docs only: no check reaches it ("docs and comments" in AGENTS.md).
2026-11-22 09:41:11 -08:00