test(phys): A6.P5 fixture — 3 ticks from live door-stuck capture
over-penetration-capture.jsonl is 3 records extracted from door-stuck-capture.jsonl: the cell-crossing over-penetration tick (0xA9B4013F -> 0xA9B40150, sphere committed 0.27m INTO slab), a stuck-position hit=yes tick, and a stuck-position hit=no tick. Drives the A6.P5 replay tests that prove the cellSet gate removal closes both the over-penetration and the intermittent-visibility bugs. extract-records.ps1 is a one-shot extractor; reusable if we capture more. Source captures (door-stuck-*.jsonl, door-stuck-*.launch.log) gitignored. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7910d51e7a
commit
82781c272b
3 changed files with 77 additions and 0 deletions
64
tools/jsonl/extract-records.ps1
Normal file
64
tools/jsonl/extract-records.ps1
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# A6.P5 fixture builder — pull the 3 representative records from the live
|
||||
# capture into the test fixture. One-shot; gitignored fixture path.
|
||||
param(
|
||||
[string]$Source = 'door-stuck-capture.jsonl',
|
||||
[string]$Out = 'tests/AcDream.Core.Tests/Fixtures/door-bug/over-penetration-capture.jsonl'
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$outDir = Split-Path -Parent $Out
|
||||
if (-not (Test-Path $outDir)) { New-Item -ItemType Directory -Force -Path $outDir | Out-Null }
|
||||
|
||||
# We need exactly three records:
|
||||
# A) The over-penetration tick: cellId 2847146303, currentPos.Y ~16.35,
|
||||
# targetPos.Y ~16.76 — the resolve that committed the over-penetration.
|
||||
# B) A stuck-position hit=yes tick: cellId 2847146320, currentPos at
|
||||
# (132.401, 16.762, 94), resultCollisionNormalValid=true.
|
||||
# C) A stuck-position hit=no tick: cellId 2847146320, same currentPos,
|
||||
# resultCollisionNormalValid=false.
|
||||
|
||||
$records = Get-Content -LiteralPath $Source -Encoding UTF8 |
|
||||
ForEach-Object {
|
||||
if ([string]::IsNullOrWhiteSpace($_)) { return }
|
||||
$obj = $_ | ConvertFrom-Json
|
||||
$obj | Add-Member -NotePropertyName _raw -NotePropertyValue $_
|
||||
$obj
|
||||
}
|
||||
|
||||
# A — over-penetration tick: input cell 2847146303, output cell 2847146320,
|
||||
# target Y >~16.7, result position approx == target (not blocked).
|
||||
$overpen = $records |
|
||||
Where-Object {
|
||||
$_.input.cellId -eq 2847146303 -and
|
||||
$_.result.cellId -eq 2847146320 -and
|
||||
$_.input.targetPos.y -gt 16.7 -and
|
||||
[Math]::Abs($_.result.position.y - $_.input.targetPos.y) -lt 0.01
|
||||
} |
|
||||
Select-Object -First 1
|
||||
|
||||
# B — stuck-position hit=yes
|
||||
$stuckHit = $records |
|
||||
Where-Object {
|
||||
$_.input.cellId -eq 2847146320 -and
|
||||
[Math]::Abs($_.input.currentPos.x - 132.401) -lt 0.001 -and
|
||||
[Math]::Abs($_.input.currentPos.y - 16.762) -lt 0.001 -and
|
||||
$_.result.collisionNormalValid
|
||||
} |
|
||||
Select-Object -First 1
|
||||
|
||||
# C — stuck-position hit=no
|
||||
$stuckMiss = $records |
|
||||
Where-Object {
|
||||
$_.input.cellId -eq 2847146320 -and
|
||||
[Math]::Abs($_.input.currentPos.x - 132.401) -lt 0.001 -and
|
||||
[Math]::Abs($_.input.currentPos.y - 16.762) -lt 0.001 -and
|
||||
-not $_.result.collisionNormalValid
|
||||
} |
|
||||
Select-Object -First 1
|
||||
|
||||
if ($null -eq $overpen) { throw 'over-penetration tick not found' }
|
||||
if ($null -eq $stuckHit) { throw 'stuck hit=yes tick not found' }
|
||||
if ($null -eq $stuckMiss) { throw 'stuck hit=no tick not found' }
|
||||
|
||||
@($overpen._raw, $stuckHit._raw, $stuckMiss._raw) | Set-Content -Encoding utf8 -Path $Out
|
||||
"Wrote $Out with 3 records (over-penetration + stuck hit + stuck miss)."
|
||||
Loading…
Add table
Add a link
Reference in a new issue