Files
BT411/scratchpad/night15/ram_bench.sh
T

49 lines
2.1 KiB
Bash

#!/usr/bin/env bash
# #128: collision-rattle eligibility bench. 20 synthetic over-floor collision
# hits (~80 lottery sub-hits). PASS iff every struck-subsystem receipt is in
# the binary's eligible set {HeatSinkBank, Gyroscope, Torso}; any Myomers /
# Condenser / Reservoir / Generator / Sensor / weapon receipt = FAIL.
. /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 3
rm -f ram_t.log
bt_expert_egg MP.EGG RAM.EGG
sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" RAM.EGG
grep -q "advancedDamage=1" RAM.EGG || { echo "FAIL: egg lacks advancedDamage=1"; exit 1; }
( export BT_SELF_DAMAGE=60000 BT_SELF_DAMAGE_TYPE=collision BT_SELF_DAMAGE_TICKS=20
export BT_SELF_DAMAGE_DELAY=10 BT_DMG_LOG=1 BT_LAMP_LOG=1 BT_SCORE_LOG=1
bt_launch ram_t.log RAM.EGG 0x03 -egg RAM.EGG )
sleep 75
bt_kill_ours; sleep 2; taskkill //F //IM btl4.exe >/dev/null 2>&1
python - <<'PY'
import io, re
txt = io.open("ram_t.log", encoding="latin-1", errors="replace").read()
rattles = len(re.findall(r"\[colldmg\] rattle", txt))
# struck-subsystem receipts: techstat condition transitions after the rattles
allowed = ("HeatSinkBank", "Gyroscope", "Torso")
banned = ("Myomers", "Condenser", "Reservoir", "Generator", "Sensor",
"Laser", "PPC", "Missile", "AmmoBin", "Gauss", "AFC")
hits_ok = hits_bad = 0
bad_lines = []
for m in re.finditer(r"\[techstat\]\s+(\S+).*condition.*SET", txt):
name = m.group(1)
if any(a in name for a in allowed):
hits_ok += 1
elif any(b in name for b in banned):
hits_bad += 1
bad_lines.append(m.group(0)[:100])
print("=== #128 RATTLE ELIGIBILITY ===")
print("rattle events ([colldmg]):", rattles)
print("allowed-set receipts :", hits_ok)
print("BANNED-set receipts :", hits_bad)
for l in bad_lines[:6]: print(" BAD:", l)
if rattles == 0:
print("VERDICT: FAIL -- no rattles fired (bench mis-set)")
elif hits_bad > 0:
print("VERDICT: FAIL -- ineligible subsystems still being struck")
else:
print("VERDICT: PASS -- %d rattles, all receipts within {Bank,Gyro,Torso}" % rattles)
PY