feat(render): implement Campaign AR and terrain fidelity

This commit is contained in:
Erik 2026-08-22 13:13:29 +02:00
parent 99cf26e00c
commit 7a5f96ede5
368 changed files with 50611 additions and 950 deletions

View file

@ -9,11 +9,15 @@ param(
[switch]$CaptureContention,
[switch]$SkipRuntimeCounters,
[int]$LoginTimeoutSeconds = 90,
[int]$CollisionShadowEvery = 0
[int]$CollisionShadowEvery = 0,
[ValidateSet('retail', 'low', 'medium', 'high', 'auto')]
[string]$RenderPackPreset = 'retail',
[hashtable]$RenderPackSettingOverrides = @{}
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
. (Join-Path $PSScriptRoot 'connected-render-pack-gate-common.ps1')
if ([string]::IsNullOrWhiteSpace($Account)) { $Account = 'testaccount' }
if ([string]::IsNullOrWhiteSpace($Password)) { $Password = 'testpassword' }
@ -722,35 +726,19 @@ if (-not $SkipBuild) {
if (-not (Test-Path -LiteralPath $exe)) { throw "client executable not found: $exe" }
if (-not (Test-Path -LiteralPath $cliDll)) { throw "CLI assembly not found: $cliDll" }
$sourceCommit = (& git -C $Repository rev-parse HEAD).Trim()
# -SkipBuild is intentionally supported, so the checked-out source commit is
# not necessarily the binary being measured. Read the SDK-stamped
# AssemblyInformationalVersion from the executable and make the BINARY commit
# the baseline identity. Otherwise a docs-only commit after a build can
# silently mislabel every performance artifact.
$binaryProductVersion = [Diagnostics.FileVersionInfo]::GetVersionInfo($exe).ProductVersion
$binaryCommitMatch = [regex]::Match(
[string]$binaryProductVersion,
'\+([0-9a-fA-F]{40})(?:\.|$)')
$binaryCommit = if ($binaryCommitMatch.Success) {
$binaryCommitMatch.Groups[1].Value.ToLowerInvariant()
}
else {
$null
}
$commit = if ($null -ne $binaryCommit) { $binaryCommit } else { $sourceCommit }
$binaryMatchesSource = $null -ne $binaryCommit -and $binaryCommit -eq $sourceCommit
# Generated logs and artifacts may be untracked beside a clean source tree.
# The reproducibility contract is about tracked source modifications.
$sourceStatus = @(& git -C $Repository status --short --untracked-files=no)
if ($null -eq $binaryCommit) {
$failures.Add(
"client binary ProductVersion '$binaryProductVersion' does not identify a 40-character source commit")
}
elseif (-not $binaryMatchesSource) {
$warnings.Add(
"measured binary commit $binaryCommit differs from checked-out source commit $sourceCommit")
}
$renderPackGate = New-ConnectedRenderPackGateState `
-Root $artifactDir `
-Preset $RenderPackPreset `
-SettingOverrides $RenderPackSettingOverrides
try {
$binaryIdentity = Get-ConnectedGateBinaryIdentity `
-Repository $Repository -Executable $exe -SkipBuild:$SkipBuild
$sourceCommit = $binaryIdentity.SourceCommit
$binaryProductVersion = $binaryIdentity.BinaryProductVersion
$binaryCommit = $binaryIdentity.BinaryCommit
$binaryMatchesSource = $binaryIdentity.BinaryMatchesSource
$sourceStatus = @($binaryIdentity.SourceTrackedStatus)
$commit = $binaryCommit
$videoControllers = @(Get-CimInstance Win32_VideoController -ErrorAction SilentlyContinue | ForEach-Object {
[pscustomobject]@{ Name = $_.Name; DriverVersion = $_.DriverVersion; AdapterRam = $_.AdapterRAM }
})
@ -789,7 +777,7 @@ $null = New-Item -ItemType Directory -Force -Path $artifactDir
$acdreamEnvVars = Get-ChildItem Env: | Where-Object { $_.Name -like 'ACDREAM_*' } |
Sort-Object Name |
ForEach-Object {
$sensitive = $_.Name -match '(?i)(PASS|PASSWORD|TOKEN|SECRET|KEY)'
$sensitive = $_.Name -match '(?i)(PASS|PASSWORD|TOKEN|SECRET|KEY|USER|ACCOUNT)'
[pscustomobject]@{
Name = $_.Name
Value = if ($sensitive) { '<redacted>' } else { $_.Value }
@ -809,6 +797,7 @@ $envDisclosure = [pscustomobject][ordered]@{
RuntimeCounters = -not [bool]$SkipRuntimeCounters
CollisionShadowEvery = $CollisionShadowEvery
Route = $routeFileName
RenderPackSelection = (Get-ConnectedRenderPackGateReport $renderPackGate)
EnvironmentVariables = @($acdreamEnvVars)
}
$envDisclosure | ConvertTo-Json -Depth 4 |
@ -924,6 +913,12 @@ try {
30
$canonicalCheckpoints = @(Read-CanonicalCheckpoints)
Add-CanonicalCheckpointFailures $process
Add-ConnectedRenderPackMetadataFailures `
-ArtifactDirectory $artifactDir `
-ScreenshotNames $expectedCheckpointNames `
-State $renderPackGate `
-Failures $failures `
-Label $runName
if ($CollisionShadowEvery -gt 0 -and $canonicalCheckpoints.Count -gt 0) {
$lastShadow =
$canonicalCheckpoints[-1].resources.PSObject.Properties['collisionShadow']
@ -1027,6 +1022,7 @@ finally {
BinaryMatchesSource = $binaryMatchesSource
SessionName = $env:SESSIONNAME
CollisionShadowEvery = $CollisionShadowEvery
RenderPackSelection = (Get-ConnectedRenderPackGateReport $renderPackGate)
ExitCode = $exitCode
GracefulExit = $gracefulExit
Failures = @($failures)
@ -1057,5 +1053,9 @@ finally {
foreach ($failure in $failures) { Write-Output "FAILURE=$failure" }
foreach ($warning in $warnings) { Write-Output "WARNING=$warning" }
}
}
finally {
Restore-ConnectedRenderPackGateEnvironment $renderPackGate
}
if ($failures.Count -gt 0) { exit 1 }