#!/usr/bin/env bash # Collision-pricing audit bench (2026-07-31) -- verifies the two fixes: # A. knockdown-paced crash economy (freshBlock hysteresis removed): a mech # held against a wall must STAGGER periodically and survive, not pay # full-speed crash price every frame and die in seconds. # B. raw ram dispatch (the *0.001 double-normalization removed): a fast # mech-vs-mech ram must land REAL internal rattle on the VICTIM # ([colldmg] on the victim's node), which was impossible before. # # usage: mp_rampricing.sh wall (leg A: solo, arena, BT_GOTO beeline into a wall) # mp_rampricing.sh ram (leg B: 2-node, BT_GOTO=enemy ram + observer) 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 LEG="${1:-wall}" if [ "$LEG" = "wall" ]; then # Solo arena: beeline far past the arena wall -> full-speed strike, then a # sustained push. PASS: [knock] BIND repeats (paced), crashdmg has no # constant-|v| full-price ramp, ZERO deaths. rm -f rp_wall.log BT_GROUND_LOG=1 BT_DMG_LOG=1 BT_GOTO="5000 0" \ bt_launch rp_wall.log WALLTEST.EGG 0x03 sleep 150 bt_kill_ours echo "=== WALL LEG (rp_wall.log) ===" echo "-- deaths (MUST be 0):"; grep -c "DESTROYED" rp_wall.log echo "-- knockdown binds:"; grep -c "knock] BIND" rp_wall.log grep "knock] BIND" rp_wall.log | head -8 echo "-- crashdmg events:"; grep -c "crashdmg" rp_wall.log echo "-- rattle (colldmg) events:"; grep -c "colldmg" rp_wall.log grep "colldmg" rp_wall.log | head -5 else # 2-node ram: A chases + rams B (stationary master). PASS: RAM lines show # amt == raw (no *0.001), B's node prices [colldmg] rattle > 0 on arrival # speed, and neither mech dies from a few rams. sed "s/^map=.*/map=grass/; s/^time=.*/time=day/" MP.EGG > RM.EGG rm -f rp_ram_victim.log rp_ram_rammer.log # victim (B): stationary master, DMG log for the divert verdict BT_MP_LOG=1 BT_DMG_LOG=1 BT_MP_NET=1 BT_REPL_LOG=1 \ bt_launch rp_ram_victim.log RM.EGG 0x0C -net 1601 sleep 2 # rammer (A): chase the peer and hit it BT_MP_LOG=1 BT_DMG_LOG=1 BT_MP_NET=1 BT_GROUND_LOG=1 \ BT_GOTO=enemy BT_GOTO_STOP=2 \ bt_launch rp_ram_rammer.log RM.EGG 0x03 -net 1501 sleep 4 python ../tools/btconsole.py RM.EGG 127.0.0.1:1501 127.0.0.1:1601 & PC=$! sleep 150 kill $PC 2>/dev/null bt_kill_ours rm -f RM.EGG echo "=== RAM LEG ===" echo "-- rammer RAM dispatches (raw vs amt -- MUST match):" grep -o "RAM.*" rp_ram_rammer.log | head -6 grep "collide-tx" rp_ram_rammer.log | head -4 echo "-- victim rattle ([colldmg] MUST appear for fast rams):" grep "colldmg" rp_ram_victim.log | head -6 echo "-- victim received type-0 ([mp-hdlr] type=0):" grep "mp-hdlr" rp_ram_victim.log | grep "type=0" | head -4 echo "-- deaths on each node (a few rams must NOT kill):" grep -c "DESTROYED" rp_ram_rammer.log grep -c "DESTROYED" rp_ram_victim.log echo "-- rammer knockdown pacing:" grep -c "knock] BIND" rp_ram_rammer.log fi echo "=== DONE ($LEG) ==="