Reverts 0825b1ea2, restoring 0afc30f37, e8d04b187 and ea13ccbca. A write-combined
mapping of the region does take: the region's descriptor is physically
contiguous, and xnu's fault path maps such an object's pages in its own cache
mode (vm_fault's pmap_map_block_addr, read from the public xnu source), which
the earlier reading missed. The page-table probe that seemed to agree saw only
the processes on the CPUs at its instant, not the bench.
Measured on the Radeon 780M host, draws.10k's encode: 9.2-9.5 ms at the base,
7.7 ms with the slabs in the process's own pages alone (936e3968d's set), and
1.05-1.3 ms with the spans write-combined as well (0afc30f37's and ea13ccbca's
sets). The kext's comment and the design doc say why, and docs/lessons.md the
probe's trap.
For the guest, as 0afc30f37: a queue's submission ring starts 3840 bytes into
its block, the kext's Alloc takes a third input and its feature word holds
1 << 7.
Two of gpu::fill's Metal tests failed on the M3 Max (macOS 27.0.1): for a
colour in a format Metal packs no colour in, Metal wrote 80 ef 0b 82 02 00 00
00 42 a2 3d fe 01 00 00 00 where the tests expected the bytes of the colour
fill before it.
Metal packs no colour there. It fills the 16 bytes of the calling thread's
stack where its packing writes a colour. Sent right after another colour
fill, with no call between them, it writes that fill's texel. Sent right
after a call that set the stack below to one byte, it writes that byte.
Both were measured from a plain Objective-C process and from the test
binary. The tests sent through the Metal platform, and in a dev build
objc2 checks the method before each send. That check left the encoder's
class and the selector there as pointers: the bytes above are those two
addresses (measured). So the tests were reading our own build's stack. It
held the earlier fill's texel when the tests were recorded.
The tests now send Metal's two fills by objc_msgSend itself.
metal_fills_a_colour_it_packs_none_in_with_its_stacks_bytes (renamed) pins
both measured answers for every format in LEFTOVER_FORMATS and
UNPACKED_FORMATS. leftover_colours_fill_an_earlier_colours_bytes_as_metals
compares ours, after the earlier fill in the same encoder or in an earlier
one, with Metal's fill sent right after another. Across an encoder's end,
Metal's stack holds other bytes, and the runtime holds the command buffer's
last packed texel: one answer of that envelope. The AMD 5300M and the
Intel 630 (macOS 26.7.1) raise NSInvalidArgumentException at every colour
fill, so they give no other answer to match.
Nothing the guest or the host sees changes. The module's docs and
docs/lessons.md say what was measured.
reims-graphics' device tests were leaky in car 12's and car 13's checks,
and they spawn no process. A probe of tests that only read their own
descriptors and sleep shows why: std on macOS sets close-on-exec on a
child's pipes after making them, so a test nextest starts in that window
holds the output pipe of the test started beside it, and that test is
leaky when the other outlives it. No change to the tests can prevent it.
kache served dist's SDL from a run with none of its flags, as SDL's build
script declares none of them, and a release test link after a dist lost
std's __isPlatformVersionAtLeast to LTO; each says how to spot the next.
metal_drops_small_blits_into_the_texture faults the GPU on purpose, and
a_reservation_of_2_31_minus_1_is_metals holds 16 GiB of its memory for about
a second. On a Mac every process shares the GPU, so each run failed the
in-flight work of every other process, the desktop's included: a stress loop
of the first restarted the GPU under the owner's WindowServer on the M3 Max.
Both are #[ignore]d now, run only for a change to what they test (nextest
--run-ignored only), and nextest.toml still runs them first and alone then.
AGENTS.md and docs/lessons.md say so.
The guest lane's HEVC check took ffmpeg's software decode for the truth, and
a difference on 16x16-CTB streams with SAO and deblocking on was first taken
for a bug of NVIDIA's decoder. x265's reconstruction, NVIDIA's decode,
VideoToolbox's on an M3 Max and the guest's all agree; ffmpeg 9.0.2's
software decode is the one that differs.
The writer's model of AppleGVA's short-term sets put the delta lists where
the flags are, and tests built from the same model passed while the guest
refused the stream that used them; a dump compared field by field with the
stream found the layout.
Tests that pass alone failed under the check's load:
- client_direction's GPU-faulting test failed 9 to 14 others of each
check on the M3 Max; it runs first and alone;
- the Vulkan crate's paging and unmap tests held work in flight with busy
kernels sized for the M3 Max, too short on an RTX 5080 Laptop GPU; each
holds as long as it means, through gpu::spin;
- Metal's compute answers are made in a child the test restarts when the
compiler service crashes;
- a released ICB's ID may come back once the handlers ran, timed by the
crate's clock.
docs say what a busy kernel holds and what it cannot, and tie a compiler
crash's client to its binary.
Source: 3ff3ef405 f278b85aa 88b524c90 92ffe0067 38bd30f60 084cad5ae c442c1d44
294a44dcf
Each worktree's check compiled everything again with full debuginfo and
incremental caches no rebuild used. The dev profile keeps line tables for
the workspace and none for its dependencies, the check builds without
incremental caches, and builds go through kache where it is installed, so
a worktree's first build reuses what another tree built, build scripts
included. Tests read the tree's paths at run time, so a build is the same
in every tree.
scripts/new-worktree.sh makes a worktree from clones of the main checkout's
suite files, and AGENTS.md says a profiling run removes its traces.
Source: 53a4a8edd b568f382e 0c7a0eabc 72c24f74b 10051ba78 8f415697a 73d557f71
bde4220b6 46c7c6b23
A Linux surface's buffers at an offset, or over memory read-only for the
GPU, lay over a second view of the allocation, with a writable twin per
buffer. They now lie over the surface's own view of the pages. The
over_pages registry, which checked every command's uses against textures
that core's flow never places, goes with its searches.
- Placements in Metal's space find the lowest gap by a treap search, not a
walk (33 us a placement at 20k held runs before).
- The search for unmap holds is bounded by the longest live hold.
- A one-range surface's hold starts at the range's first byte, and a
released hold's unmaps are ordered with the VM's fixed overwrites.
- A command buffer's submissions live in its own place, a detached object's
release is stored before its lower count, and a close no longer lets go
of a command buffer that is committing.
Tests count a surface's dma-buf import and say per import path what a remap
under a buffer does on RADV.
Source: 9c12c6687 5995c12f7 586dd3df7 4c87c0bf8 9a7423f9e 06ad006cd 4ad9f7d0c
c592b5830 65c0d62c5 60e369ddf 0eb75522d 8bd0dbac8 f5331d86c 5cdb739ca
8fe111c39 22400b296
This repository now holds libreims_vgpu, a Rust library that is the host
side of the paravirtualized GPU macOS guests drive, in place of Apple's
ParavirtualizedGraphics.framework: the library and its C API
(reims_vgpu.h), the PCI device's option ROM, QEMU's apple-gfx on that API
(vendor/qemu), the behaviour-lock suite that drives the C API as QEMU
does, and reims-ctl, the VM manager users run. README.md says what it is
and how it is laid out, and AGENTS.md how to change it.
Every file of the earlier tree is replaced. vendor/qemu moves to the
steelbrain/reims-vgpu branch of the same public repository.