Commit Graph
11 Commits
Author SHA1 Message Date
Anees Iqbal 402b7463a9 🐎 Restore the write-combined spans: they take, and the encode was theirs
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.
2026-11-07 08:27:28 -08:00
Anees Iqbal 5cd40c68be ✅ Send the fill tests' Metal fills by objc_msgSend
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.
2026-11-07 05:24:40 -08:00
Anees Iqbal c7cf38125a 📝 Say why nextest calls tests leaky on macOS that leak nothing [ci skip]
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.
2026-11-05 21:59:36 -08:00
Anees Iqbal 9d9a1625b8 📝 Record the kache and LTO traps dist's SDL fell into [ci skip]
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.
2026-11-05 21:59:32 -08:00
Anees Iqbal 9679523a17 ✅ Make the tests that fault or fill the Mac's GPU opt-in
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.
2026-11-05 21:59:30 -08:00
Anees Iqbal 7db353a79f 📝 Record two traps of the guest's HEVC decode [ci skip]
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.
2026-11-05 21:59:24 -08:00
Anees Iqbal 73a0b0988d 📝 Record the video devices' bugs, hardening and layout [ci skip]
docs/video/bugs.md records what is wrong with the video devices or put off,
and what each boot round found; hardening.md the bounds on guest input.
AGENTS.md, docs/development.md and docs/lessons.md gain the video crates'
rows, their checks and the traps their review found.

Source: c5b409362 f5d0311e3 532db9c03 cb582881c 5dd0d9373 60d08c4f4 efbcf2dbb
        c4c476643 82f25c397 fe105edcb 36a6a82c6 c5750b87f d7d5cfede 51bad7d67
        a07ffd70b 958524e64 cc8cbfd2d 8f9e68b8b 39881a0b3 aba73491a 233801b96
        886833dc2 710929c9d 509f64a8b fd20de9bf 2ae4acf64 7433026a9 0030b24a7
        64497f931 3bf366e81 eed5d9446 0fa52d070 c21cff4fb 1ff907b68 1ccde0ef6
        41235220c 33b40ae4a 0fbe863c3 0b7e8c004 ae49b63a3 4151f4de8 76951e3ea
        7cfd37c9b 853cfdc0e 6ed3d12a4 2dbca9dcd af2b396b2 16f8ee77b ba01dec38
        095f975b2 b6ac2bb54 943f091af ef26f02e1 d27a5f48a 7bbfdf888 203585632
        4aa89d356 31ffd8de7 08bb763c4 9400f48cb 9e050f933 5ff2dd73f 62e19c8ef
        c8c7b3400 ce406ddb2 fd92f66c4 52fba93c9 e179dc0bd b5f40ad74 73d7e9c85
        d01bbdc9e 0dcca7ff7 30ed556cb 601c23067 9857b1fc8 675e1cf8d b427bebfb
        9817ecd8f 55a1d96e7 96f459104 8c58f98c4 f9c7a5811 eef22173d 9628f09a8
        fa2a248c3 5dccbdd18 ef54c395f 745cef197 d02148033 da8b42c4c e7cb403a2
        46120bbf7 25e4ae539 221176d06 22625b578 75d879cf5 c23c83073 051c64ebb
        73e48ad5a bc6fcdaa7 b02b003f5 986872956 deb03015c 096878653 8b915bb9e
        89e863767
2026-10-26 12:24:31 +02:00
Anees Iqbal 24683a8a5a ✅ Hold the GPU-faulting and busy-kernel tests to intent
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
2026-10-26 12:24:31 +02:00
Anees Iqbal 6e20652eea 🐎 Build lean, and share builds between worktrees through kache
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
2026-10-26 12:24:31 +02:00
Anees Iqbal 09c3e75a19 🔥 Lay Linux surfaces over their own page views, dropping over_pages
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
2026-10-26 12:24:31 +02:00
Anees Iqbal 98fe2a3bd5 🆕 Replace the tree with libreims_vgpu and its C API
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.
2026-10-11 20:27:17 +03:00