fix(physics): seal collision generations before activation

This commit is contained in:
Erik 2026-07-31 15:53:05 +02:00
parent be94bc9b06
commit d94145e6b8
15 changed files with 1556 additions and 410 deletions

View file

@ -12,11 +12,15 @@ as "delete everything and start over." A partial retail transition port exists:
- `PhysicsDataCache` loads GfxObj, Setup, and CellStruct physics data.
- Landblock streaming never edits the live collision world incrementally.
`PreparedLandblockCollisionGeneration` owns an off-side cache, CellGraph,
engine snapshot, buildings, statics, and versioned dynamic-owner refloods;
`RuntimePhysicsState.CommitCollisionGeneration` validates freshness and
activates the complete generation on the single update thread. A dirty live
owner returns to the App cursor for refresh. The old generation remains
queryable until that commit. See
engine snapshot, buildings, statics, and versioned retained-owner refloods.
Retained means every non-suspended dynamic or adjacent-root static touching
(or withdrawn from) the target prefix; only authored target-root statics are
superseded. All scans and replacement construction run through bounded
capture/seal cursors. `RuntimePhysicsState.CommitCollisionGeneration` does
one final mutation-version check and activates the sealed generation without
managed allocation on the single update thread. Cancellation tears down only
the named staging generation. The old generation remains queryable until
commit. See
`docs/research/2026-07-31-atomic-collision-generation.md`.
- `ShadowObjectRegistry` gives the resolver a broadphase over nearby objects.
- `TerrainSurface` uses triangle-aware terrain contact.