Files
VoxelForge/Saved/Research/intervals/REPORT.md
T
Fr0zkaandClaude Opus 5.5 61b1c9c329 research(intervals): one-day spike -- whole near region in 241 ms (6 workers), exact signs, far proxy 8.6 ms
Standalone C++20 (MSVC /O2 /arch:AVX2), no Unreal. A 372-shape corpus (rooms at the hardest
profile's scale, winding tunnels, pillars, stalactites, shelves, floating masses, thin strata,
rotated shapes, crowded junctions, craters), built two ways: point-by-point reference vs column
intervals on 3 axes + 64-bit sign words + bit-scanned active cells + meshing from analytic crossings.
64 m near region at 25 cm (17.4 M nodes), 5 seeds, fresh processes:
  workers  near CPU total (median/p95/worst)  interval stage   mesh stage (single-threaded)
  1        349 / 358 / 358 ms                  154 ms           188 ms
  6        241 / 280 / 288 ms                   48 ms           191 ms
  8        240 / 271 / 277 ms                   43 ms           193 ms
Near mesh ~563k triangles, 13.5 MB; total output 19.9 MB; busiest line 58 candidates (< 64).
Correctness: 0 sign mismatches vs reference at every node, 0 missing crossings/open contours, thin
strata with no lattice node inside get explicit triangles (dropping them is caught), same hash on
1/6/8 workers and a repeated run. Far field: 47k nodes / 92k patches in ~8.6 ms, but fixed-grid
ellipsoid sheets, not a validated cave hierarchy: unproven. No noise detail in this corpus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MmSoF64BbRFmk9C3p1VsBJ
2026-10-02 00:45:59 +02:00

12 KiB
Raw Blame History

Analytic intervals and packed signs: one-day spike

Date: 2026-10-02
Result: the near-region interval/bit compiler is promising at this corpus size. The experiment does not prove the complete realistic visible world can be built in under one second: the near output is smaller than the proposed 60 MB workload, and the far-field generator is a coarse sheet proxy rather than the production cave hierarchy.

What was built

interval_spike.cpp is a standalone C++20 program. It generates the same ordered quadric CSG world for both implementations:

  • A point reference evaluates every one of the 17,373,979 near-region lattice nodes, using a 3D AABB index to select possible features.
  • The interval path intersects the same fixed-point quadrics along all three 67,081-line axis families, sweeps sorted entry/exit events with a 64-bit membership word, composes the ordered edits, and fills packed sign words.
  • OR(8 corners) & ~AND(8 corners) finds active cells 64 at a time. The mesher joins edge crossings around cell faces, uses an exact center sign for ambiguous faces, and emits indexed position/normal buffers. Near-region vertices come from quantized analytic quadric crossings, not edge midpoints.
  • Sub-cell strata that have no lattice point inside them receive an explicit analytic surface patch. The patches are filtered against the final composed occupancy.
  • The near cube has 256³ core cells at 25 cm and one node of halo on each side. Its cell region is split into 64 pages. Edge vertices are shared in one keyed buffer and assigned to a deterministic owner page.
  • A separate far-field stage builds five stacked parent ellipsoid sheets as indexed patches, without generating children.

The corpus has 372 features per seed: 18 rooms, 147 overlapping ellipsoid tunnel segments on winding and vertical connections, 40 pillars, 36 stalactites/stalagmites, 42 shelves, 24 floating masses, 12 craters, 40 crowded-junction edits, and 13 thin strata. It uses the current HyperComplex scale as a guide: 26 m room pitch and roughly 0.28–0.37 pitch radius fractions. Five deterministic seeds were measured.

The crowded cluster has 40 overlapping operations. Across the whole corpus the largest candidate list on a line was 58 shapes, below the 64-membership limit. The largest primitive-interval list was 52. No tested line overflowed the membership word.

Toolchain and numeric contract

The host reports an AMD Ryzen 7 5800X3D with 16 logical processors. The build used the requested VS 2022 vcvars64.bat and cl /std:c++20 /O2 /arch:AVX2 /EHsc.

From the plugin root, the tested build command was:

call "E:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
cl /nologo /std:c++20 /O2 /arch:AVX2 /EHsc /Fe:Saved\Research\intervals\interval_spike.exe /Fo:Saved\Research\intervals\interval_spike.obj Saved\Research\intervals\interval_spike.cpp

Each benchmark process takes <seed> <workers> arguments, for example interval_spike.exe 1 6, and writes one JSON record to stdout. The final per-process records are final_seed1_w1.json through final_seed5_w8.json in this directory.

Shape transforms are Q15 integer matrices; quadric coefficients are rounded once into Q28 per cm². Occupancy points and interval endpoints use signed 1/16 cm integer coordinates. A shape contains a point when its integer quadratic predicate is <= 0; the endpoint inclusion and ordered CSG operation rules are fixed. Line endpoints are found by integer bisection over the canonical coordinate grid, and mesh crossings are the midpoints between the last outside and first inside coordinates.

The sign paths use integer arithmetic only. With this corpus, local coordinates stay within each feature’s conservative AABB; the largest Q28 coefficient is bounded by the 4 cm minimum radius, and the largest possible quadratic terms stay below 10¹⁸, within signed 64-bit range. That makes the sign decision identical on x64 CPUs implementing the same C++ integer rules. The far parent surface root and explicit thin-patch parameterization use floating point for vertex placement, after the sign/classification decision; cross-vendor bitwise mesh identity was not tested. On this 5800X3D, final geometry hashes matched across worker counts and repeated fresh processes.

Timings

Each row summarizes five fresh processes, one per seed. The p95 uses linear interpolation between ordered samples. The interval stage includes solving/composing all three axes and writing packed sign words; active-cell masks are timed separately. Meshing is single-threaded in this spike, so worker counts primarily affect interval generation.

Times are milliseconds, shown as median / p95 / worst.

Stage 1 worker 6 workers 8 workers
Corpus and spatial hierarchy 0.5 / 0.6 / 0.6 0.5 / 0.7 / 0.7 0.5 / 0.7 / 0.8
Interval solve, compose, and sign words (3 axes) 154.2 / 167.8 / 170.8 48.2 / 52.6 / 52.9 43.2 / 49.0 / 50.1
Active-cell masks 2.1 / 3.4 / 3.7 2.1 / 2.3 / 2.3 2.1 / 2.2 / 2.2
Near mesh emission 188.4 / 197.4 / 198.7 191.2 / 229.3 / 238.4 192.8 / 219.8 / 223.9
Far-field proxy 8.6 / 8.7 / 8.8 8.6 / 8.6 / 8.6 8.6 / 8.9 / 9.0
Near CPU total 349.3 / 357.9 / 358.1 241.1 / 280.3 / 288.3 240.2 / 270.9 / 276.7
Near plus far proxy 357.9 / 366.5 / 366.7 249.7 / 288.9 / 296.9 248.8 / 279.5 / 285.3

The interval stage fits its 150 ms allocation at 6 and 8 workers, but not at one worker. The near CPU total stays below 430 ms for every measured run. The 6-worker mesh p95 exceeds the proposed 220 ms mesh allocation; the 8-worker p95 is just below it, while its worst run is slightly over.

Output and memory

Result Median across five seeds Range
Near vertices 282,404 272,704–296,660
Near triangles 563,052 543,828–591,512
Near mesh buffers 13,535,700 bytes (13.54 MB) 13,072,232–14,219,284 bytes
Near plus far buffers 19,848,460 bytes (19.85 MB) 19,384,992–20,532,044 bytes
Process working set after validation 45,191,168 bytes (43.1 MiB) 44,199,936–46,628,864 bytes

The proposed 60 MB output workload was not reached. This corpus emitted about 23% of the round-3 estimate of 2.4 million triangles, so the measured mesh time does not establish how a 60 MB result scales.

Interval and crossing statistics

Each axis has 67,081 lines. The table gives the median line p50, the median of the five per-seed line p95 values, and the worst single-line value over all five seeds. The per-seed line p95 uses the sorted index floor(0.95 * (N - 1)).

Axis Candidate shapes per line: p50 / p95 / worst Primitive intervals per line: p50 / p95 / worst Composed crossings per line: p50 / p95 / worst Occupancy runs per line: p50 / p95 / worst
X 0 / 16 / 44 0 / 11 / 40 0 / 8 / 20 1 / 9 / 21
Y 0 / 17 / 46 0 / 12 / 40 0 / 10 / 24 1 / 9 / 23
Z 1 / 13 / 58 0 / 9 / 52 0 / 8 / 22 1 / 9 / 19

The busiest observed line used 58 candidate slots, leaving six membership bits unused. The long lists are localized; the median line has no candidate shape in X and Y and one in Z. The distributions and maxima were stable across worker counts.

Correctness and determinism

  • Full sign agreement: all 15 final benchmark processes compared the pointwise reference with all three interval-axis sign paths at every lattice node: zero mismatches.
  • Mesh crossings: zero sign-changing lattice edges lacked an analytic crossing; zero contour-degree faults and zero open cell contours.
  • Page ownership: all 64 near pages passed unique edge-key and owner-page checks. Shared border vertices use one canonical crossing record and quantized position.
  • Tangency: an exact tangent line retained its single-point interval.
  • Coincident edits: coincident carve/add intervals had identical roots, and both operation orders produced their defined last-operation result.
  • Negative coordinates: the full lattice includes negative world X and Z coordinates and passed the point-reference comparison.
  • Thin strata: 13 sub-cell strata were in each corpus. Across the five seeds, 1–10 had no structural lattice point inside; every such feature received explicit surface triangles (288–1,993 triangles per seed). The deliberately isolated 12 cm-thick air seam had no lattice sample and two crossing tags on its central line. The validation gate was also given a deliberately omitted thin surface and rejected it.
  • Determinism: for each of five seeds, the combined geometry hash was identical at 1, 6, and 8 workers. A repeated fresh seed-1/one-worker process also matched. Per-seed hashes: e5ad62303de5f641, 17a0d35b9c500445, c74544dc1b78ce7b, 69cef91397829b57, afb5e5e8fa54b8a9.

Far-field result and limit

The proxy selected 47,040 nodes, 92,150 patches, 94,090 vertices, and 184,300 triangles in 6,312,760 bytes, with zero descendants. It takes about 8.6 ms. The grid spans ±6 km on each horizontal axis and has five stacked parent layers.

This is not a proof of the far cave hierarchy. The patches are all on the same 125 m grid; the reported LOD bands are metadata rather than different tessellation levels. The parent shapes are five broad ellipsoid sheets, not the room/tunnel grammar used in the near corpus. The square reaches about 8.5 km at its corners, and no far/near transition surface was built or validated. The production far field is therefore unproven.

Gate decision

The near interval/bit core passes the 430 ms timing portion of the first gate on this 372-feature corpus, and crowded junctions stay below the 64-shape line limit. The output is only 13.1–14.2 MB nearby, however, so the proposed ~60 MB mesh budget was not exercised. The 6-worker mesh p95 also exceeds its 220 ms sub-budget. Thin-feature and shared-boundary checks pass for the tested feature family.

This is a positive near-core result, not a whole-world pass. Do not treat the under-367 ms near-plus-proxy figure as evidence that the realistic six-kilometre cave world is ready for the Unreal publication/collision test; the far hierarchy and larger output workload remain unproven.

Failed and retried builds/runs

  • Build attempt 1 failed because Win32 min/max macros expanded std::min/std::max calls. NOMINMAX fixed that class of error.
  • Build attempt 2 then failed on the room-center array dimensions and the Windows far macro colliding with a local variable name. Both were corrected; subsequent MSVC builds succeeded.
  • vcvars64.bat printed that vswhere.exe was not recognized on each build, but it continued and launched cl.exe. The final build succeeded with only unused-parameter and bool-comparison warnings.
  • The first benchmark launch attempt used PowerShell’s unsupported Start-Process -PriorityClass parameter and did not start the executable. The retry launched the process and immediately set its priority to BelowNormal.
  • The first executable run completed but failed validation with 878,033 sign mismatches and no thin crossing tags. The line solver had omitted the shape-center offset when converting the quadratic vertex to an absolute coordinate. After correction, the full sign comparison passed; thin surfaces and explicit contour-integrity assertions were then added.
  • A final-run preflight initially aborted at a self-imposed 6 GB free-memory threshold; no process started. The machine then had 4.5 GB free while another foreground process used about 12.3 GB. The benchmark working set was about 45 MB, so the final checks were retried below-normal with a 1 GB floor. All three checks passed, followed by all 15 final fresh-process runs.

All final runs exited 0. No Unreal process was launched, no Source/ file was modified, and no commit, push, or stash was made.

Next step

Extend the CPU corpus until it emits the intended ~60 MB / 2.4 million triangle workload, with page meshing parallelized deterministically. In parallel, replace the far sheet proxy with actual selected parent room/tunnel/strata shapes, radial horizon clipping, and a shared near/far transition. Re-run the same validation and gates; then decide whether the Unreal publication/collision test is justified.