refactor(core): bind generator fields once per resolved strate (L40, migration step 2); research R7

SurfaceWorld, FloatingIslands and legacy evaluators sit behind one immutable densityAt adapter held in
a variant (no virtual call per sample); BindResolvedStratumFields builds a sorted strate table at world
setup, so DensityAt, native SW/FI sampling and ClassifyBoxDetailed no longer ask the strate manager per
sample. No arithmetic change: owner hashes identical to L37/L39 at W1/W12. Cost vs L39: FI -0.66%,
SW -1.31% (noise). verify fast/medium/full PASS (full re-run alone: 407 gates).
Research R7: disk cache design for UE5/Windows/multiplayer and a zlib probe (about 1/3 size, 0.1 ms/tile).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
This commit is contained in:
Fr0zkaandClaude Opus 5.5 committed 2026-10-23 17:15:46 +02:00
1 parent 753cc9c259
commit efa9e89468
8 files changed
+859 -118

No files matched your search

@@ -0,0 +1,74 @@
# Linux40 — immutable field binding
## Change
`ShapeWorldInternal.h` now has concrete immutable SurfaceWorld, FloatingIslands and legacy adapters
with a common `densityAt(x,y,z,out)` call shape. `FGeneratorFieldAdapterV1` stores them in a variant,
so hot sampling uses concrete dispatch without a virtual call. FI retains its fixed-point sampler and
captures the legacy boundary parameters while binding.
`BindResolvedStratumFields` creates a sorted table of resolved strate bounds, plan references and
evaluator objects during world construction/initialization. Native SurfaceWorld and FI sampling,
boundary composition lookup, legacy SurfaceWorld bridging and `ClassifyBoxDetailed` select from that
table. The manager layout width is captured once for the legacy-compatible chunk projection.
## Lookup boundary and identity
The direct manager selection lookups in native SurfaceWorld/FI evaluation and box classification are
removed. `DensityAt` now selects native fields through the bound table. Legacy
`UVoxelGenerator::GetDensityAt` still performs its own manager routing when reached through the
legacy bridge or an out-of-plan fallback. Manager-derived layout width/FI compatibility parameters
are captured at bind time; manager access also remains in build/planning helpers. Generator-specific
boundary and passage policy still lives in `FStandaloneShapeWorld`.
No density arithmetic, fixed-point conversion order, evaluator version or Unreal adapter changed.
The canonical owner FI and SurfaceWorld hashes are identical to L37/L39 for W1 and W12. The owner
layout IDs also match L39: FI `b7a7d9ecc48d8f26`, SurfaceWorld `8a52e84c26ed92d2`. Fast logs and hash
summaries: `Saved/Linux/l40/fast-trial1.log` and `Saved/Linux/l40/fast-summary.json`.
## Cost
Five interleaved pairs against the L39 Clang binary, using the canonical owner recipes:
| Recipe | L39 median | L40 median | Median change | Paired changes (L40 vs L39) |
|---|---:|---:|---:|---|
| FloatingIslands | 17.556 s | 17.440 s | −0.66% | +2.26%, −3.99%, −0.66%, −0.87%, −0.47% |
| SurfaceWorld | 1.829 s | 1.805 s | −1.31% | −2.64%, −0.22%, +0.55%, −0.44%, −1.48% |
Both deltas are within observed pair noise; no per-voxel regression was measured. Raw output is in
`Saved/Linux/l40/cost-l40-vs-l39-run.log` and `cost-l40-vs-l39-summary.json`.
## Verification
| Tier | Result | Wall time | Evidence |
|---|---|---:|---|
| Fast | PASS | 162.0 s | Canonical owner hashes match L37 for both recipes at W1/W12; all controls pass. |
| Medium | PASS | 468.6 s | Transition, route/proof, LOD0–8 ring, owner shape and capture matrix pass. |
| Full | TIMED OUT | 1740 s (29 min) | GCC build and supplement passed; L25 and crossing24 determinism passed for both compilers, and Clang upper-SW style0 W1/W8/W12 passed. The run timed out during the GCC upper-SW style0 W1 cell; no full summary or cost-baseline/pair results were produced. |
Clang and GCC candidate builds succeeded with source stamp
`f35bc59c6172370e98dc83ec8ee5ba51dfab83a3faf075c26189fc83172f4ac8`. The full run used the requested
CPU/memory limits and a 1740-second timeout. At the stop, host load was 20.5. The partial log is
`Saved/Linux/l40/full-final.log`; a `full-summary.json` was not written. Other tier and build logs are
under `Saved/Linux/l40/`.
## Failed attempts
- The first Clang build passed `unique_ptr` objects to adapter constructors expecting raw observer
pointers; corrected with `.get()`, then the build passed.
- Two early cost-harness launches failed before starting measurements: one shell quoting error and
two Python `-c` quoting errors. The later logged five-pair run completed successfully.
- The single full-tier run reached its 1740-second timeout while the GCC upper-SW fixture style0 W1
determinism cell was still running. The cell has no completion record; the run returned timeout
status 124. No full-tier L36 baseline build or full-tier cost pairs ran.
No Unreal compile was run; no Unreal adapter or `VoxelWorld.cpp` source change was required.
## Orchestrator review (Claude)
Accepted. The full tier had timed out here under load (two Lunas plus host load of about 20). I re-ran it alone on
the final source (stamp `f35bc59c…`): **PASS, 407 gates, 2857 s.** Its built-in cost comparison is against
**L36** and shows FI +3.03% (all five pairs positive) and SW +0.38%. That FI delta is L37's mouth geometry; this
round's own L39→L40 pairs are −0.66% FI and −1.31% SW. Two follow-ups for the tool:
- the full tier's cost baseline is hard-coded to L36; it should follow the previous commit;
- the full tier now needs about 48 minutes including builds, so its timeout must be above 29 minutes.