summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-08-01 19:52:05 +0200
committersalmonik <salmonik@tuta.io>2026-08-01 19:52:05 +0200
commit819778f292ee4e1294603b98662e083e49e23463 (patch)
tree8df31b678432d2a89cac8e0d50f271a75a3882b5 /scripts
parentrsnix v0.4.0: GUI input foundation — PS/2 mouse + scheduler message queues (diff)
downloadrs-dos-819778f292ee4e1294603b98662e083e49e23463.tar.gz
rs-dos-819778f292ee4e1294603b98662e083e49e23463.zip
rsnix v0.5.0: graphics layer + cursor compositor
The first visible GUI surface: real rect primitives, a single shadow→display push path, and an on-screen mouse cursor that can never race the text surface. gop: - fill_rect + push_rect(x,y,w,h): every raster op rasterises into the RAM shadow, then push_rect copies the rect to the display (write-only, still never read) and composites the cursor on top. blit_glyph and scroll shifts now route through it. - cursor overlay: 12x16 pointer (const-fn built from column lists) drawn white with a black offset outline; position in one AtomicU64 (x:high 32, y:low 32) — unpack masks the low word (a bare 'as usize' cast is a no-op on 64-bit). The cursor never enters the shadow, so erasing is just a shadow push of the old rect. - cursor_redraw after scroll shifts and once at spawn (the vt diff never re-blits idle cells). cursor task (task 2, spawned at boot when a mouse is present): - owns the PS/2 ring; polls every 10 ms, moves the cursor (clamped), tracks buttons, and forwards every event to a task's queue when 'mouse <id>' armed it (the window-manager input path). - /dev/mouse is now a position device (x/y/buttons snapshot); 'mouse' watches the cursor live (prints on change); 'cursor' prints one-shot state; 'gfx' draws a status-bar demo; 'gfx check' is an in-kernel pixel self-test (shadow readback, display readback, cursor overlay purity) — PASS/FAIL per stage. Tests (headless QEMU + monitor injection): - make test-gfx (new): all four compositor checks PASS. - make test-mouse (rewritten): cursor tracks mouse_move deltas, buttons ride along, /dev/mouse snapshot, live watch, real-event queue routing. - make test-msg: task numbering shifted (cursor is task 2; msgrecv is task 3) — updated, still PASS. - make test-disk regression re-passes. 0 build warnings.
Diffstat (limited to '')
-rwxr-xr-xscripts/test-gfx.sh114
-rwxr-xr-xscripts/test-mouse.sh125
-rwxr-xr-xscripts/test-msg.sh37
3 files changed, 214 insertions, 62 deletions
diff --git a/scripts/test-gfx.sh b/scripts/test-gfx.sh
new file mode 100755
index 0000000..a6e4016
--- /dev/null
+++ b/scripts/test-gfx.sh
@@ -0,0 +1,114 @@
1#!/usr/bin/env bash
2#
3# scripts/test-gfx.sh — automated graphics-layer verification.
4#
5# The cursor overlay compositor is the core of the GUI path: the shadow
6# holds true content, the display gets shadow pushes with the cursor
7# painted on top at every push, and the cursor never enters the shadow.
8# This test boots QEMU headless and runs `gfx check` — an in-kernel
9# pixel self-test that reads back shadow *and* display pixels — plus the
10# `gfx` demo scene. Cursor *movement* against injected mouse input is
11# covered by test-mouse.sh; here we prove the compositor math.
12#
13# Usage: ./scripts/test-gfx.sh
14# Env: OVMF, QEMU (same defaults as other test scripts)
15#
16set -euo pipefail
17
18SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
19PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
20cd "$PROJECT_DIR"
21
22OVMF="${OVMF:-/usr/share/edk2/x64/OVMF.4m.fd}"
23QEMU="${QEMU:-qemu-system-x86_64}"
24ESP_DIR="$PROJECT_DIR/esp"
25QPID=/tmp/rsdos-gfx-qpid
26SOCK=/tmp/rsdos-gfx-qmon.sock
27LOG=/tmp/rsdos-gfx-serial.log
28QLOG=/tmp/rsdos-gfx-qemu.log
29
30trap 'kill "$(cat "$QPID" 2>/dev/null)" 2>/dev/null || true' EXIT
31
32fail() {
33 echo "FAIL: $1"
34 [ -f "$LOG" ] && tail -40 "$LOG"
35 exit 1
36}
37
38wait_log() {
39 local i=0
40 while [ "$i" -lt $((${3:-60} * 10)) ]; do
41 grep -q "$2" "$1" 2>/dev/null && return 0
42 sleep 0.1
43 i=$((i + 1))
44 done
45 return 1
46}
47
48wait_qemu_exit() {
49 local i=0
50 while [ "$i" -lt $((${1:-30} * 10)) ]; do
51 kill -0 "$(cat "$QPID" 2>/dev/null)" 2>/dev/null || return 0
52 sleep 0.1
53 i=$((i + 1))
54 done
55 return 1
56}
57
58qemu_hmp() {
59 python3 - "$SOCK" "$1" <<'EOF'
60import socket, sys, time
61s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
62s.connect(sys.argv[1])
63s.sendall((sys.argv[2] + "\n").encode())
64time.sleep(0.4)
65EOF
66}
67
68echo "==> 1/5 build kernel (debug)"
69cargo build --package rsdos --target x86_64-unknown-uefi
70
71echo "==> 2/5 deploy to ESP"
72mkdir -p "$ESP_DIR/EFI/BOOT"
73cp target/x86_64-unknown-uefi/debug/rsdos.efi "$ESP_DIR/EFI/BOOT/BOOTX64.EFI"
74
75echo "==> 3/5 boot QEMU (headless)"
76kill "$(cat "$QPID" 2>/dev/null)" 2>/dev/null || true
77sleep 1
78rm -f "$SOCK" "$LOG"
79"$QEMU" -bios "$OVMF" \
80 -drive file=fat:rw:"$ESP_DIR",format=raw \
81 -serial file:"$LOG" \
82 -monitor unix:"$SOCK",server,nowait \
83 -m 256M -machine q35 -cpu qemu64 -no-reboot -display none \
84 >"$QLOG" 2>&1 &
85echo $! >"$QPID"
86
87wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell"
88grep -aq "cursor: task " "$LOG" || fail "cursor task did not spawn"
89
90echo "==> 4/5 in-kernel pixel self-test (gfx check)"
91python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \
92 "clear" \
93 "gfx check"
94sleep 1.5
95
96# Every sub-check must have printed OK.
97grep -aq "fill_rect/shadow: OK" "$LOG" || fail "shadow writeback failed"
98grep -aq "display push: OK" "$LOG" || fail "shadow→display push failed"
99grep -aq "cursor overlay: OK" "$LOG" || fail "cursor not composited on display"
100grep -aq "cursor not in shadow: OK" "$LOG" || fail "cursor leaked into the shadow"
101grep -aq "gfx check: PASS" "$LOG" || fail "gfx check did not PASS"
102grep -aq "gfx check: FAIL" "$LOG" && fail "gfx check reported FAIL"
103
104echo "==> 5/5 demo scene + poweroff"
105python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \
106 "gfx" \
107 "poweroff"
108wait_qemu_exit 30 || fail "QEMU did not exit after poweroff"
109
110grep -aq "gfx: drew status bar" "$LOG" || fail "gfx demo did not draw"
111
112echo ""
113echo "PASS — graphics layer OK (shadow, display push, cursor overlay)"
114echo " compositor: shadow=content, display=push+cursor, cursor never in shadow"
diff --git a/scripts/test-mouse.sh b/scripts/test-mouse.sh
index ed4df44..e58d474 100755
--- a/scripts/test-mouse.sh
+++ b/scripts/test-mouse.sh
@@ -1,20 +1,19 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2# 2#
3# scripts/test-mouse.sh — automated PS/2 mouse round trip. 3# scripts/test-mouse.sh — automated mouse round trip (cursor model).
4# 4#
5# Builds the kernel, boots QEMU headless, injects mouse movement and 5# Since v0.5.0 the cursor task owns the PS/2 ring: mouse input shows up
6# button presses through the monitor's `mouse_move` / `mouse_button` 6# as *cursor position + buttons* on the screen, not as an event drain.
7# commands, and verifies the guest decoded them via IRQ12 → ring → 7# This script boots QEMU headless, injects movement/buttons via the
8# packet decoder. Covers both surfaces: 8# monitor, and verifies:
9# - `cat /dev/mouse` (VFS snapshot of pending events) 9# - the `cursor` command reports a position that moves with `mouse_move`
10# - `mouse` (live streaming command, stopped by ^C) 10# - button presses ride along (L while held)
11# - `/dev/mouse` is a position device (one snapshot line)
12# - the `mouse` watch command prints live changes and stops on ^C
13# - a `mouse <id>` forward routes real events to a task's queue
11# 14#
12# Usage: 15# Usage: ./scripts/test-mouse.sh
13# ./scripts/test-mouse.sh 16# Env: OVMF, QEMU (same defaults as other test scripts)
14#
15# Environment:
16# OVMF firmware (default: /usr/share/edk2/x64/OVMF.4m.fd)
17# QEMU qemu binary (default: qemu-system-x86_64)
18# 17#
19set -euo pipefail 18set -euo pipefail
20 19
@@ -30,16 +29,14 @@ SOCK=/tmp/rsdos-mouse-qmon.sock
30LOG=/tmp/rsdos-mouse-serial.log 29LOG=/tmp/rsdos-mouse-serial.log
31QLOG=/tmp/rsdos-mouse-qemu.log 30QLOG=/tmp/rsdos-mouse-qemu.log
32 31
33# Never leave a QEMU behind.
34trap 'kill "$(cat "$QPID" 2>/dev/null)" 2>/dev/null || true' EXIT 32trap 'kill "$(cat "$QPID" 2>/dev/null)" 2>/dev/null || true' EXIT
35 33
36fail() { 34fail() {
37 echo "FAIL: $1" 35 echo "FAIL: $1"
38 [ -f "$LOG" ] && tail -20 "$LOG" 36 [ -f "$LOG" ] && tail -30 "$LOG"
39 exit 1 37 exit 1
40} 38}
41 39
42# wait_log FILE PATTERN TIMEOUT-SECONDS
43wait_log() { 40wait_log() {
44 local i=0 41 local i=0
45 while [ "$i" -lt $((${3:-60} * 10)) ]; do 42 while [ "$i" -lt $((${3:-60} * 10)) ]; do
@@ -50,7 +47,6 @@ wait_log() {
50 return 1 47 return 1
51} 48}
52 49
53# wait_qemu_exit TIMEOUT-SECONDS
54wait_qemu_exit() { 50wait_qemu_exit() {
55 local i=0 51 local i=0
56 while [ "$i" -lt $((${1:-30} * 10)) ]; do 52 while [ "$i" -lt $((${1:-30} * 10)) ]; do
@@ -61,7 +57,6 @@ wait_qemu_exit() {
61 return 1 57 return 1
62} 58}
63 59
64# qemu_hmp — send one raw HMP command to the monitor socket.
65qemu_hmp() { 60qemu_hmp() {
66 python3 - "$SOCK" "$1" <<'EOF' 61 python3 - "$SOCK" "$1" <<'EOF'
67import socket, sys, time 62import socket, sys, time
@@ -72,14 +67,21 @@ time.sleep(0.4)
72EOF 67EOF
73} 68}
74 69
75echo "==> 1/5 build kernel (debug)" 70# cursor_state — run `cursor`, return "x y buttons" of the LAST occurrence.
71cursor_state() {
72 python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "cursor"
73 sleep 0.5
74 sed -n 's/.*cursor: x=\([0-9]*\) y=\([0-9]*\) buttons=\([A-Za-z-]*\).*/\1 \2 \3/p' "$LOG" | tail -1
75}
76
77echo "==> 1/6 build kernel (debug)"
76cargo build --package rsdos --target x86_64-unknown-uefi 78cargo build --package rsdos --target x86_64-unknown-uefi
77 79
78echo "==> 2/5 deploy to ESP" 80echo "==> 2/6 deploy to ESP"
79mkdir -p "$ESP_DIR/EFI/BOOT" 81mkdir -p "$ESP_DIR/EFI/BOOT"
80cp target/x86_64-unknown-uefi/debug/rsdos.efi "$ESP_DIR/EFI/BOOT/BOOTX64.EFI" 82cp target/x86_64-unknown-uefi/debug/rsdos.efi "$ESP_DIR/EFI/BOOT/BOOTX64.EFI"
81 83
82echo "==> 3/5 boot QEMU (headless)" 84echo "==> 3/6 boot QEMU (headless)"
83kill "$(cat "$QPID" 2>/dev/null)" 2>/dev/null || true 85kill "$(cat "$QPID" 2>/dev/null)" 2>/dev/null || true
84sleep 1 86sleep 1
85rm -f "$SOCK" "$LOG" 87rm -f "$SOCK" "$LOG"
@@ -93,38 +95,73 @@ echo $! >"$QPID"
93 95
94wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell" 96wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell"
95grep -aq "ps2: mouse ready" "$LOG" || fail "mouse driver did not come up at boot" 97grep -aq "ps2: mouse ready" "$LOG" || fail "mouse driver did not come up at boot"
98grep -aq "cursor: task " "$LOG" || fail "cursor task did not spawn"
96 99
97# Seed a move *before* any consumer runs, so `cat /dev/mouse` has a 100echo "==> 4/6 cursor position tracks injected movement"
98# queued event to drain (exercises the VFS snapshot path). 101INIT=$(cursor_state)
99qemu_hmp "mouse_move 8 4" 102[ -n "$INIT" ] || fail "no initial cursor position"
100 103IX=$(echo "$INIT" | awk '{print $1}')
101echo "==> 4/5 drive the shell (cat /dev/mouse, mouse stream, poweroff)" 104IY=$(echo "$INIT" | awk '{print $2}')
102python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \ 105IB=$(echo "$INIT" | awk '{print $3}')
103 "cat /dev/mouse" \ 106echo " initial: x=$IX y=$IY buttons=$IB"
104 "mouse" 107[ "$IB" = "---" ] || fail "expected no buttons at boot, got $IB"
105 108
106# While the `mouse` stream is live: a move, a left-press, a move with the
107# button held, then release — the button state must ride along on the
108# movement packet.
109qemu_hmp "mouse_move 20 7" 109qemu_hmp "mouse_move 20 7"
110S1=$(cursor_state)
111X1=$(echo "$S1" | awk '{print $1}')
112Y1=$(echo "$S1" | awk '{print $2}')
113[ "$X1" -eq $((IX + 20)) ] || fail "x did not move +20 (was $IX, now $X1)"
114[ "$Y1" -eq $((IY + 7)) ] || fail "y did not move +7 (was $IY, now $Y1)"
115
116echo "==> 5/6 buttons ride along; /dev/mouse is a position device"
110qemu_hmp "mouse_button 1" 117qemu_hmp "mouse_button 1"
118S2=$(cursor_state)
119B2=$(echo "$S2" | awk '{print $3}')
120[ "$B2" = "L--" ] || fail "left press not seen (got $B2)"
121
111qemu_hmp "mouse_move -5 -3" 122qemu_hmp "mouse_move -5 -3"
123S3=$(cursor_state)
124X3=$(echo "$S3" | awk '{print $1}')
125Y3=$(echo "$S3" | awk '{print $2}')
126B3=$(echo "$S3" | awk '{print $3}')
127[ "$X3" -eq $((X1 - 5)) ] || fail "held move x wrong ($X1 -5 = $((X1 - 5)), got $X3)"
128[ "$Y3" -eq $((Y1 - 3)) ] || fail "held move y wrong ($Y1 -3 = $((Y1 - 3)), got $Y3)"
129[ "$B3" = "L--" ] || fail "button state dropped during held move (got $B3)"
130
112qemu_hmp "mouse_button 0" 131qemu_hmp "mouse_button 0"
113qemu_hmp "sendkey ctrl-c" 132S4=$(cursor_state)
133B4=$(echo "$S4" | awk '{print $3}')
134[ "$B4" = "---" ] || fail "release not seen (got $B4)"
135
136python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "cat /dev/mouse"
137sleep 0.5
138grep -aq "x=$X3 y=$Y3 buttons=---" "$LOG" || fail "/dev/mouse does not report position snapshot (x=$X3 y=$Y3)"
139grep -aq "mouse: no events" "$LOG" && fail "/dev/mouse is still an event drain"
114 140
141echo "==> 6/6 live watch + forwarding + poweroff"
115python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \ 142python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \
116 "poweroff" 143 "msgrecv" \
144 "mouse 3"
117 145
118echo "==> 5/5 wait for shutdown + verify" 146# Live watch running: a move must appear as a changed line.
119wait_qemu_exit 30 || fail "QEMU did not exit after poweroff" 147qemu_hmp "mouse_move 3 2"
148# Forwarding live: the same move must reach the msgrecv task (spawned as
149# task 3; task 2 is the cursor task itself).
150sleep 1
151qemu_hmp "sendkey ctrl-c"
152
153grep -aq "mouse: routing events to task 3" "$LOG" || fail "mouse 3 did not arm routing"
154grep -aq "msgrecv\[3\]: Mouse(+" "$LOG" || fail "task 3 queue did not receive the routed Mouse event"
155# Watch line: x/y/buttons format (any occurrence after watching started).
156grep -aq "mouse: x=$((X3 + 3)) y=$((Y3 + 2)) buttons=---" "$LOG" || fail "watch did not print the moved cursor (x=$((X3+3)) y=$((Y3+2)))"
157grep -aq "mouse: stopped" "$LOG" || fail "^C did not stop the mouse watch"
120 158
121grep -aq "ps2: mouse ready (IRQ12, stream mode)" "$LOG" || fail "no mouse-ready boot line" 159python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "poweroff"
122grep -aq "dx=+8 dy=+4 buttons=---" "$LOG" || fail "/dev/mouse did not drain the queued move (dx=+8 dy=+4)" 160
123grep -aq "dx=+20 dy=+7 buttons=---" "$LOG" || fail "mouse stream missed mouse_move 20 7" 161echo "==> done: wait for shutdown + verify"
124grep -aq "dx=+0 dy=+0 buttons=L--" "$LOG" || fail "left-button press did not decode" 162wait_qemu_exit 30 || fail "QEMU did not exit after poweroff"
125grep -aq "dx=-5 dy=-3 buttons=L--" "$LOG" || fail "held-button movement wrong (dx=-5 dy=-3 L)"
126grep -aq "mouse: stopped" "$LOG" || fail "^C did not stop the mouse stream"
127 163
128echo "" 164echo ""
129echo "PASS — PS/2 mouse round trip OK (IRQ12, /dev/mouse, live stream, buttons)" 165echo "PASS — mouse round trip OK (cursor task, /dev/mouse, watch, forward)"
130echo " events: 8,4 · 20,7 · L-press · -5,-3 held · release" 166echo " moves: +20,+7 · -5,-3 held · +3,+2 watch"
167echo " path: IRQ12 → ring → cursor task → overlay + queue"
diff --git a/scripts/test-msg.sh b/scripts/test-msg.sh
index 0bd1c81..d81d8d7 100755
--- a/scripts/test-msg.sh
+++ b/scripts/test-msg.sh
@@ -93,20 +93,21 @@ echo $! >"$QPID"
93wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell" 93wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell"
94 94
95echo "==> 4/5 drive the shell (msgrecv / send / mouse routing / queue-full)" 95echo "==> 4/5 drive the shell (msgrecv / send / mouse routing / queue-full)"
96# msgrecv spawns as task 3 (task 2 is the cursor task).
96python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \ 97python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \
97 "msgrecv" \ 98 "msgrecv" \
98 "send 2 user 42" \ 99 "send 3 user 42" \
99 "send 2 timer" \ 100 "send 3 timer" \
100 "send 2 key enter" \ 101 "send 3 key enter" \
101 "send 2 key ctrl-c" \ 102 "send 3 key ctrl-c" \
102 "send 2 key f3" \ 103 "send 3 key f3" \
103 "send 2 mouse 5 -3 3" \ 104 "send 3 mouse 5 -3 3" \
104 "sleep 800" \ 105 "sleep 800" \
105 "jobs" 106 "jobs"
106 107
107# Real IRQ12 events through the queue: start routing to task 2, inject 108# Real IRQ12 events through the queue: start routing to task 3, inject
108# moves + a left press, stop. 109# moves + a left press, stop.
109python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "mouse 2" 110python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "mouse 3"
110qemu_hmp "mouse_move 20 7" 111qemu_hmp "mouse_move 20 7"
111qemu_hmp "mouse_button 1" 112qemu_hmp "mouse_button 1"
112qemu_hmp "mouse_move -5 -3" 113qemu_hmp "mouse_move -5 -3"
@@ -140,20 +141,20 @@ python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \
140echo "==> 5/5 wait for shutdown + verify" 141echo "==> 5/5 wait for shutdown + verify"
141wait_qemu_exit 30 || fail "QEMU did not exit after poweroff" 142wait_qemu_exit 30 || fail "QEMU did not exit after poweroff"
142 143
143grep -aq "msgrecv: task 2 listening" "$LOG" || fail "msgrecv did not spawn" 144grep -aq "msgrecv: task 3 listening" "$LOG" || fail "msgrecv did not spawn"
144grep -aq "msgrecv\[2\]: User(42)" "$LOG" || fail "user message missing" 145grep -aq "msgrecv\[3\]: User(42)" "$LOG" || fail "user message missing"
145grep -aq "msgrecv\[2\]: Timer" "$LOG" || fail "timer message missing" 146grep -aq "msgrecv\[3\]: Timer" "$LOG" || fail "timer message missing"
146grep -aq "msgrecv\[2\]: Key(Enter)" "$LOG" || fail "key enter missing" 147grep -aq "msgrecv\[3\]: Key(Enter)" "$LOG" || fail "key enter missing"
147grep -aq "msgrecv\[2\]: Key(Ctrl-c)" "$LOG" || fail "key ctrl-c missing" 148grep -aq "msgrecv\[3\]: Key(Ctrl-c)" "$LOG" || fail "key ctrl-c missing"
148grep -aq "msgrecv\[2\]: Key(F3)" "$LOG" || fail "key f3 missing" 149grep -aq "msgrecv\[3\]: Key(F3)" "$LOG" || fail "key f3 missing"
149grep -aq "msgrecv\[2\]: Mouse(+5,-3 L R)" "$LOG" || fail "synthesized mouse message missing" 150grep -aq "msgrecv\[3\]: Mouse(+5,-3 L R)" "$LOG" || fail "synthesized mouse message missing"
150# Real IRQ12 events routed through the queue (button held across the move). 151# Real IRQ12 events routed through the queue (button held across the move).
151grep -aq "msgrecv\[2\]: Mouse(+20,+7" "$LOG" || fail "real mouse move 20,7 not routed to queue" 152grep -aq "msgrecv\[3\]: Mouse(+20,+7" "$LOG" || fail "real mouse move 20,7 not routed to queue"
152grep -aq "msgrecv\[2\]: Mouse(-5,-3 L" "$LOG" || fail "held-button routed move missing" 153grep -aq "msgrecv\[3\]: Mouse(-5,-3 L" "$LOG" || fail "held-button routed move missing"
153grep -aq "queue full" "$LOG" || fail "17th send did not report queue full" 154grep -aq "queue full" "$LOG" || fail "17th send did not report queue full"
154grep -aq "send: unknown type" "$LOG" && fail "a bad send slipped through (expected none)" 155grep -aq "send: unknown type" "$LOG" && fail "a bad send slipped through (expected none)"
155 156
156echo "" 157echo ""
157echo "PASS — message queues OK (all types, ordering, real-input routing, queue-full)" 158echo "PASS — message queues OK (all types, ordering, real-input routing, queue-full)"
158echo " sent: user · timer · key(enter,ctrl-c,f3) · mouse · 16+1 queue-full" 159echo " sent: user · timer · key(enter,ctrl-c,f3) · mouse · 16+1 queue-full"
159echo " routed: mouse_move 20,7 → queue → msgrecv[2]" 160echo " routed: mouse_move 20,7 → queue → msgrecv[3]"