Files
BT411/scratchpad/night6/bench_common.sh
T
Joe DiPrimaandClaude Fable 5 4e89baeff3 bench parity: local nodes now launch exactly like a player's shortcut
Local benches had drifted from the shipped launchers and every divergence
cost a debugging session:

  * no BT_START_INSIDE -> benches opened in the EXTERNAL CHASE camera while
    every player starts in the COCKPIT.  The first first-person look at a
    bench window was misread as a broken HUD.
  * novice bench eggs  -> every SHIPPED egg is expert; novice gates off the
    entire heat model, crits and jams, so bench combat was not field combat.
    (Verified: the aligned node now boots experience=3 simLive=1
    heatModelOn=1, where it used to boot 0/0/0.)
  * 1-LP affinity pins -> starved the gauge executive and produced a false
    "the comms panel never counts deaths" reading.  Two LPs per node keeps
    the documented single-box jitter fix without the starvation.

scratchpad/night6/bench_common.sh now owns the contract (bt_player_env,
bt_launch, bt_expert_egg, bt_novice_egg) copied verbatim from play_solo.bat,
with bt_assert_player_env warning if the shipped bat ever drifts.  All three
4-node benches source it.  The limp bench keeps a novice egg -- expert crits
the aimed leg and the mech turns-but-never-moves -- and now says so loudly.

Also: BT_SHOT_EVERY=<n> headless backbuffer capture (btl4vid.cpp), the tool
this was diagnosed with.  It must sit above the warp phase-0 early-out since
that fn is the per-frame alpha-pass hook.  OS screen-capture is off-limits:
a foreground-lock failure photographed the user's browser instead of the game.

KB: build-and-run.md gains the bench-parity rule + the capture diag;
cockpit-view.md gains the measured aspect/FOV finding (the surround's 2.05:1
view collapses vertical FOV to 31.5 deg vs the pod's 46.8, so fixed canopy
geometry covers 68.6% of the lower half -- NOT a regression: the shipped 643
binary reports identical geometry).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-30 13:30:30 -05:00

71 lines
3.6 KiB
Bash

#!/usr/bin/env bash
# ===========================================================================
# BENCH COMMON -- launch a local test node EXACTLY as a field player's
# shortcut does, so what we see locally is what they see.
#
# WHY THIS FILE EXISTS (2026-07-30): local benches had drifted from the
# shipped launchers, and every divergence cost a debugging session:
# * no BT_START_INSIDE -> benches opened in the EXTERNAL CHASE camera while
# every player starts in the COCKPIT. Hours were
# spent on a "broken HUD" that was simply the first
# first-person look at a view the benches never showed.
# * novice bench eggs -> every SHIPPED egg is `expert`; novice silences the
# whole heat model, crits and jams, so bench combat
# was not the combat players get.
# * 1-logical-processor affinity pins -> starved the gauge executive and
# produced a false "the comms panel never counts"
# reading. Two LPs per node keeps MP jitter pinned
# (the documented single-box fix) without starving.
#
# THE PLAYER ENV IS THE CONTRACT. It is copied verbatim from the shipped
# play_solo.bat / join.bat (dist zip). bt_assert_player_env compares this
# list against a shipped .bat when one is available, so drift is caught.
# ===========================================================================
BT_ROOT=/c/git/bt411
BT_EXE=$BT_ROOT/build/Release/btl4.exe
# --- the exact env every shipped launcher sets -----------------------------
bt_player_env () {
export BT_PLATFORM=glass # unified build, desktop cockpit layer
export BT_START_INSIDE=1 # COCKPIT eyepoint -- what a player sees
export BT_DEV_GAUGES=1 # MFD/gauge surfaces + cockpit surround
}
# --- warn if the shipped launcher has gained/lost a setting ----------------
bt_assert_player_env () {
local bat="$BT_ROOT/dist/BT411_4.11.643/play_solo.bat"
[ -f "$bat" ] || return 0
for v in BT_PLATFORM BT_START_INSIDE BT_DEV_GAUGES; do
grep -qi "set $v=" "$bat" || echo "[bench] WARNING: shipped bat no longer sets $v"
done
}
# --- launch one node -------------------------------------------------------
# bt_launch <logfile> <egg> <affinity> [extra args...] (env: extra BT_* vars)
# Two logical processors per node: disjoint core sets keep single-box packet
# delivery even (peer-shakiness fix) without starving the gauge executive.
bt_launch () {
local log="$1" egg="$2" aff="$3"; shift 3
( bt_player_env
export BT_LOG="$log" BT_AFFINITY="$aff"
"$BT_EXE" -egg "$egg" "$@" & )
}
# --- an EXPERT copy of an egg (what players actually fly) ------------------
# Shipped eggs are all experience=expert. Bench eggs must match unless the
# harness itself needs otherwise (see bt_novice_egg).
bt_expert_egg () { # bt_expert_egg <src.egg> <dst.egg>
sed 's/^experience=.*/experience=expert/' "$1" > "$2"
}
# --- a NOVICE copy, for the harnesses that genuinely require it ------------
# ONLY the aimed-leg gimp bench: on expert the self-damage bursts roll CRITS on
# the aimed leg, and one myomers crit leaves the mech turning-but-not-moving --
# which destroys the limp demo. Novice gates crits; the leg gimp still fires.
# Any bench using this is NOT showing player-authentic damage behaviour.
bt_novice_egg () { # bt_novice_egg <src.egg> <dst.egg>
sed 's/^experience=.*/experience=novice/' "$1" > "$2"
echo "[bench] NOTE: novice egg $2 -- crits/heat/jams are GATED OFF (harness requirement)"
}