#!/usr/bin/env bash # #32 AUDIO SOURCE POOL verification. # # BEFORE: sources were alGenSources'd per sound event and alDeleteSources'd on # release. Every 4.11.674 player log shows thousands of ACQUIRE FAILED lines # (3031-6571 across five machines), first failure ~10% into the match, still # failing at 97% -- combat bursts churned through OpenAL's 256-source context # limit. # # AFTER: sources are generated once and recycled. This run reproduces the # failure mode -- sustained combat, all weapon groups firing, missiles, deaths # and explosions -- and reads the census. # # PASS: # * ACQUIRE FAILED lines == 0 # * census `pooled` settles well under the 200 cap (steady-state demand) # * census `reuses` climbs into the thousands (recycling is doing the work) 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 sed "s/^map=.*/map=grass/; s/^time=.*/time=day/" MP.EGG > AUD.EGG LOG=audiopool_${1:-post}.log rm -f "$LOG" BT_DMG_LOG=1 \ BT_SPAWN_ENEMY=1 BT_GOTO=enemy BT_GOTO_STOP=2 \ BT_AUTOFIRE=1 BT_AF_MISSILE=1 BT_AF_PERIOD=1 \ bt_launch "$LOG" AUD.EGG 0x03 sleep 200 taskkill //F //IM btl4.exe > /dev/null 2>&1 sleep 2 echo "=== ACQUIRE FAILED (want 0) ===" grep -c "ACQUIRE FAILED" "$LOG" echo "=== census progression ===" grep -oE "\[audio\] source census:.*" "$LOG" | head -3 grep -oE "\[audio\] source census:.*" "$LOG" | tail -3