Files
reims-vgpu/scripts/lib
Anees IqbalandClaude cdaa8c1a67 🔧 One Return is not reliably the Return that lands, so the consent answer is a retry and belongs to the call
Component: host-side probe harness (`scripts/lib/guest-display.sh`,
`scripts/window-drag-probe/`). No device or Rust change.

`93a1fb67` answered the Apple Events consent panel once, in a dedicated step
before the probe's real work. On macos-12 that was not enough and the probe
stopped with "Safari is running but has no front window" while a screenshot
showed the panel plainly up — the same shape of misreport the commit set out to
remove, one step further along.

Two ways the single press misses, and they pull in opposite directions:

- **The panel is not up yet.** A cold application can take longer to accept its
  first Apple Event than the consent step waits, so the Return goes out before
  any modal exists and the panel is raised later, by one of the probe's own
  queries.
- **Something else takes the keystroke.** The guest desktop raises its own
  transient furniture; a software-update notification arrived during one run.

So the answer is no longer a step, it is a property of the call.
`guest_osa_consenting` runs any short AppleScript and, each time it times out,
presses the default button of whatever modal is up and tries again — three times
by default, `GUEST_CONSENT_ATTEMPTS`. `guest_apple_events_consent` is now a thin
call to it with the smallest query that raises the panel, and the drag probe's
`appwin` helper routes every frame read through it. On a guest that has already
consented nothing changes: the call returns at once and no key is pressed.

Still never blind — the keystroke goes out only after a call has been *seen* to
hang, because that remains the only evidence available that a modal is up.

Verified on a live macos-12 boot (macOS 12.7.6, x86 `reims-vgpu-pci`, KVM,
discrete NVIDIA host). Before: the probe exited 2 at the frame read. After: it
completes, and gives this rail its first driven measurement —

  present_hz / offered_hz  med 57.70  max 59.60 Hz over 25 samples
  draw_us/draw             med 133.64      flush_us/flush med 181.23
  window blocked 0, window wait_us 0 in every sample
  draws_fresh              med 59, draws_stale med 0

The last run's own line reports that the achieved motion rate bounds these, so
they are not this rail's ceiling.

Not verified: the retry was not exercised on a rail that has never consented at
all in this session — macos-12 had already consented by the time it landed, so
what is proven here is that the loop is harmless when there is nothing to answer
and that the probe now completes. Nothing on arm64. No Rust touched, so no
clippy, test or feature-matrix arm applies.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-09 11:19:11 +03:00
..