Commit Graph
371 Commits
Author SHA1 Message Date
Anees Iqbal 56e04b7630 build: --backend both, so the two rails can be compared without a rebuild
The Rust side has carried both rails since the selection commit; nothing could
produce a QEMU that used it. `scripts/qemu-build/qemu-build.sh --backend both`
now does, passing `-Dreims_vgpu_backend=both` to the submodule's meson (its own
commit).

Apple only, checked before meson runs so the message names the build choice
rather than arriving as a rustc error inside a custom target: `both` carries
`backend-metal`, which the crate rejects off macOS because there is no
host-stub Metal arm. The pre-existing metal-only check becomes a `case` over the
two backends that share that requirement.

`AGENTS.md` gains the fourth pathway row and the rule this whole branch is the
consequence of: **a `cfg` may answer only "what did this build compile", never
"which rail is running".** On the fourth row those are different questions and
the compiler cannot tell them apart — a `not(feature = "backend-vulkan")` block
meaning "the Metal arm" disappears silently when both features are on, which is
what `emit_object_cache_levels`, `mipmap` and `exec`'s preflight each did before
`Backend` took those decisions over. The row is documented as a measurement
configuration, not a shipping one.

Verified: `--backend both --target aarch64` configures, compiles and links
`qemu-system-aarch64` on this Apple host, and the linked binary carries both
rails — `compute_mtl_pipeline_ref_zero` *and* `compute_vk_pipeline_ref_zero`,
`MTLCreateSystemDefaultDevice` *and* `vkCreateInstance` — plus `rail_selected` /
`rail_refused` and `REIMS_VGPU_RAIL`. The `--backend vulkan` build was then
rebuilt to leave `vendor/qemu/build` configured as it was found.

Not verified: no guest boot on the both-rails binary. The three shipping
pathways are unaffected — `resolve_rail` returns a single-rail build's only rail
for every input — but the comparison this configuration exists for has not been
run against a guest yet.
2026-08-31 19:41:39 +03:00
Anees Iqbal 76db0dec46 backend: one binary carries both rails, and the running one is chosen at run time
This is what the branch was for. An Apple host reaches its GPU natively through
Metal and through MoltenVK, and those two paths translate the guest's command
stream by completely different means — so when a frame is wrong, "is this a
metal2vulkan defect or a defect in this device" is the first question, and it
was unanswerable without a rebuild that changes the binary, the caches and the
boot. It is now one binary, one guest stream, and one variable.

`lib.rs` no longer rejects `backend-metal,backend-vulkan`. The remaining rule is
"at least one".

`backend::resolve_rail` is the decision, and it is a **pure total function** —
`(Compiled, metal_available, RailRequest) -> RailChoice` — compiled on every arm
so its table is tested on every arm. Needing two live GPUs present to check a
narrowing rule would have put its tests on no arm at all, which is exactly how
the `not(backend-vulkan)` gates this seam replaced went stale unnoticed.
`Compiled` is an enum, not two bools, because "neither rail" is not a build
`lib.rs` permits and a bool pair would make that state representable in the very
table that decides what executes guest work.

The rules, in order of authority:

* What the build carries. One rail compiled is chosen even with no device
  behind it — there is nothing to fall back to, and refusing here would replace
  "the draw found no Metal device", which names the missing device where it was
  needed, with a failure at device create.
* What the host was measured able to run. Metal's probe is one
  `MTLCreateSystemDefaultDevice`. Vulkan has no equivalent by design: its
  context is created lazily at the first encode so protocol tests need no ICD,
  and asking whether an ICD exists *is* that creation. So Vulkan is the fallback
  rather than the preference, and that asymmetry is stated rather than implied.
* What the operator asked, through the new `REIMS_VGPU_RAIL`. **It narrows and
  never widens.** `rail=metal` on a host with no `MTLDevice` is refused, not
  obeyed — obeying it would put every draw in front of an absent device. Naming
  an uncompiled rail, naming an unavailable one, and misspelling one are three
  refusals and not one, because they are three operator mistakes with three
  different fixes.

`env::choice` is the third parse kind beside `switch` and `count`, with its own
registry so `report_line` prints `rail=metal` rather than
`rail=unrecognized(metal)`. `Rail::name` is the single spelling: the env value,
the boot line, every refusal and `Backend::name` all read it.

`REIMS_VGPU_RAIL` is deliberately *not* the build-time `REIMS_VGPU_BACKEND` that
`scripts/qemu-build` and `vm/` read. Two owners, two lifetimes; one name would
make "I set it and nothing changed" ambiguous between "this build has no such
rail" and "the device declined the ask".

Six tests keyed an expectation or a stimulus on `cfg` where they meant the
running rail, and eight more reached `backend::selected()` where they meant a
specific one. Each now says which: `VulkanBackend`/`MetalBackend` by name where
the test is about a rail, `selected().rail()` where the answer legitimately
differs. The mapper's alias test split in two — the rail hands an alias back
once, the heartbeat unmaps what it is handed — because those are two contracts
with two owners and testing them together only worked while a build had one
rail.

`scripts/feature-matrix` gains a fourth cell. It is not a fourth flavour of the
other three: it is the only cell where "which rail did this build compile" and
"which rail is running" differ, so it is what catches a `cfg` that conflates
them — the class that `emit_object_cache_levels`, `mipmap` and `exec`'s
preflight each fell into.

Verified: feature matrix (all four arms, both workspaces rustfmt-clean), clippy
`-D warnings` on metal / vulkan / both, and the full suite serially on metal
(1332), vulkan (2274), both-default (2353), both with `REIMS_VGPU_RAIL=vulkan`
(2353) and with `=metal` (2353). The forced-rail runs are the ones that matter:
the same binary executes the same 2353 tests through either GPU API.

Not verified: no VM boot. Nothing here changes what a single-rail build does —
`resolve_rail` returns that build's only rail for every input — so the shipping
pathways are unaffected, but the both-rails binary has not been run against a
guest and the QEMU build plumbing does not yet offer it.
2026-08-31 19:09:15 +03:00
Anees Iqbal 1bf7f90ce5 contract: the protocol vocabulary cannot name a backend, and now the compiler says so
Component: crates/reims-vgpu (contract, runtime/compute_exec) plus the new
crates/reims-vgpu-contract. Pathway: all three. Structural; no guest-visible
behavior and no rail-specific term.

Contract: the catalogue's F0 item asks for a backend-neutral semantic vocabulary
— decoded enums, descriptors, geometry, pixel formats, pass actions, page
arithmetic, exact refusal values — with Vulkan handles, SPIR-V, memory
placement, descriptors, queue families, image layouts and host capability policy
kept out of it. `contract/`'s own doc already said "pure data and pure functions
only — no guest state, no GPU, no QEMU", and every module in one crate could
reach every other, so the rule held only while someone was reading.

Owner: the crate graph. Behaviour changed: none at runtime. `src/contract/`
becomes `reims-vgpu-contract`, depending on the wire views, the paging walk, and
the decline vocabulary — nothing else is in scope, so a contract check cannot
name an `ash` type, a Metal object, a QEMU type or this device's state by
accident. It is re-exported as `crate::contract`, so no call site moves.

The move produced one thing the doc could not. `Extent3` is shared between this
decoder and the backend it dispatches through, and `compute_exec` carried an
inherent `impl Extent3` whose two constructors refuse with `ComputeStatus` and
read a decoded `Size3` — device vocabulary the contract crate cannot name. The
orphan rule rejected it. They are now `extent_from_wire` and
`extent_from_indirect` free functions in the decoder that owns those types, with
the same arithmetic and the same refusals; the extent type stays shared and only
the narrowing that produces it from this device's wire moved.

`iosurface_pages`' fixtures took the arm64e page size from `model`, which
re-exports the shift from `contract::gva` and widens it locally for its own
address arithmetic. The test now derives the same `u64` from the same shift on
this side of the boundary, so the two still cannot disagree in value.

Test: no new behaviour, so no new regression test; the counts are the claim.
2274 tests in `reims-vgpu` before, 2165 plus 109 in `reims-vgpu-contract` after
— the same 2274, none dropped or silently cfg'd out. The feature matrix's
support-crates cell counts the new crate too.

Verified: `cargo test -p reims-vgpu --no-default-features
--features backend-vulkan,host-window -- --test-threads=1` (2165 + 97, 0
failed); `cargo test -p reims-vgpu-contract -p reims-vgpu-env -p
reims-vgpu-observe -p reims-vgpu-paging -- --test-threads=1` (109 + 13 + 45 +
36, 0 failed); all three main clippy arms plus `-p reims-vgpu-contract`, all
with `-D warnings`; `scripts/feature-matrix/feature-matrix.sh` all cells PASS;
`cargo fmt --all` and `--check`; the rustdoc link pass, whose unresolved-link
multiset is byte-identical to the parent's; a release staticlib build carrying
no test log path.

Not verified: no VM boot and no conformance battery were run.
`reims-vgpu-wire`'s twelve oracle-fixture failures remain inherited debt,
unchanged and untouched.
2026-08-31 14:42:41 +03:00
Anees Iqbal 4fdd3d6efc observe, env: make the layering below the device a fact the compiler checks
Component: crates/reims-vgpu (observe, env, contract, runtime) plus the new
crates/reims-vgpu-env and crates/reims-vgpu-observe. Pathway: all three.
Structural; no guest-visible behavior and no rail-specific term.

Contract: the catalogue's F0 item asks for a backend-neutral vocabulary — a
protocol layer that can name a refusal without naming a backend, with
observability and configuration extracted as behaviour-free support beneath it.
`observe`'s own module doc already made the claim in prose ("the sink must sit
somewhere `translate/` and `caps/` can name their reason type without depending
on `runtime/`"), and nothing checked it: every module in one crate can reach
every other, so the direction held only as a habit.

Owner: the crate graph. Behaviour changed: none at runtime. `env.rs` becomes
`reims-vgpu-env`, and `observe`'s sink, decline vocabulary, `Emit` builder, slug
registry, driver watch, footprint and phase clock become `reims-vgpu-observe`.
Both are re-exported under the paths callers already write — `crate::env::…`,
`crate::observe::fail(…)`, `crate::observe::Decline` — so no call site moves. A
layering change that also rewrote three hundred call sites would be two changes
reviewed as one.

`ladder` and `panic` stay in `reims-vgpu`: both name `runtime` types, which is
precisely the dependency the split is drawing a line under.

The split immediately produced one thing prose could not. `contract::gva_resolve`
carried `impl Refusal for ResolveStatus`, with both the trait and the type now
foreign to `reims-vgpu` — an orphan-rule error, and an honest statement that
`reims-vgpu-paging`'s walk status and `reims-vgpu-observe`'s vocabulary meet in
neither crate. It is now `walk_refusal(&ResolveStatus) -> Option<&'static str>`
with the same twelve slugs, and `MemError::slug` delegates to it exactly as it
delegated to the impl.

Test-only surface: `FailCapture`, `fail_log_path`, `forget_all_latches` and the
slug-collision panic are used by tests compiled separately from the crate that
defines them, so they are gated on `any(test, feature = "testing")` and
`reims-vgpu` turns the feature on from `[dev-dependencies]`. Verified that the
shipping artifact does not: `cargo tree -e features` shows `testing` only under
dev-dependencies, and the release staticlib contains `/tmp/reims-vgpu-fail.log`
once and no per-pid test path, so the background writer and the flood detector
are the ones that ship. The writer's flood machinery is `cfg`'d to the
configurations that use it rather than given an `allow(dead_code)`.

Test: no new behaviour, so no new regression test. The existing suite is the
evidence, and the counts are the claim: 2332 tests before the move, 2274 in
`reims-vgpu` plus 45 in `reims-vgpu-observe` plus 13 in `reims-vgpu-env` after —
the same 2332, none dropped or silently cfg'd out. `scripts/feature-matrix`
gains a support-crates cell so a future module move does not read as the
emptied-arm loss its own warning is about.

Verified: `cargo test -p reims-vgpu --no-default-features
--features backend-vulkan,host-window -- --test-threads=1` (2274 + 97, 0
failed); `cargo test -p reims-vgpu-env -p reims-vgpu-observe -p
reims-vgpu-paging -- --test-threads=1` (13 + 45 + 36, 0 failed); all three main
clippy arms plus `-p reims-vgpu-observe --features testing` and the bare arm,
all with `-D warnings`; `scripts/feature-matrix/feature-matrix.sh` all cells
PASS; `cargo fmt --all` and `--check`; the rustdoc link pass, which loses nine
pre-existing unresolved links and adds none; a release staticlib build.

Not verified: no VM boot and no conformance battery were run.
`reims-vgpu-wire`'s oracle-fixture tests fail 12 cases when the gitignored
fixtures are present. That is inherited debt, not this change: the same 12 fail
identically on the parent, run from a separate worktree with
`REIMS_WIRE_FIXTURES_DIR` pointed at the same fixtures. Nothing here touches
that crate.
2026-08-31 14:37:26 +03:00
Anees Iqbal bde2342fd9 Merge pull request #58 from steelbrain-bot/steelbrain/v6-backport
Backports from v6 branch + metal2vulkan upgrade + fixes
2026-08-31 14:01:14 +03:00
Jiajun Liang 2835b6c032 Enable the x86 macOS / host-Vulkan pathway on Windows hosts
Platform-gated port of the Vulkan backend and its build to Windows:

- lib.rs: allow backend-vulkan on target_os = windows (the gate comment says
  a new port is a deliberate edit to this list; Windows hosts use native
  ICDs, so this is that edit).
- backend/vulkan/engine/context.rs: add the VK_KHR_win32_surface platform
  arm next to the macOS/Linux arms.
- host_window/present.rs: Windows refuses a non-main-thread winit event loop
  unless the application opts in; add the EventLoopBuilderExtWindows::
  with_any_thread opt-in, mirroring the existing X11/Wayland arms.
- scripts/qemu-build/qemu-build.sh: the ninja target and QEMU_BIN path carry
  a .exe suffix on MINGW/MSYS hosts.
- vm/boot-windows.sh (new): Windows boot script — WHPX/TCG selection, the
  standard pcibridge + GOP romfile attach, QMP over tcp (no unix sockets on
  Windows), SSH forward 2222.
- vendor/qemu: bump to the Windows-build shim commit (PR
  steelbrain/qemu-reims-vgpu#2).

Verified on Windows 11 (WHPX + TCG): MSYS2 build of qemu-system-x86_64.exe
with the Vulkan backend; the device initializes on a native NVIDIA ICD
(vk_caps: api=1.4, host_pointer_import=supported), the host window presents
its first frame, the guest firmware installs the reims EFI GOP and the boot
loader proceeds to kernel handoff. Linux: cargo check for
backend-vulkan,host-window passes unchanged; the WSL/KVM pathway is
unaffected.
2026-08-31 09:16:20 +08:00
Anees IqbalandClaude Opus 5 ca66596b83 repro: the aim called a fully open menu "mid-animation" because two settles disagreed by 300ms
Component: menu-close probe (scripts only). Pathway: x86 macOS / Linux Vulkan,
rail macos-15. No product code and no guest-visible behaviour changes.

RETRACTION: `mab-r1-ctl` reported `VERDICT=CLEAN` on the control binary. That
verdict is void, and so is the A/B run it opened. Both self-tests passed, the
metric was sound, and the run still measured nothing.

The settled-open reference waited 1.2 s after the right-click. Every timed trial
waited 0.9 s. The menu is still animating open at 0.9 s, so a fully open menu
photographed by a trial measured 199.697 against a 193.06 reference -- a 6.6 gap
with nothing closing. The aim looks for a frame matching neither settled state,
and 6.6 clears the 4.00 tolerance, so it accepted that static open menu as the
close animation at its very first offset. Every trial then photographed the same
static menu, scored zero new black, and the run reported CLEAN.

The `ANIMATION_NOT_SAMPLED` guard added one commit earlier did not catch it,
because the guard asks the same classifier the same question and gets the same
wrong answer. A guard that shares the defective predicate is not a second
opinion. What was missing is upstream of both: one definition of "the menu is
open". `OPEN_SETTLE` is now that definition and both sites use it -- the same
repair as `grab_at`, which made the aim and the measurement share one dismiss
schedule, applied one stage earlier to the open schedule.

Two further corrections to the calibration, both from this boot's numbers:

The noise floor was measured from two captures 0.5 s apart of one standing menu,
which measures the capture path rather than the trial-to-trial variation that
matters -- each trial opens its own menu. It read exactly 0.000 twice over,
flattering the calibration while missing the 6.6 the trials saw. Each state is
now captured twice through a full open-or-dismiss cycle.

`crop_mean` now measures colour only. The captures are `srgba` and
`%[fx:mean]` averages all four channels, so a constant opaque alpha contributed a
fixed 255 to every reading: this rail's closed desktop and open menu separate by
134 on colour and by 100 with alpha folded in. It also makes this reading and the
scoring metric describe the same channels, which matters more than the
sensitivity -- the metric's previous defect was exactly a disagreement about
which channels were being read.

Verified: bash -n; the alpha contribution measured on this boot's real captures
(closed 92.6 -> 38.5, open 193.1 -> 172.4).

Not verified: no boot has run this version. No menu-close verdict on either
binary means anything yet, and the A/B remains unrun.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 00:05:02 +03:00
Anees IqbalandClaude Opus 5 08b3c2dbe0 repro: the scoring metric was disabled by an alpha channel, and its self-test could not have four channels
Component: menu-close probe (scripts only). Pathway: x86 macOS / Linux Vulkan,
rail macos-15. No product code and no guest-visible behaviour changes.

RETRACTION FIRST: `smoke-ctl` reported `VERDICT=BLACK_RECTANGLE` on the control
binary with `new_black_frac=0.917071` on all six trials. That verdict is void.
Re-scored with the metric below, all six of its frames score exactly 0, and all
six are photographs of a fully open menu. Nothing about the black-rectangle
defect was measured.

Two independent defects produced it.

1. The score was the mask's own mean, not an intersection. The host captures are
   `srgba` -- four channels -- and `-negate` negates every channel, alpha with
   the rest. The thresholded frame came out fully transparent, so compositing it
   over the mask left the mask untouched and `%[fx:mean]` read back the mask:
   0.917071, the same number for every frame of every trial, and large enough to
   trip the 0.10 threshold. The third constant this probe has reported as a
   measurement.

   The metric now flattens with `-alpha off -colorspace Gray` before thresholding
   and intersects with `-evaluate-sequence min`. Darken *is* min, but as a
   composite it is an alpha-aware blend of a source onto a destination, which is
   not the operation wanted; as a sequence operator it cannot be turned into a
   no-op by an alpha channel arriving from a different capture helper. Both
   changes are needed and each fixes the case alone.

   The self-test could not have caught this: it built its images with `xc:` and
   no alpha, so the one channel that broke the metric was the one channel the
   test did not have. It now builds `PNG32:` four-channel images, and it darkens
   the reference's top half against the frame's left half so the answer is the
   0.25 quadrant while *both* operands measure 0.50. The old half-black case
   expected 0.50, which is also what returning either operand untouched produces
   -- the expected value coincided with the failure. On the new images the old
   pipeline scores 0.75 and this one scores 0.25.

2. The aim's tolerance was a flat 3 and the desktop is noisier than that. The
   open menu measured 193.06 at calibration and 199.697 seconds later with no
   input in between. Every later capture of a static open menu therefore read as
   "neither settled state", the aim declared the animation found at its very
   first offset, and all six trials photographed that static menu.

   Each settled state is now captured twice, 0.5 s apart with no input, and the
   tolerance is 2x the larger drift plus 3. A run whose two states are not
   separated by three times that noise floor ends METRIC_BLIND rather than
   scoring the noise. Against this boot's measured values the drifted open menu
   classifies as not-MID, which is what lets the aim keep scanning to the
   offsets where the grab lands after the dismiss.

Verified: bash -n; both metric transitions demonstrated on four-channel images
(0.75 -> 0.25) and on this boot's real frames (0.917071 -> 0); the tolerance
transition checked against this boot's measured settled means.

Not verified: still no boot has produced a menu-close verdict that means
anything, on either binary. The A/B remains unrun.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 23:56:47 +03:00
Anees IqbalandClaude Opus 5 b1c7b531fe repro: the menu probe aimed at a window of offsets the capture's grab never fell in
Component: menu-close probe (scripts only). Pathway: x86 macOS / Linux Vulkan,
rail macos-15. No product code and no guest-visible behaviour changes.

The probe reached its aim stage on a live boot for the first time and refused:
five dismiss delays returned `mean=199.697` to six digits, the same fully-open
menu five times, against `no_menu=92.6` and `menu_open=193.1`. The menu opened
and the metric worked; the frames were simply all taken before the menu closed.

The quantity that decides whether a frame lands in the fade is the offset
between the dismiss click and the moment the capture grabs, and the probe
controls neither directly -- it controls when it starts the capture, and the
grab happens an unknown latency L later inside the helper. The old sweep always
started the capture first and dismissed 0.34-0.50 s afterwards, so it covered
offsets in [-0.50, -0.34]: a 0.16 s window, entirely on the far side of the
grab. No value in it could have sampled the animation.

The aim is now over a signed offset O = (capture start) - (dismiss), so the
grab lands at O + L and a range wider than L + fade crosses the fade without
anything having to know L. A coarse scan over [-0.40, +0.45] brackets it, and
when two neighbouring offsets read open and closed the transition is between
them and four bisections find it. `grab_at` owns that timeline and both the aim
and the measurement call it, because two spellings of one schedule is how they
come to disagree about what the chosen offset means.

The classifier is distance from each settled state, not betweenness. Betweenness
was the obvious spelling and it is blind to this probe's own defect: a black
rectangle where the menu was reads near 0 against a 92.6 closed desktop and a
193 open menu, so it is below *both* settled states rather than between them. A
betweenness test files it as "closed", the aim never finds the animation on a
defective boot, and the one boot carrying the defect is the one the probe
refuses to score. Demonstrated, not reasoned: on this boot's measured means an
all-black frame classifies not-MID under the old test and MID under the new one.

Two guards keep a blind run from reading as a clean one. `classify 0` must
return MID against the means this boot actually measured, or the run ends
`VERDICT=METRIC_BLIND` -- the same shape as the existing scoring self-test, and
run after BASE and OPEN are known because the answer depends on them. And a run
whose trials all drifted onto the settled closed frame ends
`VERDICT=ANIMATION_NOT_SAMPLED` rather than CLEAN, because a settled frame is
uniformly not-new-black and scores zero for a reason that has nothing to do with
the defect.

Verified: bash -n; the classifier transition checked both ways against this
boot's measured means. Not verified: no boot has yet run the repaired aim, so no
menu-close verdict exists on either binary. The prior A/B produced none.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 23:49:54 +03:00
Anees Iqbal 80a0e4043a Unify host screenshot capture
Replace the separate KDE and macOS helpers with one capture-app based path. Capture at native resolution, validate the PNG, and cap output at 720p or optional 1440p while preserving strict window selection and black-frame refusal.

Update probes and documentation to use the unified helper.

Validated with bash syntax checks, Python parsing, diff checks, and a live KDE capture at 3840x2290 downsampled to 1207x720.
2026-08-30 23:38:42 +03:00
Anees IqbalandClaude Opus 5 c9c425fe69 repro: the menu probe's verdict was computed from a quantity that did not depend on the frame
Component: host-driven repro harness (scripts/menu-close-probe). Pathway: x86
macOS / Linux Vulkan, rail macos-15. No product code and no guest-visible
behaviour changes.

This probe could not see a black rectangle. It reported CLEAN because CLEAN is
what a blind metric reports.

How it surfaced: a control binary (with 6277c55d's product change reverse-
applied) and a candidate binary were both run through it, and every trial of
every boot of both arms returned the identical `new_black_frac=0.0829293` --
seven digits, four boots, two different binaries -- while the per-frame `mean`
varied from 141 to 180. A number that does not move when the frames move is not
measuring the frames. 0.0829293 is the mean of `basemask.png`: the wallpaper
crop's own dark fraction.

The cause is one operator. `basemask` was built with `-threshold 6% -negate`,
making it "white where the no-menu frame **is** near-black". The scoring
composite is `Darken`, which is `min`, so the metric computed `near-black now
AND near-black before` -- the intersection. The comment two lines above it
states the intended quantity as "near-black in the frame AND **not** near-black
with no menu on screen", the difference. Over a static wallpaper crop the
intersection is a constant.

Demonstrated, not argued: a synthetic frame with half the box painted black
scores 0 under the old pipeline and 0.50 under the corrected one.

Consequences to record plainly: every menu-close verdict this probe has ever
produced is void, including three CLEAN results on the candidate and one on the
control gathered earlier today. Symptom 3 remains undriven by a working
instrument.

Two changes:

1. The `-negate` is removed from the mask, so `Darken` intersects "dark now"
   with "was not dark before" and measures the difference the probe is named
   for.

2. A `self_test` runs on every invocation and abandons the run with
   `VERDICT=METRIC_BLIND` unless the metric scores a synthetic half-black frame
   at ~0.50. This probe has now shipped two scoring metrics that measured
   nothing -- the first used `%[fx:mean(lightness)<0.06]`, which is not a magick
   expression, so the column was empty on every frame -- and both failed
   silently, and both reported CLEAN, which is the defect's own answer. A CLEAN
   verdict is only worth reading from an instrument that would have said
   BLACK_RECTANGLE if the rectangle were there.

The self-test and the real measurement now call the same `base_mask` and
`new_black_frac`, rather than the self-test building its own mask. That is the
part that makes the guard mean something: with a private copy, a self-test would
pass while the measured path stayed blind, which is precisely the failure being
guarded. Verified by regression: reintroducing the `-negate` inside the shared
`base_mask` drops the self-test to 0 and the run is abandoned.

Verified: shell syntax (bash -n); the corrected pipeline scores a synthetic
half-black frame at exactly 0.50 and the old one at 0; the self-test passes on
the corrected polarity and fails on the reintroduced one.

Not verified: no boot has run the corrected probe. Both arms have to be re-run,
and no statement about symptom 3 survives this commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 20:43:24 +03:00
Anees IqbalandClaude Opus 5 819ccdf946 repro: the web-content probe needed an interpreter the guest is not obliged to have
Component: host-driven repro harness (scripts/web-content-probe). Pathway: x86
macOS / Linux Vulkan, rail macos-15. No product code and no guest-visible
behaviour changes.

Observation: two boots of this rail ran the probe and both exited `rc2` with
"the page never declared a layout". That message reads as a rendering failure
and is not one -- no page was ever served.

The probe's server runs inside the guest and is a `python3` script. macOS ships
`/usr/bin/python3` as a **stub**: it satisfies `command -v python3`, and running
it without the Command Line Tools installed opens a GUI dialog and exits. On a
rail image without them the server never starts, nothing is served, the page
declares no layout, and the only evidence of any of this is a log file inside a
guest that is reverted moments later. Both boots produced the identical message
and no diagnosis, because every fact that would explain it died with the guest.

`--serve host` serves the same page from this machine and points the browser at
the slirp gateway `10.0.2.2`, which removes the guest-side interpreter from the
probe entirely. `probe_server.py` needs no change: QEMU user networking
translates a guest connection to `10.0.2.2` into a host-side connection to
loopback, so its existing `127.0.0.1` bind is reachable and it does not have to
be widened to `0.0.0.0` to be reached. The layout JSON then lands on the host,
so reading a result no longer requires an ssh into a guest that is about to
disappear.

`--serve guest` remains the default. Host serving is very likely better on every
rail, but the rails this probe already measures were measured through the guest
arm and changing their transport underneath them is a claim this change has no
evidence for.

The guest-arm failure message now names the stub and points at `--serve host`,
so the next person meets the diagnosis rather than the symptom.

Verified: shell syntax (bash -n); the host server started and served the probe
page over HTTP (200, 14972 bytes) in a local smoke test with no guest involved.

Not verified: no guest has loaded the page over the gateway yet, so the
end-to-end host-served path is unproven -- the arm that will exercise it is
queued behind the symptom-3 control arm. The guest arm is untouched and
unretested by this change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 20:40:11 +03:00
Anees IqbalandClaude Opus 5 0a585b3884 repro: the menu probe's two anchors were guesses about a desktop it never looked at, and both were wrong
Component: host-driven repro harness (scripts/menu-close-probe). Pathway: x86
macOS / Linux Vulkan, rail macos-15. No product code and no guest-visible
behaviour changes.

Observation: five consecutive graded boots ran this probe and all five exited
`rc2` with "the menu box did not change when the menu opened". That reads as a
menu that failed to appear. Differencing the probe's own two captures on the
boot that did not panic shows 38 % of the screen changing over a bounding box
of the whole display, with the mean moving 106 -> 148. No context menu was
created on any of the five. The right-click raised an application window; the
dismiss click put it behind Finder.

Both of the probe's anchors were positional guesses:

- `ICON_X,ICON_Y = 333,1033`, documented as "the Finder icon, leftmost in the
  dock". On this rail's current snapshot that coordinate is not Finder.
- `AWAY_X,AWAY_Y = 1700,400`, documented as "somewhere with no window and no
  menu". The snapshot boots with an application window open and frontmost, so
  it was beside that window rather than on bare desktop.

Dock layout is precisely what moves between snapshots, guest versions and
running-application sets, so re-measuring the dock would buy one snapshot's
worth of correctness and fail the same way at the next.

The probe now opens the **desktop** context menu instead. macOS places it with
its corner at the cursor, so the rectangle follows from the coordinate this
script itself clicked rather than from a dock it cannot see in advance. The
crop is derived from `MENU_X,MENU_Y` and inset well inside the smallest menu
the desktop produces, because a crop overhanging the menu scores desktop that
never had a menu over it.

What that gives up is stated in the file rather than papered over: the reported
interaction names a dock icon's menu, and this is one step removed from it. The
defect is a property of the menu layer's close-in animation rather than of
which menu it is, but if it turns out to be dock-specific this probe will read
CLEAN and be wrong, and the dock variant will have to be aimed by survey.

Second change, from the same arm: a right-click on this rail has been observed
killing the guest about four seconds later. A dead guest yields frozen,
identical captures, and identical captures score as no new black at all --
which reads as CLEAN. That is the one wrong answer this probe must not give,
because it would report the defect repaired by a boot that died before it could
show it. `guest_gone` marks the serial log's length before the first input and
is consulted at the opening captures, inside the trial loop, and before the
verdict; a run with no trial against a live guest reports GUEST_GONE and scores
nothing.

Verified: shell syntax only (bash -n). Not verified: no boot has run the
re-aimed probe yet, so neither the menu coordinate nor the crop has been
confirmed against a live desktop. The probe's own precondition -- the box must
change by more than 8 mean when the menu opens -- is what will catch it if the
coordinate is still wrong, and it fails loudly rather than scoring.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 20:11:53 +03:00
Anees IqbalandClaude Opus 5 98d66f5387 repro: three inputs arrived inside one eight-second window and no log could say which killed the guest
Component: host-driven repro harness (scripts/input-lever). Pathway: x86 macOS
/ Linux Vulkan, rail macos-15. No product code and no guest-visible behaviour
changes.

Observation this exists for: an arm of five graded boots on this rail killed
its guest three times out of three, each within ~2 s of the menu-close probe's
right-click on a dock icon. Converting each panic's uptime through the rail's
consistent ~11 s firmware-to-kernel offset lands on the probe's own right-click
capture in all three boots -- 140.5 against 140, 142.1 against 142, 136.0
against 136 -- so the association is tight enough to act on and too tight to
have come from an unrelated background event.

It is not, however, an attribution. That probe issues a desktop-wide pointer
sweep, a left-click dismiss, and the right-click inside one eight-second
window. Its logs cannot say which of the three is the lever, and a guest that
dies 2 s after an input is indistinguishable in them from one that dies 60 s
after nothing.

This probe issues exactly one named input onto an identically settled guest and
then stops touching it. The hold afterwards is the measurement rather than a
courtesy: nothing is issued during it, so a panic inside it belongs to the one
preceding input or to nothing at all. The latency is polled rather than slept
through, because "2 s after the input" and "60 s later while idle" are
different defects and a single sleep to the end of the hold reports neither.

The serial log's length is marked before the input, so a panic that was already
present is excluded by construction instead of by reading timestamps -- and a
guest already gone before the input exits non-committally rather than scoring.

`move` is offered but is not the arm's subject: every boot of this harness
already issues five dock-strip pointer moves as its repair sweep, and roughly
ninety historical boots did so without panicking, so pointer motion alone is
already controlled for. The arm that matters is rclick against click against
none.

Verified: shell syntax only (bash -n). No boot has run this probe yet; the arm
that will is queued behind the arm that produced the observation.

Not verified: nothing about attribution to a commit. No control binary has run
this workload, and until one has, none of the above names a cause.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 19:55:08 +03:00
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