detached 0002628

chore(tools): fail the bench when neferwl does not start

commit
0002628d706d188aee9a9a59838141a52bff8d33
author
brice · · 2026-10-13 17:58 UTC
committer
brice · · 2026-10-14 04:34 UTC
parent
7f86f64
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +14 -3
M tools/bench/bench.sh +14 -3
@@ -39,6 +39,11 @@ nwl=$!
3939 pids+=("$nwl")
4040 log=$tmp/state/neferwl/runs/headless/latest.log
4141 for _ in $(seq 50); do [ -S "$tmp/rt/wayland-1" ] && break; sleep 0.1; done
42+if [ ! -S "$tmp/rt/wayland-1" ]; then
43+ echo "neferwl did not start: no wayland-1 socket; its output:" >&2
44+ cat "$tmp/nwl.out" >&2
45+ exit 1
46+fi
4247
4348 if [ -n "${BENCH_X11:-}" ]; then
4449 disp=
@@ -59,12 +64,18 @@ sleep 8
5964
6065 cs() { cat /proc/"$nwl"/task/*/status | awk '/^voluntary_ctxt/{v+=$2} END{print v}'; }
6166 # CPU time in ns summed over threads (schedstat is finer than stat's ticks).
62-ticks() { cat /proc/"$nwl"/task/*/schedstat | awk '{v+=$1} END{printf "%d\n", v}'; }
67+cpu_ns() { cat /proc/"$nwl"/task/*/schedstat | awk '{v+=$1} END{printf "%d\n", v}'; }
6368 frames() { grep -c '"message":"frame"' "$log" || true; }
6469
65-t0=$(ticks); f0=$(frames); c0=$(cs)
70+t0=$(cpu_ns); f0=$(frames); c0=$(cs)
6671 sleep "$secs"
67-t1=$(ticks); f1=$(frames); c1=$(cs)
72+t1=$(cpu_ns); f1=$(frames); c1=$(cs)
73+
74+if [ "$((f1 - f0))" -le 0 ]; then
75+ echo "no frame presented in ${secs}s: the page did not animate or neferwl stalled" >&2
76+ tail -n 20 "$tmp/nwl.out" >&2
77+ exit 1
78+fi
6879
6980 python3 - "$((t1 - t0))" "$((f1 - f0))" "$((c1 - c0))" "$secs" "$page" <<'EOF'
7081 import sys
@@ -39,6 +39,11 @@ nwl=$!
39 pids+=("$nwl")39 pids+=("$nwl")
40 log=$tmp/state/neferwl/runs/headless/latest.log40 log=$tmp/state/neferwl/runs/headless/latest.log
41 for _ in $(seq 50); do [ -S "$tmp/rt/wayland-1" ] && break; sleep 0.1; done41 for _ in $(seq 50); do [ -S "$tmp/rt/wayland-1" ] && break; sleep 0.1; done
42+if [ ! -S "$tmp/rt/wayland-1" ]; then
43+ echo "neferwl did not start: no wayland-1 socket; its output:" >&2
44+ cat "$tmp/nwl.out" >&2
45+ exit 1
46+fi
42 47
43 if [ -n "${BENCH_X11:-}" ]; then48 if [ -n "${BENCH_X11:-}" ]; then
44 disp=49 disp=
@@ -59,12 +64,18 @@ sleep 8
59 64
60 cs() { cat /proc/"$nwl"/task/*/status | awk '/^voluntary_ctxt/{v+=$2} END{print v}'; }65 cs() { cat /proc/"$nwl"/task/*/status | awk '/^voluntary_ctxt/{v+=$2} END{print v}'; }
61 # CPU time in ns summed over threads (schedstat is finer than stat's ticks).66 # CPU time in ns summed over threads (schedstat is finer than stat's ticks).
62-ticks() { cat /proc/"$nwl"/task/*/schedstat | awk '{v+=$1} END{printf "%d\n", v}'; }67+cpu_ns() { cat /proc/"$nwl"/task/*/schedstat | awk '{v+=$1} END{printf "%d\n", v}'; }
63 frames() { grep -c '"message":"frame"' "$log" || true; }68 frames() { grep -c '"message":"frame"' "$log" || true; }
64 69
65-t0=$(ticks); f0=$(frames); c0=$(cs)70+t0=$(cpu_ns); f0=$(frames); c0=$(cs)
66 sleep "$secs"71 sleep "$secs"
67-t1=$(ticks); f1=$(frames); c1=$(cs)72+t1=$(cpu_ns); f1=$(frames); c1=$(cs)
73+
74+if [ "$((f1 - f0))" -le 0 ]; then
75+ echo "no frame presented in ${secs}s: the page did not animate or neferwl stalled" >&2
76+ tail -n 20 "$tmp/nwl.out" >&2
77+ exit 1
78+fi
68 79
69 python3 - "$((t1 - t0))" "$((f1 - f0))" "$((c1 - c0))" "$secs" "$page" <<'EOF'80 python3 - "$((t1 - t0))" "$((f1 - f0))" "$((c1 - c0))" "$secs" "$page" <<'EOF'
70 import sys81 import sys

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 23

Tags 10

↑↓ moveenter openesc close