🐛 Put the guest's cursor in a display's last pixel

vendor/qemu moves to 2f7c68a7, past a contributor's PR 24 and the two
commits that fix it forward. reims-graphics-pci now sends a window's
pointer at its display's last column or row as the tablet's maximum, on
every display and both axes, with no property: QEMU scales [0, size] over
the tablet, and the pixel itself, size - 1, put a macOS 26 guest's cursor
at 2014.92 of 2016 pixels and 1258.94 of 1260, never in the last column or
row; the maximum puts it at 2015.98 and 1259.98, still on its own display
with another beside it.

The PR's opt-in properties go: tablet-right-edge-head gave the maximum to
one display's x alone, and dock-pressure, with its second, motion-only
usb-mouse, showed no hidden Dock the tablet did not. An x86-64 26.7.2
guest's tablet shows a hidden Dock at the bottom, right and left on Linux
and Windows hosts, and an arm64 26 guest under TCG shows it at the right
and left and, with or without the pulses, not at the bottom. reims-ctl's
command does not change.

docs/qemu.md carries the fork's row and the measurements, with their
potluck jobs, and docs/lessons.md the trap.

(cherry picked from commit 634ce5f359c096e0c2456f28537b97a6ebb355a5)
This commit is contained in:
Anees Iqbal committed 2026-12-03 13:48:08 -08:00
1 parent 5013b22787
commit 7c3bd2d299
3 files changed
+12 -2

No files matched your search

+1
View File
@@ -158,6 +158,7 @@ one. A new trap found the same way goes here.
- A wire record that grows without the version moving is misread by a guest of that version, not refused. On 11-18 `RgfxRenderPipelineCreate` grew from 464 to 496 bytes at wire version 2: a bundle built before then still carried the kext's marker and met a later host's `VERSION`, so the host read the `RgfxRenderPipelinePrivateState` the old bundle put at byte 464 as the new tessellation fields (a partition mode of 4294967295, the sample mask's `UINT64_MAX`), refused 22 of WindowServer's render pipelines, and WindowServer restarted at every boot: a user's report of 11-28, after an update whose guest still ran the old bundle. A refusal the old bundle meets once the kext has registered its accelerator does not help: its device answers nil, and WindowServer aborts under a registered accelerator as with no bundle at all. Only a version the kext reads before it registers ends in a picture, which is why `include/reims_graphics_wire_sizes.h` pins every record's size to `RGFX_VERSION` on both sides (graphics-kext/design.md, "The wire's version"). How to spot the next one: refusals in the host's log that name a raw value no Metal enumerator has, from WindowServer at each boot; compare the guest set's build with the host's.
- A rate the guest's frameworks report as 0 need not come from our answers. An x86-64 26.7.2 guest listed its seven modes at 0 Hz (`CGDisplayModeGetRefreshRate`, System Information) while the framebuffer answered 60 Hz in each mode's information and detailed timing, and the arm64 guest listed the same modes at 60 Hz. The 0 is x86-64 macOS's: CoreDisplay's mode building gives every mode the rate 0 where all the display's valid modes are progressive and between 57.5 and 62.5 Hz, an Intel Mac's 60 Hz-only panel among them, and leaves the rates where one valid mode is at another rate, interlaced or a television's (design.md, "A mode's rate in an x86-64 guest"; **measured** 2026-12-02, potluck m3-max-78416; a scratch framebuffer that gave every mode 120 Hz listed all seven at 120 Hz, m3-max-78544). Dropping the framebuffer's Apple timing ID, the first suspect, changed nothing. How to spot the next one: read the framebuffer's `IOFBConfig` in the guest (`ioreg -l -w0 -r -c ReimsGraphics -d 1`): `IOFB0Hz` there, with nonzero rates in the modes' `DM` records, is macOS's rule, not a wrong answer of ours.
- A check that finds the guest's work by a path counts nothing once a change moves the path, and the rest of the boot still passes. Placing the Metal bundle under `/System/Library/Caches/ai.aneesiqbal.reims-graphics`, linked from `/Library/GPUBundles/reims-graphics.bundle`, made Metal map the bundle's executable by the placed path; `check-boot`'s `amfi-map` grepped WindowServer's mappings for `GPUBundles/reims-graphics.bundle`, so the next arm64 26 boot under TCG read "maps the bundle 0 times" while `windowserver-metal` and `metal-app` passed on the device. The placement had been checked by walks that did not run `check-boot`. How to spot the next one: a change that moves a file the guest maps or opens greps the checks for the old path (`git grep` it) and runs the boots whose checks read it.
- QEMU's `qemu_input_queue_abs(con, axis, value, min, max)` scales [min, max] over the tablet's 0 to 0x7fff, so a display's last pixel sent as itself, size - 1, never reaches the tablet's maximum: a macOS 26.7.2 guest put its cursor at 2014.92 of 2016 pixels and 1258.94 of 1260, never in the last column or row, while the hot corners and the hidden Dock at those edges still fired, so no check of what fires there saw it (lane pr24, potluck job m3-max-84927). reims-graphics-pci sends the last pixel as size (`reims_pointer_axis`). How to spot the next one: at an edge, read where the guest's cursor is (CoreGraphics' `CGEventGetLocation` in the guest), not only what fires there.
## Tools and worktrees
+10 -1
View File
@@ -146,6 +146,7 @@ virtio device (`d151bcd9`, upstream's `b501f21312`).
| the window opens at the `resolution` property's size, 1920x1080 without it | `9bf62d84` |
| `resolution` takes one size for every display or a comma-separated list of one per display (`2560x1440,,1920x1080` on QEMU's line), each window's first size or, without a window, each display's mode (the config's `headless_modes`); another count of sizes than `displays` is refused at realize | `1d614106` |
| the `displays` property, 1 to 4 (1 by default, others refused at realize): display i is head i, with a console, a window under `-display none` and a cursor of its own; console i reads display i (`rvg_graphics_device_read_display_at`), so QMP's `screendump` of head i saves it ("The reims-graphics device", below) | `010bf827` |
| a window's pointer at its display's last column or row goes to the guest's tablet as the tablet's maximum, on every display and both axes (`reims_pointer_axis`, `hw/display/reims-pointer.h`): QEMU scales [0, size] over the tablet's range, so the pixel itself, size - 1, put a macOS guest's cursor at 2014.92 of 2016 pixels, never in the last column, and the maximum puts it at 2015.98, on that display with another beside it ("The reims-graphics device", below); `tests/unit/test-reims-pointer.c` checks the values. A contributor's PR 24 (the first two commits) also gave a hidden Dock relative pulses through a second, motion-only `usb-mouse` (`dock-pressure`) and the maximum to one display's x alone (`tablet-right-edge-head`), both opt-in; the last two commits remove both, as the tablet alone showed every Dock the pulses did | `ba62be0d`, `72759d28`, `3ea8ab3b`, `2f7c68a7` |
| the device's `x-write-counts` property: a set to true over QMP (`qom-set`, on `/machine/peripheral/gfx` as reims-ctl names the device) has the library write its degradation counts into QEMU's log then (`rvg_write_counts`), where they changed since it last wrote them; `reims-ctl report` sets it on a running VM before it zips the VM's logs | `b057a987` |
| file-backed guest RAM (the memfd of `reims-ctl`'s VMs) mapped 2 MiB-aligned on Linux, as anonymous RAM is | `5e83e90dc2` |
| shared file-backed guest RAM of base pages (the memfd of `reims-ctl`'s VMs) collapsed into huge pages (`MADV_COLLAPSE`) once its prealloc has run, with a line saying how much of it the collapse put on them; the device's realize fails on a Linux host below 7.2, naming its release ("Linux hosts: guest RAM's pages and the kernel's release", below) | `695ad62c`, `458f4b7b` |
@@ -520,7 +521,15 @@ is its transport:
macOS 26.7.2 guest ran 2688x1512; `2560x1440` and the default opened it
shrunk to 1744x981 points, the guest at 3662x2039 (**measured**). Its
input is queued for a BH and reaches the guest's tablet and keyboard
through its display's console. Closing any window asks first, and its
through its display's console. The pointer at the image's last column or
row reaches the tablet at its maximum, which puts the guest's cursor in
the display's last pixel: measured with capture off on macOS 26 guests,
the pixel itself put it at 2014.92 of 2016 and 1258.94 of 1260 (x86-64
26.7.2, potluck job m3-max-84927) and at 1007.43 of 1008 points (arm64,
m3-max-84982), and the maximum at 2015.98, 1259.98 and 1007.98
(m3-max-84928, m3-max-84980, m3-max-84983). The guest scales the tablet
over the display its cursor is on, so the maximum on a display with
another beside it leaves the cursor on its own (m3-max-84980). Closing any window asks first, and its
Turn Off powers the VM off. With no window (`REIMS_VGPU_WINDOW=0`, which
`reims-ctl start NAME --headless` gives QEMU for that start, or another
display of QEMU's), each display offers the guest its size of the
Vendored
+1 -1
Submodule vendor/qemu updated: 445170b5c6...2f7c68a7dc.