Files
Fr0zkaandClaude Opus 5.5 a443eb8546 research(intervals): blends, dual contouring, surface relief -- look better, not there; new stages single-threaded
Bounded smooth blends at junctions (3.1% of cells), QEF dual contouring on the exact crossings and
analytic normals, band-limited surface relief (bound 0.60 m, observed 0.40-0.44 m, R toggles it),
sparser strata. Exact signs vs the blended reference at every node, thin features kept, same hash
across worker counts. Mesh has 0 boundary edges but 3-7 overused edge groups: not collision-ready.
Near CPU total, 6 workers: 241 -> 836 ms. The new stages all run on ONE thread: blend index 186 ms,
blend evaluation 201 ms, dual contouring 322 ms, relief 61 ms.
Look: slab stack gone, joins rounder; chambers read as broad crumpled facets, junction seams still
flaky. Viewer built as interval_viewer2.exe (the owner had the first one open).

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

22 KiB
Raw Permalink 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.

Round 2: bounded blends, QEF mesh, and surface relief

Date: 2026-10-02. The existing section above records the first-round measurements; this section records the changed field and mesh.

What changed

  • The corpus now has 363 shapes: 18 rooms, 147 anisotropic tunnel segments with changing cross-sections, 40 pillars, 36 stalactite/stalagmite forms, 42 shelves, 24 floating masses, 12 craters, 40 crowded-junction edits, three sparse rock bands, and the isolated audit seam. The 12 repeated thin strata were removed. The three remaining bands have different orientations and are placed at a nearby air lattice node so the interval mesh sees their thin crossings.
  • Smooth min/max is applied only in bounded overlap regions. At 70 cm blend width, the mask covers a median 3.08% of cell centers (3.07–3.19% across five seeds) and 1.94% of lattice nodes (1.94–1.98%). Everywhere else the original exact ordered interval field is used. The banded features keep their hard field so their crossings remain exact.
  • The near mesh now uses per-cell QEF dual contouring with cached analytic Hermite crossings/normals, face-connectivity component splits, a deterministic ambiguous-face sign, and deterministic page ownership. Page-edge ownership is checked across all 64 pages. The 12 cm audit seam, which no lattice point can see, gets a closed 336-triangle analytic patch.
  • A deterministic four-band value-noise displacement runs after meshing, with wavelengths 6.4, 3.2, 1.6, and 1.2 m. The shortest band spans 4.8 voxel cells. The hard displacement bound is 0.60 m; the five measured seeds reached 0.404–0.439 m. Vertex normals are rebuilt after displacement. No extra volume samples are taken for relief.
  • interval_viewer2.exe renders the blended dual-contour mesh and keeps a separate displaced vertex buffer. Press R to switch displacement off/on. The world-space rock color mottling and D3D11 back-buffer PNG capture are part of this standalone viewer. Capture mode closes its own window after writing the screenshots.

Timing comparison

The first-round values below are the medians from the original five-seed report. Round 2 reports the median/p95/worst of five fresh sequential processes per worker count; p95 is linearly interpolated at the 95th percentile. The blend-index row is the AABB overlap raster plus surface-pair filtering. Near total includes the listed stages; far-field time is separate.

Stage (ms) Before medians, 1 / 6 / 8 workers After, 1 worker med / p95 / worst After, 6 workers med / p95 / worst After, 8 workers med / p95 / worst
Corpus/hierarchy, excluding blend-zone index 0.5 / 0.5 / 0.5 0.96 / 1.03 / 1.04 0.96 / 0.97 / 0.97 0.96 / 1.08 / 1.10
Blend-zone index and mask — / — / — 186.68 / 203.10 / 205.61 186.07 / 203.27 / 205.51 186.97 / 202.43 / 204.94
Interval solve, compose, and sign words 154.2 / 48.2 / 43.2 154.88 / 156.72 / 157.12 48.89 / 50.47 / 50.65 46.10 / 46.97 / 47.16
Blend-zone pointwise evaluation and crossings — / — / — 203.85 / 225.44 / 229.87 200.79 / 205.81 / 205.98 201.49 / 208.96 / 209.65
Active-cell masks 2.1 / 2.1 / 2.1 2.62 / 3.82 / 3.86 2.85 / 4.05 / 4.28 3.58 / 4.29 / 4.29
Near meshing: old contour emitter / QEF dual contour 188.4 / 191.2 / 192.8 315.62 / 324.11 / 325.76 322.14 / 344.69 / 349.24 330.38 / 331.55 / 331.57
Surface displacement and normal rebuild — / — / — 61.43 / 62.29 / 62.45 61.04 / 61.80 / 61.91 61.26 / 63.41 / 63.69
Near CPU total 349.3 / 241.1 / 240.2 931.93 / 957.68 / 959.08 836.06 / 848.28 / 849.57 824.27 / 854.37 / 861.33
Far-field proxy 8.6 / 8.6 / 8.6 8.59 / 8.61 / 8.62 8.57 / 9.51 / 9.58 8.58 / 8.60 / 8.61
Near plus far 357.9 / 249.7 / 248.8 940.54 / 966.28 / 967.68 844.62 / 857.37 / 858.80 832.85 / 862.93 / 869.89

That is a 2.67× / 3.47× / 3.43× near-total cost against round 1 at 1/6/8 workers. Most of the new cost is visible in the table: roughly 187–190 ms to build the overlap mask, 201–204 ms to evaluate blended nodes/rebuild crossings, 316–330 ms for dual contouring, and about 61 ms for relief plus normal rebuild. The 6/8-worker interval speedup remains, but the zone work and mesher are single-threaded here.

The median output across the five seeds is 265,508 near vertices, 531,164 triangles, and 12,747,440 near-buffer bytes. Median working sets were 69.6 / 70.0 / 70.4 MB at 1 / 6 / 8 workers. The proposed 60 MB mesh workload is still not exercised.

Correctness, topology, and repeatability

  • All 15 final processes (seeds 1–5 at 1, 6, and 8 workers) exited 0. Each compared the interval/blend signs against the new pointwise blended-field reference at every lattice node: zero mismatches and zero blend-boundary sign disagreements. All page ownership checks passed, with zero missing analytic crossings, zero cell-contour faults, and zero open cell contours.
  • The three lattice-snapped bands are present in the structural mesh. The 12 cm audit seam has no lattice sample and is retained by its closed 336-triangle patch. The thin-surface omission check still rejects a deliberately omitted patch.
  • The edge-manifold diagnostic reports zero boundary edges on all five seeds, but 3–7 overused edge groups remain. The JSON non_manifold_edges_zero field is therefore false. These are localized dual-contour singularities around ambiguous/multiple-crossing cells; they are visible in the diagnostics and were not waived as a zero count. The page-ownership/sign/thin-feature validation result is reported separately from this remaining topology count.
  • The QEF clamp counter is 141,729–155,046 across seeds. It increments per clamped coordinate axis, not per unique vertex. There are also 1,654–2,035 retained near-zero-area triangles; keeping them preserves edge connectivity after QEF clamping. These facts, plus the remaining overused edges, mean the mesher still needs topology work before treating the output as production collision geometry.
  • For each seed, raw mesh, displaced mesh, and combined hashes match at all three worker counts. A fresh repeated seed-1/one-worker process also matched: mesh 20d4d80f439c17f6, displaced mesh 0592d64cb4f269ca, combined fe846e12af9fef67. Per-seed combined hashes: fe846e12af9fef67, 8f0994fe2295a34e, ee13abc933f14a3f, 129dcc0c9bac3b3e, 66361d9daff2b1a6.

Screenshots and visual judgement

These PNGs were captured from the viewer’s own D3D11 swap-chain back buffer, at 1280×800:

View Capture
Inside the first chamber, relief on chamber.png
Same camera, relief off chamber_relief_off.png
Open point in the crowded junction junction.png
Close to the chamber wall wall.png

Compared with the reject image, the repeated thin slab stack is gone, the color has rock-like variation, and many primitive junctions read as rounded transitions. The relief-on chamber is visibly less smooth than the relief-off view. The result is still well short of the reference cave: the close-wall view shows an obvious rounded ellipsoid, the chamber has broad flat-looking facets, and the material lacks the target’s rich rock texture, crystals, and water. I would describe this as a measurable improvement over the rejection, not a finished natural-rock look.

Failed and retried Round 2 attempts

  • Two early compile invocations passed the vcvars64.bat path with broken shell quoting, so cl.exe never started. An intermediate C++ build also failed because near was used as an identifier; it was renamed. The first D3D11 viewer link failed with unresolved CoInitializeEx/CoUninitialize/CoCreateInstance; linking ole32.lib fixed it. A later corpus-snap build failed once because eval_quad was used before declaration; a forward declaration fixed it. The corrected builds succeeded. MSVC continued to print that vswhere.exe was unavailable from vcvars64.bat, but it still launched cl.exe.
  • round2_probe3 through round2_probe12 were intermediate dual-contour runs that exited on validation failures while the Hermite cache, component topology, degenerate triangles, and thin patches were being corrected. At probe 12, missing crossings had reached zero, but the mesh still reported about 3.7k non-manifold edges. Skipping the zero-area triangles produced thousands of boundary edges; a one-QEF-vertex-per-cell experiment made the overused-edge count worse (798), so both approaches were reverted. The final five-seed check has zero boundary edges and 3–7 overused groups.
  • The first two D3D capture runs failed at WIC pixel-format selection (0x88982f80, unsupported RGBA); they left zero-byte PNGs. The capture path now swaps the D3D11 RGBA readback into WIC BGRA and writes all four non-empty images above. The capture-mode viewer closed itself; no previously open viewer was touched.
  • MSVC continued to print that vswhere.exe was unavailable from vcvars64.bat, but all final builds completed. All 15 final benchmark runs and the repeated determinism run exited 0. No Unreal build or launch was done, no plugin Source/ file changed, and nothing was committed, pushed, or stashed.

Round 2 conclusion

Smooth joins and broad relief improve the rejected world, with only about 3.1% of cell centers in blend zones. The price is substantial: the near build rises from 241 ms to 836 ms at six workers and from 240 ms to 824 ms at eight workers. QEF clamping and the remaining 3–7 overused edges also keep this from being production-ready geometry. The viewer and measurements are ready for owner review; the screenshots show honestly that more corpus shaping/material work is needed to approach the reference.