Files
BT411/scratchpad/night13/layoutround.sh
T
Joe DiPrimaandClaude Opus 5 43d30ca7e4 #140 receipts: name the corruption case in a FIELD log
Two ungated one-liners, because no bench here reached the failing path and
the next playtest is a better instrument than more automation:

  [glasswin] destroy entry #N windows=M   -- N=2,M=0 is the double-destroy
  [glasswin] saved ... (live=L remembered=R) -- live=0 IS the corruption case
                                                (pre-cache that wrote a file
                                                holding only the plasma line)

Also lands the benches that did NOT reproduce it, with their failure modes
recorded in the headers so the next attempt does not repeat them:
layoutsave.sh (round trip -- passes on the fixed build), layoutteardown.sh
(graceful WM_CLOSE; still never reaches the dtor chain), layoutround.sh (MP
round boundary; the relay never started the mission inside the window).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NCJQkvq6G2JNrpVbA75tVZ
2026-08-07 01:23:33 -05:00

54 lines
2.1 KiB
Bash

#!/usr/bin/env bash
# =========================================================================
# #140 -- reach the teardown the way the FIELD does: a MISSION that ENDS.
#
# Three earlier attempts never exercised BTGlassPanels_Destroy at all:
# bt_kill_ours uses `taskkill /F` (no dtors), and a graceful WM_CLOSE on a
# solo -egg run did not reach it either. The path that matters is the one
# testers hit constantly -- the controls manager is destroyed and rebuilt at
# every ROUND boundary, which is exactly what the relay drives in MP.
#
# Panels ON for both nodes; the relay starts a round and the round ends.
# The receipt to read is `[glasswin] destroy entry #N windows=M`:
# #1 windows=7 then #2 windows=0 -> the double-destroy, confirmed
# and then exactly ONE "saved N window position(s)" line, with the cfg intact.
# =========================================================================
set -x
. /c/git/bt411/scratchpad/night6/bench_common.sh
cd /c/git/bt411/content || exit 1
taskkill //F //IM btl4.exe > /dev/null 2>&1
sleep 2
rm -f glass_layout.cfg lr_a.log lr_b.log lr_relay.log
bt_expert_egg MP.EGG LR.EGG
sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" LR.EGG
( export BT_GLASS_PANELS=1 BT_GLASS_LAYOUT=save BT_MP_LOG=1
bt_launch lr_b.log LR.EGG 0x0C -net 1601 )
sleep 2
( export BT_GLASS_PANELS=1 BT_GLASS_LAYOUT=save BT_MP_LOG=1
bt_launch lr_a.log LR.EGG 0x03 -net 1501 )
sleep 5
python ../tools/btconsole.py LR.EGG 127.0.0.1:1501 127.0.0.1:1601 > lr_relay.log 2>&1 &
RELAY=$!
sleep 180
kill $RELAY 2>/dev/null
sleep 5
bt_kill_ours
sleep 2
taskkill //F //IM btl4.exe > /dev/null 2>&1
sleep 3
echo "=================== #140 TEARDOWN RECEIPTS ==================="
for n in a b; do
echo "--- node $n: destroy entries ---"
grep -a "destroy entry" lr_${n}.log
echo "--- node $n: SaveLayout receipts ---"
grep -a "window position" lr_${n}.log
done
echo
echo "--- glass_layout.cfg entries ---"
grep -aE "^[^#]+=" glass_layout.cfg 2>/dev/null || echo "(no file)"
echo -n "entry count: "; grep -acE "^[^#]+=" glass_layout.cfg 2>/dev/null