Component: scripts/menu-close-probe, scripts/qmp.
Pathway: x86 macOS / Linux Vulkan. Rail: macos-15.
Test tooling only: no product code, no guest-visible behavior, so no
conformance battery applies.
The reported defect -- right-click a dock icon, left-click to dismiss, and a
black rectangle is left behind for the duration of the close animation --
had a probe that had never produced a valid reading. Three things were wrong
with it and each alone was fatal:
1. It captured repeatedly *after* the dismiss click and reported the
darkest frame. The host capture costs 1 427 ms on this rig (six timed
captures, 8 562 ms) and the animation is ~250 ms, so every frame landed
after it was over. That is why every trial of every run reported the
identical mean -- the number was the settled desktop, not the
animation.
2. Its verdict column was `dark=%[fx:mean(lightness)<0.06]`. `mean(...)`
is not a magick fx operator, so magick errored on every frame and the
column was empty on every frame. The probe's actual verdict never
computed.
3. Its menu rectangle was a hardcoded guess.
What replaces it: aim the capture rather than chase the animation. The
capture's 1 427 ms is nearly all setup and the frame is grabbed late, about
500 ms in -- measurable by starting a capture and opening the menu 150 ms
later, which puts the menu in the resulting frame. So starting the capture,
waiting, and *then* dismissing lands the grab inside the fade. The delay is
scanned per run rather than assumed, because it is a property of the host
compositor and not of the guest, and the scan produces the fade as a ramp:
88.4 / 92.7 / 106.9 / 131.7 / 147.4 against a menu-open 147.4 and a no-menu
96.0.
The rectangle is anchored to the icon that opens the menu, not differenced
out of two captures. Differencing was tried: the captures are over a second
apart on a desktop repainting damage rectangles continuously, so the
changed-pixel bounding box came back 1279x704 -- the whole screen -- and on
a boot with the blank-desktop defect the field is itself churning between
the frames. The anchored box is then validated against the two settled
states, so a right-click that opened no menu is reported as such.
The score subtracts the settled no-menu frame: it is the fraction of the box
that is near-black in the animation frame and was *not* near-black without
the menu. Dark foliage in the wallpaper reads near-black honestly, and
without the subtraction the probe reports the desktop as the defect.
Exit 2 is a first-class outcome and is why this probe can be trusted: a run
that did not land inside the fade says so instead of reporting a verdict on
frames that never contained the animation.
scripts/qmp/qmp.py gains `rclick X Y` and a `button` parameter on
send_pointer/send_button. The right button is not a convenience here -- a
dock context menu is only reachable with it, so a driver that speaks only
`left` cannot drive this interaction at all. This replaces an ad-hoc
right-click script that lived outside the tree.
Verification run. Driven against a live macos-15 guest (qemu pid 513878,
HEAD 27a0dc1d): `rclick` opens the Finder dock menu, confirmed by the menu
box reading 147.4 against a no-menu 96.0. Two probe runs of 4 and 8 trials
each calibrated to delay 0.46 and reported worst new-black fractions of
0.031086 and 0.031086, stable to under 0.001 across trials, VERDICT=CLEAN.
Not verified. CLEAN here is one boot. The defect is reported as intermittent
across boots, so this run does not establish a rate and does not show the
probe catching a real black rectangle -- only that it samples the animation
and scores it stably. The probe has not been run on any other rail.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
qmp.py
One-shot QMP client for the VM's control socket. vm/boot-arm64.sh opens a
per-boot socket in vm/guest/run/ plus a stable qmp.sock symlink — the
default here; override with QMP_SOCK=/path/to.sock.
The x86 guest rail (vm/boot-x86.sh) puts its per-boot socket + qmp.sock symlink
under vm/disks/run/, so the arm default does not apply there — pass
QMP_SOCK=vm/disks/run/qmp.sock (the boot script prints the exact path).
Covers both raw QMP commands and GUI input helpers over the machine's built-in usb-kbd + usb-tablet.
Raw QMP
scripts/qmp/qmp.py cmd query-status
scripts/qmp/qmp.py cmd quit
scripts/qmp/qmp.py cmd human-monitor-command '{"command-line":"info usb"}'
GUI helpers
scripts/qmp/qmp.py click 640 480
scripts/qmp/qmp.py click 640 480 --double
scripts/qmp/qmp.py move 100 100
scripts/qmp/qmp.py drag 900 500 400 500 1400 700 # left-button rubber-band drag through points
scripts/qmp/qmp.py key ret # qcodes; chords via +
scripts/qmp/qmp.py key meta_l+q
scripts/qmp/qmp.py type 'hello World_123'
Click coordinates are guest display pixels.
Screenshots
Screenshot capture is intentionally handled by the host helpers, not by QMP.
qmp.py shot, qmp.py screendump, and qmp.py cmd screendump are blocked so a
stale QEMU display surface is not mistaken for the host-owned window.
scripts/screenshot-when-macos-host/screenshot-when-macos-host.sh out.png
scripts/screenshot-when-kde-plasma-host/screenshot-when-kde-plasma-host.sh -o out.png
click / move / drag still size the guest display through QMP
internally. They are input helpers, not screenshot helpers.
Why QMP Screenshots Are Blocked
QMP display capture reads QEMU's DisplaySurface. The host-owned window presents through the Rust
backend and the compositor, so QMP is the wrong observation surface for screenshots. Use
scripts/screenshot-when-macos-host/ on macOS or scripts/screenshot-when-kde-plasma-host/ on KDE
Plasma.
Input delivery is unaffected. click / move / drag / key / type ride
input-send-event to the guest's usb-kbd + usb-tablet, which is display-
independent; they keep working under -display none and the host window. The
pointer helpers still use QMP to learn the display geometry, but input delivery
itself does not depend on QEMU owning the visible window.