feat(core): native Core caves generator, slice 1 -- spine + room, whole view 0.73 s (L54); research R23

Core.Caves.PrimitiveField v1, opt-in per strate (legacy TunnelNetwork assets stay legacy): solid host rock
and one smooth union of two elliptical spine tubes and an ellipsoid room, each intersected with its rising
floor by cubic smooth-max (W 2.4 m, measured fillet 0.70 m, no trailing floor cap). Bound in the L40 field
table and L42 capabilities, BVH feature candidates, isTileShapeFree aware, exact interval boxes (0 misses).
Capsule flood fill arrival -> departure passes (headroom >= 0.3 m, grade <= 15 deg); the generalized
whole-surface audit passes with its controls failing. Cold whole view 0.727 s, near ring 0.19 s. Graph
ordering/serialization changes are scoped to native caves (the flagged L47 demo is unchanged); verify
tiers write captures under --out only. fast/medium/full PASS, Clang and GCC.
Research R23 (deepened): per-tile LOD0 kernel speed plan.

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-25 04:10:19 +01:00
1 parent 20f6c98ec5
commit 9458217d34
24 files changed
+471136 -59

No files matched your search

@@ -0,0 +1,91 @@
# VoxelForge R23 — Making Each Tile Cheaper
## LOD0 stage model
`World::generateTile` activates the shared column caches, binds the shape world, runs tile classification, calls `GenerateMesh`, and copies the mesher timings into diagnostics. The mesher builds a 32³-cell LOD0 tile with a 35³ padded density grid, then classifies cells, computes gradients, interpolates edges, streams triangles, emits skirts, and returns arrays for assembly. See [World::generateTile](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/VoxelForgeCore.cpp:1983>) and [UVoxelMarchingCubesMesher::GenerateMesh](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:117>).
L52 used 512 LOD0 tiles. These are **summed worker times**, not wall times. Stage shares below use each recipe’s LOD0 worker sum as the denominator. Gradient, interpolation, and dedup/stream timings are sampled and extrapolated; their subtotals do not add exactly to `mc_exclusive`. `mc_other` is a residual, not an allocation timer.
| LOD0 stage | SW worker ms (% of 2,031.707 ms) | FI worker ms (% of 28,633.183 ms) |
|---|---:|---:|
| MC exclusive, excluding skirts | 1,284.636 (63.23%) | 27,019.018 (94.36%) |
| Density grid | 608.641 (29.96%) | 26,703.171 (93.26%) |
| Cell classification | 131.076 (6.45%) | 104.673 (0.37%) |
| Gradient normals | 49.508 (2.44%) | 24.732 (0.09%) |
| Edge interpolation, including midpoint re-queries | 370.383 (18.23%) | 30.921 (0.11%) |
| Vertex dedup and triangle streaming | 95.139 (4.68%) | 66.466 (0.23%) |
| MC residual (`other`) | 47.487 (2.34%) | 106.111 (0.37%) |
| Skirts | 650.112 (32.00%) | 1,094.614 (3.82%) |
| Mesh assembly | 10.458 (0.52%) | 13.247 (0.05%) |
The direct profile rows and counts are in the [SW LOD0 log](</home/jahni/VoxelM/Plugins/VoxelForge/Saved/Linux/l52/profile/final-surface-world.log:72>) and [FI LOD0 log](</home/jahni/VoxelM/Plugins/VoxelForge/Saved/Linux/l52/profile/final-floating-islands.log:78>).
| LOD0 count | SW | FI |
|---|---:|---:|
| Density-grid samples | 21,952,000 (42,875/tile; full 35³ grid) | 17,883,062 (34,928/tile; 81.46% of full grid) |
| Candidate cell slots before proof skips | Up to 16,777,216 | Up to 16,777,216 |
| Classified and surface cells | Not logged | Not logged |
| Gradient queries / fallback density probes | Not logged | Not logged |
| Midpoint density re-queries | Not logged | Not logged |
| Generated skirt triangles | 179,600 | 198,464 |
`density_samples` is the mesher’s grid-fill count. It does not count gradient fallbacks, midpoint re-queries, or skirt probes; shared-density-grid copies also do not increment it. `CellClassificationCalls` and `SurfaceCellCalls` exist locally but are not emitted. Gradient fallback calls and memo hits, and midpoint calls, already exist in `FVoxelMarchingCubesStageTimings` and Core diagnostics; the L52 LOD logger omits them. Add per-LOD output for those counters, proof-skipped cells, active cells, and unique midpoint edges. The skirt timer and triangle count are logged, but skirt edge scans and density probes are not.
The generic heightfield column counters are zero at LOD0 for both recipes. That does **not** mean FI’s island column cache is idle: `IslandDensity` uses a separate four-way TLS cache and a four-way shared cache, activated by `World::generateTile`. The shared cache takes a per-set spin lock on misses. Add local hits/misses, shared hits/misses/computes, conflict replacements, and lock-wait time at [IslandColumnCache](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/FloatingIslandsInternal.h:461>) and [TSharedColumnValueCache](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/include/VoxelForgeCore/SharedColumnCache.h:43>).
The LOD0 grid costs about **0.0277 worker-seconds per million samples for SW** and **1.493 worker-seconds per million for FI**, at the current sample mix. Before-to-final FI profiles show samples falling from 18.951M to 17.883M and grid time from 28.335s to 26.703s. This was a package change, not an isolated proof A/B. The current proof audit checked 27,727 blocks and 36.9M samples with zero violations across Clang and GCC; it does not report LOD0 counts by skip reason. See the [L52 report](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Research/WorldAssemblerM3/Linux52/REPORT.md:36>).
Tile classification is a separate all-LOD aggregate: L52 reports 0.622 ms for SW and 22.465 ms for FI. FI’s all-LOD classifier counted 14,119 air, 18,857 mixed, and 240 unknown boxes, with 216 whole-tile skips. These are not LOD0 cell counts, and `classification_worker_ms` can overlap mesher proof work. **Correction to R22:** the FI figure is 22.465 milliseconds, not 22.5 worker-seconds.
## Techniques and measured opportunity
There is no isolated L52 A/B result for the new techniques below. I give the measured worker-time budget or a counter-based saving formula rather than inventing a point forecast.
- **Proof-guided sparse sampling — highest FI opportunity.** The existing 8³ block proofs and required-sample mask are in [GenerateMesh](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:556>), [sample-mask setup](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:911>), and [grid fill](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:1150>). Measure smaller proof blocks and active sample runs; the current proof mask disables the X8 batch path. At the current sample mix, each additional million samples avoided corresponds to about 1.493 FI or 0.0277 SW worker-seconds, before proof overhead. The earlier FI package delta corresponds to 1.632 worker-seconds less grid time, but cannot be attributed to this change alone. Keep exact samples for retained cells and the one-sample gradient halo; mixed or unknown blocks must fall back. The [NVIDIA sparse-MC design](https://github.com/NVIDIA/warp/blob/main/design/sparse-marching-cubes.md) gives the Lipschitz pruning bound; do not assume `L=1` for composed or roughened fields unless that bound is proven for the recipe.
- **SIMD density evaluation — worth measuring for FI.** The batch route is in [GenerateMesh](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:1200>) and [DensityAtLatticeX8](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/ShapeWorldInternal.h:3132>); FI’s expensive island evaluation is in [IslandDensity](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/FloatingIslandsInternal.h:743>). The current FI X8 API still evaluates native-island lanes serially, and proof-masked fills disable X8 batching. Both the i9-12900H and Ryzen 7 5800X3D support AVX2, which is eight float32 lanes; a 16-lane batch is two AVX2 vectors, not a wider native instruction. The Intel specs list AVX2 on a 6P+8E/20-thread part; AMD lists AVX2/FMA3 on the 5800X3D ([Intel](https://www.intel.com/content/www/us/en/products/sku/132214/intel-core-i912900h-processor-24m-cache-up-to-5-00-ghz/specifications.html), [AMD](https://www.amd.com/en/products/processors/desktops/ryzen/5000-series/amd-ryzen-7-5800x3d.html)). The grid-stage ceilings are 0.609 SW and 26.703 FI worker-seconds; each measured 10% grid-stage cut would save 0.061 and 2.670 worker-seconds, respectively. That is a sensitivity, not a forecast. FastNoise2 reports AVX2 3D value noise at 494.49M samples/s versus 64.13M for FastNoise Lite, and Perlin at 261.10M versus 47.93M on an i7-7820X; those are noise-kernel numbers, not this composite SDF ([FastNoise2](https://github.com/Auburn/FastNoise2)). Both CPUs have AVX2 width 8; benchmarking each is necessary.
- **Cache midpoint density queries by edge — exact SW candidate.** The midpoint re-query is inside [edge interpolation](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:1735>). Cache only the density result for repeated identical midpoint inputs; keep the existing orientation-specific interpolation arithmetic. `EdgeMidpointDensityCalls` exists but is not logged. The entire interpolation stage is a hard ceiling of 0.370 worker-seconds SW and 0.031 FI, or 30.9 and 2.6 ms of ideal W12 drain. The actual query saving is unknown until attempts, unique edges, hits, field-evaluation time, and total interpolation time are reported.
- **MC kernel layout / Flying Edges.** The cell loop uses AVX2 to classify eight X cells at once and only processes surface cells; the interpolation and `GetOrCreateVertex` path is at [GenerateMesh](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:1575>) and [vertex dedup](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:242>). Row-major X-fast storage and TLS scratch reuse already exist. The [Newman et al. SIMD MC paper](https://doi.org/10.1016/j.cag.2003.12.008) reports roughly 2× over compiler-optimized C and 4× over unoptimized C on older x86. The [Flying Edges paper](https://doi.org/10.1109/LDAV.2015.7348069) reports 6.76s versus 2.39s for Synchronized Templates at 36 threads on a 2048³ plasma volume. Those are not this field or a direct forecast. The current non-grid MC budget is 0.676 SW and 0.316 FI worker-seconds, at most 56 and 26 ms ideal W12 drain. Flying Edges can avoid repeated edge work and point merging, but changes output ordering and likely needs a recipe version bump.
- **Grid gradients versus analytic gradients.** The current [GradAt path](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:1485>) already computes central differences from cached density-grid samples and memoizes them. The [Round 18 report](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Research/WorldAssemblerM3/Round18/REPORT.md:96>) measured fallback probes falling from 11,474 to 3,018 per sampled p95 and normal cost from 65.10 to 24.16 ns/sample. The remaining L52 gradient-stage ceiling is only 49.5 ms SW and 24.7 ms FI worker-time. Analytic gradients change normals. For comparison, GPU Gems describes central differences as six volume samples; ExaBrick reports 2.70s central-difference versus 130ms analytic rendering, but that workload pays additional ray traversals, unlike our already-filled grid ([GPU Gems](https://developer.nvidia.com/gpugems/gpugems3/part-i-geometry/chapter-1-generating-complex-procedural-terrains-using-gpu), [ExaBrick paper](https://pds.uni-koeln.de/sites/home/szellma1/exabrick-compressed.pdf)).
- **Skirt-face culling — strong SW candidate, versioned output.** Skirts take 0.650 SW and 1.095 FI worker-seconds at LOD0. The viewer already computes face visibility at [ComputeVisibleSkirtFaceMask](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/StandaloneViewer.cpp:105>) and filters triangles at draw time; mesher extrusion is at [EmitSkirts](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:1960>). A 125-tile mixed-LOD capture found 87.4% of SW and 87.0% of FI skirt triangles hidden. Applied linearly to all LOD skirt timers, that gives a **modeled** 1.55/2.32 worker-seconds gross, or 0.129/0.194s ideal W12 drain. Triangle share is not a time share; edge scanning remains. Pass the neighbor mask into meshing, include it in mesh-cache identity, and rebuild when neighbor coverage changes. The captured percentages are from [SW](</home/jahni/VoxelM/Plugins/VoxelForge/Saved/Linux/l52/capture-owner-sw-arrival-render.log:7>) and [FI](</home/jahni/VoxelM/Plugins/VoxelForge/Saved/Linux/l52/capture-owner-fi-arrival-render.log:7>).
- **Transvoxel, Surface Nets, dual contouring.** These are not first-round LOD0 speed wins. Transvoxel handles 2:1 LOD boundaries, using nine high-resolution samples and 512 cases grouped into 73 classes; it could replace some seam skirts but adds transition-cell work ([Transvoxel](https://transvoxel.org/)). On an RTX 5090 sphere benchmark, uniform 512³ MC took 5.4 ms versus 6.9 ms for Surface Nets and 7.0 ms for one dual-contouring variant; sparse results were 1.9, 2.2, and 2.3 ms, with 300k active cells versus 134M dense cells ([isoext benchmark](https://guangyancai.github.io/isoext/performance.html)). These GPU results are not a CPU prediction. All three alternatives change topology or seam geometry. Dreams’ SIGGRAPH slides describe GPU MC with compaction, while Astroneer identifies MC as a core algorithm to optimize; neither supplies a comparable CPU speedup ([Dreams](https://advances.realtimerendering.com/s2015/AlexEvans_SIGGRAPH-2015-sml.pdf), [Astroneer](https://blog.astroneer.space/p/going-faster/)).
Per-tile scratch is already substantially reused: density grid, required-sample mask, gradient memo, vertex maps, and triangle arrays are thread-local and retain capacity. A per-tile `SurfaceVertexDensitySamples` vector still allocates, but there is no allocator-only timer. Add scratch growth/allocation counts and bytes; do not treat `mc_other` as allocator cost.
## Exactness and determinism
| Technique | Output class | Clang/GCC risk with FP contraction off |
|---|---|---|
| Proven block/sample omission with original samples, traversal, and gradient halo | Bit-identical | Low if bounds are sound; audit every recipe, including new caves. |
| SIMD with the same per-lane operation order | Bit-identical possible | Avoid FMA, reassociation, approximate reciprocal/sqrt, and different transcendental implementations. Existing X8 results and L52 Clang/GCC hashes pass; GCC’s default contraction previously broke SW W1 LOD2. |
| Reuse cached midpoint-density result for identical inputs | Bit-identical | Key exact input bits; preserve existing interpolation arithmetic. |
| Remove or replace midpoint re-query; analytic gradients | Slight change; version bump | Peer-identical remains required; normals or vertex positions can change. |
| Scratch/cache/layout reuse | Bit-identical | Reset state fully; retain output order and arithmetic. |
| Hidden skirt-face generation skip | Visible output can match for the same neighbor set; mesh payload changes, so bump version/cache identity | Neighbor masks and invalidation must be deterministic. |
| Flying Edges, Surface Nets, dual contouring, Transvoxel | Geometry/order changes; version bump | Use stable traversal and tables, then require Clang/GCC peer hashes. |
Current builds use `-fno-fast-math` and FP contraction off; explicit FMA intrinsics can still fuse. Keep the [L52 Clang/GCC W1/W8/W12 matrix](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Research/WorldAssemblerM3/Linux52/REPORT.md:55>) as the determinism gate.
## Sequenced plan and projections
Use the unprofiled paired W12 medians from R22 as the whole-view baseline: **SW 1.718s; FI 5.614s**. Convert worker-time deltas to wall-time only as an ideal W12 estimate; retain paired unprofiled whole-view measurements as the score.
1. **Round 1 — instrument and establish baseline.** Emit per-LOD candidate/classified/surface/proof-skipped cells; sample omissions by reason; X8 calls and active lanes; `GradAt` calls, memo hits/misses and fallback probes; midpoint attempts/unique edges/hits and query time; skirt face candidates/probes/times; FI local/shared cache stats and lock waits; scratch allocations/capacity growth. Keep profile timers from overlapping or label them as such. Gate: counters reconcile with existing sample and skirt totals, output hashes match, and unprofiled W12 stays at 1.718/5.614s.
2. **Round 2 — isolate kernel changes.** For FI, A/B proof block sizes and active-lane batching, measuring samples removed and net `mc_grid_ms`; for SW, A/B the exact midpoint-density memo, measuring query hits and interpolation time. Gate: zero proof violations, Clang/GCC W1/W8/W12 hashes match, and whole-view medians improve without profile-only gains. A 10% FI grid-stage reduction is a useful pass threshold: 2.670 worker-seconds, or 0.223s ideal W12. Without that result, credit no FI saving. Credit SW only from its measured A/B delta; its full interpolation-stage ceiling is 31ms ideal W12.
3. **Round 3 — cull hidden skirt faces before extrusion.** Pass the viewer’s neighbor mask into the mesher and cache key. Gate: fixed-view captures match visible output, neighbor/LOD transitions have no gaps, mask changes invalidate the mesh, and whole-view W12 medians improve. The capture-based scenario is 0.129s SW and 0.194s FI; treat it as optimistic until measured.
| Stage | Conditional whole-view projection |
|---|---|
| Round 1, counters only | SW 1.718s; FI 5.614s |
| Round 2, FI grid gate passes; no SW delta yet measured | SW 1.718s; FI about 5.39s; if FI gate fails, 5.61s |
| Round 3, skirt scenario also passes | SW about 1.59s; FI about 5.20s if Round 2 passed, or 5.42s if it did not |
| Any gate fails | Retain the last measured baseline for that recipe |
These projections are scenarios, not forecasts. Even removing all LOD0 worker work would save at most about 0.17s SW or 2.39s FI on an ideal 12-worker drain; LOD0-only changes cannot take SW from 1.718s to 1s.
@@ -0,0 +1,68 @@
# VoxelForge — Research R23: making each tile cheaper
## Stage model
[`World::generateTile`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/VoxelForgeCore.cpp:1983>) sets the shape and optional shared-cache scope, classifies the tile, calls the mesher, then copies mesh data into the tile payload. The LOD0 mesher path is [`GenerateMesh`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:117>).
LOD0 uses a 32³ cell tile and a 35³ density grid: 42,875 samples per fully sampled tile. FI sampled 17.883M points across 512 LOD0 jobs, an average of 34,928 per job (81.5% of the full grid); SW sampled all 21.952M. FI’s proof mask marks active cells and their one-sample gradient halo. Proof-mask construction is outside the density-grid timer, in the residual work.
The density fill, proof mask and X-batch gates are in [`VoxelMarchingCubesMesher.cpp`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:888>). The cell loop classifies eight X-adjacent cells with AVX2, then computes gradients, interpolation, deduplication and streams triangles for surface cells. The mesher reads gradients from the density grid and memoizes them; it re-queries only for proxy-band fallback samples. Edge interpolation can re-query at the midpoint when `T` is between 0.375 and 0.625. The skirt pass clips and emits boundary geometry; final triangle and skirt-mask assembly follows. These stages are in [`VoxelMarchingCubesMesher.cpp`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:1484>). Round18 found only 35 midpoint probes in its audit, so that re-query has little measured headroom.
The table shows L52 totals for 512 LOD0 jobs. Shares use each recipe’s `worker_sum_s` as denominator. Grid and skirt timers are direct; some mesher substage buckets are sampled or extrapolated. Those buckets exceed the outer mesher timer by about 17 ms in both recipes, so treat shares as approximate.
| Stage | Code | SW total / share | FI total / share |
|---|---|---:|---:|
| Density grid | `GenerateMesh`, fill and grid timer | 608.641 ms / 30.0% | 26,703.171 ms / 93.3% |
| Cell-case classification | AVX2 X rows | 131.076 ms / 6.45% | 104.673 ms / 0.37% |
| Gradients and normals | central differences, memo | 49.508 ms / 2.44% | 24.732 ms / 0.09% |
| Edge interpolation | edge crossings and midpoint probes | 370.383 ms / 18.23% | 30.921 ms / 0.11% |
| Vertex dedup and stream | vertex maps, triangle bins | 95.139 ms / 4.68% | 66.466 ms / 0.23% |
| Other mesher work | setup, proof-mask work, finalization residual | 47.487 ms / 2.34% | 106.111 ms / 0.37% |
| Skirts | boundary scan, clipping, emission | 650.112 ms / 32.0% | 1,094.614 ms / 3.82% |
| Core mesh assembly | mesh-to-payload copy | 10.458 ms / 0.51% | 13.247 ms / 0.05% |
The LOD0 worker sums are 2.032 seconds for SW and 28.633 seconds for FI. With 12 workers, their ideal drains are 0.169 and 2.386 seconds. SW’s LOD0 work alone cannot close R22’s roughly 0.72-second whole-view gap to one second; the shared kernel needs to carry into other LODs as well.
Tile and block classification is separate from the cell-case stage. L52’s final logs report `classification_worker_ms=0.622` for SW and `22.465` for FI across 960 full-detail tiles, with no LOD0 split. [`ClassifyBoxDetailed`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/ShapeWorldInternal.h:5273>) records milliseconds. The Linux52 report’s prose calls the FI figure 22.47 worker-seconds; that conflicts with the final log field and source units, so I have not counted it as seconds.
The X8 density API is not generally eight-lane SIMD: its native-only route loops over scalar `DensityAtLattice` calls. FI’s proof-masked fill disables the X-batch route. The cell classifier is genuine AVX2; a separate primitive Z-run helper uses four double lanes. The relevant code is [`ShapeWorldInternal.h`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/ShapeWorldInternal.h:3132>) and [`ShapeWorldInternal.h`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/ShapeWorldInternal.h:9407>).
The world-level shared column cache is scoped in [`VoxelForgeCore.cpp`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/VoxelForgeCore.cpp:1055>) and used by `Heightfield2D::point` in [`WorldAssemblerInternal.h`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/WorldAssemblerInternal.h:2576>). L52’s LOD0 heightfield-column counters are zero. FI also has an island XY column cache in [`FloatingIslandsInternal.h`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/FloatingIslandsInternal.h:477>); its hit rate and cost are not reported. An optional shared 3D density grid exists, but Core passes null, and using it disables proof-mask sampling.
## Techniques and evidence
- **SIMD field evaluation:** both the i9-12900H and Ryzen 7 5800X3D list AVX2 support; the AVX2 width is eight floats, so X16 means two vectors rather than a wider instruction. [Intel specs](https://www.intel.com/content/www/us/en/products/sku/132214/intel-core-i912900h-processor-24m-cache-up-to-5-00-ghz/specifications.html), [AMD specs](https://www.amd.com/en/products/processors/desktops/ryzen/5000-series/amd-ryzen-7-5800x3d.html). FastNoise2 reports 494.49M 3D value samples/s with AVX2 versus 64.13M for FastNoiseLite on an i7-7820X; this is an illustration, not a VoxelForge forecast. [FastNoise2 benchmark](https://github.com/Auburn/FastNoise2). An earlier in-repo packed X-row path reduced its LOD0 grid timer 62.4% with matching W1/W8 hashes; its workload differs from L52. [Round9 report](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Research/OwnerShapeWorld/speed_round/round9/REPORT.md>).
- **Sparse sampling:** refine the existing conservative 8³ block proofs to smaller mixed blocks, retaining exact fallback for unknown blocks and the gradient halo. The method is already proven for the current block sizes: L52’s brute-force audit checked 36.9M samples with zero violations under Clang and GCC. [Linux52 report](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Research/WorldAssemblerM3/Linux52/REPORT.md>). Generic Lipschitz pruning assumes a valid field bound; use VoxelForge’s exact box proofs rather than assuming every field is a unit-distance SDF. [NVIDIA Warp sparse MC design](https://github.com/NVIDIA/warp/blob/main/design/sparse-marching-cubes.md).
- **Alternative extraction:** Flying Edges’ four-pass structure intersects each edge once and preallocates output; its paper reports up to 5.22× serial and 8.26× at 36 threads versus its optimized MC baseline on CT angiography data. VTK warns that its output may include degenerate triangles and differ from MC. These are much larger workloads than a 32³ tile. [Paper](https://doi.org/10.1109/LDAV.2015.7348069), [VTK documentation](https://vtk.org/doc/nightly/html/classvtkFlyingEdges3D.html). Surface Nets and dual contouring change vertex placement and mesh topology. On an RTX 5090 sphere benchmark at 512³, uniform MC took 5.4 ms, Surface Nets 6.9 ms and dual contouring 7.0 ms. [Isoext performance](https://guangyancai.github.io/isoext/performance.html). Transvoxel solves 2:1 LOD seams using nine high-resolution samples and 512 cases in 73 classes; it does not reduce interior LOD0 sampling. [Transvoxel](https://transvoxel.org/).
- **Reuse and layout:** density, proof-mask and gradient arrays, vertex maps and triangle bins already retain worker-local capacity. The grid is X-fast and cell traversal follows X rows. The visible per-tile scratch allocation is `SurfaceVertexDensitySamples`; allocation time is not isolated. The viewer already computes visible skirt faces, but generation currently emits all skirt faces. [Viewer mask](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/StandaloneViewer.cpp:105>).
## Exactness
| Technique | Bit-identical? | Conditions |
|---|---|---|
| AVX2 arithmetic batches | Yes, conditionally | Preserve each lane’s operation order; keep contraction off; avoid approximate math. |
| Grid-derived gradients and memoization | Yes; already implemented | Preserve central differences and the proxy-band fallback. |
| Finer proof blocks | Yes, conditionally | Use conservative proofs, exact fallback and the same halo. |
| Scratch reuse and cache changes | Yes | Reset all validity and key state; cache replacement must affect residency only. |
| Vectorized `sin`/`cos` | Not guaranteed | SIMD math can shift bits. Pin the implementation and compare Clang/GCC peers. |
| Hidden skirt-face omission | Mesh output changes | Rendered output can match for a fixed neighbor mask, but hashes and cache identity change. |
| Flying Edges, Surface Nets, dual contouring or Transvoxel | No | Geometry or topology changes; peer determinism is possible with a fixed implementation and version bump. |
VoxelForge already disables FP contraction for Core; GCC and Clang document that contraction controls FMA formation. Those flags do not fix libm or vector-trig results across implementations. [GCC](https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html), [Clang](https://clang.llvm.org/docs/UsersManual.html#controlling-floating-point-behavior), [FastNoise2 reproducibility notes](https://github.com/Auburn/FastNoise2/wiki/FAQ).
## Ranked plan
Savings are scenarios in **worker-seconds across the same 512 LOD0 jobs**. Divide by 12 for ideal-drain wall time. They are not additive.
| Rank | Change and code location | SW / FI scenario | Risk and measurement |
|---|---|---:|---|
| 1 | Add mask-aware AVX2 field batches in mesher fill and field evaluators: [`VoxelMarchingCubesMesher.cpp`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Source/VoxelForge/Private/VoxelMarchingCubesMesher.cpp:911>), [`ShapeWorldInternal.h`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/ShapeWorldInternal.h:3132>), FI [`IslandDensity`](</home/jahni/VoxelM/Plugins/VoxelForge/Standalone/Core/src/FloatingIslandsInternal.h:743>). | If grid fill speeds up 1.25–1.5×: **0.12–0.20 / 5.34–8.90 s** | Current X8 API and FI proof mask fall back to scalar work. Preserve lane operation order first; pin vector math if trig is vectorized. Count active lanes and compare grid timers, then paired unprofiled medians and hashes under Clang/GCC on both CPUs. |
| 2 | Refine 8³ proofs to 4³ in mixed blocks; retain unknown fallback and halo. | If FI grid work falls another 5–15%: **≈0 / 1.3–4.0 s** | Sensitivity range only; finer proofs may cost more than they save. Measure samples and classifier time, then repeat the brute-force proof audit and hash matrix. |
| 3 | Pass the viewer’s visible-face mask into `GenerateMesh` and skip hidden skirt emission. | **h×0.650 / h×1.095 s**, where `h` is the hidden fraction | L52 has no hidden-face histogram. Measure mask fractions and skirt time under fixed adjacency; include the mask in any mesh-cache key. |
| 4 | Prototype Flying Edges after grid fill. | If the post-grid MC work became 2.5× faster: **≈0.41 / 0.19 s** | Literature results may not transfer to 32³ tiles; output ordering and degenerates differ. Benchmark prefilled grids and whole tiles; version the changed mesh. |
| 5 | Instrument and reuse remaining scratch; add FI island-cache hit/miss timing. | **Unmeasured / unmeasured** | Existing buffers already retain capacity. Count allocations and cache hits before selecting a change; compare output hashes after any scratch reuse. |
**Read-only pass complete.** No source edits, scripts, tests, builds or binaries were run.