@echo off REM Builds and runs batch_accum_check.exe - the offline math check for the REM mini-batch accumulation exports (2026-08-09 audit, F4). Locates the VS REM build environment itself, exactly like build_cpu.bat beside it. REM Run build_cpu.bat FIRST so WarriorCPU.lib/.dll match the current source. setlocal set VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" if not exist %VSWHERE% ( echo Could not find vswhere.exe - is Visual Studio / Build Tools installed? exit /b 1 ) for /f "usebackq tokens=*" %%i in (`%VSWHERE% -latest -products * -property installationPath`) do ( set VSINSTALL=%%i ) if not defined VSINSTALL ( echo Could not find any Visual Studio / Build Tools installation. exit /b 1 ) call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" if errorlevel 1 exit /b 1 cd /d "%~dp0" cl.exe /nologo /EHsc /O2 /std:c++17 batch_accum_check.cpp WarriorCPU.lib /Fe:batch_accum_check.exe if errorlevel 1 ( echo Build failed. exit /b 1 ) REM ".\" prefix on purpose - some shells refuse to launch an executable by bare REM relative name, and the failure reads as "build produced nothing". .\batch_accum_check.exe exit /b %errorlevel%