param([string]$MasmRoot = 'F:\MASM32\masm32') $ErrorActionPreference = 'Stop' $root = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path Push-Location $root try { & 'C:\Python314\python.exe' tools\tests\export_scratch_probe.py if ($LASTEXITCODE -ne 0) { throw 'Scratch probe state export failed' } & "$MasmRoot\bin\ml.exe" /c /coff /Cp /nologo /I. /Fobuild\scratch\native-probe.obj tools\tests\scratch_native_probe.asm if ($LASTEXITCODE -ne 0) { throw 'Scratch probe assembly failed' } $sdkRoot = Join-Path ${env:ProgramFiles(x86)} 'Windows Kits\10\Lib' $sdk = Get-ChildItem -LiteralPath $sdkRoot -Directory | Sort-Object Name -Descending | Where-Object { Test-Path -LiteralPath (Join-Path $_.FullName 'um\x86\kernel32.lib') } | Select-Object -First 1 $libraries = @() if ($sdk) { $libraries += '/LIBPATH:' + (Join-Path $sdk.FullName 'um\x86') } $libraries += "/LIBPATH:$MasmRoot\lib" & "$MasmRoot\bin\link.exe" /nologo /SUBSYSTEM:CONSOLE /ENTRY:ScratchProbeStart @libraries /OUT:build\scratch\native-probe.exe build\scratch\native-probe.obj build\scratch\native-probe-base.obj kernel32.lib winmm.lib user32.lib ws2_32.lib gdi32.lib if ($LASTEXITCODE -ne 0) { throw 'Scratch probe link failed' } & .\build\scratch\native-probe.exe if ($LASTEXITCODE -ne 0) { throw "Scratch probe failed: $LASTEXITCODE" } Write-Output 'PASS: 36 edge-coin frames + 78 portrait scratching frames; coating survives view switches; grounded solid counter and hall entry/exit without console or extra charge' } finally { Pop-Location }