Files
reims-vgpu/scripts/input-lever/input-lever.sh
T
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

93 lines
3.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# input-lever.sh KIND -- issue exactly one input onto a settled guest and watch
# it live or die.
#
# The `s9` arm killed its guest three times out of three within ~2 s of the
# menu probe's right-click on a dock icon. That probe issues three different
# inputs -- a desktop-wide pointer sweep, a left-click dismiss, and the
# right-click -- inside one eight-second window, so which of them is the lever
# is not decidable from its logs. This probe issues one, names it, and then
# stops touching the guest entirely.
#
# The hold afterwards is the measurement, not a courtesy: a guest that panics
# 2 s after an input and a guest that panics 60 s after an unrelated background
# event are different defects, and only a silent hold separates them. Nothing
# is issued during the hold, so a panic inside it belongs to the one input that
# preceded it or to nothing at all.
#
# KIND is one of:
# rclick -- one right-click on the dock icon (the s9 probe's own action)
# click -- one left-click at the same point, which is the s9 probe's
# dismiss and arrives ~3 s before its right-click
# move -- one pointer move to the same point, no button at all
# none -- no input; the control that prices the hold itself
#
# Env: QPID (required, the qemu pid), OUT (required, a directory).
# LEVER_SETTLE seconds to settle before acting (default 8)
# LEVER_HOLD seconds to hold untouched after (default 90)
# LEVER_X/Y guest-pixel target (default the Finder icon)
set -u
KIND="${1:-rclick}"
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
QMP="$REPO/scripts/qmp/qmp.py"
X="${LEVER_X:-333}"; Y="${LEVER_Y:-1033}"
SETTLE="${LEVER_SETTLE:-8}"; HOLD="${LEVER_HOLD:-90}"
[ -n "${OUT:-}" ] || { echo "input-lever: OUT unset"; exit 2; }
mkdir -p "$OUT"
[ -n "${QPID:-}" ] || { echo "input-lever: no running guest"; exit 2; }
# The serial log is the panic's own witness and it is what this probe grades.
# Its length before the input is the baseline: a panic that was already in it
# is not this input's panic, and without the mark there is no way to say so.
SER="$(ls -t "$REPO"/vm/disks/run/serial-*.log 2>/dev/null | head -1)"
[ -n "$SER" ] || { echo "input-lever: no serial log to watch"; exit 2; }
BEFORE="$(wc -c < "$SER")"
alive() { kill -0 "$QPID" 2>/dev/null; }
panicked() {
tail -c +"$((BEFORE + 1))" "$SER" 2>/dev/null \
| grep -q 'Debugger called: <panic>\|panic(cpu '
}
if panicked || ! alive; then
echo "input-lever: the guest was already gone before the input; this run says nothing"
exit 2
fi
echo "input-lever: kind=$KIND target=$X,$Y settle=${SETTLE}s hold=${HOLD}s qemu=$QPID"
sleep "$SETTLE"
if panicked || ! alive; then
echo "input-lever: VERDICT=PANIC_IN_SETTLE"; exit 1
fi
T0="$(date +%s)"
case "$KIND" in
rclick|click|move) python3 "$QMP" "$KIND" "$X" "$Y" >> "$OUT/action.log" 2>&1 ;;
none) echo "no input issued" >> "$OUT/action.log" ;;
*) echo "input-lever: unknown kind '$KIND'"; exit 2 ;;
esac
ACT_RC=$?
echo "input-lever: issued kind=$KIND rc=$ACT_RC"
# Polled rather than slept-then-checked, because the latency from the input to
# the panic is the number that distinguishes "this input killed it" from "it
# died later while idle", and a single sleep to the end of the hold cannot
# report one.
ELAPSED=0
while [ "$ELAPSED" -lt "$HOLD" ]; do
if panicked; then
echo "input-lever: VERDICT=PANIC latency=${ELAPSED}s after kind=$KIND"
exit 1
fi
if ! alive; then
echo "input-lever: VERDICT=GONE_NO_PANIC latency=${ELAPSED}s after kind=$KIND"
exit 1
fi
sleep 2
ELAPSED=$(( $(date +%s) - T0 ))
done
echo "input-lever: VERDICT=SURVIVED kind=$KIND held=${ELAPSED}s"