#!/usr/bin/env bash # The decision-relevant matrix: one session's container (1280x720) per pass, one # session at a time. # # Why it is narrower than the first attempt: the `--all` cells changed meaning # whenever a second session existed (2560x720 became 3840x720), and running two # sessions plus four routes on a two-core software-rendered box twice crashed the # compositor mid-run. The wire-relevant case for live streaming and agent eyes is # one session's window, so that is what this measures -- and it runs the sessions # sequentially to keep the load off the compositor. set -u cd "$(dirname "$0")" start_session() { local page="$1" profile="$2" hhstream session start chromium --idle-timeout 3h --wait-ready 45s -- \ --ozone-platform=wayland --no-first-run --no-default-browser-check \ --user-data-dir="/var/lib/hermes/hhstream-sessions/$profile" \ --window-size=1280,720 "--app=$page" >/dev/null 2>&1 sleep 6 hhstream session list --json 2>/dev/null | python3 -c " import json,sys d=json.load(sys.stdin) s=d['sessions'][-1] print(s['container']['output'])" } echo "########## PASS A: moving screen ##########" A=$(start_session "http://127.0.0.1/spin.html" chromium-bench-fin) echo "target: $A" if [ -n "$A" ]; then nix-shell shell.nix --run "python3 bench.py --output $A --cells output-raw --cells output-jpeg \ --frames 200 --warmup 10 --runs 2 --control-seconds 10 --resume --results results/final-motion" hhstream session kill "$(hhstream session list --json | python3 -c 'import json,sys;print(json.load(sys.stdin)[\"sessions\"][-1][\"id\"])')" >/dev/null 2>&1 else echo "no session: compositor may be down" fi echo "########## PASS B: still screen ##########" B=$(start_session "http://127.0.0.1/static.html" chromium-bench-still) echo "target: $B" if [ -n "$B" ]; then nix-shell shell.nix --run "python3 bench.py --output $B --cells output-raw --cells output-jpeg \ --frames 200 --warmup 10 --runs 2 --control-seconds 10 --resume --results results/final-still" fi echo "########## compositor survived? ##########" systemctl is-active hyprland-headless.service journalctl --since "30 minutes ago" --no-pager 2>/dev/null | grep -c "dumped core" | sed 's/^/core dumps in the last 30 min: /' echo "########## final matrix complete ##########"