Files
faumarayandClaude Opus 5.5 1ffcf690cc spikes/gpui/windows: spike 3, a second window on the shared model
A main window and a Studio-like window (cx.open_window through
gpui_kit::open_window) both render views that observe one root entity: a
counter both change, the push-to-talk state, which window is active, and
the studio's preview. Closing the studio window docks it
(on_window_should_close), closing the main window ends the app, F11
toggles fullscreen, Ctrl+Tab activates the other window. The global
push-to-talk key is voelin-platform's X11 hotkey (XInput2 raw events),
read by a GPUI foreground task. The preview comes from voelin-media's
studio compositor and its preview tap, one BGRA RenderImage shown by both
windows, the replaced one dropped from every atlas. drive.sh runs the
scenario and its checks on the headless display.

From the interrupted attempt, changed here: the window's size after a
fullscreen toggle is logged once the window manager has set it (the
toggle's own bounds are the old ones) and checked (1000x900 back);
drive.sh says how long the app took to end; measure.sh (new) runs the
three cost cases into $OUT instead of the README's commands, which wrote
into the current directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 01:43:43 +03:00

34 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# The cost of spike 3's shared preview on the headless display: CPU and
# memory with the main window alone (the preview in it), with the studio's
# window open too (one picture in both), and with both windows but no
# compositor. Every case writes <case>.jsonl (one line a second, then the
# summary) and <case>.load (load average before and after) to $OUT.
#
# spikes/gpui/shell.sh spikes/gpui/headless.sh -- spikes/gpui/windows/measure.sh [CASE...]
#
# Cases (default: all): windows-main windows-both windows-none.
# SECONDS_RUN (default 45) and WARMUP (default 10) set their length.
set -eu
root=$(cd "$(dirname "$0")/../../.." && pwd)
out=${OUT:-$root/.scratch/gpui-spikes-results}
mkdir -p "$out"
out=$(cd "$out" && pwd)
seconds=${SECONDS_RUN:-45}
warmup=${WARMUP:-10}
for c in ${*:-windows-main windows-both windows-none}; do
case $c in
windows-main) args= ;;
windows-both) args=--open-studio ;;
windows-none) args="--open-studio --no-preview" ;;
*) echo "unknown case $c" >&2; exit 2 ;;
esac
echo "== $c: spike-windows $args" >&2
echo "load before: $(cat /proc/loadavg)" >"$out/$c.load"
# shellcheck disable=SC2086
"$root/target/release/spike-windows" $args --seconds "$seconds" --warmup "$warmup" \
--out "$out/$c.jsonl" >/dev/null 2>"$out/$c.log"
echo "load after: $(cat /proc/loadavg)" >>"$out/$c.load"
tail -1 "$out/$c.jsonl"
done