Files
VoxelForge/Standalone/Research/WorldAssemblerM3/Research28/REPORT.md
T

14 KiB
Raw Blame History

R28 — revised report

I withdraw the earlier claim that the motif/profile timing gap identifies a code-path cost. The runs are not comparable, and the logged stage timings are not a complete additive breakdown of wall time.

Cost ledger

Worker sums are CPU seconds across workers, not wall seconds. The LOD sums below are derived by adding the indicated per-LOD log rows. The per-tile figure is their total divided by the run’s tile count; it is a workload average, not isolated dispatch overhead.

Generator Whole-view wall time Shape stage: total (local; intervals/signs; surface band; far parents), ms LOD worker-s: 0–1 / 2–3 / 4–8 Average worker time per tile
Natural SurfaceWorld 1.786 s in a raw paired run (log); separate instrumented static run: 1.590 s (log) 403.838 (35.042; 76.196; 235.239; 50.008) (log) 3.472580 / 1.965454 / 7.878235 s, derived from LOD 0, 1, 2, 3, 4, 5, 6, 7, 8 5.62 ms/tile, derived: 13.316269 worker-s ÷ 2,370 tiles (log)
flatField profile 1.330 s (log) 432.380 (35.708; 77.840; 243.355; 67.675) (log) 3.757256 / 1.936127 / 4.675822 s, derived from LOD 0, 1, 2, 3, 4, 5, 6, 7, 8 4.66 ms/tile, derived: 10.369205 worker-s ÷ 2,226 tiles (log)
Caves 0.706 s (log); the L54 report records 0.727 s (report) 60.375 (27.537; 13.054; 19.202; 0) (log) 5.773526 / not run / not run; LOD 0 only (log) 7.92 ms/tile, derived: 5.773526 worker-s ÷ 729 tiles (log)
Motifs 0.524 s (log) 45.207 (27.253; 14.085; 3.510; 0) (log) 4.888551 / not run / not run; LOD 0 only (log) 14.25 ms/tile, derived: 4.888551 worker-s ÷ 343 tiles (log)
Lattice 1.647 s (log); the L58 report records 1.694 s (report) 136.529 (61.169; 35.675; 38.559; 0) (log) 17.254969 / not run / not run; LOD 0 only (log) 23.67 ms/tile, derived: 17.254969 worker-s ÷ 729 tiles (log)
Floating Islands 5.028 s paired median (log); older diagnostic run: 4.899 s (log) 444.665 (36.714; 85.436; 262.287; 52.390) (log) 32.535211 / 3.989240 / 13.653194 s, derived from LOD 0, 1, 2, 3, 4, 5, 6, 7, 8 21.17 ms/tile, derived: 50.177645 worker-s ÷ 2,370 tiles (log)

“Not run” means those LODs were excluded by the fixture configuration, not that their cost was zero. Shape component values are the logged bins; their sums do not exactly equal the logged ShapeStage total. No separate fixed per-tile dispatch cost is isolated. The average worker time per tile includes density evaluation, grid work, skirts/refinement and mesh assembly.

The far-LOD work is visible in the SurfaceWorld LOD rows: LOD4–8 account for 7.878235 worker-s, derived above. In those rows, column evaluation totals 2.699576 worker-ms, cap refinement 870.358 worker-ms, and skirts 789.370 worker-ms, derived from the LOD4 through LOD8 counters. Connectors are not reported as a separate counter. This is CPU work, not wall time.

Every run pays some owner-data loading, plan/layout resolution, shape setup and per-requested-tile scheduling/meshing. The directly logged preflight is only a few to tens of milliseconds here—for example, owner-data load is 5.193 ms and plan timing 10.991 ms for flatField (log, log). Shape setup is not a universal fixed half-second: it ranges from 45 ms in the restricted motif run to roughly 404–445 ms in the full SurfaceWorld/FI diagnostics. Far LODs are not paid when a fixture requests only LOD0.

Motifs versus flatField profiles

The 2.54× headline ratio is derived from 1.330 ÷ 0.524; it does not isolate field cost.

Both fixtures set surface_profile_override.kind to flatField (flatField fixture, motif fixture). Both logs use the SurfaceWorld recipe, the same worker count, clip radius and zero camera step. They also report the same stratum range and passage: strate 1, chunks −16…−79, route points 33, and passage passage/0-1/0, segments 153…1790 with the same vertical span. Both report no Floating Islands stratum (flatField log, motif log).

They are not the same view. The flatField log requests LOD0–8 and reports 2,226 tiles; the motif log forces max level 0 and reports 343 tiles. The motif run also has render_distance_override=yes, versus no for flatField. Both HeadlessConfig lines say camera_step_m=(0,0,0), but neither records the absolute starting camera. The motif fixture adds two SDF records. These differences prevent attributing the timing ratio to code path or terrain.

The code confirms there is no cheaper motif base-field branch. Both resolve through the SurfaceWorld adapter to Heightfield2D; the adapter wraps that evaluator, and native SurfaceWorld dispatch selects it. Heightfield2D::point uses the cached column and computes the density from ground and cap heights (source).

The flatField specialization is actually cheaper per height sample than a patterned profile: it skips the cosine calculations:

std::int64_t relief = 0;
if (profile.kind != WorldAssemblySurfaceProfileKindV1::flatField)
{
    // cosine-based relief calculation
}

(source)

Motifs add a bounded stamp overlay after the base density (call site, stamp bounds and candidates). Caves use a different adapter for constant host rock before cavern composition (source); that is not the motif path. So the logs show a shared SurfaceWorld base with extra motif work, not a primitive motif shortcut.

Shared plan, ranked by measured work

The fact-card targets imply required wall reductions of 0.78 s for Natural SurfaceWorld (1.78 − 1), 0.33 s for flatField (1.33 − 1), and 0.69 s for Lattice (1.69 − 1). These are derived target gaps, not predicted savings. Caves and motifs are already below one second in their restricted LOD0 runs; that does not establish their full-view times.

  1. Reduce far-LOD grid, cap and skirt work. The measured SurfaceWorld LOD4–8 pool is 7.878235 worker-s; flatField’s is 4.675822 worker-s. That is the largest shared measured pool for the full-view heightfield runs. It is an opportunity estimate, not an achievable gain. Keep exact density, mesh and seam checks. Falsify the optimization if per-LOD work falls but matched whole-view wall time does not improve, or if far connectors, caps or skirts fail geometry checks.

  2. Reduce or reuse cold shape setup. Full-view diagnostics show about 0.404 s for SurfaceWorld, 0.432 s for flatField and 0.445 s for FI. This offers a broad but limited ceiling; no saved result shows how much can safely be removed. Falsify it if the ShapeStage time drops without lowering matched cold whole-view time, or if reuse changes route/passage outputs.

  3. Specialize the shared heightfield/grid work. SurfaceWorld LOD0–1 used 3.472580 worker-s; the flatField run used 3.757256 worker-s across LOD0–1. The Lattice fixture used 17.254969 worker-s at LOD0, but requested no far LODs. A common optimization may help profiles and Natural SurfaceWorld, but the Lattice sample cannot justify transferring a far-LOD technique. Falsify it if field/grid counters and worker time do not fall on a matched view, or if canonical hashes and surface/passage audits change.

  4. Keep Caves and Motifs as regression cases until their views match. Their existing 0.706 s and 0.524 s logs cover 729 and 343 LOD0 tiles respectively. A same-view rerun is needed before claiming either is already near one second on the 2,370-tile workload.

Before judging gains, rerun the generators with the same tile keys, LOD counts, camera, hash setting and passage/FI structure. The current logs fail that comparability check. The reference image is unavailable here, so visual fidelity cannot be checked in this report.

What remains unknown

The logs do not isolate fixed dispatch cost per tile, do not consistently expose field/column counters, and do not provide a same-view Motif/Profile comparison. Several headline values also come from different measurement series: for example, the Caves speed log says 0.706 s while its report says 0.727 s; Lattice says 1.647 s in the speed log and 1.694 s in its report. I have kept those distinctions rather than treating them as one measurement.

I did not change the tree or run scripts, tests, builds or binaries.