A replicant could not start walking between gait-change records. The port's
body case 4 (the task-#64 lockstep twin) is an INSERTION sitting between case 0
and the advance group; in the binary case 4 is a MEMBER of that group
(FUN_004a5678 @004a5678: case 2,3,4,5,8,... -- no turn block, no speed exit),
so case 0's fallthrough is meant to land on Advance(). The insertion caught it.
On a replicant that is not a race but an identity: case 0 arms walk iff
standSpeed < bodyTargetSpeed, and the inserted block resets iff standSpeed <
bspd -- where bspd IS bodyTargetSpeed for a replicant. Same expression, so arm
and reset fire on the same frame, forever, and a peer parked at Standing with a
live replicated demand never cycles. bodyCycleSpeed stays 0 while position
advances from dead reckoning: the skate.
This is the sequel to e91d447 (#82). Before it the replicant branch read the
dead local mapper cell (0 forever), the exit never fired, and the fallthrough
worked BY ACCIDENT. Fixing the dead cell closed the escape hatch.
Fix: case 0 -> goto advance_body_normally, the leg twin's own idiom, restoring
the binary's structure without touching the #64/#82 turn logic.
BT_NO_BODY_FALLTHRU=1 reverts.
Measured (2-node, scratchpad/night13/skatelock.sh):
legacy 336 consecutive locked seconds, bspd=39.2324 bts=39.2324 every line
fixed 0 locks, every pass
master body-Standing samples 52 -> 21 (it locked too, invisibly at mj=0)
turn-in-place intact: pivoter body state 4 x9 / leg state 4 x8, in lockstep
Diagnostics (both keepers): [skate] now carries bstate= -- the field lines
proved "both channels idle" but never named the state, which was the whole
answer; [bodySM]/[peergait] under BT_BODY_SM_LOG instrument the arm->reset pair
and a moving replicant's body channel.
NOT claimed: that this accounts for the night-13 field episodes. That link is
inference -- locked + translating IS the skate signature by construction, but no
bench caught the two together. bstate= settles it next playtest.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NCJQkvq6G2JNrpVbA75tVZ
73 lines
3.4 KiB
Bash
73 lines
3.4 KiB
Bash
#!/usr/bin/env bash
|
|
# =========================================================================
|
|
# TURN-IN-PLACE regression check for the #52 fallthrough fix.
|
|
#
|
|
# The fix only changes ONE path: case 0 no longer falls into the port's
|
|
# turn block. Entry INTO state 4 is unaffected -- masters arm it via the
|
|
# leg twin's lockstep (mech2.cpp:1014) and peers via the #82 block
|
|
# (mech4.cpp:2851), and both set the state so the NEXT frame dispatches
|
|
# straight to case 4. This bench exercises that claim instead of asserting
|
|
# it: force sustained PIVOTING and confirm state 4 is still entered, still
|
|
# advances, and still exits -- on both the master and the peer.
|
|
#
|
|
# PROVOCATION: BT_GOTO with a tiny throttle and a stop radius it can never
|
|
# reach -- the mech steers at the enemy forever while creeping below
|
|
# standSpeed, which is exactly the trn entry gate (turning + speed in
|
|
# [0, standSpeed] + turnCapable).
|
|
# =========================================================================
|
|
set -x
|
|
MODE="${1:-fixed}"
|
|
DUR="${2:-150}"
|
|
. /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 tr_${MODE}_a.log tr_${MODE}_b.log tr_${MODE}_relay.log
|
|
|
|
bt_expert_egg MP.EGG TR.EGG
|
|
sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" TR.EGG
|
|
|
|
LEGACY=""
|
|
[ "$MODE" = "legacy" ] && LEGACY=1
|
|
|
|
# v2: MUTUAL goto converged instantly -- both mechs faced each other, err~0,
|
|
# nothing ever turned (146 samples parked at Standing). A pivot needs a target
|
|
# that keeps MOVING, so B autodrives away and A creeps-and-steers after it:
|
|
# heading error stays live while A's speed stays under standSpeed, which is the
|
|
# trn entry gate.
|
|
( export BT_AUTODRIVE=0.6 # B: the moving target
|
|
export BT_BODY_SM_LOG=1 BT_MP_LOG=1
|
|
[ -n "$LEGACY" ] && export BT_NO_BODY_FALLTHRU=1
|
|
bt_launch tr_${MODE}_b.log TR.EGG 0x0C -net 1601 )
|
|
sleep 2
|
|
( export BT_GOTO=enemy BT_GOTO_STOP=5 BT_GOTO_THR=0.02 BT_GOTO_LOG=1
|
|
export BT_BODY_SM_LOG=1 BT_MP_LOG=1 # A: the pivoter
|
|
[ -n "$LEGACY" ] && export BT_NO_BODY_FALLTHRU=1
|
|
bt_launch tr_${MODE}_a.log TR.EGG 0x03 -net 1501 )
|
|
sleep 5
|
|
python ../tools/btconsole.py TR.EGG 127.0.0.1:1501 127.0.0.1:1601 > tr_${MODE}_relay.log 2>&1 &
|
|
RELAY=$!
|
|
sleep "$DUR"
|
|
kill $RELAY 2>/dev/null
|
|
bt_kill_ours
|
|
sleep 2
|
|
taskkill //F //IM btl4.exe > /dev/null 2>&1
|
|
sleep 3
|
|
|
|
echo "=================== TURN REGRESSION MODE=$MODE ==================="
|
|
echo "--- MASTER: does the turn-in-place clip still get entered + advanced? ---"
|
|
for n in a b; do
|
|
echo "node $n body state=4 samples : $(grep -a '\[gaitSM\] adv=' tr_${MODE}_${n}.log | grep -caE ' state=4 ')"
|
|
echo "node $n leg state=4 samples : $(grep -a '\[gaitSM\] adv=' tr_${MODE}_${n}.log | grep -caE ' legState=4')"
|
|
echo "node $n full body distribution:"
|
|
grep -a "\[gaitSM\] adv=" tr_${MODE}_${n}.log | grep -oaE "state=[0-9]+" | sort | uniq -c | sort -rn | head -6
|
|
done
|
|
echo
|
|
echo "--- PEER: does a replicant still pivot (body state 4 while moving)? ---"
|
|
grep -a "\[peergait\]" tr_${MODE}_b.log | grep -oaE "bstate=[0-9-]+" | sort | uniq -c | sort -rn | head -8
|
|
echo
|
|
echo "--- no new lock / no skate ---"
|
|
echo -n "STANDING-LOCK a/b: "; echo "$(grep -ac 'STANDING-LOCK' tr_${MODE}_a.log) / $(grep -ac 'STANDING-LOCK' tr_${MODE}_b.log)"
|
|
echo -n "SKATING a/b: "; echo "$(grep -ac 'SKATING' tr_${MODE}_a.log) / $(grep -ac 'SKATING' tr_${MODE}_b.log)"
|