acdream/launch-a6-issue98-cottage-gfxobj-dump.ps1
Erik 97fec19dbb test(phys): A6.P3 #98 — comparison harness reproduces cottage-floor cap
Apparatus convergence. With the cottage GfxObj 0x01000A2B registered as
a ShadowEntry in BuildEngineWithCellarFixtures, the harness now reproduces
the live cap-event collision normal (cn=(0,0,-1)) exactly, ending the
"harness doesn't reproduce" divergence the prior session's findings doc
identified.

Concretely:
  * Adds a minimum-stub landblock (TerrainSurface at z=-1000) so
    TryGetLandblockContext succeeds at the cellar XY — production's
    FindObjCollisions early-returns without a landblock and would skip
    the cottage shadow query.
  * Adds RegisterCottageGfxObj that loads the 74-polygon cottage fixture
    via GfxObjDumpSerializer.Hydrate, then registers it at the cottage's
    world transform (translation (130.5, 11.5, 94.0) + 180° around Z,
    derived from the cellar cell's WorldTransform), matching
    GameWindow.cs:5893's landblock-baked-static registration shape.
  * LiveCompare_FirstCap_HarnessMissesCottageFloorBecauseCottageGfxObjNotRegistered
    flips: the cap-normal reproduction is now enforced by
    LiveCompare_FirstCap_HarnessReproducesCottageFloorCapNormal.
  * The full per-field round-trip uncovered ONE residual divergence:
    live preserves +0.0266m of +X motion through the cap event (edge-
    slide along the floor in XY); harness blocks ALL motion at the cap.
    Captured by LiveCompare_FirstCap_ResidualXMotionDivergence_Docs...
    in documents-the-bug form so the next session has a concrete next
    target.

Fixture: tests/AcDream.Core.Tests/Fixtures/issue98/0x01000A2B.gfxobj.json
(74 polygons, 6 downward-facing cottage-floor triangles at object-local
Z=0, BSP radius 13.989m matching the live [resolve-bldg] bspR=13.99).
Captured via launch-a6-issue98-cottage-gfxobj-dump.ps1.

In-isolation: all 12 CellarUpTrajectoryReplayTests + 4 GfxObjDumpRoundTripTests
+ 1 new PhysicsDiagnosticsTests pass.

Note on full-suite baseline: the full xUnit serial run shows 8–19
failures depending on order (pre-existing test interaction with shared
statics across PlayerMovementControllerTests, MotionInterpreterTests,
PositionManagerTests, etc.). The flakiness is independent of this
change — confirmed by stashing the harness changes and observing the
same flaky range. Investigating the static-state isolation problem is
out of scope for issue #98; tracked as a follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 20:44:50 +02:00

46 lines
2.2 KiB
PowerShell

$env:ACDREAM_DAT_DIR = "$env:USERPROFILE\Documents\Asheron's Call"
$env:ACDREAM_LIVE = '1'
$env:ACDREAM_TEST_HOST = '127.0.0.1'
$env:ACDREAM_TEST_PORT = '9000'
$env:ACDREAM_TEST_USER = 'testaccount'
$env:ACDREAM_TEST_PASS = 'testpassword'
# A6.P3 #98 (2026-05-23 evening v2) — focused capture of the cottage
# GfxObj 0x01000A2B's full polygon table. ACDREAM_DUMP_GFXOBJS triggers
# a one-shot JSON dump the first time PhysicsDataCache.CacheGfxObj fires
# for the listed id. The dump lands in the tests' fixture directory under
# the worktree, so the harness can load it without copying.
#
# Reproduction steps for the user:
# 1. Run this script (it launches in the foreground; log streams to the
# file path below).
# 2. Log into +Acdream. The cottage GfxObj caches when the streaming
# worker walks the cottage building's mesh — which happens as soon
# as the cottage landblock enters the streaming N1 (near) tier.
# Holtburg's cottage (the one with the cellar) is at the spawn area,
# so just being in-world is enough.
# 3. Watch the log for "[gfxobj-dump] wrote 0x01000A2B polys=N → ..."
# then close the client.
#
# After the dump file exists at
# tests/AcDream.Core.Tests/Fixtures/issue98/0x01000A2B.gfxobj.json
# come back to Claude to continue with the RegisterCottageGfxObj wiring.
$env:ACDREAM_DUMP_GFXOBJS = '0x01000A2B'
# Output dir is the relative fixture path; the dump infrastructure
# resolves it against the worktree current dir (Set-Location below).
$env:ACDREAM_DUMP_GFXOBJS_DIR = 'tests/AcDream.Core.Tests/Fixtures/issue98'
# Keep the cell-transit probe on so the launch log shows when the player
# enters cells — helps correlate the dump event with player position.
$env:ACDREAM_PROBE_CELL = '1'
$logPath = 'C:\Users\erikn\source\repos\acdream\.claude\worktrees\strange-albattani-3fc83c\a6-issue98-cottage-gfxobj-dump-launch.log'
Write-Host "Log path: $logPath"
Write-Host "Dump target: $env:ACDREAM_DUMP_GFXOBJS_DIR\0x01000A2B.gfxobj.json"
Write-Host ''
Write-Host 'After login, watch the log for [gfxobj-dump] then close the client.'
Set-Location 'C:\Users\erikn\source\repos\acdream\.claude\worktrees\strange-albattani-3fc83c'
dotnet run --project src\AcDream.App\AcDream.App.csproj --no-build -c Debug *> $logPath