Commit Graph
4 Commits
Author SHA1 Message Date
Anees Iqbal 839b8ae9ca ✨ The gate was blind to the two classes that lose guest work most quietly
`scripts/visual-gate` is this repo's stated sign-off harness — three probes plus
a budget over the silent-loss counters — and it watched six classes. Two that
belong were not among them, and both read zero on every boot in the tree, which
is exactly the state in which a gate is worth adding rather than argued about.

Component: `scripts/visual-gate`. Harness only; no device code touched.

- **`render_unimplemented`** — the class a green run hides best. AGENTS.md
  already says it in so many words: an `Ok` from `render::decode` is not a
  decode, because `Kind::OtherAccepted` is the catch-all for "no arm claimed
  this". The draw completes, the guest is stamped, and the only trace is this
  one line. It is deduped per opcode, so the count is a count of *kinds* lost.
- **`device_info truncated`** — the device-info reply could not carry every
  capability key the guest's own key-table length admits. The guest asks once
  per boot, frees the buffer and answers every later reader from what it
  parsed, so a firing is a capability gone for that boot's life.

Both enter `baseline.tsv` at **0** with their measurement written beside them,
which is the file's own rule: zero is the default and needs no argument, a
non-zero budget is an admission about the device. `render_unimplemented` is zero
across all seventeen archived boots, driven and idle; `device_info truncated` is
zero by construction on the guests measured here — a whole page of pair slots
against a table of a few dozen keys.

The parser is proved to see them rather than assumed to. `self-test.sh` gains
three cases: one per class firing on text quoted from the emitter, and one
asserting an `OFF `-prefixed lookalike is *not* counted — the channel inversion
AGENTS.md warns about when ranking `reason=` slugs. Its class-count guard goes
6 → 8, which is what caught the headers this commit also fixes; that guard
exists so a class can never quietly stop being parsed.

Verified: `self-test.sh` PASS, 17/17 cases. `counter-budget.sh` against the
archived driven boot at this branch's head
(`journal/2026-08-06-driven-boot-at-head.log`) prints all eight classes at 0 and
exits 0. Synthetic firings of both new classes take it to exit 1. A full
`visual-gate.sh --quick` on a live x86/PCI boot of this head passed earlier this
session — 3/3 probes green, counters all zero over 1.27 MB of fail log — but
that run predates these two classes; what covers them is the archived-log check
above, not that run.

Not verified: no live gate run since the classes were added, and neither class
has ever been observed firing on real hardware — that is the point of the zero,
not a gap in it.
2026-08-06 15:10:55 +03:00
Anees IqbalandClaude 1ebf7a8f88 ✨ A failing probe now says which region, in the gate's own output
The gate printed each probe's verdict line and nothing else, so a failure read
"9 of 20 captures with a region that did not measure its declared colour" and
stopped there. The probes name the region, the trial and the colour they
measured, on their own lines, and without those a reader has to re-run with
`--keep` to learn anything — by which time the boot that produced the failure is
gone. That is not hypothetical; it happened on the first real failure this gate
caught.

A failing probe now has up to `FINDING_LINES` (10) of its own output echoed under
its verdict. Ten covers every trial of a `--quick` run and the first ten of a
full one, which is enough to see whether one region is failing repeatedly or
every region failed once — a distinction that decides where to look next.
Bounded because a probe failing every trial would otherwise bury its own verdict.

Component: `scripts/visual-gate`. No Rust and no device behavior.

Tests: `self-test.sh` still 14 cases, green; `bash -n` clean. The echo path
itself is not covered — it is reachable only from a failing probe, which needs a
guest.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-03 04:08:31 +03:00
Anees IqbalandClaude 8796a9b40b 🐛 The gate's first live run refuted its own premise: two of the six classes are not zero
The gate specified in the plan asserted that all six silent-loss counters read
zero, so any non-zero reading was a failure. Its first full run, on unmodified
9e3969b with no code change under it, read

  visual-gate: FAIL — full mode, 3/3 probes green, counters over 4825975 B of
  fail log: deferred_flush_lost=1 mapping_page_drift=1

That is the gate working, not the gate broken. The three probes are green; what
fired is one real pair of events this device has been producing all along.

Measured on x86/PCI, host GPU P8, one boot: two consecutive full gate windows
read 1 and 2, and the boot as a whole read 5 over about fifteen minutes. Every
one is the same shape — the guest re-points a 24-pixel-tall strip (1877x24 four
times, 43x24 once; at 1920 wide that is the menu bar) with no packet saying so,
page 0 of the cached list disagrees with a fresh walk, and the render is dropped
rather than landed. Four read reason=translation_moved, one no_translation.
Refusing the write is correct — landing at stale GPAs would scatter a frame into
guest memory the guest has since repurposed. Not re-landing it at the new
translation is an open defect, and it predates this gate.

So the budgets move out of the script and into `baseline.tsv`, one row per
class, each carrying the measurement that justifies it. Zero is the default and
four keep it. A class with no row is budgeted zero, so a forgotten row fails
strict rather than leaving the class unwatched. Every class that fired is named
in the verdict whether or not it was inside budget, so a PASS reading
`deferred_flush_lost=2/4` is never read as nothing lost.

Two other defects the live run found, both in the gate itself:

- `local name="$1" log="$WORK/$name.log"` does not see `$name` in the same
  statement, so every run died at the first probe with an unbound variable.
- The 1-minute load average is not a settle signal until the guest has been up
  longer than the average's own window. Measured on this boot: 40 s up reading
  1.28, 65 s up reading 1.09, still climbing as the desktop loaded. The gate now
  requires SETTLE_MIN_UPTIME (180 s) as well, read from `kern.boottime` rather
  than from `uptime`'s prose — that string spells its own age "40 secs", "1 min"
  and "1:23" by turns.

Component: `scripts/visual-gate`. No Rust and no device behavior.

Verified live, x86/PCI, `vm/boot-x86.sh --device reims-vgpu-pci --testing`, host
GPU at P8/180 MHz throughout:

  visual-gate: PASS — full mode, 3/3 probes green, counters over 5747463 B of
  fail log: deferred_flush_lost=2/2 mapping_page_drift=2/2

That run is what raised the budget from 2 to 4: it landed exactly on the
ceiling, which is not a margin. 4 is double the worst window observed.

Tests: `self-test.sh` is 14 cases now, up from 10. The two budget-boundary cases
read the boundary out of `baseline.tsv` instead of hardcoding it, so
re-measuring the standing rate moves one number in one place. Mutation-checked
as before: dropping the `^` anchor and matching route fields by prefix each fail
exactly one case.

Not verified: the menu-bar drift defect itself is recorded, not fixed. Nothing
here changes when a render is dropped.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-03 03:27:48 +03:00
Anees IqbalandClaude 9e3969b0ef ✨ The probes that could have caught the reset now gate the commit that would cause it
Performance work on this device has been verified against clippy, unit tests,
the feature matrix and device-side counters. None of those can see a rendering
regression. A branch of 59 commits — 21 code-changing, +7687/-820 across 38
files — was reset off wholesale because it had introduced graphical glitches,
and every one of those commits had been verified. The instruments were
performance instruments because the work was performance work, so the defect was
invisible by construction. Nothing lied; the right question was never asked.

Three probes already ask it. Each is a two-observation instrument — the guest
declares what it believes it drew and where, the host measures its own capture
at exactly those places — which is what separates "the guest declined to draw
it" from "this device lost it". None of them gated anything. That is the defect
this fixes.

`scripts/visual-gate/visual-gate.sh` is one entry point:

- It refuses to start on an unsettled guest. sshd answers well before the
  desktop composites, and one probe run in that window read 12.2 fps with the
  device idle at `duty=0.001`. It polls `uptime` for a 1-minute load average
  under SETTLE_LOAD (1.0) up to SETTLE_TIMEOUT (420 s), and aborts if QEMU stops
  matching, so a boot that died early cannot read as a clean run.
- It runs all three probes even when an earlier one fails. Which probe fails is
  the diagnostic.
- It marks the fail log by byte offset before the first probe and applies the
  six silent-loss classes over its own window only, never the accumulated log,
  which spans builds. Byte offset rather than timestamp because the device's
  `t=` clock does not correlate with the shell's — the same bound
  `window-drag-probe` uses.
- One verdict line; exit 0 clean, 1 regression, 2 setup failure.

`--quick` cuts the trials to 5/3/3 for iteration; the README says a green
`--quick` is not a phase sign-off, and that a change whose failure mode needs a
second frame to appear wants the full gate run twice on one boot.

The counter parsing is its own script so it can be tested without a boot. That
split is the point: a parser that matches nothing prints the same six zeros a
clean run does, so a green gate would mean nothing and its output could not say
which. AGENTS.md carries the rule itself, next to the section on what a
screenshot cannot say.

Component: `scripts/`, x86/PCI and arm64 pathways alike; no Rust and no device
behavior.

Tests: `scripts/visual-gate/self-test.sh`, 10 cases over synthetic log text
quoted from the emitters, no guest or GPU needed. Mutation-checked twice:
dropping the `^` anchor on the line families fails exactly the
"matches its own prefix only" case, and matching route fields by prefix instead
of exactly fails exactly the "a longer field name is not this class" case.
`bash -n` clean on all three scripts. The gate's own refusal path was exercised
with no QEMU running and reported it.

Not verified: no live boot yet, so the gate has never run its three probes
end to end. That is the next step and it is what establishes the green baseline
at this HEAD before any Phase A change.

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