docs(p0): P1 design nuances — acdream already has FindTransitCellsSphere; test the production ResolveWithTransition path

From reading CEnvCell::find_transit_cells @ pc:309968: P1 is mostly REWIRING
curr_cell advancement (RunCheckOtherCellsAndAdvance/SetCheckPos) to use the
portal-crossing candidate, not FindCellSet's point-in-cell pick. The P1
conformance must replay the golden positions through ResolveWithTransition (a
trajectory incl. outdoor landcell 0031), not bare FindCellList.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-03 15:09:46 +02:00
parent bb4dead0ae
commit 81ea3aa41a

View file

@ -110,6 +110,29 @@ boundary. (Plus intrinsic building entry A3 + uniform `find_env_collisions` B1.)
documents-the-bug test `FindCellList_DoorwayThreshold_DivergesFromRetail_PendingP1` PASSES while
this diverges and FAILS when P1 lands → rewrite it to assert the full sequence then.
**P1 design nuances (from reading `find_transit_cells` @ pc:309968 + the acdream membership map):**
1. `find_transit_cells` (sphere variant) STRUCTURE: per portal —
(a) exit portal (`other_cell_id == 0xffffffff`): if a sphere crosses the exit-portal polygon
plane toward outside → set `exitOutside`; (b) interior/building portal with a LOADED neighbour:
if a sphere `CCellStruct::sphere_intersects_cell(neighbour) != OUTSIDE``add_cell(neighbour)`;
(c) interior/building portal with an UNLOADED neighbour: if a sphere crosses the portal POLYGON
plane (`dist` vs ±(radius+0.0002), honoring `exact_match`) → `add_cell(other_cell_id)`. After
all portals, `if (exitOutside) add_all_outside_cells`. The transition's `curr_cell` then advances
to the crossed/overlapped neighbour — BEFORE foot-containment.
2. **acdream already has `CellTransit.FindTransitCellsSphere`** (a partial port of exactly this:
exit→exitOutside, loaded-neighbour→`SphereIntersectsCellBsp`, unloaded→plane-distance). So P1 is
NOT writing find_transit_cells from scratch — it is making `curr_cell` ADVANCEMENT use the
portal-crossing result (the candidate the sphere crossed into) as the membership answer, instead
of `FindCellSet`/`FindCellList`'s point-in-cell interior-wins pick. Audit `RunCheckOtherCellsAndAdvance`
+ `SetCheckPos` (the swept-cell advance) — that is where the pick criterion gets chosen.
3. **Test against the PRODUCTION path, not bare `FindCellList`.** The P0 documents-the-bug test
calls `FindCellList` directly (unit-level). P1's conformance must replay the golden POSITIONS
through `PhysicsEngine.ResolveWithTransition` (a trajectory, like `CellarUpTrajectoryReplay`,
seeded incl. the outdoor landcell `0031`) and assert the swept `CellId` sequence matches the
captured retail `change_cell` sequence. Bare-`FindCellList` is the unit pin; the trajectory is
the integration gate. (Needs the outdoor landcell + building portal loaded — more than the
building-only cache P0 uses.)
## P0 status / P1-entry checklist — COMPLETE
**Apparatus: COMPLETE + GREEN.** (Conformance suite 59 pass / 1 skip / 0 fail.)