#!/usr/bin/env bash # ========================================================================= # #142 CROUCH does not toggle -- name the gate. # # FIELD (Oracle, night 13): "the crouch button did not toggle to display # crouched ... no state change ... the light next to it always flashes when # pressed, but state does not change. Remains in stand mode." # # That is the EJECT bug's signature: the press reaches the handler (lamp # responds) and a GATE silently declines it. DuckRequestMessageHandler # always succeeds -- it just sets duckState=1. The CONSUMER (mech4.cpp) is # where it dies: # # if (duckState != 0 && squatCapable != 0) { # if (mapPosture == 1) squat; # else if (mapPosture == 2) rise; # else if (BT_DUCK_LOG) log; <- only diagnostic, env-gated # duckState = 0; # } # # squatCapable == 0 skips the whole block: no log, and the latch is not even # consumed. A new ungated [duck] REQUEST DROPPED receipt covers both misses. # # Runs the SAME chassis twice is pointless -- squatCapable is per-model # ('squ'/'sqd' clips shipped), so sweep several. CROUCH is button 0x13 # (shipped bindings: left column 0x10-0x15 = map+/map-/IR/CROUCH/searchlight/ # display). BT_BTNTEST2 exists precisely for "crouch then rise". # ========================================================================= set -x V="${1:-madcat}" . /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 cr_${V}.log bt_expert_egg MP.EGG CR.EGG sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=${V}/" CR.EGG ( export BT_BTNTEST=0x13,900,960 # CROUCH press export BT_BTNTEST2=0x13,1500,1560 # and again (toggle back / retry) export BT_DUCK_LOG=1 BT_GAIT_LOG=1 BT_KEY_NOFOCUS=1 bt_launch cr_${V}.log CR.EGG 0x03 ) for i in $(seq 1 60); do grep -aq "btntest" cr_${V}.log 2>/dev/null && break; sleep 2; done sleep 45 bt_kill_ours; sleep 2; taskkill //F //IM btl4.exe > /dev/null 2>&1; sleep 2 echo "=================== #142 CROUCH vehicle=$V ===================" echo "--- 1. did the press reach the handler? ---" grep -a "btntest" cr_${V}.log | head -4 grep -a "DuckRequest" cr_${V}.log | head -3 echo echo "--- 2. THE GATE: why was it dropped? ---" grep -a "REQUEST DROPPED" cr_${V}.log | head -4 echo -n "dropped-receipt count: "; grep -ac "REQUEST DROPPED" cr_${V}.log echo echo "--- 3. did a posture change actually happen? ---" grep -aE "\[duck\] (SQUAT|RISE)" cr_${V}.log | head -4 echo -n "SQUAT/RISE events: "; grep -acE "\[duck\] (SQUAT|RISE)" cr_${V}.log echo echo "--- 4. does this chassis even ship the squat clips? ---" grep -aiE "squatCapable|squ.*clip|sqd" cr_${V}.log | head -4