Files
reims-vgpu/scripts
Anees IqbalandClaude 93a1fb67dd 🔧 Every GUI probe was written against the one rail that had been clicked through by hand
Component: host-side probe harness (`vm/guest-authorize.sh`, `scripts/lib/`,
`scripts/window-drag-probe/`). No device or Rust change; no pathway behaviour
changes.

Driving a guest's GUI needed four separate things that only the macos-13 rail
had, and each one failed in a way that read as a defect somewhere else. On
macos-11 the combined symptom was `could not read Safari's window frame (pos ''
size '')`, which reads as a compositor that produces no windows — on a rail
whose desktop was on screen at the time.

1. **Apple Events consent has a panel and nobody was answering it.** The first
   `osascript ... "System Events"` from an ssh session raises a modal on the
   guest's own screen; until it is answered the call never returns. Nothing on
   the host can see it. `vm/guest-authorize.sh` now runs a consent probe, and
   *only if that probe is seen to hang* presses Return over QMP's usb-kbd — the
   panel's default button is Allow. The keystroke is never sent blind, because a
   Return at a live desktop is not free. Self-verifying: the same call is
   retried and has to answer. `--no-automation` opts out.

2. **TCC scopes Apple Events per (client, target) pair**, so consenting System
   Events says nothing about Safari. `guest_apple_events_consent` in
   `scripts/lib/guest-display.sh` is the one implementation, called per app.

3. **The probes drove windows through System Events, which needs assistive
   access — and that has no panel to answer.** It is granted by hand in System
   Preferences, and macos-13 is the only rail where someone did. Everywhere else
   `System Events` answers `-25211` and the probe reports an app with no
   windows. Both the frame reads and `reposition.applescript` now go through the
   target application's own Standard Suite (`bounds of front window`), which
   needs only consent 1–2. `bounds` is {l,t,r,b}, so the loop carries the window
   size across steps to move without resizing.

4. **Two guest-side dependencies that are not part of macOS.** `open -a Safari
   about:blank` fails on macOS 11 — Big Sur's `open` resolves a bare argument as
   a path first, so Safari never launched; the probe now opens a local blank
   file, which also keeps the network out of a compositing measurement. And the
   reposition run was timed by a guest-side `python3`, which is a
   Command-Line-Tools stub that raises an install dialog on a rail without them
   and does not exist at all from 12.3. Timing moved to the host, so the guest
   step is `osascript` and nothing else; the ssh round trip is counted into
   elapsed, which understates the achieved rate and never overstates it.

Also: an unreadable frame now names which of the three causes it was, instead of
printing the empty string it got.

Verified on the live macos-11 rail (macOS 11.7.11, x86 `reims-vgpu-pci`, KVM,
discrete NVIDIA host), snapshot `current`. First driven measurement this rail has
ever had — `window-drag-probe --seconds 25 --app Safari` now completes:

  posted 1202 steps in 24.5 s = 49.1 Hz achieved
  present_hz  med 46.65  max 50.00      offered_hz med 46.65
  window blocked 0, window wait_us 0    draw_us/draw med 137
  module_rejected 0 across the whole boot

The device tracked the stressor: 46.7 Hz presented against a 49.1 Hz motion, so
these counters are bounded by the Apple Events round trip and are not this
device's ceiling. The probe says so itself.

Not verified: `--motion drag` still needs clang on the guest and Accessibility
trust, and neither is available on this rail — that path is unchanged and still
reports its own build failure. Nothing here was run on arm64, on macos-12/14/15/26,
or with `REIMS_GUEST_IMPORT=off`; no Rust code is touched so no clippy or
feature-matrix arm is affected.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-09 10:32:50 +03:00
..