Commit Graph
157 Commits
Author SHA1 Message Date
Anees IqbalandClaude Opus 5 69602dd5b5 tooling: the menu-close animation had no witness that could sample it
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>
2026-08-30 13:54:30 +03:00
Anees Iqbal 4cbaa00c1d repo: gate formatting in the feature matrix, where nothing else can see it
Component: scripts/feature-matrix/feature-matrix.sh. Tooling only; no product
code, no device behavior, no pathway or rail involvement.

Contract. Formatting is a property of the whole tree under the rustfmt.toml at
the repo root, not of any one backend arm, and nothing else in the toolchain
observes it -- rustc and clippy are both silent on formatting. AGENTS.md
already mandates `cargo fmt --all` followed by `--check` as a required Rust
gate; until now nothing executed that mandate, so the only thing standing
between the tree and unbounded drift was each worker remembering.

Behavior changed. Two cells run before every arm, one per workspace (the root
workspace and crates/reims-vgpu-efi), each running `cargo fmt --all -- --check`
and failing the run on a diff. They run first because they are the cheapest,
need no target installed, and a formatting diff is the one failure nobody
should have to read a compile log to find. The final messages now distinguish
"an arm does not compile" from "the tree is unformatted".

Owning invariant: a missing rustfmt is a FAIL, never a SKIP. A gate that
quietly stands down on the machine lacking its tool is indistinguishable from a
gate that passed, which is the failure mode that lets an arm rot unnoticed.

The v6 original also rewrote AGENTS.md's formatting section. Not carried: this
tree already mandates `cargo fmt`, in stricter terms than that rewrite ("Running
only `--check` does not satisfy it: run `cargo fmt` itself first"). Only the
executable half was missing here, so only the executable half is ported.

Verification actually run. `bash -n` on the script passes. Red witness probed
by hand: appending a deliberately misformatted function to
crates/reims-vgpu-efi/src/main.rs makes the run print
`FAIL rustfmt / reims-vgpu-efi   run: cargo fmt --all` and exit non-zero, with
the diff echoed under its own heading and attributed to the correct workspace,
while the root-workspace cell still reports PASS. The probe was removed by
restoring the file from a copy and verified byte-identical to HEAD with `cmp`;
no git checkout/restore was used. A full `--no-counts` run on the restored tree
then reports all five cells PASS and exits 0: both rustfmt cells clean, metal /
aarch64-apple-darwin, vulkan,host-window / x86_64-unknown-linux-gnu, and
option-rom / x86_64-unknown-uefi.

Not verified. This host is Linux, so the Metal and Vulkan arms are `cargo
check` cross-compiles and no Metal test was run. No VM boot was performed and
none is owed: this commit cannot affect guest-visible behavior. The `--counts`
half of the matrix was not exercised.
2026-08-30 04:47:44 +03:00
Anees IqbalandClaude Opus 5 f0e2d8ab6c scripts: preserve Maps windowed correctness evidence
Backported from steelbrain/stability-fixes-v6 (ca2a6279).

Capture the windowed Maps state and the guest status-item process and preference state before entering full screen, keeping setup prompts and menu-bar defects distinguishable from the scored animation window.

Component: scripts/maps-probe. Pathway: x86 macOS / Linux Vulkan. Rail:
macos-13. No device code changes: host-side shell probe only.

Verified: `bash -n` parses the script. The capture and the guest status-item
query both sit before full-screen entry and before the measurement mark, so
neither enters the scored window.

Not verified: the probe was not driven end-to-end for this commit; it is read
by the next Maps interaction.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 23:58:38 +03:00
Anees IqbalandClaude Opus 5 1481ec6249 scripts: measure Maps after first-run setup
Backported from steelbrain/stability-fixes-v6 (6a02d928).

Dismiss both first-run sheets using their keyboard focus order, preserve immediate and settled captures, and score only the probe's exact interaction window. Keep crash-report freshness and performance counters fail-closed when their identifying context is unavailable.

Component: scripts/ probe harness. Pathway: x86 macOS / Linux Vulkan. Rail:
macos-13. No device code changes: this commit touches only host-side shell
probes, so no guest-visible behavior can move.

Verified: the three scripts parse under `bash -n`. The reverted snapshot's
first-run sheets are the observation this encodes, and the change keeps their
dismissal out of the scored window.

Not verified: the probes themselves were not driven end-to-end for this commit.
Their behavior is exercised when a Maps interaction is next run, which is the
gate that will actually read them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 23:58:28 +03:00
Anees IqbalandClaude Opus 5 36c27f681e vgpu: an integer render target reaches its own format, and a retired ref is retired by its own namespace
Review of this branch. Three defects lost guest work, and the first two share a
cause: a capability mask narrowed below the question its reader asks does not
decline, it answers wrongly.

Component: crates/reims-vgpu contract pixel tables, the Vulkan capability
snapshot and its device probe, the sampled upload rail, and runtime::objects
resolution. x86 macOS / Linux Vulkan pathway, except the object-list half, which
is transport-independent.

## An integer colour attachment had no capability bit, so it was never renderable

`91de82c8` split the two per-layout masks into their own vocabularies and sized
the render-target one by *blendable* layouts. Vulkan mandates no
`COLOR_ATTACHMENT_BLEND` for an integer format, so `Rg16Uint` was in neither
mask, `DeviceCapabilitySnapshot::render_target_layout_supported` had no bit to
read and returned `false`, and `gva_resident_format` built every `RG16Uint`
resident at `RESIDENT_RGBA_FORMAT`. Both Store arms then refused the frame: the
GPU-direct one on `ResidentFormatMismatch` (`held` eight-bit against `want`
`R16G16_UINT`), and the copying one inside `convert_rgba8_to_row`, which has no
integer arm by design and must not gain one.

So `33908f96` admitted the format at `render_target_bpp` and the loss moved one
rung later under a different name. Its boot evidence — `rt_linear_format`,
`clear_dropped` and `mrt_slot_unresolved` all 27/27/108 to zero — measured the
rung that stopped refusing, not the frame.

Three parts, and the probe is one of them because a bit nobody can set is not a
fix:

- the vocabulary is now `TexelLayout::is_render_target_layout` — exactly the set
  the reader asks about. `is_blendable_attachment` is deleted rather than kept
  beside it, so the two spellings that could drift are one function;
- `caps::device_features`'s per-layout probe (`color_attachment_blend` ->
  `color_attachment`) demands `COLOR_ATTACHMENT_BLEND` only of layouts that can
  blend. The old conjunction could only ever answer `false` for an integer one;
- `sampled_layout_linear_filter_if_published`'s "no bit" arm returned
  `Some(true)`, written for the block-compressed layouts alone, so this device
  claimed a `VK_FILTER_LINEAR` on an integer format that no driver advertises
  and that the unpublished arm answers `false` for. The arm splits.

The `bool` that selected between the two masks is a `CapabilityMask` enum, so a
third mask fails the build in a `match` instead of silently widening one arm of
an `if`. Bit budget after: 32 + 8 render-target + 1 + 15 filter + 1 published
+ 1 BC = 57, six spare.

## A sampled integer texture fell into a converter with no arm for it

`linear_native_upload_format` gained an `Rgba32Float` arm and not an `Rg16Uint`
one, so a linear sampled `RG16Uint` returned `None`, took the CPU rung, and
refused as `linear_load_row_convert_unsupported`. The sampled half of that
commit's claim was unreachable; the tests exercised the translate tables and not
the production loader.

The arm is ungated, like `Rgba8Unorm` and unlike everything between them:
Vulkan mandates `SAMPLED_IMAGE` for `R16G16_UINT`, and the capability the other
native layouts are gated on is not this layout's question. Linear filtering of
an integer format is undefined in Vulkan and forbidden in Metal, so the guest's
own validation has already made the sampler nearest before the texture arrives —
the same relationship a draw's primitive type has with its pipeline's declared
topology class.

That whole rule lives in one engine door, `supports_sampled_layout_bind`. The
call site asked the filter query directly, which is why making that query
truthful would otherwise have made the layout unbindable.

## `CmdDeleteObject` retired object-list entries with a ref from another namespace

`47f610c6` wired `retired_entry::retire_ref` to `apply_delete_object`, whose own
`## Separate reference spaces stay separate` section — written directly above the
call — records that this ref is in the serializer's per-kind space, that the
object table is keyed by the kernel object-list ref, and that equal integers
across those spaces are unrelated. The measurement is in that doc: 1 988 deletes
in a 25 s driven boot, not one naming a live object-table ref, 22 colliding with
one under a different task.

So the call could only evict an entry that happened to share the integer, which
drops exactly the packets the store exists to keep — and object-list refs were
never retired on delete at all. It is gone; `retire_ref` with it. Retirement is
by namespace, which is the task's object list.

Three more on the same store:

- **Task teardown retires it.** `define_task` and `delete_task` retire every
  other per-task ledger — objects, resources, sampler and pipeline states,
  `map_audit`, `node_guard`, linear residents, GVA views — and did not retire
  this one. A task deleted and never reused held its entries for the life of the
  `DeviceState`, unbounded in a map whose whole design is "no capacity, no
  eviction"; a redefined id could be answered from the previous generation
  between the redefine and its first `CmdSetObjectList`.
- **The instruments run first.** `note_slot_empty_claimants` and
  `slot_recheck::note_slot_empty` were skipped whenever the recall answered, so
  the two instruments built to measure this miss class read zero exactly when
  the population was largest. `slot_recheck` is the only thing that can still
  contradict the freed reading the recall rests on, so it has to keep sampling
  the slots the recall serves.
- **The census reads the device it is given.** `LIVE` was a process-wide
  `AtomicU64` over a per-`DeviceState` map, so with two devices it reported
  neither while `served`/`unknown` summed across both. `note_drain_tranche`
  takes `&DeviceState`; the per-resolve `store(map.len())` is gone with it.

`ListMiss::SlotEmpty` and `retired_entry` asserted opposite readings of a zero
slot — "not written yet" against "freed". They now agree, on the measurement
that settled it (`slot_recheck` landed zero of 147 verdicts on a slot that later
filled; half the misses were on refs that had already resolved in the same
task), and both name the residual this does not fix: a slot freed, reallocated
and read before the guest's twelve-byte entry lands is zero for a ref that
already names something new. The fix for that is a generation captured at
submission time, which the wire does not carry.

## Docs that no longer described the code

- `render_target_bpp` carried a section headed "`RG16_UINT` is measured, wanted,
  and still not here" arguing the format is refused and naming `rt_linear_format`
  as the live refusal, while `is_render_target_format` immediately below listed
  it. Rewritten as the record of why it is admitted and what the native rail
  discharges.
- `draw::render_target`'s call site said `render_target_bpp` "refuses a format
  with no known bytes-per-texel", which is the width/capability conflation that
  function's own doc identifies as the bug.
- `note_load_action_dont_care` said "nothing is changed here, deliberately" about
  plumbing the ordinal to the pass key — the change `8b50fac5` made — and still
  claimed DontCare and Clear reach `caches.rs` as one key. It is also a latched
  line, not a counter, so the new call sites' "counts the cases" comments were
  wrong about their own instrument.
- Three items were spliced into a neighbour's doc block, leaving the neighbour
  undocumented: `is_integer` into `is_block_compressed`'s, `readback_vk_format`
  into `readback_bytes_per_texel`'s (so the readback-slot safety argument no
  longer sat with the `unwrap_or` it warns about), and `retired_entry::census`
  between `slot_recheck`'s comment and `slot_recheck`. `tight_row_bytes` lost its
  doc outright, including the rule that it answers in blocks for a compressed
  layout.

## Instruments and dead code

- `Phase::PrepSeed` had no `enter()` after `09e491a3` removed the CLEAR-seed
  loop, so `prep_seed_us` was permanently zero — a bar that looks measured and
  measures nothing. Retired with its rail; the span it held is charged to
  `Prep`, and the following ordinals renumber.
- The widened DontCare seed path had no instrument at all: it now walks the LOAD
  doors (a provenance seed clone, or `resolve_type11_load_seed` reading the
  surface out of guest memory) on every pass, and `note_load_seed_outcome` stays
  LOAD-only. `dontcare_seed_served`/`dontcare_seed_empty` are the counters, so a
  boot can say how often the widening pays.
- `EVERY_GATE_OPEN` was a field-for-field copy of `NativeUploads::ALL` with
  nothing comparing them; a fifth gate set in one and missed in the other makes
  `native_bind_is_host_gated` compare two equal answers and skip asking the host,
  reproducing the `RGBA32Float` defect it exists to have fixed. `ALL` widens to
  `any(test, backend-vulkan)` and is used. Its doc also corrects "every gate
  shut": the shut arm is `BGRA8`, because `bgra8` is not a host gate.
- `solid_bgra8` lost its only non-test caller with the seed loop and is `pub` in
  `contract`, so nothing warned. Deleted with its test.
- `write_gva_frame_within` allocated the tight scratch row on the
  `FrameRows::Native` arm, which never reads it.

## Behaviour narrowed without a test

`clear_publish_target` stopped retargeting a clear when the store action is
`STORE` and `resolve_texture_ref` is non-zero — the old code keyed the retarget
on the resolve texture's presence alone. That is the more correct reading and it
stays, but it was uncovered; the case is asserted now.

## The screenshot helper's fallback restored the defect it fixed

`55de1305` narrowed the default selector to an exact caption and then fell back
to the substring match, warning on stderr. The case that reaches the fallback is
the guest window being *absent* — a VM that died, or a boot that lost the
hostfwd race — which is exactly when a larger unrelated window mentioning this
device wins the area ranking, and the capture reports FOUND and exits 0. Failing
is the safe default: a missing guest display is a real result and a picture of
something else is not. The fallback is `--inexact` now.

## Verification

`cargo test -p reims-vgpu --no-default-features --features
backend-vulkan,host-window -- --test-threads=1`: 2225 lib green plus 8
integration binaries, 0 failed, 4 ignored (the gitignored wire fixtures and
three doc tests). Net +1 test: -1 for the deleted `solid_bgra8` case, +2 new.

clippy `-D warnings` exit 0 on all three arms — native vulkan,host-window,
`--target aarch64-apple-darwin` backend-metal, `--target
x86_64-unknown-linux-gnu`. `scripts/feature-matrix`: all arms PASS, warnings=0,
lib=2225 all_targets=2322, no dropped count. `cargo doc` intra-doc link pass:
178 warnings, every one in the pre-existing cosmetic classes, none naming a
symbol this touches.

Two new tests gate the halves that fail silently.
`an_integer_colour_attachment_is_renderable_and_never_filterable` sets the
sampled-filter array for the integer layout deliberately and requires the
snapshot not to read it, so it pins both directions.
`a_deleted_or_redefined_task_keeps_no_remembered_entries` asserts through the
map rather than through a resolve, because a torn-down task misses with
`TaskInactive` long before the recall runs — the leak is invisible to
`lookup_list_entry` by construction, which is why it survived. Verified by
ablation: stubbing the retirement fails it on "the object list these refs index
went away with the task".

## Not verified

No live boot. Every defect above is a rung no counter in this tree reports
today: the RG16Uint Store loss reads as `ResidentFormatMismatch` and a
row-converter refusal rather than `rt_linear_format`, and the sampled one as
`linear_load_row_convert_unsupported`. Confirming any of it needs a driven
macos-15 x86/Vulkan boot read at those slugs, plus the
`REIMS_VGPU_GUEST_IMPORT=off` pair compared on pixels — the copying Store arm is
where two of these fixes land and a host with the import never takes it.

The reused-slot window is designed around, not closed; `slot_recheck` is left
sampling as the instrument that would report it firing, and a non-zero fill rate
there is the signal to retire the recall.

`--inexact` passes `bash -n`; the KWin fallback path itself is untested live, as
it was before.

The `backend-metal` test functions do not run on a Linux host, so the Metal arm
is compile-only for all of this — which covers the `CapabilityMask` const
assertions, since rustc evaluates them on the cross-compiled arm.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015FVCj11zRrQQgLSws6k6zu
2026-08-29 12:59:21 +03:00
Anees IqbalandClaude Opus 5 ce25f8a1bc scripts: a drag reports the pointer rate it achieved, not the one it asked for
`scripts/qmp/qmp.py` — host-side input helper, used by every probe that drives
a guest through QMP.

`drag()` returned nothing and the CLI printed `ok`, so the rate the guest
actually received was never on the record. It is not a diagnostic: an app that
pans by tracking the pointer redraws per motion event and cannot produce more
distinct views than it was sent, so that rate is a ceiling on any frame rate
measured across a drag. A caller reporting frames without it is quoting
whichever of the two is smaller and cannot say which.

`drag()` now returns `(moves, seconds)` for the held glide — the press, its
settle and the release stay outside the timed window — and the CLI prints
`moves=`, `secs=` and `moves_s=`.

The rule is not new here. `window-drag-probe.sh` already computes `posted_hz`
and warns "the counters below are bounded by the drag, not by this device", and
`drag.c`'s header says reporting the device as slow for an under-driven probe
"would be measuring this program". `maps-probe.sh` was written later, drives
through this helper, and sends its stdout to /dev/null.

Two facts the new output established immediately, both recorded in the
docstring because both had been assumed:

- The QMP round-trip is **0.7-0.9 ms** on x86/PCI macos-15 with the device
  idle, so the default `hold_s=0.012` dominates and a drag achieves ~77
  moves/s in-glide. A session had reasoned from an assumed ~20 ms round-trip to
  the conclusion that a 28 fps app was bounded by this loop; the first arm
  refuted it.
- The returned rate is **in-glide**, and a caller spawning one `qmp.py` per
  circuit does not achieve it: ~0.14 s of process spawn between circuits took a
  measured 77/s in-glide down to 54/s sustained, and 1490/s down to 151/s.

Verification: offline against a stubbed transport, `drag()` reports 24 timed
moves per 4-segment circuit and recovers an injected round-trip to within
0.6 ms across three (hold, rtt) pairs. Live on macos-15 x86/PCI, two banded
bare-desktop arms produced the numbers above. No Rust changed, so no clippy or
test arm is affected.

Not verified: the round-trip was measured with the device idle. Whether it
holds while the device is drawing is a separate arm, in flight.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 12:08:54 +03:00
Anees IqbalandClaude Opus 5 55de1305eb scripts: the guest display is selected by an exact caption, not a mention
x86/Vulkan verification tooling. With no selector, the screenshot helper chose
the window to capture with a *substring* test over caption and resourceClass,
then ranked the survivors by area. Any window whose title merely contains
"Reims vGPU" therefore passed the selector, and a maximized one beat the
1920x1080 guest display precisely because it was bigger.

That is not hypothetical and it is not rare: this host has a browser window
captioned "Discord | #general | Reims vGPU - Google Chrome", so a probe that
took the default selector photographed the operator's screen instead of the
VM it had just driven. It reported FOUND and exited 0, so the capture read as
a successful measurement. `scripts/maps-probe` takes exactly that path, and its
before/after pair for a Maps drag was two pictures of a chat client.

Two costs, and the second is the one that made this worth a commit rather than
a `--pid` in one caller:

- a screenshot verdict taken from it is simply wrong, and nothing says so;
- whatever is on the host's screen is written into the probe's outdir, which
  for an unattended sweep means it lands in artifacts nobody reviewed.

The host-owned window's caption is the exact string `Reims vGPU`
(`host_window/present.rs` and `device/window_publish.rs` build the WindowConfig
with it), so equality identifies it and a mention cannot spoof it. The default
branch now filters on caption equality. A caption that has gained a suffix is
still findable — the substring match remains as a fallback — but that selection
is ambiguous by construction, so it emits `:INEXACT` and the shell surfaces it
on stderr with the two selectors that disambiguate. `--window`, `--pid` and
`--match` are unchanged; only the no-selector default is narrowed, so no caller
that already passes a selector is affected.

Verified live on macos-15 with the decoy window present: with a VM up, the
default selector and `--pid <qemu>` now return the same window —
`size=1921x1079 -> 1280x719, mean=87.1741, colors=320981` from both, which is
the guest display's signature. (The two PNGs are not byte-identical and cannot
be: the guest wallpaper animates between the two captures a second apart, so
the size/mean/colour triple is the comparison, not `cmp`.) Before the change
the same invocation selected the Chrome window; its candidate line is what
identified the bug.

Not verified: the `:INEXACT` fallback path, which needs a build whose window
caption differs from this constant to reach. It is a warn-and-continue arm of
behaviour that was previously the unconditional default, so it cannot be worse
than what it replaces. No Rust changed, so the Rust suites and clippy arms are
untouched by this commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 12:08:54 +03:00
Anees IqbalandClaude 4210c0f07f scripts: score a boot on both halves, joined by the timestamp the censuses carry
Component: scripts/boot-score, a new log reader. Reads a fail log and prints one
line per boot; it reads a log and never this repository's source, which is the
whole licence for it to exist under `AGENTS.md`'s ban on source-scanning gates.

It exists because the two mistakes it avoids were both made on real boots.

**Joining by line ordinal drifts.** `drain_duty`, `gpu_span`, `window_publish`
and `store_routes` are emitted from different places and skip different windows —
an idle second costs `gpu_span` nothing and `drain_duty` a line — so pairing them
by position slides within a boot and pulls idle-desktop publishes into a driven
band. The ad-hoc harness that had been scoring driven Maps boots did exactly this
and reported ~31 fps; the same nine logs joined on `t` read **47-52**.

**Ranking on `us/draw` ranks half the change.** On the x86/Vulkan iGPU pathway
`gpu_span busy_us` per draw is the *larger* half — 10-12 µs against 9 µs of drain
CPU — and `(cpu + gpu) x draws/s` accounts for 95-100 % of every busy second
across nine boots of three builds, so the device is saturated, the halves barely
overlap and frames track their sum.

Hence the `occ` column, which is that product: near 1.0 says both halves are the
bottleneck and a microsecond off either converts; well under says something else
paces the guest. And hence `d/frame`, printed because frames are not comparable
across boots without it — `fps = 1e6 / (sum x d/frame)` and the second term is
what the guest chose to draw, which drifts between boots of one binary.

Verified against the boots the numbers above come from, including the
`REIMS_VGPU_PASS_CHURN=on` arm, where it reports the sevenfold GPU move
(9.25 -> 67.64 µs a draw) that made the render-pass boundary the ranking cost in
this device.

No Rust touched, so no clippy or test arm applies.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-16 01:09:48 +03:00
Anees IqbalandClaude 43ac3d177b scripts: bound the Maps probe's zoom drift, which does not cancel
Component: host-side driving only.

The first driven run of this probe disproved a claim its own comment made. The
comment said the four-phase circuit was closed on the zoom axis because phase 1
zooms in by as many wheel ticks as phase 3 zooms out. It is not: Maps clamps at
the world view long before it clamps at street level, so from the regional view
a boot starts at, the out-ticks reach the clamp and are discarded while the
in-ticks all land, and each circuit nets a little further in.

Measured on one driven macos-13 boot: nine circuits at 40 ticks walked the
scale bar from `0 12,5 25 37,5 km` to `0 5 10 m`, which is the far clamp -- so
the back half of that window measured a map that could not zoom any further,
which is precisely the failure the deleted comment claimed to prevent.

Drops the excursion to 12 ticks, which keeps a window of this length inside
both clamps, and replaces the false claim with the asymmetry and the reading
that showed it. The tick count is named as fixed rather than tunable, because
two boots with different phase mixes are not two measurements of one workload.
A much longer run would still need a mid-zoom start; that is stated rather than
implemented, since nothing needs it yet.

Changed now rather than later because no result has yet been scored against
this probe's phase mix, so this is the cheapest moment to re-baseline it.

Verified: `bash -n`. The drive itself was confirmed working on that boot -- the
scale bar and window title both moved, so pan and zoom reach the guest.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-15 17:22:33 +03:00
Anees IqbalandClaude 64a1ee4538 scripts: a sustained Maps pan-and-zoom probe
Adds `scripts/maps-probe/maps-probe.sh`, carrying the same (outdir, seconds)
interface as the sustained-animation and window-drag probes so it drops into
`perf-ab.sh` via `--probe`.

Component: host-side driving only; no device or QEMU code is touched.

Why. The two existing sustained instruments measure a Safari canvas repainting
itself and the window server translating an opaque rectangle. Maps is neither:
it is a full-screen client drawing a tiled vector scene through its own Metal
pipelines, and pan and zoom are the two interactions that redraw the entire
scanout per frame instead of damaging a corner of it. `AGENTS.md` requires a
number to name the probe it came from because two probes rank this device's
costs in a different order; Maps is a third such population and nothing in the
tree could measure it. The `sustained-animation-probe.sh` header has referred
to a `maps.sh` for some time -- no such file was ever in the tree.

Behavior. Opens Maps over ssh, full-screens it with the system Enter Full
Screen binding, parks the pointer, marks the fail log, then drives four phases
back to back for the whole window: a closed rectangular pan circuit, a 40-tick
wheel zoom in, a zigzag pan, and a 40-tick wheel zoom out. The circuit is
closed on both the position and the zoom axis so every round starts from the
same scale; without the closing zoom-out the probe walks to a zoom limit and
the back half of a long window measures a clamped map. The drive loop never
sleeps, because a probe built from discrete interactions spends its wall clock
inside guest animations at zero draws and ranks the device's phases wrongly.

Each pan is a single `qmp.py drag` over a multi-point path, so a phase is one
process and one QMP connection for seconds of continuous motion rather than a
process spawn between every pair of points. Zoom uses `qmp.py wheel`, whose
ticks go over one connection dt apart, for the same reason.

Maps needs Apple's tile servers, which the rails reach only through user-net
NAT, so the probe records a tile-server reachability verdict in the outdir
rather than failing on it: a tileless Maps still exercises the same client
pipelines and is a valid perf population, but a correctness reading from one
would be wrong and the outdir has to say which was measured. Host screenshots
are taken before and after the scored window, outside it.

Verified: `bash -n` only. Not yet run against a booted guest -- no live-VM
result is claimed here, and the phase mix is deliberately fixed so that the
first boot to use it is comparable with later ones.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-15 17:14:21 +03:00
Anees IqbalandClaude 3ac2754b21 scripts: resolve the QMP socket per pathway, and pin one QEMU per perf-ab run
Two harness defects, both of which make a measurement silently not happen.

qmp.py resolved only the arm64 socket
-------------------------------------
`SOCK` defaulted to `vm/guest/run/qmp.sock`, which is boot-arm64.sh's run
directory. boot-x86.sh publishes the same stable symlink in `vm/disks/run/`, so
on the x86 pathway every unqualified `qmp.py` call died with a bare
`FileNotFoundError` on a path belonging to the other host.

That matters more than a wrong default usually would, because AGENTS.md makes
QMP the *preferred* way to drive a guest — it is the one route that works on all
six rails with no guest tooling, no Apple Events consent and no ssh, and the
rails with open defects are exactly the ones where the guest-side alternatives
do not build. A driver script that reaches for it on x86 got a traceback, and a
harness that ran the probe anyway recorded a boot that was never driven.

Now resolved from the two known run directories, whichever is live. A boot
removes its own symlink on the way out, so at most one exists during a boot and
"whichever is there" is unambiguous; the ordering only makes the both-present
case deterministic, and that case is a stale symlink outliving its boot, where
connecting to a dead socket raises rather than driving the wrong VM. `QMP_SOCK`
still overrides. `sustained-animation-probe.sh` already set `QMP_SOCK`
explicitly and is unaffected.

perf-ab did not pin its QEMU
----------------------------
It rebuilt on every boot, so a `--rounds 3 --arms "a b"` run was six builds off
whatever the Rust tree said at each moment. Nothing forced the arms to be the
same tree, and an edit landing mid-run split the sweep into two arms nobody
declared — invisibly, since the results table has no column that could show it.
The last session's journal recorded the same defect in `sweep-rails.sh` as owed.

Builds once up front and exports `QEMU_BIN` for the whole run. Two constraints
are written into the comment because both have already cost a boot here: the pin
must live in the build tree, because QEMU resolves its BIOS datadir relative to
its own path and a copy in /tmp dies on `kvmvapic.bin` before the guest starts;
and it must cross as an exported variable rather than argv, because any command
line naming `qemu-system-x86_64-...` is matched by the
`pkill -f 'qemu-system-x86_6[4].*reims-vgpu'` the next boot issues, which kills
the runner instead of the previous VM. An explicit `QEMU_BIN` in the environment
still wins, so an existing pin can be handed in.

Verified: `bash -n` on perf-ab.sh; qmp.py parses and resolves to the x86 socket
path on this host. NOT verified: no A/B run has completed on this change yet —
the pin path is exercised by the next perf-ab invocation, not by a test.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-15 17:10:54 +03:00
Anees IqbalandClaude dbea1625bd 🔍 The trail named what the wedging draw sampled and not what it sampled it through, and a snapshot's four-day-old crash reports were being read as this boot's
Two instruments and one harness repair. No behaviour change on any rail.

## The sampler was the one hypothesis nothing could observe

`kb/the-sampled-image-is-defined-everywhere-except-the-gathered-vouch.md`
leaves three live: the resolved texture is wrong, the format is wrong, the
sampler is wrong. `SampledNote` answered the first two. The third is not a
property of any texture — all four of the uber shader's unbounded loops sample
through **one** sampler (m2v set 0 binding 67 = guest fragment sampler index 3,
which this device's bands put at 160 + 3 + 288 = 451) — and a `LINEAR` filter
on a texture whose texels are the next UV returns a blend of two cells that is
in neither, so the walk leaves the graph the guest built and never reaches the
terminating zero cell.

`SamplerNote` records the filters, the mip mode, both address modes, the
unnormalized flag, and — the field it exists for — **provenance**. This device
has two routes to a `SamplerResource::normalized_default`, which is
`Linear`/`Linear` and which no guest asked for: a bind whose `sampler_ref` is
`0`, and a binding the residual SPIR-V scan provisions for. A translated guest
sampler that happens to be `Linear`/`Linear` and one this device invented are
the same value afterwards, so provenance has to be recorded where the choice is
made — `g` guest object, `c` AIR constexpr from reflection, `d` this device's
default, `?` a route that did not record one. Printed as
`smpl=N[s451:gNNnee,…]`.

## And the 1x1 texel nobody had ever read

`SampledNote` gains `texel0`, the first four bytes of a CPU-bytes source. For a
**1x1** image that is the entire content, which is the point: the wedging draw
binds one at fragment index 7, one of the two the loops walk, and a 1x1 texture
returns the same texel at every coordinate — so `while sample(uv).x > 0` either
exits at once or never, decided by that one red channel with no undefined
memory anywhere in the story. `kb`'s open question 3, answerable now without a
dedicated boot. Only the bytes rail is read; the gather rail's texels are in
guest RAM and the target rail's are on the GPU, and reading either to write a
log line is not a trade this makes.

## A third silent narrowing site, reported rather than fixed

The type-5 view path folds every format its native table does not name through
`convert_row_to_rgba8`, and said nothing when that quantized. It is the third
CPU convert found doing so. `type5_view_narrowed` is added; the native
half-float arm is **not**, deliberately — this is the video-plane rail, nothing
has measured a type-5 view arriving in a half-float format, and the census is
what should decide. Measure before fixing, in that order.

## The crash-report gate was reading snapshot baggage as evidence

`wait-for-desktop.sh` refuses to log in when the guest holds a crash report,
because a login restarts the session over it. It was treating the **whole
directory** as evidence. These rails boot from snapshots, so a report captured
into an image is in every boot of it forever: macos-12's carries fourteen
`bluetoothd` reports from 2026-08-08, nothing to do with graphics, four days
older than any boot that finds them, and it counted the AppleDouble `._`
sidecars beside them for a tally of 42.

Nothing was lost to it yet — macos-12 reached the desktop this sweep and took
the success path, where the finding is only printed — but the login-window
branch shares the same test and that one exits 3 and skips the rail. On one of
the two rails carrying the standing GPU hang, a gate that always fires is worse
than one that never does, because an always-firing one reads as a finding.

`crashes_since_boot` narrows it to reports newer than the guest's own
`kern.boottime`, taken over the same ssh so no clock comparison crosses the
host boundary, via a reference file (portable where `find -newermt` is not).
Older reports are still collected and still printed — they cost nothing — but
they no longer decide. An unreadable `kern.boottime` treats everything as fresh,
so the failure mode stays "refuse to log in".

Checked against the 42 files macos-12 actually produced: 21 after the sidecar
exclusion, **0** fresh for a boot today, 21 for an earlier cutoff, 21 when
boottime is unreadable.

## Verification

`cargo test … -- --test-threads=1`: 1971 passed / 0 failed, engine parity 52 /
0. Clippy clean with `-D warnings` on all three arms including the
cross-compiled `aarch64-apple-darwin` one.

**Four-rail sweep on `9a57611b`** (one pinned binary, `sweep-rails.sh`,
Safari / Maps / App Store / Contacts / Reminders / Safari-torture /
Launchpad→Screenshot):

| rail | legs | panic |
|---|---|---|
| macos-11 | **7/7 ok** | no |
| macos-12 | **7/7 ok** | no |
| macos-13 | 7/7 ok | no |
| macos-14 | 7/7 ok | no |

The baseline this session inherited was macos-11 **Maps FREEZE** with the
later legs `NO-FRAMES` behind the lost device, and macos-12
**Launchpad→Screenshot FREEZE**. Both freeze rails are clean, and
`sampled_texture_narrowed` — one line on every previous macos-11 boot — is
**absent** from the whole sweep.

## Not verified, and this is the part that matters

**This is n=1 per rail and is NOT reported as a fix.** This repository's own
rule is that a FREEZE eliminates an arm while an `ok` confirms nothing, that a
passing arm needs n>=3, and that macos-11's Maps has produced a fluke pass
before (1 in 15). Repeats on both freeze rails are the next step and no claim is
made until they are in. The instruments above are landed precisely because the
repeats may still freeze.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 19:07:13 +03:00
Anees IqbalandClaude f7acdf7556 ✨ A login window is a WindowServer crash report waiting to be collected, and this harness used to type over it
`scripts/app-sweep-probe/wait-for-desktop.sh`, `sweep-rails.sh`, and the rule in
`AGENTS.md`. No device code.

## What was being thrown away

Every harness here treated the guest's login window as a state to get past.
`wait-for-desktop.sh` typed the password and carried on, and its own doc already
recorded the tell it was walking past: `stat -f%Su /dev/console` answering
`_windowserver` rather than `root` means the guest's **WindowServer aborted**,
measured live on a macos-11 boot.

When it aborts the guest writes a `.ips` report naming the failure — the most
direct evidence this project can get about a graphics failure *inside* the
guest, as opposed to a fence this device gave up on. Logging in starts a fresh
session over the top of it and the next boot's snapshot revert discards the
overlay, so those reports have never once been read here.

It is not a rare state. The `REIMS_VGPU_SAMPLED_IDENTITY=off` boot run today hit
`_windowserver` before its probe had started, and the harness logged in and went
on to report a Maps freeze — attributing to a GPU wedge a boot whose window
server had already died.

## What it does now

The login window is a collection point, not an obstacle:

- `collect_reports` tars `/Library/Logs/DiagnosticReports` and the user's own
  copy off the guest into `--reports DIR`, in one round trip, **before** a
  character is typed. Read without `sudo` on purpose — this file already records
  a guest `sudo` wedging with its timestamp lock held, which queues every later
  `sudo` forever, and a report this account cannot read is worth less than a
  boot.
- A login window with any report behind it **exits 3 without logging in**.
  `--login-after-crash` overrides that and an unattended sweep must not pass it.
- A login window with *no* reports is the benign case this script already
  documented — a guest that never logged in — and it logs in as before.
- The success path collects too. Autologin can restart a session over an early
  abort, so a WindowServer that crashed can have a Dock by the time anything
  looks; the console check cannot see that class and the report can.

`sweep-rails.sh` maps exit 3 to a `WINDOWSERVER-CRASH` row per rail and keeps
the reports under `$OUT/$rail-reports`, because a rail that crashes its window
server is not a rail whose app verdicts mean anything.

## Verified

`bash -n` on both scripts and `--help` renders. **Not verified by a boot**: no
guest has yet been made to produce a crash report through this path, so the tar
pipe and the two directory names are unexercised. The next macos-11 boot is what
tests it.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 17:43:07 +03:00
Anees Iqbal f90784e8a6 ✨ The thing worth pricing on this host is not one of this crate's switches, and the A/B could only express this crate's switches
`scripts/perf-ab/perf-ab.sh`. x86/Vulkan tooling; no crate code changed.

An arm was comma-joined `NAME=value` pairs, every one exported as
`REIMS_VGPU_NAME=value`. That cannot express a driver arm, and a driver arm is
what this host now needs priced: the macos-11/12 GPU hang is Mesa's SIMD16/32
shader codegen — `INTEL_DEBUG=no16,no32` turns the Maps freeze into `ok` with
zero device recreates — so "what would working around it cost" is a question
about a Mesa variable and nothing this device spells.

Running that as two blocks instead would break the script's own first rule. A
macos-13 boot latches one of two compositing regimes for its life and the rate
at which it picks the slow one drifts across a day, so two blocks are two base
rates and the comparison is against the drift as much as the arm. Interleaving
is the only ordering that cancels it, and interleaving requires both arms to be
expressible in one run.

A pair whose name begins with `INTEL_` is now exported verbatim; everything else
keeps the `REIMS_VGPU_` prefix. Values use `+` where the variable wants a comma,
since the arm string is already comma-separated —
`INTEL_DEBUG=no16+no32` exports `INTEL_DEBUG=no16,no32`.

The stale-variable sweep between arms now clears `INTEL_*` as well as
`REIMS_VGPU_*`. Without that a driver arm would leak into every later round and
turn the whole interleaved run into one arm while still printing two — the
failure mode that reads as a result.

Verified: `bash -n` clean, and the arm parser exercised directly on
`INTEL_DEBUG=no16+no32,LAYOUT_CHURN=off`, which expands to
`INTEL_DEBUG=no16,no32` and `REIMS_VGPU_LAYOUT_CHURN=off`.

Not verified: no A/B has been run through the changed path yet — the machine is
booting the SIMD narrowing arms. The `shipping` arm is untouched, so an existing
invocation behaves exactly as before.
2026-08-12 15:31:43 +03:00
Anees Iqbal e807c176f2 🐛 A four-rail sweep was four builds, and the rails are the populations it compares
`sweep-rails.sh` prints one verdict table across `macos-11 … macos-14` and that
table is read as four rails of one device. It was not: `boot-x86.sh` rebuilds
in-tree QEMU on every boot unless `QEMU_BIN` names something else, and the sweep
set nothing, so each rail booted whatever the tree held when its turn came.

Nothing forced those four to agree, and the way they stop agreeing is not
exotic. A sweep takes the better part of an hour. Anyone editing Rust during it —
which is the obvious thing to do with an hour of waiting, and which this session
deliberately did *not* do only because the trap was noticed — splits the run in
two, and the output is a well-formed table that looks exactly like one binary's.
The rails are the populations the table compares; they have to be one build or
the comparison is not one.

So the sweep now builds once, copies the result to a per-run pin, and exports
`QEMU_BIN` for every rail. Three details are load-bearing and each is a rule this
repository already paid for:

- **Exported, never argv.** `pkill -f 'qemu-system-x86_6[4].*reims-vgpu'` matches
  whole command lines, so a pin named on one would match the shell that named it
  and the shell would kill itself. An environment variable never appears in
  `/proc/pid/cmdline`.
- **The pin lives in `vendor/qemu/build`.** QEMU finds `pc-bios` relative to its
  own path, so a copy in `/tmp` dies on `kvmvapic.bin`.
- **A trap removes it.** Otherwise every sweep leaves ~110 MB behind. That is not
  hypothetical: this working tree currently holds 58 such pins from earlier
  sessions, 6.3 GB, none of them cleaned up by the harness that made them.

An operator who sets `QEMU_BIN` themselves keeps it, and the script says which of
the two happened on its own stdout, so a table can be attributed to a build after
the fact.

Component: `scripts/app-sweep-probe/sweep-rails.sh` (x86/Vulkan verification
harness only; no crate code touched, so no Rust test or clippy arm is affected).

Verified: `bash -n` clean. The four-rail sweep that motivated this ran to
completion immediately before it, on one tree, and reported macos-11 1/7,
macos-12 6/7, macos-13 7/7, macos-14 7/7 with **no guest kernel panic on any
rail** — checked by grepping each boot's own stdout, which outranks `probe
exit=0`.

Not verified: the pinned path has not itself been exercised by a full four-rail
run yet — the run above predates this change. The next sweep is that test, and
its first line will say `pinned …` if it took.
2026-08-12 12:57:24 +03:00
Anees Iqbal 490b11f700 🐛 The arm this script calls the first question worth asking is longer than a file name may be
`hang-bisect.sh` names every artifact of a boot after the arm that produced it,
and its own header says a comma-joined arm carrying every narrowing switch at
once is "the first question worth asking: if the hang survives every
optimization being switched off, no optimization causes it and there is nothing
to bisect". That arm is 319 characters. `NAME_MAX` is 255.

So the one arm the script most wants to run was the one arm it could not: the
boot log redirect failed with `File name too long`, and because the script runs
under `set -uo pipefail` rather than `-e`, it carried on and booted anyway. What
it produced was a results row with `stalls=`, `lost=` and `freezes=` all empty
and `probe_exit=1` — which reads as an arm that reached a desktop and drove
nothing, not as an arm whose file names were rejected.

Past 48 characters the tag is now the arm's position within the round, and
`arms.tsv` maps every tag to its full arm string. Short arms are unaffected and
keep naming their own files, so `r1-shipping-fail.log` still reads the way every
existing note about this script says it does.

Component: `scripts/app-sweep-probe/hang-bisect.sh` (x86/Vulkan verification
harness only; no crate code touched).

Verified: `bash -n` clean; the all-switches-off arm now runs to a driven macos-11
desktop and reports `host_pointer_import=disabled_by_env`, so the arm takes and
the boot is scoreable. Not verified: nothing else in the harness changed, and no
Rust was touched, so the Rust test suites and clippy arms are unaffected.
2026-08-12 12:16:30 +03:00
Anees Iqbal 502a69f6c3 ✨ The first draw of a pipeline carries its modules and geometry, and a leg that presented nothing is not a leg that passed
Two instrument repairs, both from one driven macos-11 boot at `285446a6`.

**`recent_pipeline_firsts` records the whole note.** It recorded the ref alone,
which sends a reader to a log line that may not exist: `linux_m2v_resources` is
emitted only for a pipeline whose decoded fixed state the Vulkan request cannot
represent, so the boot that named `pipe=91` eighteen draws before its wedge had
nothing anywhere saying how large that pipeline's modules were or what geometry
it drew. The record was already holding a `DrawNote`; it now keeps it, and the
line reads `[-18 pipe=91 vw=… fw=… WxH vtx=… inst=… fdecl=… fprov=… fgap=…]`.

**`app-sweep-probe` gains a `NO-FRAMES` verdict.** That boot reported five
consecutive legs as `ok  present_hz med=0.0 min=0.0  worst census gap=1.0s`,
after Maps wedged the GPU. Neither existing test can see it: the drain worker
goes on writing one census a second with zero draws in it, so the gap stays at
1.0 and `drain_n` is non-zero. A sweep judged on the verdict column would have
called that boot 6/7 when the device presented nothing after its second leg.
Applied to all three verdict sites — the per-app legs, the Safari torture, and
Launchpad.

What the same boot said about this session's five correctness fixes, stated
plainly because it is the honest reading: `t11seed_cache_refused_guest_wrote`,
`cb_bind_dropped_unfilled_gather`, `wbdebt_superseded_by_skipping_write` and
`sampler_bind_collided` all read **zero**, and so does `t11sample_resident_merged`
— the rung whose payment `17b3aa69` repaired never ran on this workload at all.
Those are real defects with tests, and this rail and probe do not reach them. A
rail that does is still owed.

Verified: `cargo test -p reims-vgpu --lib runtime::gpu_hang_trail` 6 passed, with
the first-draw test updated to the new spelling. `bash -n` on the probe. Clippy
was clean on both arms at the parent commit and this changes no code path outside
the trail's formatting.

Not verified: the enriched line has not been read by a boot yet — that is the
next one, and one macos-11 boot is enough because Maps wedges on every one.
2026-08-12 12:05:01 +03:00
Anees Iqbal 9e4d9e86d7 ✨ One boot per arm sits inside a spread of two to thirteen, so the bisect interleaves rounds and reads the stall
`scripts/app-sweep-probe/hang-bisect.sh` decided every arm on a single driven
boot. Five macos-11 boots of one binary, shipping or near it, logged 2, 13, 6, 2
and 12 kernel `GPU HANG` lines — so every table this script has produced is one
sample from a distribution whose spread is wider than any effect it was looking
for, and three suspects were "eliminated" by numbers sitting inside it.

Changed:

- `--rounds N` wraps the arm loop, so the arms interleave round by round rather
  than running one arm's boots consecutively. An hour of boots drifts the host's
  own state; interleaving puts that drift on both arms.
- Per-round log names (`r<N>-<arm>-*`), so a round no longer overwrites the
  previous one's boot log, probe log and work directory.
- `stalls=` and `lost=`, counted from the device's own fail log, which is copied
  aside before the next arm truncates it. A `sync_exec_lock_hold` is one wait
  giving up and a kernel `GPU HANG` is one reset; several stalls routinely share
  a reset, so the stall count is the better-resolved of the two.
- `panic=`, grepped from the boot's own stdout. `AGENTS.md` is explicit that a
  guest kernel panic can land after the probe has reported success, so an arm
  was previously being scored clean on `probe_exit=0` alone.

Shell-only change: `bash -n` clean. No Rust touched, so no clippy or test arm is
affected. Not yet run end to end — the run it was written for is next.
2026-08-12 11:22:48 +03:00
Anees IqbalandClaude 1e05bb23ea ⚡ A desktop is not a settled device, and the boot that read 3.5 Hz spent its probe window compiling shaders
`scripts/perf-ab/perf-ab.sh` — settle 25 s after the desktop rather than 8 s.

One boot of nine in the first interleaved run scored 3.5 Hz and 1 738 draws/s
against a population of 50-58 Hz and 40-54 000. Its slice holds 69 `air_loading`
records and 6 translates, so the probe drove a guest that was still compiling the
shaders it was about to draw with. That is an outlier a reader has to find and
exclude by hand, and the wait is what it was short of.

The measurements this harness has taken so far are in `kb/` (gitignored) and are
summarised here because they redirect the performance work:

- On this Intel iGPU the chain's phase ranking is **inverted** against the
  discrete host every constant in `AGENTS.md` was priced on: `engine` 55-56 %
  and `store` 21 %, against 28 % and 35 % there.
- This device is **CPU-bound** here — `gpu_span` reads 51-64 % GPU duty while the
  drain worker's own duty is ~1.0 — where `runtime::pipeline_resolve`'s doc
  correctly concludes the opposite about its host.
- Inside the engine phase, `record_us` is **4.84 µs a draw**, ~40 % of the span.
- Both experiments left in the tree for exactly this host class come back
  **null**: `PASS_CHURN=on` and `LAYOUT_CHURN=on` overlap shipping on
  `present_hz` and on `us/draw` over three interleaved rounds.
- `passheld_*` says why the pass merge cannot be the lever here: the dominant
  reason a pass does not survive to the next draw is a **guest buffer gather**
  recorded outside it, on nearly every draw. `PASS_CHURN`'s doc measured the
  reachable share at 82 % on the discrete host; here it is a small minority.

So the gather is both the record cost and the pass-merge blocker. Sparse buffer
binding does not rescue it — ANV's sparse block is 64 KiB and the measured region
is 14.7 KB — which leaves not gathering the same window twice, against a measured
91 % recurrence. That is a cache, it is the shape whose failure is occasional
transient corruption, and it does not get built on a recurrence rate alone.

# Verified

`bash -n`. The measurements above are three plus nine driven macos-13 boots on a
quiesced host, interleaved, one binary.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 11:12:25 +03:00
Anees IqbalandClaude bfa84e7407 ✨ The A/B loop that scores frames, because the hang loop scores kernel resets and neither can be read as the other
`scripts/perf-ab/perf-ab.sh` — new, no crate change.

Every performance constant in `AGENTS.md` was priced on a discrete NVIDIA host.
This machine is now an Intel Arrow Lake iGPU, so the whole verification section's
timings need taking again here, and there was no harness for it: `hang-bisect.sh`
is the same boot loop but scored on kernel `GPU HANG` lines.

This is the boot loop scored on the census. It reuses the race-avoidance the
sweep scripts already carry — `stop-previous-vm.sh`, waiting on the fail log
rather than on ssh, `guest-authorize.sh`, `wait-for-desktop.sh`, a bracketed
`pkill` pattern, arms exported and never passed as argv — and adds the four rules
that belong to scoring rather than to booting:

- arms are interleaved round-robin, because a macos-13 boot latches one of two
  compositing regimes for its life and the *rate* it picks the slow one drifts
  across a day;
- `present_hz` and `offered_hz` are both columns, because the presenter passes
  what it is offered and one without the other cannot say which moved;
- `regime` is a column and the band between the two populations reports `?`
  rather than being binned, so a boot that lands in the empty gap is looked at;
- `probe` is a column, because a bursty interaction probe and a sustained one
  rank this device's costs in a different order.

The per-window census fields are summed and the per-second ones taken as a
median — a mean would let one census second inside a stall outweigh a whole
healthy boot. A `guest kernel panic` in the boot's own stdout overrides the
regime, because it can land after the probe has already reported success.

# Verified

`bash -n` only. No arm has been run through it yet; the first use is the
macos-13 baseline this exists to take.

Also in this commit: nothing else. The 25 s `FENCE_TIMEOUT_NS` probe run
alongside it was restored to 5 s by hand, and its result — negative, the GPU
genuinely wedges and the kernel's own detector agrees — is in `kb/`.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 10:12:44 +03:00
Anees IqbalandClaude 5702597108 🐛 A retire forgets an object exactly as a clear does, and only one of the two told its readers
`crates/reims-vgpu` (both backends; the type is pure logic and its tests run on
every arm), plus the hang-bisect harness under `scripts/app-sweep-probe/`.

# The device change

`BufferWriteGens` hands a reader a `(epoch, gen)` stamp and answers
`quiet_since` by comparing both. The epoch exists so that a *forgetting* cannot
read as "unchanged": the whole-map clear at `MAX` bumps it, and the doc says why
in the direction that matters — an object forgotten silently reports a cache hit
for a window whose bytes moved.

`retire_task` forgot without bumping. Dropping `(5, 7)` at generation 3 and
letting a later task 5 declare three writes to a later object 7 puts the counter
back at 3 under an unchanged epoch, so a stamp taken before the retire compares
equal to one taken after across entirely unrelated bytes. The existing
`retiring_a_task_forgets_its_objects` did not catch it because it retired at
generation 1 and compared against 0, which differs by luck of the count.

Bumped, and only when an entry actually went — retiring a task that declared no
writes must leave every other reader's stamp alone, or task teardown by itself
would report every window as dirty.

Nothing decides a skip on this today; it is the instrument that would license a
content cache, so a false-quiet here is a wrong answer to the question "may a
cache serve these bytes again".

# The harness change

`hang-bisect.sh` took one `NAME=value` per arm and unset three variables by
name. It now accepts comma-joined pairs, so a single boot can run with every
narrowing switch off at once — which is the first question to ask of a hang, and
cheaper than bisecting a set that may contain no cause at all. The clear now
derives its list from the environment rather than from three names written here,
which could not go stale before and now cannot.

# Verified

`a_stamp_that_straddles_a_retire_is_not_quiet` and
`retiring_an_untracked_task_leaves_every_stamp_alone` added; the first confirmed
red with the epoch bump stubbed out (6 passed, 1 failed) and green with it.
`cargo test --lib` filtered to the module: 7 passed. Clippy `-D warnings` clean
on all three arms — `backend-metal` via `--target aarch64-apple-darwin`,
`backend-vulkan,host-window` native and via `--target x86_64-unknown-linux-gnu`.

Not verified: no live boot. The harness change is untested against a real arm
and is exercised for the first time by the run that follows this commit.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 09:30:09 +03:00
Anees Iqbal 19585a934c ✨ A runtime GPU hang cannot be found by sweeping a pool offline, so the blobs are filed with the time they were translated
`scripts/app-sweep-probe/collect-air.sh`, new. Host-side x86 harness.

`m2v_cache::translate_air` writes each blob it is about to translate to a fixed
scratch name per stage in `/tmp/reims-vgpu-m2v-cache-<pid>/`, keeping only the
last one. `bugs/README.md` already describes polling that for a *translation*
defect, where the pool can be swept offline afterwards and the failures fall out.

That does not work for the failure being chased on macos-11. There the SPIR-V is
valid, it compiles, and it then occupies the GPU past the host kernel's 7500 ms
`preempt_timeout_ms` and takes a context reset. Nothing about the blob says so;
the only usable question is *which shaders were translated just before the GPU
stopped completing*, so this files each distinct blob with the wall clock at
which it appeared and the device's own fail log supplies the other half.

It works: on a macos-11 boot whose first `vk_engine_fence_timeout` landed at
device t=73149 ms, the index named three fragment blobs and one vertex blob
translated in one 220 ms burst at t≈68.5 s and nothing else in the preceding
twenty seconds.

`--out` inside the repository is refused. Every byte this writes is Apple's AIR;
`bugs/` is gitignored for that reason but an arbitrary `--out` would not be, so
the rule is enforced by the tool rather than by a reviewer remembering it.

Verified: `bash -n`; the guard refuses a path under the repo and accepts one
under /tmp; the correlation above is from a real boot. Not verified: nothing here
identifies the hanging shader yet — the four correlated blobs translate to 173,
206, 630 and 785 words with **zero** loops between them, so none of them is a
shader that fails to terminate, and the cause is still open. No Rust changed.
2026-08-12 09:00:08 +03:00
Anees Iqbal 9597687a42 🐛 A five-second sleep after killing the previous VM is not long enough for the one boot a sweep most wants to follow
`scripts/app-sweep-probe/stop-previous-vm.sh` (new), wired into `sweep-rails.sh`,
`hang-bisect.sh` and `desktop-rate.sh`. Host-side x86 harness.

All three killed the previous QEMU and then slept a fixed 5-6 s. `AGENTS.md`
already describes what a short wait does — the old QEMU still holds
`localhost:2222`, the next boot dies on

    Could not set up host forwarding rule 'tcp::2222-:22'

and every other line of its output reads like a normal start — but the harnesses
were still guessing at a duration.

The guess fails in the worst possible place. A healthy QEMU is gone well inside
5 s; a macos-11 QEMU that has just taken a GPU reset is inside device recreation
and is not. That is precisely the boot a sweep follows with another one, so the
fixed sleep breaks on the rail under investigation and not on the quiet ones. It
did: in the four-rail sweep at /tmp/reims-rail-sweep3, macos-11 hung the GPU 16
times, its QEMU outlived the sleep, and **macos-12 was reported `no device came
up in 300s`** — a rail scored as a boot failure for a race with its predecessor.

The helper waits on the condition instead: process gone *and* nothing listening
on the port, SIGKILL at the halfway mark, and on giving up it names which of the
two it was still waiting for. Callers warn rather than abort, so a sweep still
runs and still says the boot was at risk.

Verified: `bash -n` on all four; the helper run standing alone with no VM up
exits 0. Not verified: it has not yet been exercised against a VM that is
actually wedged — the case it exists for — because reproducing that means hanging
the GPU again. No Rust changed.
2026-08-12 08:51:39 +03:00
Anees Iqbal 81480edf2c 🐛 The Launchpad leg photographed a running Screenshot.app and reported NO-LAUNCH, because the process is not called Screenshot
Two changes, both from the same sweep's artefacts.

**`scripts/app-sweep-probe/app-sweep-probe.sh`.** The leg asked
`pgrep -x Screenshot || pgrep -f 'Screenshot\.app'`. Neither can match: the app
is a stub that launches
`/System/Library/CoreServices/screencaptureui.app`, and the running process is
`screencaptureui`. So the leg reported NO-LAUNCH on macos-11, macos-13 and
macos-14 while its own `-launchpad-screenshot-app.png` for each of them shows the
capture toolbar on screen — the step had worked every time. The check now names
`screencaptureui`, keeping `Screenshot` as an alternative so a rail that does
spell it that way still counts.

This is the second defect in one leg: the previous commit fixed the trigger (F4
opened nothing), and with the trigger fixed the leg opened Launchpad, filtered
it, launched the app — and still failed itself on the verdict.

**`crates/reims-vgpu/src/runtime/drain/mod.rs`.** Comment only: records the
after-measurement for the ONLINE-poll change. The same setup-to-online interval,
read the same way from five macos-11 boots' own logs, now reads 1, 1, 1, 3 and
4 ms against the 2139-2365 ms before. The wait is gone rather than shortened,
which is what says the divisor was the whole of it.

Verified: `bash -n`; clippy clean with `-D warnings` on the host Vulkan arm (the
Rust change is a comment, so the other two arms are unaffected and were green on
this tree one commit ago). Not verified: `screencaptureui` has not been confirmed
by name against a live guest — it is inferred from the app bundle layout and from
the toolbar being visible in the captured frames. The next sweep exercises it.
2026-08-12 08:25:01 +03:00
Anees Iqbal 6df477a539 🐛 The login-window detector tested for root, and the one login window measured here was owned by _windowserver
`scripts/app-sweep-probe/wait-for-desktop.sh`. Host-side x86 harness.

The branch that types the password fired on `stat -f%Su /dev/console` being
exactly `root`. That is the usual answer before anyone logs in, but it is not the
only one: the macos-11 guest whose WindowServer had aborted answered
`_windowserver`, measured live over ssh alongside `who` returning nothing and
`pgrep -x Dock` failing. Against that guest the branch could never have fired, so
the helper would have waited out its whole timeout on exactly the state it was
written to fix.

The test is now "is this an account a person could log in as" rather than "is it
root": `root` and any leading-underscore daemon account count as nobody being
logged in. An empty answer is treated as an ssh that did not land — it retries
rather than typing a password at a guest it cannot see, which the previous
`case` arm did by accident and this one does on purpose.

Also corrects the reported state to name the console account, so a timeout says
which login window it timed out at.

Verified: `bash -n`. **Not verified against a live login window**, and the run
that prompted this change is not evidence either way: four macos-12 boots with
the helper wired in all reached a desktop, but their logs show it reported
`desktop up (console user aneesiqbal)` every time — the guest autologged in on all
four and the password branch never executed. The earlier 2-of-4 timeout rate is
therefore still unexplained, and 4/4 must not be read as this helper fixing it.
No Rust changed.
2026-08-12 07:31:01 +03:00
Anees Iqbal e212b35cd8 ⚡ Half of macos-12's boots stop at a login window, so the rate instrument has to log in before it can report a rate
`scripts/app-sweep-probe/desktop-rate.sh`. Host-side x86 harness.

Four macos-12 boots: 2 reached a desktop, 2 timed out. Both timeouts were
device-healthy — each boot's kept fail log carries `display_shared_state_setup`
with a valid GPA, `display_online_signal` and `display_online_ack` at t=16-18 s,
and three fail-channel lines in the whole boot, all of them normal display
lifecycle. The device published the display and the guest onlined it. Nobody
logged in.

So the rail's autologin is unreliable at about one boot in two, and an instrument
that scores that as a failure is measuring the rail's login and calling it the
device. It now waits through `wait-for-desktop.sh`, which types the password when
the console is still owned by root, and only what survives that is reported.
`WS-CRASH` stays a separate verdict because it is the one failure in this family
that is ours.

Verified: `bash -n`, and the two timing-out boots' logs were read before the
change — this commit's claim about them is from the artefacts in
/tmp/reims-desktop-rate-12, not from memory. Not verified: `wait-for-desktop.sh`
has still never driven a live login window; the next macos-12 run is its first
exercise and the point of making this change now. No Rust changed.
2026-08-12 07:27:38 +03:00
Anees Iqbal ad78417e40 ♻️ Two sweeps waited for a Dock the same wrong way, so the rail that was waiting for a password read as the rail that never booted
`scripts/app-sweep-probe/{sweep-rails,hang-bisect}.sh`. Host-side x86 harness.

Both carried their own copy of the same `pgrep -x Dock` loop, and both copies
have the defect `wait-for-desktop.sh` was written for: they cannot tell a guest
that is still booting from one sitting at the login window, so a rail with no
autologin times out and is reported NO-DESKTOP. They now call the shared helper,
which asks the console user and types the password when that is what the wait is
for.

For `hang-bisect.sh` this is not only tidier. An arm that never reaches a desktop
drives no applications, so its GPU-hang count is a reading of an idle GPU — and
the bisect scores arms against each other by exactly that count. A NO-DESKTOP arm
silently contributes a zero that looks like the arm having fixed the hang.

Verified: `bash -n` on both. Not verified: neither script has been re-run
end-to-end since the change — a `desktop-rate` run is using the machine. No Rust
changed.
2026-08-12 07:11:36 +03:00
Anees Iqbal 2e042621b7 ✨ The rail that "never showed a desktop" was a window server aborting on our framebuffer, and one boot cannot tell that from a slow one
`scripts/app-sweep-probe/desktop-rate.sh`, new. Host-side x86 harness.

Boots one rail N times and reports how many reached a desktop, keeping each
boot's device fail log and, where there is one, the guest's own crash report.

The failure it exists to catch was found on macos-11 and is invisible to every
signal the sweep already reads. WindowServer aborts about 13 s into boot; the
screen then keeps showing the verbose kernel console because nothing else is
drawing. Meanwhile sshd answers, `guest-authorize.sh` installs its key and
reports Apple Events consented, the device presents ~29 fps of fresh frames, and
the fail log carries no fail-channel record at all. The guest's own crash report
is the only thing that says what happened:

    IOConnectMapMemory VRAM failed: port 0x… error 0xe00002c2
    Failed to create FB 1 of 1 (Failed to map VRAM)
    Assertion failed … CGXMappedDisplayStart … MappedDisplay.cpp

`0xe00002c2` is `kIOReturnBadArgument`, and the refusing party is
`AppleParavirtFramebuffer` — so this is a statement about what this device
published, not about the guest.

It is intermittent, which is why this is a rate and not a boot: of the two
macos-11 boots observed so far one aborted this way and one reached a full
desktop and ran seven applications. The same `AGENTS.md` rule that governs guest
kernel panics applies — a single green run says nothing and so does a single red
one — and a `pgrep -x Dock` loop cannot distinguish "still booting" from
"WindowServer is gone", so both sweeps here have been reporting the second as the
first.

Keeping a failing and a passing boot's fail log side by side is the point: the
difference between them is the bug.

Verified: `bash -n`, and every signal quoted above was read off a live macos-11
boot (crash report fetched to /tmp, not committed — it is Apple's). Not verified:
the script has not completed a full run yet; that is the next step. No Rust
changed.
2026-08-12 07:07:09 +03:00
Anees Iqbal 3779bad897 ✨ A rail that stopped at the login window read as a rail with no desktop, and every signal a harness checks said it was healthy
`scripts/app-sweep-probe/wait-for-desktop.sh`, new. Host-side x86 harness.

macos-12 was reported NO-DESKTOP by a four-rail sweep. It had booted. Its serial
log repeats `IOConsoleUsers: ... lin 0, llk 1` and `gIOScreenLockState 3` — the
login window, with nobody logged in — while sshd answered, `guest-authorize.sh`
installed its key and reported Apple Events already consented, and the device
presented a first frame at 1921x1079. Every signal the sweep reads says the guest
is fine, because it is. The rail simply has no autologin, and `pgrep -x Dock`
cannot tell "still booting" from "waiting for a password".

The console user separates them for one ssh round trip: `stat -f%Su /dev/console`
is `root` at the login window and the account name once a session owns the
console. This waits on the Dock as the old inline loops did, and when it finds
the console owned by root it types the password at the login window through QMP,
host-side, because the guest cannot log itself in. Two attempts at most — the
second leads with a Return for the case where the window is showing the user list
rather than a focused password field — and a timeout now names which of the two
states it timed out in, which the inline loop could not.

The password default is the one `vm/guest-authorize.sh` already documents for
these throwaway rails, overridable with `REIMS_GUEST_PASSWORD`.

Verified: `bash -n`. Not verified against a live guest — macos-12 is the rail it
was written for and the machine is running an unrelated bisect. `sweep-rails.sh`
and `hang-bisect.sh` are not yet wired to it; that is deliberate, since editing a
running bash script corrupts it and the bisect is mid-flight. No Rust changed.
2026-08-12 06:57:49 +03:00
Anees Iqbal abe10c1a39 🐛 The hang bisect died on its first leg, and the freeze detector it needed was switched off by the same flag that was not passed
`scripts/app-sweep-probe/app-sweep-probe.sh`, host-side x86 harness. Three
defects, all found by running the probe the way `hang-bisect.sh` runs it.

**It aborted after the first application.** `run_app` declared `hash` with
`local` and then assigned it only inside `if [ -n "$SHOTS" ]`, so with no
`--shots` the read at the stall check hit `set -u`: `line 218: hash: unbound
variable`. Every arm of a bisect would have reported one leg and a truthy
`freezes=0`, which reads as the arm passing. `shot` and `hash` are now
initialised at declaration.

**The stall detector was gated on where the frame is filed.** Comparing this
app's frame to the previous app's is the probe's only evidence for a host window
that has stopped updating while the census keeps ticking from another thread —
which is exactly the macos-11 symptom the bisect exists to count. It ran only
when `--shots` asked for the frames to be kept. The frame is now always taken,
into `$WORK`; `--shots` chooses whether it is also copied out.

**The Launchpad leg was not opening Launchpad.** F4 is the glyph on an Apple
keyboard, where the key sends a HID consumer usage; QMP's usb-kbd sends the plain
F4 keycode, which macOS has bound to nothing. Photographed on macos-13 and
macos-14 in `/tmp/reims-rail-sweep/shots`: the desktop is unchanged across the
F4, and the eight characters typed after it went into a Maps dialog that was
still frontmost. The leg has been reporting `present_hz` for a static modal on
both rails, under a comment asserting F4 was "the stock Launchpad binding on
every rail here". It now opens it through LaunchServices (`open -a Launchpad`),
which behaves the same on all four rails and needs no Apple Events consent, and
it hashes the frame either side of the trigger: a full-screen blur that leaves
the frame identical did not happen, and is reported as the new `NO-LAUNCHPAD`
rather than folded into `NO-LAUNCH`.

Verified: `bash -n`. Not verified: the `open -a Launchpad` route has not yet run
against a live guest — the next bisect boot is its first exercise. No Rust
changed, so no clippy or feature-matrix arm is affected.
2026-08-12 06:55:41 +03:00
Anees IqbalandClaude bccf1f6004 🐛 A rail reported its desktop as 1920x24 and the probe drove it anyway
Component: `scripts/app-sweep-probe/`. Host-side harness only.

`qmp.py size` reads QEMU's `DisplaySurface`. Under the host-owned window that
is not the surface the guest draws into — it only *usually* still carries the
right dimensions, which is the documented reason sizing is exempt from the
screenshot ban. On macos-11 it reported **1920x24** for a fully composited
desktop, and the sweep took it: the whole seven-application run drove a geometry
that no result can be attributed to, and said `display=1920x24` in its own header
without anything treating that as a problem.

The size is now retried, and if it stays implausible the probe falls back to the
device's own published scanout size — `host_window_start id=1 WxH`, which is what
this device told the window system and the strongest available statement about
how many pixels the guest has. The header names which source won, because a run
driven against a fallback geometry is a different measurement from one driven
against the guest's own, and a reader should not have to guess which they have.

If neither source answers, the run refuses rather than driving blind.

The 400-row floor is not tuned: it sits far below any desktop these rails boot
at and far above the degenerate values seen, so it separates the two without the
probe needing to know the rail's real size.

Verified: `bash -n`, and the fallback pattern parses `1920x1080` out of a real
boot's fail log. Not verified: the fallback arm has not yet been exercised on
macos-11 itself — the rail sweep that found this is still running and a second
VM beside it would measure contention.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 06:39:12 +03:00
Anees IqbalandClaude 07a6110090 ✨ Which rail of this device hangs the host GPU, counted by the kernel and bisected with the narrowing switches
Component: `scripts/app-sweep-probe/hang-bisect.sh`. Host-side harness only.

A macos-11 sweep put six of seven application legs at FREEZE, and the cause is
not a wedge in this device: the host kernel is resetting the GPU —
`i915 … GPU HANG: ecode 12:1:85dff5fb … context reset due to GPU hang`,
fourteen times in four minutes, the same ecode every time. The device survives
each one by recreating, so the guest keeps running, but every recreate loses the
writebacks in flight (`render_store_lost`, `wbdebt_pay_lost`) and stalls the
drain for ten to twenty seconds. That is what the FREEZE verdict measured.

The device's own log cannot name the submission that hung: by the time anything
is observable the fence has already failed with `ERROR_DEVICE_LOST` and the
batch is gone. So the instrument is the kernel's hang count per arm, and the
arms are the `REIMS_VGPU_*` narrowing switches — each turns a rail off without
turning anything on, which is the only direction AGENTS.md allows an override to
move.

Two things it does that a hand-run A/B here has got wrong before: the arm is
exported rather than passed as argv, because a command line naming the arm is
matched by the next round's own `pkill -f`; and the capability line is read back
from the boot's log into the results table, so an override that was silently
ignored cannot be scored as an arm that ran.

Verified: `bash -n`. Not verified: not yet run — the rail sweep that motivated
it is still going, and running a second VM beside it would measure the
contention rather than the device.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 06:36:15 +03:00
Anees IqbalandClaude 30b035b9ec ✨ The loop around the app sweep, carrying the four rules a hand-run rail sweep has got wrong
Component: `scripts/app-sweep-probe/sweep-rails.sh`. Host-side harness only.

`app-sweep-probe` judges one boot. This is the loop across rails, and
everything it does beyond looping is an AGENTS.md rule that a hand-run sweep has
previously got wrong:

- the panic verdict outranks the probe's, because a guest kernel panic can land
  *after* the probe reports success — so the boot's own stdout is grepped for
  `guest kernel panic` after the probe, and reported per rail beside its exit;
- the wait is on the fail log and not on ssh, because the previous boot's QEMU
  outlives its script long enough to hold localhost:2222, and a new boot that
  loses that race dies on the hostfwd rule while ssh answers at once from the
  *old* VM — which attributes every number to the wrong guest;
- one character of the pkill pattern is bracketed, or the pattern matches the
  shell issuing it;
- every rail is authorized, because only macos-13 carries the ssh key and
  BatchMode turns a password rail into a silent 'not up yet';
- the Dock is waited for, because sshd answers well before the desktop
  composites and a probe started at port-open photographs the progress bar.

Verified: `bash -n`. Not verified: this commit is the runner only; its first
real sweep is the next commit's evidence.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 06:30:28 +03:00
Anees IqbalandClaude 87552c3490 🐛 The black-frame guard was measuring the alpha channel, so it read a solidly black boot as max=255 and waved it through
Component: `scripts/screenshot-when-kde-plasma-host/`. Host-side harness only;
no device change.

The guard exists so a black capture is never read as evidence that the guest
rendered black. It could not fire, and the cost was immediate: a whole driven
boot of a solidly black window was captured seven times, measured "max=255
mean=63.7673 colors=30" each time, passed as good frames, and used to judge a
six-application rail sweep that reported `ok` for every leg.

Two independent faults, and fixing either alone still passes a black frame.

**It measured alpha.** `%[fx:maxima]` and `%[fx:mean]` are taken over every
enabled channel, and spectacle writes RGBA with fully opaque alpha. On a black
frame that is max=255 and mean=63.75 — which is 255/4, three zeroes and an
opaque alpha, and the give-away that it was never looking at the picture.
`-alpha off` makes both numbers describe what is on screen; the same capture
then reads max=22, mean=0.024.

**max is the wrong statistic even with alpha off.** A black *window* capture is
not uniformly black: the corners are rounded and anti-aliased against the
desktop behind them, so max=22 is still over the max<=8 threshold and would have
passed a second time. Its 717 non-black pixels out of 920 320 are all corner
artifacts.

So there is now a second arm on `mean`, threshold 0.5. The margin is wide in
both directions: the black capture is 0.024, twenty times below; a composited
desktop measures 94-99, two hundred times above; and the darkest frame worth
keeping — a macOS boot screen, black but for the Apple logo — is around 1.0 by
that logo's area and brightness alone. The two arms report separately, because
"nothing bright anywhere" and "black but for a handful of edge pixels" are
different failures and the message should say which.

The die message now also names the device as a possible cause. It listed only
capture-path explanations, and this week the cause was the device: guest RAM was
being gathered as garbage through a truncated host-pointer import.

Verified against three real captures: the archived black boot (max=22
mean=0.0244) is refused by the new arm; a live composited Ventura desktop
(max=255 mean=98.9) passes end to end through the real script; `bash -n` clean.

Not verified: no synthetic frame near the 0.5 boundary was constructed, so the
threshold's headroom is argued from the three measurements above rather than
bisected.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 06:29:37 +03:00
Anees IqbalandClaude 7c0435cea7 ✨ Launchpad is three loads, and photographing the blur skips the two that matter
Component: `scripts/app-sweep-probe/`, host-side probe harness. No device change.

The Launchpad leg opened the layer, photographed it and pressed Escape. That
captures the full-screen blur and nothing else, and the blur is the easiest of
the three things Launchpad does.

It now types `screenshot` into the search field — which has focus the moment
Launchpad opens, so no click is needed — and presses Return. Two loads the
photograph missed:

- the grid re-filters live on every keystroke, icons fading out and the
  survivors re-laid-out, once per character;
- Return launches Screenshot.app out of the blurred full-screen layer while
  that layer tears down underneath it. A real app launch out of a full-screen
  composite is the step that has to survive; the static blur is not.

Two screenshots now, `-launchpad.png` and `-launchpad-screenshot-app.png`, so
the two states are separable when one of them is the wrong one.

New verdict NO-LAUNCH, asked *before* the Escape that tears the capture UI down
rather than after — `pgrep` for Screenshot is the only evidence that the Return
landed on Screenshot rather than on whatever else the grid had filtered to. It
is not a device failure, but it is not a pass either: it means the leg's whole
point did not happen and the counters are a blurred desktop's.

Screenshot.app presents a floating capture bar rather than a window, so it is
dismissed with Escape, not Command-Q.

Verified: `bash -n`. Not verified: no rail has run this leg yet.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 05:52:04 +03:00
Anees IqbalandClaude 9dba0338ed ✨ Six stock applications and a tab-churning Safari, judged on the census that stops rather than the one that complains
Component: `scripts/app-sweep-probe/`, host-side probe harness. No Rust or QEMU
change; nothing in the device moves.

Every probe in this tree drives one motion of this repository's own choosing —
`window-drag-probe` repositions a window, `sustained-animation-probe` runs a rAF
loop, `spotlight-probe` opens one panel — and all three measure throughput. None
answers whether an ordinary user opening ordinary applications gets a freeze or
a panic, which is the question a rail sweep has to answer.

The six targets are not interchangeable stressors. Safari is layer-backed
compositing and tab churn; Maps is the only stock app holding a high-frequency
render loop open with no user input; App Store populates a collection view
asynchronously so its draws arrive in bursts separated by real idle; Contacts
is a vibrancy sidebar; Reminders is list animation and sheet presentation; and
Launchpad blurs the entire desktop, which is the largest single composite these
guests perform.

Three verdicts, and they fail differently:

- FREEZE is a gap in `drain_duty` wider than 8 s. Every census in this device is
  written at the *end* of a drain tranche, so a drain thread that never returns
  emits nothing while `display_vbl` and `host_window_loop` keep ticking from
  other threads — the boot then reads healthy. The gap is measured from each
  line's own `t=`, device milliseconds, never from the host clock.
- GUEST-GONE is the guest not answering ssh. The panic verdict itself stays with
  `vm/boot-x86.sh`, which owns the serial log and exits 126; this probe supplies
  the evidence, not the name.
- STALL is two different applications photographing byte-identical. A latched
  compositor is invisible to every counter this device has, and only the
  screenshots can see it — which is why they are hashed rather than left for a
  human to leaf through.

Driving is host-side over QMP's usb-tablet and usb-kbd, per AGENTS.md: a
guest-side probe does not degrade on macOS 26, it fails to build. Launching is
the one step that still needs ssh, and it is bounded by `timeout` so its failure
reports as a launch failure rather than as a device result.

`present_hz` is reported per app but is explicitly not a ranking instrument
here — AGENTS.md records that a bursty interaction probe measures the gaps
between its bursts, so these rates must not be quoted against a code change.

Verified: `bash -n` on the shell, and the reducer run against a captured driven
boot log from `journal/`, where it returns a 1.0 s worst gap over 76 drain
censuses and 65 cadence lines with 0 alarms — i.e. it reads a healthy boot as
healthy. Not yet verified: no rail has been swept with it, and no FREEZE or
STALL verdict has been observed firing against a known-bad boot.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 05:51:05 +03:00
Anees IqbalandClaude e4a725bffc 📝 The probe this harness was told not to rank changes with is the one that separates them disjointly
Component: `scripts/gpu-load-probe/gpu-load-probe.sh` — header doc only. No
behaviour change; `bash -n` clean.

That probe's header opened by explaining that the sustained-animation probe had
saturated: ~26 800 draws and ~76 presented frames a second whatever the device
did, drain duty 0.83, and a 3.9 us/chain saving worth under 0.1 % of `draws_s`.
The conclusion drawn from it — "a probe the device cannot fall behind cannot rank
a device change, in either direction" — is the first thing a session reads when
choosing how to measure, and it is now wrong.

Both premises have moved. The presenter no longer clamps at ~41 frames a second,
and the device is faster: drain duty is 0.55-0.58 and a fast-latching macos-13
boot presents 109-119 Hz. On that tree the twenty-four interleaved boots of
`f1765e27`, scored over their fast boots only, separate **disjointly** on this
very probe — 113.2 Hz mean against 105.5 for a device doing 20.6 % more GPU work
per draw, the slowest shipping boot above the fastest slowed one — while
`us/draw` overlaps across the same fourteen boots.

Corrected in place rather than appended to, with the original reading kept and
marked as taken on a slower device, because the *shape* of that argument is still
how a saturated probe should be recognised if one ever saturates again. The
second claim further down — "it remains the arm for ranking a change" for the
reason "that probe reaches duty 0.83 and this one does not" — is repaired to rest
on the disjointness instead, since the duty figure it cited is no longer the one
that boot produces.

This probe keeps its own job, which the same paragraph already stated: loading
one particular rail harder than a compositing page does, which is why it is worth
having even when it is not the ranking arm.

Verified: `bash -n` clean. No boot — this commit changes no code and asserts no
new measurement; the numbers quoted are `f1765e27`'s captures re-read in
`e196a3b0`.

Not verified: macos-13 / x86 / Vulkan / one discrete host. Whether the sustained
probe saturates again on a future faster device is exactly the thing this doc now
tells the reader to re-check rather than assume.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 01:27:16 +03:00
Anees Iqbal 4d4e79b2b9 📝 Spotlight does not crash on the macos-12 rail, over 32 driven rounds on two boots, and the results list renders correctly
Investigating a report of Spotlight crashing on macOS Monterey. Two driven boots
of `macos-12` (macOS 12.7.6, 21H1320), x86 macOS / Linux Vulkan, at
`ccefe3b0` — 19 rounds and 13 rounds of open, type a query, walk the results
list, close.

**It does not reproduce.**

- Spotlight's pid is **390 before and 390 after** the second boot's 13 rounds, so
  it did not die and relaunch — the check `pgrep` alone cannot make.
- No guest kernel panic in either boot's stdout, which is the verdict that
  outranks a probe's own exit.
- No new crash report in `~/Library/Logs/DiagnosticReports` or
  `/Library/Logs/DiagnosticReports`. The newest entries are `bluetoothd` and
  analytics files that predate the boot.
- Dock alive at the end of both runs.
- The typed state photographs correctly: the search field holds "safari", the
  results list is populated and categorised, the top hit is highlighted and the
  preview pane is drawn. The vibrancy surface behind it composites correctly.
- The device's own window over the rounds holds six `sampled_resident_reclaimed`,
  five `translation_deferred`, and four `type4_backing_fail` — each of the four
  paired with its own `type4_backing_recovered` 1-10 ms later, which is the
  guest finishing a mapping the device asked about early. No loss.

What that negative does *not* cover, stated so nobody reads it as broader than it
is: one rail, one snapshot, one input pattern, keyboard-only, no results opened
by Return, and nothing typed that would reach a network or index-rebuild path.
A crash that needs a particular query, a cold Spotlight index, or a mouse-driven
result would not have been found here.

Also fixes the probe flaw that boot exposed: `cmd+space` *toggles*, so a round
starting with the window already open closed it and typed into whatever had
focus — one round in three photographed a bare desktop. It now escapes first, so
every round starts from the same state whatever the last one left behind.
2026-08-11 15:23:41 +03:00
Anees Iqbal 65a61ce078 ✨ A Spotlight probe, driven from the host, because a crash inside the guest is invisible to every counter this device has
A report of Spotlight crashing on macOS Monterey needed a way to reproduce it,
and Spotlight is worth a probe of its own regardless: its window is the guest's
heaviest *vibrancy* surface — a live blur of what is behind it, re-laid-out on
every keystroke as results arrive, over a desktop that keeps compositing
underneath. Nothing else a rail reaches by default combines a live backdrop blur
with a window whose geometry changes several times a second, and three rails here
care: the sampled-image resolve, the geometry-keyed render-target registry, and
the writeback.

Host-side over QMP — `cmd+space`, typed ASCII, arrow keys — so it needs no guest
tooling and no Apple Events consent, which matters when the thing being measured
is a crash: a probe that needs ssh cannot survive its own subject.

Two things it does that a first version got wrong and are the reusable part:

- It records Spotlight's **pid before and after**. A relaunched Spotlight has the
  same name and a different pid, so `pgrep` alone reports a crash-and-restart as
  a healthy process.
- It photographs the *typed* state, not only the end. A screenshot taken after
  the last `esc` shows an empty search field, and an empty search field is what a
  closed Spotlight and a Spotlight that never received a keystroke both look
  like — the second being a probe bug that reads as a clean result.

First run on macos-12 (macOS 12.7.6), 19 open/type/close rounds, driven:
**no crash.** Spotlight alive, Dock alive, no guest kernel panic, no new crash
report in either DiagnosticReports directory, and the device's own window holds
nothing but six `sampled_resident_reclaimed`, five `translation_deferred` and
four `type4_backing_fail` that each carry their matching
`type4_backing_recovered` 1-10 ms later. The report does not reproduce on this
rail from this input.

That first run's typed state was not photographed, which is why the probe now
does — the negative above is only as strong as the evidence that the keystrokes
landed.
2026-08-11 15:19:52 +03:00
Anees Iqbal 92ce92f1b1 📝 The slab retention removes every block allocation the WebGL dial was making, and costs the guest nothing to keep them
x86 macOS / Linux Vulkan, macos-13, `gpu-load-probe` at `layers=8&boxes=6&verts=60000`,
four interleaved driven boots of one binary (on/off/on/off), 40 s windows, host
quiesced. `REIMS_VGPU_SLAB_RETAIN`:

```
                        on1     off1     on2     off2
slab_block events         0      396       0      419
  of which ev=alloc       0      198       0      210
vk_alloc_sites delta      -    128:8192MiB:208ms   -   128:8192MiB:187ms
draw_us/draw (median)  62.6     77.5    59.5     74.1
present_hz (median)     5.8      5.8     5.8      5.8
duty (median)          0.12     0.13    0.13     0.12
```

The churn is gone rather than reduced: **zero** block events in a 40 s window
against ~400, which is 128 fewer `vkAllocateMemory` calls, 8 GiB fewer bytes
asked for and ~200 ms of driver time returned per window. Per-draw cost is
~20 % lower and the two arms are disjoint at 2v2.

`present_hz` does not move, and is not expected to: this dial's guest burns
~1.1 cores across its vCPUs to produce six frames a second while the drain
worker sits at duty 0.12, so nothing this device gives back becomes a frame
here. It is the arm that measures the churn, not the arm that measures frames.

Not verified: the effect on a saturating load. The sustained-animation probe
allocates ~4.6 blocks a second against this dial's ~8, so the same change is
worth roughly half as much there and it has not been booted.

Also lands the reading that reframes the WebGL collapse, and the instrument for
the next step. `scripts/qemu-thread-census` over these four boots puts the guest
at ~112 % of one core spread across eight vCPUs with the drain worker at ~0 and
`qemu-main` at 11 % — so the collapse is the guest computing, not this device
being slow and not a vCPU spinning on a register. Whether that computation is
Safari on the GPU or a software rasteriser the guest fell back to is the next
question, and the page now answers it directly: the WebGL context reports its
vendor, renderer, unmasked renderer and version by fetching a path the host's
server has no file for, so the answer lands in the server log. There is no other
route — the guest has no developer tools, and no counter here can see a decision
the guest made before reaching this device.
2026-08-11 14:04:46 +03:00
Anees Iqbal e33c755ed4 ⚡ The idle drain handed back the image-slab block the next frame re-allocated, on every workload that leaves a gap between frames
x86 macOS / Linux Vulkan, `backend/vulkan/engine/pools`.

The idle drain fires every `IDLE_DRAIN_INTERVAL_MS` (100 ms) whenever the poll
heartbeat ticks — which is *most passes* on any workload that does not saturate
the drain worker, because the heartbeat ticks whether or not the guest is
publishing. Every fired pass trimmed the image slab's empty blocks to zero,
overriding the hot release path's own `SLAB_KEEP_EMPTY` (2) churn budget between
two frames of a live animation.

The HOST_VISIBLE buffer pools were already protected from exactly this by
`SETTLED_PASSES_FOR_BUFFER_TRIM`, and their own comment states the reason: "a
live workload crosses a block boundary and back several times a minute and
re-crossing costs a whole block allocation". The DEVICE_LOCAL image slab was
trimmed from the caller, outside that gate, and so was not.

Measured on a driven macos-13 boot of the load probe's WebGL dial: **257 block
allocations against 162 idle trims of a 64 MiB block in a 25 s window**,
alternating one for one about eight times a second, where the compositing load
that saturates the drain worker read 39 in the same window. `vk_alloc_sites`
prices a `slab_block` allocation at ~1.2 ms on this host (352-288 allocs and
367-289 ms across two censuses 5.7 s apart), plus the `vkFreeMemory` that is not
timed. The sustained-animation probe churns too — 186 allocations and 155 trims
over one boot's log, and 284 on the boot of the same binary that latched 59 Hz.

The trim now runs from inside `trim_recycle_pools`, under the same settled state
as the buffer pools, through `idle_slab_trim_keep` — one policy, one call site,
so the two cannot drift apart again. `REIMS_VGPU_SLAB_RETAIN=off` restores the
old behaviour for the A/B; it narrows in the sense `env`'s module doc requires,
retaining strictly less memory and reaching no allocation the retaining arm
would not also reach.

Tests: 1871 + 82 pass, 0 failed (3 + 2 + 1 ignored: the wire fixtures, which are
gitignored on this checkout). New test
`idle_slab_trim_tests::an_unsettled_idle_pass_does_not_trim_the_image_slab`
fails without the gate — it would read `Some(0)` for both arms. Clippy clean at
`-D warnings` on all three arms including the cross-compiled Metal one.

Not verified: the frame-rate effect of the change. The A/B needs two driven
boots and the probe it was found with had to be fixed first (below). The `off`
arm of the switch is not reachable from the test suite, which shares one
`OnceLock` across every test in the binary.

Also: the load probe now jiggles the pointer between two corner pixels every
20 s. The guest's display sleeps, and a probe that only animates does not stop
it — a 145 s window read `display_vbl delivered=1607` frozen across two
censuses, every QEMU thread under 20 % of one core, and the page's leg
boundaries arriving exactly on schedule. A sleeping display reads as a device
that stopped.
2026-08-11 13:54:37 +03:00
Anees Iqbal a37c4f6cdc ✨ A per-thread CPU census of QEMU, because every counter this device emits measures this device
A driven boot of the WebGL dial produces six frames a second with the drain
worker's duty at 0.12. The fail log can say the device was idle seven eighths of
the time and cannot say who held the other seven eighths — a computing guest, a
vCPU spinning on a device register, and everyone asleep waiting on a round trip
all read identically there, and only one of the three is this device's bug.

QEMU names its threads, so a `/proc/<pid>/task` census separates them: a hot
`CPU n/KVM` is the guest computing, a hot `qemu-main` with a cold drain is a
guest blocked in a register write the shim handles inline, and four cold threads
against a full wall clock is a latency problem rather than a throughput one.

Costs two `/proc` reads a second. Written as its own script rather than inside a
probe because it works for any workload; `gpu-load-probe` runs it for the length
of its window.

Verified: parses and reports on a live process on the host (the field-14/15 read
counts back from the end of the line, so a thread whose name contains a space
does not shift it). Not yet run against a boot.
2026-08-11 13:46:15 +03:00
Anees Iqbal 49af089720 ✨ The load probe can raise draws, fragments and compositor blur, and walk a list of dial sets in one boot
The three dials this page had all raise *bytes*: composited surfaces, a vertex
upload, a texture upload. What a paravirtualized GPU costs is per draw — decode,
bind resolution, descriptor build, recording — so none of them could ask the
question a real 3D application asks, and the one that came closest (`verts`)
collapses the guest into its own JavaScript engine before it reaches this
device.

Three more dials, each landing somewhere the existing three do not:

- `gldraws=N` splits the WebGL frame into N `drawArrays` calls with a uniform
  write between them, so the frame's *command stream* grows while its bytes do
  not. This is the axis a paravirt device is actually priced on.
- `fragcost=K` puts K loop iterations in the fragment shader. It costs the guest
  nothing at all, so it moves ring backpressure and nothing else — which is how
  a reading says whether it was bounded by this device's CPU or by the GPU
  behind it.
- `blur=R` puts an R-pixel `backdrop-filter` on every box over a static
  patterned backdrop. The window server pays it, on the GPU, with no JavaScript
  per frame.

And `?scan=a=1,b=2;c=3&legsecs=S` walks a list of dial sets, one document each,
S seconds apart. A boot costs minutes and a leg costs seconds, so a question
about which dial moves which rail is answered by one boot instead of one boot
per dial set. It navigates rather than opening tabs or iframes, so exactly one
document is ever live; each boundary is announced by fetching a path the host's
server has no file for, and the probe cuts the fail log by byte offset when that
404 lands — which needs no mapping between the host's clock and the device's.

Verified: the page's script dry-runs under a DOM shim on the host for both a
flat dial set and both documents of a scan (the list-carrying one hands over to
leg 0, a leg document arms its own boundary timer). Not yet run against a guest;
that is the next boot.
2026-08-11 13:37:53 +03:00
Anees IqbalandClaude 23a6e3080f 📝 The load probe's WebGL dial collapses the guest rather than the device, and the layers dial is the one that drives the gather rail hardest
Pathway: x86 macOS / Linux Vulkan. Probe only; no device code.

Four driven macos-13 boots of one binary put numbers on the three dials, and
one of them does not do what the probe was written to make it do.

  dials                                     duty   draws/s  gather regions/s
  (sustained-animation probe, for scale)    0.83    26 800           427 000
  layers=24&boxes=6                         0.68    11 525           270 807
  layers=16&boxes=6&verts=30000&tex=512     0.14     1 390            34 976
  layers=8&boxes=6&verts=60000              0.11     1 017            26 592

**Any WebGL at all collapses the guest to ~1 000 draws a second at duty 0.11.**
The device is then idle seven eighths of the time and the boot measures
Safari's WebGL path rather than this device — the exact failure the probe
exists to avoid, one layer further out. The dial is kept and documented as not
usable for ranking, because the collapse is worth being able to reproduce in
one command; it is not quietly left looking like a working axis.

Two fixes went in first, so the reading above is not measuring the page:

  - the vertex array is built once and only re-uploaded. The first version
    rewrote all `verts * 2` floats per frame, which at verts=90000 gave 1 329
    draws/s at duty 0.12 — indistinguishable from the collapse above, and
    caused by the page rather than the guest. `bufferData` re-uploads the whole
    array regardless, so eight mutated entries per frame keep the device
    traffic and stop a browser eliding the call.
  - the 2D canvas draws two fills rather than twenty-five, for the same reason:
    the upload is `tex * tex` either way and the rest was guest paint time
    bought at the device's expense.

`layers` is the axis that works, and its value is the *shape* rather than the
size: at 24 layers it drives 23.5 gather regions per draw against the sustained
probe's 15.8, so it is the heavier arm for anything about the guest buffer
gather despite the lower absolute draw rate. Nothing here beats the
sustained-animation probe for total device load, and the doc now says so.

Verification performed:
  - the four driven macos-13 boots above, quiesced host, `bash -n` on the script
  - each boot's dials are recorded in its own `load-url.txt`

Not verified: `tex` has not been measured on its own, and no rail but macos-13
has run this probe.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-11 08:08:59 +03:00
Anees IqbalandClaude f7bd9eadd8 ✨ A probe with a dial on each of the three big rails, because the sustained-animation one has saturated and can no longer rank a device change
Pathway: x86 macOS / Linux Vulkan. New probe under `scripts/`; no device code.

`sustained-animation-probe` has stopped being able to measure this device on
macos-13. The guest produces ~26 800 draws and ~76 presented frames a second
whatever the device does underneath, and the drain worker sits at duty 0.83 —
it has idle time. A measured 3.9 us/chain saving in the pipeline span moved
`draws_s` by less than 0.1 %, and `slot_us` rose 77 -> 129 ms/s with
`ring_retire_blocks` 291 -> 496: the worker spent exactly what it saved
waiting, because there was no more guest work to do with it.

A probe the device cannot fall behind reports "no effect" for a real win and
for a real regression alike. That is the failure this replaces, and it is not
fixed by running the old probe longer or more often.

`gpu-load-probe` makes each guest frame heavier rather than asking for more
frames — which is also the only thing a page can do, since the frame rate is
the guest's own display cadence. Three dials, because they land on three
different rails and a change can help one and hurt another:

  layers=N   composited surfaces          -> the writeback / store rail
  verts=K    per-frame WebGL bufferData   -> the guest buffer gather rail
  tex=W      per-frame 2D canvas repaint  -> the sampled-image rail

The gather axis is the one nothing else here reaches. On a compositing load
`buffer_guest_gather_bytes` is 5.8 GB/s over 427 000 transfer regions a
second — the largest GPU cost left in the device now the writeback scatters in
one dispatch — and a CSS page barely exercises it. A WebGL canvas that
re-uploads its whole vertex buffer every frame does exactly that, and the
shader is deliberately trivial so the cost lands on the gather rather than on
fragments.

Determinism follows `anim.html`'s rule and for its reason: every step is per
frame, nothing in the content reads the clock, so two boots draw identical
content per frame and differ only in how many frames they get through. Layer
promotion is forced with `backface-visibility` plus a 3D transform rather than
hinted with `will-change`, which that page measured to be advisory often enough
to split boots of one binary into two clusters 24 % apart.

The URL is written to `<outdir>/load-url.txt`, so a result read later says
which load produced it. Two boots at different dials are two workloads, not two
readings.

Verification performed:
  - `bash -n` on the script; the shim `kb/harness/gpuload.sh` (gitignored)
    drops it into `ab.sh` as `AB_PROBE` the way `anim.sh` does

Not verified: **this probe has not been run against a guest yet.** It is
written to the same interface and the same serving pattern as
`sustained-animation-probe`, whose shape it copies deliberately, but no boot
has confirmed Safari renders the page, that WebGL is available on the macos-13
rail, or what the dials are worth in counters. That is the next thing to do
with it, and until then no number may be quoted from it.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-11 07:40:16 +03:00
Anees Iqbal 10f385db93 📝 Forcing layer promotion did not remove the probe's bimodality, and the three boots that said it had were a coin flip
Component: scripts/sustained-animation-probe (README only). Retracts the
validation claim in 7bed8f6b; the page edit in 4506c690 stands.

What happened
-------------
4506c690 made `anim.html` force layer promotion instead of hinting it, on the
hypothesis that a declined `will-change` was why boots split into two tight
clusters — ~420 draws per presented frame against ~268, 24 % apart in
`present_hz`.

7bed8f6b recorded three boots, all promoted, `present_hz` spanning 1.5 %, and
said in as many words that this was consistent-with rather than proven: at the
observed one-in-five collapse rate, three boots miss the collapsed cluster by
chance about half the time.

The seventh boot since the change collapsed — **265.8 draws per presented
frame**. Tally is now 6 promoted, 1 collapsed, about 14 % against 2 in 10
before. That is not a reduction; it is the same rate resampled.

What changes
------------
The README stops claiming the split is narrowed and says the split is still
here. Classification with `drain_duty draws` over `window_publish fresh` is
restated as mandatory rather than as a residual check, with the practical
consequence spelled out: plan a sweep expecting to discard about one boot in
seven, instead of assuming three boots an arm will land together.

The page edit is kept. It is correct on its own terms, costs nothing, and
eliminates one real candidate cause, which narrows what is left to look at. It
is simply not the cause.

The part worth keeping
----------------------
A three-boot green run against a one-in-five failure is not evidence — it comes
up about half the time. The only reason this did not land in the tracked docs as
a wrong "resolved" is that the probability was written down beside the reading
at the time instead of the verdict. That is now the note the README leaves.

Verification
------------
Seven driven macos-13 boots since 4506c690, x86/PCI/Vulkan, quiesced host, one
pinned QEMU binary per group: 424.8, 427.7, 427.6, 419.5, 420.0, 422.0, 265.8
draws per presented frame. No Rust changed, so no clippy arm, feature matrix or
test run applies.

Not verified: why the guest picks a regime. That remains open and is now known
not to be the promotion hint.
2026-08-11 04:11:00 +03:00
Anees Iqbal 7bed8f6bf8 ✅ The forced promotion holds across three boots, and the probe's present rate now spreads 1.5% where the clusters sat 24% apart
Component: scripts/sustained-animation-probe (README only; no code changed
since the previous commit made the page force promotion).

The reading
-----------
Three driven macos-13 boots, x86/PCI/Vulkan, one pinned QEMU binary, quiesced
host, 40 s each:

  boot   draws/frame   present_hz med   offered dropped
  1          424.8         40.95            4.9 %
  2          427.7         41.55            5.7 %
  3          427.6         41.30            5.6 %

All three sit inside the promoted band (417.9-429.0 draws per presented frame).
None landed in the collapsed one. `present_hz` spans 1.5 % across the three,
against the 24 % the two clusters sat apart before.

What this does and does not establish
-------------------------------------
It does not prove the split is gone. At the previously observed one-in-five
collapse rate, three boots miss the collapsed cluster by chance roughly half the
time, so 3/3 on its own is weak evidence and is recorded as such in the README.

The part that is not weak is the spread. Three boots drawn from a bimodal
population would be expected to straddle the modes about half the time too, and
these do not — 1.5 % is the within-cluster reproducibility the ten-boot sweep
already measured, not a narrow sample of a wide population.

A side reading that corrects the handoff
----------------------------------------
The presenter's dropped-frame share is **4.9-5.7 %**, not the ~20 % carried
forward from a pre-promotion boot, and `busy_acquire` is 0 on all three. So the
single-in-flight `WindowPresenter` is worth at most ~5 % of offered frames here,
not ~20 %, and the multi-flight rework that number was justifying is not the
lever it looked like. Measured, not assumed: the earlier figure came from a boot
taken before the probe was deterministic.

Verification
------------
Three boots as above; each `verdict.txt` is `ok` and no boot-stdout carries
`guest kernel panic`. No Rust changed, so no clippy arm, feature matrix or test
run applies.

Not verified: arm64/Metal (the probe is host-side and pathway-neutral, but no
arm64 boot was taken), the other five rails, and `REIMS_VGPU_GUEST_IMPORT=off`.
2026-08-11 03:44:29 +03:00
Anees Iqbal 4506c690eb 🔧 The animation probe forces layer promotion rather than hinting it, because the hint left the instrument bimodal by 24%
Component: scripts/sustained-animation-probe (host-side probe page; no device
code touched, no pathway-specific behavior).

What changed
------------
`anim.html`'s eight bands were promoted to composited layers by
`will-change: transform`, which is advisory — a compositor is free to decline
it. Ten driven macos-13 boots of one pinned binary, same snapshot, same probe,
same quiesced host, split into two tight clusters and landed nowhere between
them: 417.9-429.0 draws per presented frame against 267.7-268.5, and a
`present_hz` median of 39.1-41.7 against 49.0-50.6. Eight of ten drew the first.
Which cluster a boot drew was uncorrelated with the constant under test.

That 24% gap is larger than any device effect measured against this probe, so
the instrument could not resolve a real 17% change, and would credit the cluster
to whichever arm happened to draw it. That is not hypothetical: a cap sweep read
as a clean curve with a peak, and the repeat of one arm disagreed with itself by
more than the whole spread.

So the page stops hinting. `.band` carries `backface-visibility: hidden` and
`tick()` writes `translate3d(x%, 0, 0)` in place of `translateX(x%)`.

Both halves are load-bearing, and this is the trap in the obvious fix: `tick()`
assigns `style.transform` every frame, so a `transform: translateZ(0)` written
into the CSS rule is overwritten on the first frame and the change reads as
having been made while doing nothing. The 3D transform has to be in the JS.

Why this is the collapsed cluster's cause
-----------------------------------------
A band that is not promoted is repainted into its parent rather than composited,
which is fewer and larger draws — matching the collapsed cluster's 1.57x lower
draws per frame, its higher `draw_cover_loaded_partial_scissor` share, and its
*higher* present rate on *fewer* draws. It is the guest asking for less work per
frame, not this device delivering more.

Verification
------------
Not verified. This is a hypothesis about why the clusters exist, implemented;
the reading that confirms it is three driven macos-13 boots all landing in the
promoted cluster, and it has not been taken yet. A follow-up commit carries the
result and retracts this if the split survives.

No Rust changed, so no clippy arm, feature matrix or test run applies. Boots
taken before this commit are not comparable to boots taken after it, whichever
way the reading goes.

`drain_duty draws` over `window_publish fresh` remains the discriminator, and
AGENTS.md still says to classify a boot before comparing two — this narrows what
the classification has to reject, it does not remove the need to look.
2026-08-11 03:36:38 +03:00
Anees IqbalandClaude 507e70adb4 ✨ A driven boot can be sustained rather than bursty, because the probe that ranked every cost in this device was idle 60% of its own wall clock
Component: scripts/sustained-animation-probe (new), a third driven-boot probe
alongside the window-drag and window-server ones. No device code changes.

What it is. A full-rate animation page served by the HOST over QEMU's user-net
gateway (10.0.2.2:8123), opened once in Safari over ssh and then left alone for
the measured window. Takes (outdir, seconds) and writes window.log, the same
interface the other probes take, so `AB_PROBE=` reaches it unchanged.

Why. `AGENTS.md` says an undriven boot measures an idle device. A *bursty*
driven boot measures the bursts' gaps, which is a different error and does not
read as one: Mission Control and Launchpad each cost the window-server probe
~2 s of wall clock per round, so whole seconds of it have literally zero draws.
Nothing in its capture says so — the counters are self-consistent and the log is
well-formed.

What that cost. On macos-13, one build, one quiesced host, minutes apart:

                      bursty probe      sustained animation
  present_hz median          2.8 Hz        38.9 Hz (n=40, 35.5-42.9)
  drain worker duty     0.00 med/0.39     0.91 med (0.89-0.93)
  chain store                 10.3 %                16.7 %
  chain engine                49.0 %                54.0 %
  chain pipeline               6.2 %                13.8 %
  draws/command buffer          3.68                  6.19
  per-chain total             129 us                42.4 us

The duty row is the one that decides what is worth fixing: only the sustained
arm makes the drain worker the bottleneck, so it is the only arm on which a
per-draw CPU saving can become frames. That explains a standing pattern in this
repo's history — a bounded pipeline cache, a 39 % cut in submissions and a
twentyfold cut in `stage_us` each bought real microseconds and zero frames, all
three measured on a workload whose worker was idle.

It is also a far tighter instrument. Every figure above is a 40-sample median
whose min and max sit within ~10 % of it, against a bursty probe whose
`present_hz` spanned 0.3-13.3 and whose duty median was 0.00.

Reproducibility is the reason the page is local. A probe whose workload can
change under it cannot be A/B'd, and the rails have no reason to have working
DNS. Everything the page draws steps per *frame* and never per wall-clock
millisecond, so two boots draw identical content per frame number and differ
only in how many frames they complete. It loads both rails: eight `will-change`
layers the window server composites separately, and a canvas repainted every
frame so texture content is uploaded and not only re-composited.

Verified: two driven macos-13 boots on the current build, host quiesced, stock
GPU clocks, no guest kernel panic in either. The numbers above are from
/tmp/anim1. No host input lands inside the measured window, so nothing in the
capture is the probe's own cost.

NOT verified: any other rail (macos-11/12/14/15/26), the arm64 pathway, or a
host without VK_EXT_external_memory_host. The full-screen keystroke is Safari's
ctrl+cmd+f and is not checked for effect — a rail where it does not take
measures a windowed page, which is a lighter but still sustained load.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-11 03:00:54 +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