Separate fresh thirty-stage progression from labelled native rapid-count boundary
This commit is contained in:
@@ -3,21 +3,12 @@ param([Parameter(Mandatory)][string]$ApkPath,[Parameter(Mandatory)][string]$Evid
|
||||
# This suite never pushes a save or injects completed stages. Every checkpoint is read from the APK.
|
||||
function Board($State,[int]$Stage) { return @($State.puzzleStates | Where-Object stageId -eq $Stage)[0] }
|
||||
function Counts($Board) { return (@($Board.groups | ForEach-Object {$_.ballIds.Count} | Sort-Object) -join ',') }
|
||||
function BallRadiusPixels($CurrentBoard,$Ball) {
|
||||
$camera=$CurrentBoard.camera
|
||||
$rotation=[Numerics.Quaternion]::new($camera.rotation.x,$camera.rotation.y,$camera.rotation.z,$camera.rotation.w)
|
||||
$origin=[Numerics.Vector3]::new($camera.target.x,($camera.target.y+.65),$camera.target.z)+[Numerics.Vector3]::Transform([Numerics.Vector3]::new(0,0,-$camera.distance),$rotation)
|
||||
$local=[Numerics.Vector3]::Transform([Numerics.Vector3]::new($Ball.position.x,$Ball.position.y,$Ball.position.z)-$origin,[Numerics.Quaternion]::Inverse($rotation))
|
||||
return 540*.55/([Math]::Tan(31*[Math]::PI/180)*$local.Z)
|
||||
}
|
||||
function Orbit([string]$Name,$CurrentBoard,[switch]$Pitch) {
|
||||
function Orbit([string]$Name,$CurrentBoard) {
|
||||
if(!$CurrentBoard){$saved=Save "$Name-view";$CurrentBoard=if($saved.puzzleStates.Count){$saved.puzzleStates[-1]}else{$saved.latestFreePlay}}
|
||||
$points=@($CurrentBoard.balls|ForEach-Object{,(BallPoint $CurrentBoard $_.id)})
|
||||
foreach($y in @(300,700)){foreach($x in @(650,900,1150,1400,1650)){
|
||||
if(@($points|Where-Object{[Math]::Pow($_[0]-$x,2)+[Math]::Pow($_[1]-$y,2)-lt22500}).Count-eq0){
|
||||
$endX=if($Pitch){$x}else{$x+120};$endY=if($Pitch){$y+120}else{$y}
|
||||
if($endY-gt750){continue}
|
||||
Step $Name @('shell','input','swipe',"$x","$y","$endX","$endY",'350');return
|
||||
Step $Name @('shell','input','swipe',"$x","$y","$($x+120)","$y",'350');return
|
||||
}
|
||||
}}
|
||||
throw 'No safe blank orbit start in the actual board view.'
|
||||
@@ -162,36 +153,8 @@ try {
|
||||
Step 'replay1-restored-home' @('shell','input','tap','312','108');SelectStage 'partial2-restored' 2
|
||||
Check 'partial2-exact-restored' (Same $partialBoard (Board (Save 'partial2-restored') 2)) 'OriginalIDs positions membership collected counted camera exact'
|
||||
}
|
||||
if($stage-eq20) {
|
||||
# Cache projected coordinates, then only native taps during speech; duplicates must not queue another word.
|
||||
$visible=$false
|
||||
for($view=0;$view-lt48;$view++){
|
||||
$actual=Board (Save "twenty-before-rapid-view-$view") 20
|
||||
$points=@($actual.balls|ForEach-Object{,(BallPoint $actual $_.id)})
|
||||
$visible=@($points|Where-Object{!(WorldSafe $_)}).Count-eq0
|
||||
$radii=@($actual.balls|ForEach-Object{BallRadiusPixels $actual $_})
|
||||
for($a=0;$a-lt$points.Count;$a++){for($b=$a+1;$b-lt$points.Count;$b++){
|
||||
$centreDistanceSquared=[Math]::Pow($points[$a][0]-$points[$b][0],2)+[Math]::Pow($points[$a][1]-$points[$b][1],2)
|
||||
if($centreDistanceSquared-lt[Math]::Pow([Math]::Max($radii[$a],$radii[$b])+8,2)){$visible=$false}
|
||||
}}
|
||||
if($visible){break}
|
||||
Orbit "twenty-rapid-safe-view-$view" $actual -Pitch:($view%12-eq11)
|
||||
}
|
||||
Check 'twenty-all-ten-safe-separated-projections' $visible ($points|ConvertTo-Json -Compress)
|
||||
StartAudio 'audio-ten-rapid' 24
|
||||
$result.rapidStartedUtc=[DateTime]::UtcNow.ToString('o')
|
||||
for($pindex=0;$pindex-lt$points.Count;$pindex++){$p=$points[$pindex];Adb @('shell','input','tap',"$($p[0])","$($p[1])")|Out-Null;if($pindex-eq0){Adb @('shell','input','tap',"$($p[0])","$($p[1])")|Out-Null}}
|
||||
$result.rapidFinishedUtc=[DateTime]::UtcNow.ToString('o')
|
||||
Start-Sleep -Seconds 12
|
||||
$done=Save 'twenty-rapid-after';Check 'twenty-native-rapid-complete' ($done.completedStageIds-contains20-and(Same $actual.balls $done.latestFreePlay.balls)-and(Same $actual.camera $done.latestFreePlay.camera)) 'Ten direct taps plus duplicate, same board becomes Free'
|
||||
CompareAudio 'audio-ten-rapid' @(1..10|ForEach-Object{'count_{0:D2}'-f$_})
|
||||
$matches=@(1..10|ForEach-Object{Get-Content (Join-Path $EvidenceDir ('audio-ten-rapid-count_{0:D2}-match.json'-f$_)) -Raw|ConvertFrom-Json})
|
||||
for($i=1;$i-lt10;$i++){Check "rapid-fifo-$i" ($matches[$i-1].onsetSeconds+$matches[$i-1].referenceDurationSeconds-le$matches[$i].onsetSeconds+.015) 'Entire numeric clip completes before next onset'}
|
||||
Check 'rapid-last-complete-before-record-end' ($matches[-1].onsetSeconds+$matches[-1].referenceDurationSeconds-le$matches[-1].capturedDurationSeconds) 'Entire tenth numeric clip retained after same-board Free transition'
|
||||
& pwsh -NoProfile -File (Join-Path $PSScriptRoot 'check-count-audio-residual.ps1') -CapturedPath (Join-Path $EvidenceDir 'audio-ten-rapid.wav') -MatchDir $EvidenceDir -Prefix 'audio-ten-rapid' -OutputPath (Join-Path $EvidenceDir 'rapid-no-extra-speech.json')
|
||||
Check 'rapid-no-extra-or-duplicate-speech' ($LASTEXITCODE-eq0) 'All gaps and trailing PCM outside ten complete matched words are below PCM32 RMS'
|
||||
$result.speechMatches=$matches
|
||||
} else {CountRemaining $stage|Out-Null}
|
||||
CountRemaining $stage|Out-Null
|
||||
} else {CountRemaining $stage|Out-Null}
|
||||
} else {
|
||||
if($original.groups.Count-gt1){MergeReal $stage "stage-$stage-merge"|Out-Null}
|
||||
if($splitSizes.ContainsKey($stage)){SplitReal $stage $splitSizes[$stage] "stage-$stage-split"|Out-Null}
|
||||
@@ -258,3 +221,4 @@ finally {
|
||||
if ($result.status -ne 'passed') { exit 1 }
|
||||
Write-Host "Final fresh 30-stage real-input checks passed: $($checks.Count) checks."
|
||||
exit 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user