test(M00): record Goldshire pose evidence

This commit is contained in:
2026-07-12 01:59:42 +04:00
parent 657a1d888a
commit 03891edeb2
4 changed files with 116 additions and 13 deletions
+27 -12
View File
@@ -9,6 +9,8 @@ param(
[double[]]$YawOffsets = @(-10.0, 0.0, 10.0),
[double[]]$PitchOffsets = @(-10.0, 0.0, 10.0),
[double]$CameraFov = 62.0,
[int]$ViewportWidth = 1280,
[int]$ViewportHeight = 900,
[double]$WaitSeconds = 2.0,
[double]$MeasureSeconds = 0.1,
[switch]$PlanOnly
@@ -62,19 +64,26 @@ try {
continue
}
& $GodotPath --path . --script res://src/tools/capture_render_checkpoints.gd -- `
--output $candidateOutput --only $Checkpoint --single-pass `
--camera-fov $cameraFovText `
--camera-yaw-offset $yawText --camera-pitch-offset $pitchText `
--wait $waitSecondsText --measure $measureSecondsText
if ($LASTEXITCODE -ne 0) {
$captureArguments = @(
"--path", ".", "--script", "res://src/tools/capture_render_checkpoints.gd", "--",
"--output", $candidateOutput, "--only", $Checkpoint, "--single-pass",
"--camera-fov", $cameraFovText,
"--camera-yaw-offset", $yawText, "--camera-pitch-offset", $pitchText,
"--viewport-width", $ViewportWidth, "--viewport-height", $ViewportHeight,
"--wait", $waitSecondsText, "--measure", $measureSecondsText
)
$captureProcess = Start-Process -FilePath $GodotPath -ArgumentList $captureArguments -Wait -PassThru
if ($captureProcess.ExitCode -ne 0) {
throw "Capture failed for yaw=$yawText pitch=$pitchText"
}
& $GodotPath --headless --path . --script res://src/tools/compare_render_checkpoints.gd -- `
--reference $ReferenceDirectory --candidate $candidateOutput `
--only $Checkpoint --output $comparisonReport
if ($LASTEXITCODE -notin @(0, 1)) {
$comparisonArguments = @(
"--headless", "--path", ".", "--script", "res://src/tools/compare_render_checkpoints.gd", "--",
"--reference", $ReferenceDirectory, "--candidate", $candidateOutput,
"--only", $Checkpoint, "--output", $comparisonReport
)
$comparisonProcess = Start-Process -FilePath $GodotPath -ArgumentList $comparisonArguments -Wait -PassThru -NoNewWindow
if ($comparisonProcess.ExitCode -notin @(0, 1)) {
throw "Comparison failed for yaw=$yawText pitch=$pitchText"
}
@@ -82,8 +91,13 @@ try {
if ($comparison.compared_count -lt 1) {
throw "No paired image was compared for yaw=$yawText pitch=$pitchText"
}
$meanError = ($comparison.results | Measure-Object -Property mean_perceptual_error -Average).Average
$changedRatio = ($comparison.results | Measure-Object -Property changed_pixel_ratio -Average).Average
$metricResults = @($comparison.results | Where-Object { $null -ne $_.mean_perceptual_error })
if ($metricResults.Count -ne $comparison.compared_count) {
$statuses = ($comparison.results.status | Sort-Object -Unique) -join ","
throw "Comparison produced no numeric metric for yaw=$yawText pitch=$pitchText statuses=$statuses"
}
$meanError = ($metricResults | Measure-Object -Property mean_perceptual_error -Average).Average
$changedRatio = ($metricResults | Measure-Object -Property changed_pixel_ratio -Average).Average
$ranking.Add([pscustomobject]@{
yaw_offset_degrees = $yawOffset
pitch_offset_degrees = $pitchOffset
@@ -106,6 +120,7 @@ try {
schema_version = 1
checkpoint = $Checkpoint
reference_directory = [IO.Path]::GetFullPath($ReferenceDirectory)
viewport = @($ViewportWidth, $ViewportHeight)
candidates = $rankedCandidates
}
New-Item -ItemType Directory -Force -Path $absoluteOutput | Out-Null