feat(physics): add differential flat BSP traversal

Port every current containment, overlap, walkable, and six-path moving-collision query to immutable integer-indexed assets behind a graph-authoritative referee. Exact synthetic, installed-DAT, complete-resolver, and zero-allocation gates prove bit-identical behavior before connected dual publication.

Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-25 15:47:58 +02:00
parent 9cd42417a8
commit f7ff9f4eea
13 changed files with 3907 additions and 46 deletions

View file

@ -1654,13 +1654,20 @@ port in any phase — no separate listing here.
> defines deterministic immutable collision records and validates exact
> source identity over synthetic corruption cases and representative installed
> DATs; production traversal remains on the graph oracle until the later
> differential gate.
> differential gate. Slice I3 appends the complete prepared collision package
> to the existing single mmap. Slice I4 now ports every current containment,
> overlap, walkable, and six-path moving-collision entry point to the immutable
> integer-indexed assets. Its exact referee passes 13 focused tests, 7,500
> installed-DAT comparisons, 1,200 complete resolver frames, and 10,000 warmed
> iterations at zero managed bytes with no mismatch. Production remains
> graph-authoritative while I5 dual publication and the connected shadow gate
> are active. Release build and 8,384 solution tests / 5 skips pass.
> The historical exact cutover
> rollback remains
> `git revert ef1d263337997bb030eadb7b8e71d73dc659907a`. Slice H is complete:
> retained UI/frame work, exact bounded light selection, and
> pooled/borrowed/direct network I/O pass 8,292 Release tests / 5 skips and the
> connected lifecycle/reconnect gate. Slice I is active at I4 from
> connected lifecycle/reconnect gate. Slice I is active at I5 from
> [its detailed plan](2026-07-25-modern-runtime-slice-i.md).
**Spec:** `docs/superpowers/specs/2026-07-05-modern-pipeline-design.md` (the
@ -1685,11 +1692,11 @@ hitch and follows.
| MP1a | `AcDream.Content` extraction (GL-free MeshExtractor + boundary records out of App) | ✅ SHIPPED 2026-07-05 — user-gated (renders identical, zero tripwires, perf-neutral); 8 commits `651d041e`..`b0758d77` |
| MP1b | Pak format + `acdream-bake` CLI + mmap `PakReader` + equivalence/full-scale gate | ✅ **SHIPPED 2026-07-24** — 729,888 EnvCell keys → 17,117 unique geometries + 712,771 aliases (42.6×), 751,141 total keys / 38,370 physical blobs, zero failures, 28,192.4 MiB, 81.4 s validated atomic publish; full-DAT gate also corrected a real collision in WB's legacy geometry hash. [Report](../research/2026-07-24-slice-b-full-bake-report.md) |
| **MP-Alloc (safe batch)** | Reuse per-frame buffers: anim pose, particle draw-list, interior partition, animatedIds/drawableCells sets | ✅ SHIPPED + USER-GATED 2026-07-05 — dense-town frame-time spikes 2087ms → 610ms, alloc spikes (3075MB single-frame) eliminated, gen2 GC 511/window → ~0; user confirms FPS steady. 4 commits `b8c05e2b`..`91afea24` |
| MP-Alloc (hard sites) | EnvCell settled-camera rebuild gate + physics `Transition` reuse | 🟡 Physics half SHIPPED 2026-07-25 — retail-shaped reset-complete transition/query scratch is bit-identical and 0 B/resolve across five profiles; immutable flat collision storage and its complete deterministic prepared package are shipped; traversal differential work continues in Slice I4. |
| MP-Alloc (hard sites) | EnvCell settled-camera rebuild gate + physics `Transition` reuse | 🟡 Physics half SHIPPED 2026-07-25 — retail-shaped reset-complete transition/query scratch is bit-identical and 0 B/resolve across five profiles; immutable flat collision storage, its deterministic prepared package, and the zero-mismatch/zero-allocation flat traversal referee are shipped; connected dual publication continues in Slice I5. |
| MP1c | Streaming cutover to pak + hitch gate | ✅ **SHIPPED 2026-07-24** — typed package-only production source, explicit Setup probes, non-allocating Portal-first lookup, exact translucency metadata, and ordered teardown; capped/uncapped/dense physical routes + user visual gate pass. Uncapped CPU p99 7.825→6.496 ms, GPU p99 3.406→2.706 ms, portal frame max 202.9→39.9 MiB, process allocation 41.8%, zero invalid Setup probes. [Report](../research/2026-07-24-slice-c-prepared-asset-cutover-report.md) |
| MP2 | Retail particle distance/cell-view degradation: DAT-authored range, exact infinite/finite off-view update branches, emitter-first render scan, user-requested 2× default range | ✅ SHIPPED 2026-07-17 — Aerlinthe hotspot `0x32000223` resolves to retail 64m and defaults to 128m; landscape/entity streaming distance unchanged |
| MP3 | Arch ECS render world + delta submission (the 300-FPS lever) | ⚪ — note: does NOT fix the steady-state GC churn (that's MP-Alloc); MP3 is the draw-submission throughput lever |
| MP4 | Zero-alloc frame loop + flat physics data (residual, post-MP-Alloc) | 🟡 ACTIVE — Slice I1 zero-allocation transition scratch, I2 immutable schema, and I3 complete deterministic collision package shipped; I4 flat traversal shadow implementation is active. |
| MP4 | Zero-alloc frame loop + flat physics data (residual, post-MP-Alloc) | 🟡 ACTIVE — Slice I1 zero-allocation transition scratch, I2 immutable schema, I3 deterministic collision package, and I4 exact flat traversal referee shipped; I5 dual publication and connected shadow verification are active. |
| MP5 | Job-system parallelism | ⚪ stretch, evidence-gated |
---

View file

@ -128,8 +128,14 @@ prepared-collision interface over the existing single mmap. Two complete
29,908,271,024-byte bakes contain 2,232,170 keys with zero failures and the
same SHA-256 across different worker counts; cancellation/corruption gates and
8,371 solution tests / 5 skips pass.
Slice I4 ports every current collision entry point to integer-indexed flat
assets behind a graph-authoritative referee. Thirteen focused tests, 10,000
randomized static/swept comparisons, 5,000 walkable comparisons, 7,500
installed-DAT comparisons, and 1,200 complete resolver frames have exact
state/float-bit equality; 10,000 warmed flat iterations allocate zero managed
bytes. Release build and 8,384 solution tests / 5 skips pass.
Slice H is complete: retained UI/frame work, exact bounded light selection,
and pooled/borrowed/direct network I/O pass. Slice I is active at I4 under
and pooled/borrowed/direct network I/O pass. Slice I is active at I5 under
[`2026-07-25-modern-runtime-slice-i.md`](2026-07-25-modern-runtime-slice-i.md).
The historical exact G4 visual rollback remains
`git revert ef1d263337997bb030eadb7b8e71d73dc659907a`.

View file

@ -1,8 +1,8 @@
# Modern runtime Slice I — flat collision assets and zero-allocation physics
**Status:** I0I3 COMPLETE — retail oracle, zero-allocation transition
scratch, deterministic immutable collision records, and complete prepared
package fixed; I4 active
**Status:** I0-I4 COMPLETE - retail oracle, zero-allocation transition
scratch, deterministic immutable collision records, complete prepared
package, and exact flat-traversal differential gate fixed; I5 active
**Parent:** `2026-07-24-modern-runtime-architecture.md`, Slice I
**Purpose:** remove parsed DAT object graphs and steady collision allocations
without changing one retail collision decision, float, comparison, or traversal
@ -213,6 +213,16 @@ tests / 5 skips pass. Production traversal remains graph-only. Evidence:
Gate: zero differential mismatch. Any mismatch blocks cutover; no tolerance
band is permitted for deterministic scalar results.
**PASSED 2026-07-25:** the integer-indexed shadow ports every current
containment, overlap, walkable, and six-path moving-collision entry point.
The 13-test referee completed 10,000 randomized static/swept comparisons,
5,000 walkable comparisons, 7,500 installed-DAT comparisons across three
representative cells, all six dispatcher paths, and 1,200 complete resolver
frames with exact state and float-bit equality. Ten thousand warmed flat
iterations allocated zero managed bytes. Production remains graph-authoritative
until I5/I6. Release build and 8,384 solution tests / 5 skips pass. Evidence:
[`../research/2026-07-25-slice-i4-flat-bsp-differential.md`](../research/2026-07-25-slice-i4-flat-bsp-differential.md).
### I5 — dual publication and connected shadow gate
1. Extend collision preparation so a `LandblockBuild` carries immutable flat