Commit Graph
4 Commits
Author SHA1 Message Date
Anees Iqbal 80a0e4043a Unify host screenshot capture
Replace the separate KDE and macOS helpers with one capture-app based path. Capture at native resolution, validate the PNG, and cap output at 720p or optional 1440p while preserving strict window selection and black-frame refusal.

Update probes and documentation to use the unified helper.

Validated with bash syntax checks, Python parsing, diff checks, and a live KDE capture at 3840x2290 downsampled to 1207x720.
2026-08-30 23:38:42 +03:00
Anees IqbalandClaude ac8304ab48 ✨ The dock probe counts which guest processes aborted and on what check, because three of them were dying every few seconds and the screenshot could only show the hole they left
x86 / Linux / Vulkan, macos-26 rail. Tooling only — no device behaviour changes.

`dock-hover-probe` photographed the dock and ranked the device's own refusals, and
on macos-26 that is half the defect. Three guest processes —
`com.apple.dock.extra`, `Spotlight` and `iconservicesagent` — abort in a loop
every few seconds, and a process that dies mid-composite leaves exactly the
reported picture: the parts drawn before the abort present, the effect passes
after it missing. Nothing in this repository could count them, so the loop was
known only as PID churn and its cause not at all.

The probe now harvests the guest's `.ips` reports and ranks them by (process,
termination, faulting symbol). Measured on a driven macos-26 boot: 19 reports,
three processes, **one signature** —

    8  iconservicesagent    [Abort trap: 6]  Metal +[MTLLoader sliceIDForDevice:legacyDriverVersion:airntDriverVersion:]
    6  Spotlight            [Abort trap: 6]  Metal +[MTLLoader sliceIDForDevice:legacyDriverVersion:airntDriverVersion:]
    5  com.apple.dock.extra [Abort trap: 6]  Metal +[MTLLoader sliceIDForDevice:legacyDriverVersion:airntDriverVersion:]

so the three crash loops are one defect, not three. The full stack (in
`kb/macos-26-binary-archive-slice-assert.md`) is RenderBox loading a precompiled
binary archive for an icon, Metal failing to match a slice to this device, and
asserting rather than returning the error its caller is already prepared for.

Two things this had to get right, both of which had already cost sessions:

- **The path.** `scp macos-vm:~/Library/...` does not expand `~` in a remote
  glob, so it matches nothing and fails exactly as a missing file does. Four
  previous attempts concluded these reports are never written; they were reading
  the wrong directory. A remote path with no leading `/` is already relative to
  the home directory. Both it and the system directory are polled — neither
  alone is the population.
- **Which frame to report.** The raise path is two layers, not one, and stopping
  after the first leaves every abort in the tree reading as the same
  `MTLReportFailure`: libc raises the assert and the framework that failed
  reports it. Both are identical for every assert and neither names the check
  that refused. Skipping both is what turns the census from a count into a
  diagnosis.

The census needs ssh and the hover half deliberately does not — a guest whose
sshd never came up can still be photographed — so it is best-effort throughout
and never fails the run. `--no-crash-census` skips it; `--ssh HOST` retargets it.

The reports stay in the work directory and the probe says so: they are Apple's
data and are never committed.

Test: the parser was run against the 19 reports from
`/tmp/dockrun/m26a/ips` and against an empty directory, and `bash -n` is clean.
Proven load-bearing in the direction that matters — before the raise-path skip
it reported `MTLReportFailure.cold.1` for all 19, which is the uninformative
answer this change exists to avoid.

Not verified: no rail other than macos-26 has been run with the census on, so
"macos-15 reports zero" is inferred from that rail booting with no crash loop
and not from the census itself. No Rust changed, so no clippy or feature-matrix
arm is affected.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-10 12:29:02 +03:00
Anees IqbalandClaude 9b69aca199 ♻️ The dock hover is driven from the host, because the rail with the bug has no compiler
The probe committed at 142661e8 could not run on the only rail that shows the
defect, and its first live run is what said so. Three separate guest-side
dependencies fail on macos-26:

- **There are no command line developer tools**, so `clang` is absent and the
  `hover.c` build step requests an installer dialog instead of compiling. This
  also means `window-drag-probe --motion drag` cannot run there; it works only
  because `reposition` (AppleScript) is its default.
- `screencapture` fails outright — "could not create image from display" — so
  `scripts/lib/guest-display.sh`'s `guest_display_size` returns nothing and the
  probe exited 2 before hovering anything. `wallpaper-probe` and
  `modal-button-probe` share that helper and are expected to fail there too.
- The `osascript` desktop-bounds routes (`Finder`, `System Events`) both return
  empty in a fresh ssh session, which has no Apple Events consent.

So the pointer is now driven by QMP `input-send-event` to the machine's
usb-tablet — from outside the guest, needing no guest tooling, no consent and no
permission, and working identically on all six rails. It is the transport
`vibrancy-latch-probe` already uses. `hover.c` is deleted rather than kept as a
fallback: a second path that only works on five rails is a path that rots.

The consequence worth stating is that this probe **no longer uses ssh at all**.
A guest whose sshd never came up can still be photographed, which matters on a
rail that panics during a third of driven boots.

Adds `qmp.py size`, printing the guest display's dimensions. Sizing is not
capture, which is why it is allowed where `shot` is not: a screendump of the
host-owned window shows the wrong pixels but the DisplaySurface it reads still
carries the right dimensions, and that is all `click`/`move`/`drag` have ever
used it for — as the note in `CAPTURE_DISABLED` already said. Exposing it lets a
host-side probe place a pointer in guest coordinates without asking the guest.
Screenshots still go through the host helper, unchanged.

The hover semantics are preserved: a hover is an arrival followed by rest, so the
probe glides in over six sub-moves and then stops sending events, because
re-asserting the position on a timer restarts the window server's tooltip timer
and the tooltip never appears.

Component: `scripts/dock-hover-probe` and `scripts/qmp`, x86 pathway harness.
No crate code.

Not verified: the rewritten probe has not yet completed a run against a live
guest — the boot that exercises it is next. What is verified is the diagnosis it
is built on, each checked by hand against a live macos-26 guest this session:
`clang` absent, `screencapture` failing with that message, and both osascript
routes empty.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-10 04:31:50 +03:00
Anees IqbalandClaude 142661e8ef ✨ The dock hover effect can be asked for on demand, because a hand-taken screenshot is not a regression gate
A user-reported defect on macos-26: hovering a dock icon renders the tooltip as a
flat untextured polygon with no icon highlight, and the dock's own background
comes out mottled rather than blurred. The only evidence was a screenshot taken
by hand, and there was no way to ask for the effect again — so there was nothing
to compare against another rail and nothing a fix could be measured by.
`AGENTS.md` asks for a log- or test-level proxy for a bug class before a visual
fix lands, and this is that proxy for this one.

Component: `scripts/dock-hover-probe`, x86 pathway harness. No crate code.

Two things a screenshot cannot do. It asks for the hover reproducibly: a hover is
an *arrival followed by rest*, not a coordinate, so `hover.c` glides the pointer
in over ~200 ms and then genuinely stops posting. Setting the cursor once
measures nothing because the window server's tooltip timer never starts, and
re-posting the same coordinate every frame restarts that timer forever so the
tooltip never appears — both failure modes produce a plausible-looking screenshot
of no effect at all. And it brackets each hover with the device's own fail log,
so the lines emitted while that effect was composited are separated from the
whole boot's noise, filtered to the fail channel (`grep -v '^OFF '`, since an
`OFF` record carries `reason=` too and ranking without it inverts the queue).

The dock's geometry is not queryable without assistive access, which five of six
rails lack, so the probe hovers a band of slots across the bottom centre where a
default dock sits and reports the coordinates it used. A rail whose dock is
hidden or repositioned yields shots with no dock in them — visibly a miss rather
than a silent one. It does not judge the picture; comparing the shots against a
known-good rail is the reading.

`hover.c` is C for the reason `drag.c` is: the guest's `/usr/bin/python3` has no
PyObjC so `import Quartz` fails, while clang and the ApplicationServices headers
are present. It is compiled on the guest by the harness; no binary is shipped or
committed. Every guest-side call is `timeout`-bounded host-side, and `--rest` is
refused rather than clamped below 2.2 s because the shot lands two seconds into
the rest and a shorter one would photograph a pointer that had already left.

Not verified: this has not yet been run against a live guest. It is committed
before that run because it is complete and reviewable, and the run that exercises
it is the same macos-26 boot that will harvest the crash reports for the process
crashes suspected behind the same defect. Its first run may still need the slot
band or the 44 px icon-row offset adjusted per rail.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-10 04:17:34 +03:00