Skip to content

EPIC: Strata terrain hardening - #483

Draft
jonit-dev wants to merge 168 commits into
developfrom
epic/strata-terrain-hardening
Draft

jonit-dev wants to merge 168 commits into
developfrom
epic/strata-terrain-hardening

Conversation

@jonit-dev

@jonit-dev jonit-dev commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Strata terrain hardening across the 12 original PRDs. 5/12 PRDs complete (587, 588, 589, 590, 592); 50/62 phase boxes, 110/132 combined phase and acceptance boxes, repository bucket prd:75%. Every remaining criterion stays in scope; this is still a draft.

The branch integrates current develop through 159d1ca78. All six conflicts are resolved; regenerated canonical Three patches preserve morph pipeline sharing and bounded compressed uploads. Stale private-camera references from the automatic merge are corrected. Independent merge review: APPROVE.

Verified locally:

  • 261 focused tests pass, 4 skipped; core typecheck, frozen install and scoped Biome pass. Independent bounded-upload tests: 3/3 pass. Coastal material/shadow tests: 35/35 pass.
  • Immutable starter release v0.1.0: public download matches 31,598,616 bytes, SHA256 3062b90cd7f84e6ff14f6a96de64ad406eeba30c55c95cc045b6219edf71f5b0. A clean extracted package downloaded all 18 entries without checkout assets or a URL override. Fresh-cache forest kit scaffold/build/typecheck/playtest PASS, 819 frames on NVIDIA/Turing. Independent release audit: 50 tests pass, package 616,539 bytes with no kit assets; APPROVE. PRD-589 is archived complete.
  • Full terrain web scenario: 60/63 assertions pass; diagnostics and console/network/runtime policies pass. Three budgets FAIL: after-first-frame task 2,273ms / 250ms, ready 52,877.5ms / 15,000ms, worst-view GPU 47.92ms / 12ms. These gates remain open; full CI qualification is unverified.
  • Documentation links pass. Additional tree and ground-vegetation arms are tracked in existing PRD-580 and remain in progress; they do not change the original 12-PRD tally.

Coastal stone contact: a four-line game-material change uses front-face shadow casting for both procedural and imported coastal stones. Two exact-pose headed NVIDIA before/after pairs were independently judged IMPROVEMENT / IMPROVEMENT, overall IMPROVEMENT: the thin pale contour disappears while stone texture and contact shadow remain. The captured procedural path is proven; imported assets were not visually exercised.

Run BEFORE AFTER
1 BEFORE run 1 AFTER run 1
2 BEFORE run 2 AFTER run 2

Remaining work includes layered forest material and consumer visuals; generated forest browser/native walk budgets; actual CI Strata/editor/consumer qualification; preview ground plumbing and five-world visual judgment; complete upload runtime proof; shadow/velocity/LUT comparison; and preview/machinefall walks. Individual PRD checkboxes remain authoritative in the batch.

Accepted procedural ground vegetation

Narrow curved grass blades, meadow/fescue/sedge variation, fern growth variation and joined wind seams are integrated. Independent review of two calibrated NVIDIA/Turing BEFORE/AFTER repeats grades meadow-close and foreground IMPROVEMENT in both pairs and overall; triangle counts, texture bytes and draw structure stay unchanged. Parent integration: 55 focused tests, example TypeScript and scoped Biome pass. Remaining stiff V-shaped tufts mean this is an improvement, not full photorealism acceptance. Optional local-asset 404s still fail capture diagnostics; cooked-kit/native/full-runtime acceptance remains open.

Pair 1: BEFORE meadow-close, AFTER meadow-close, BEFORE meadow-foreground, AFTER meadow-foreground.
Pair 2: BEFORE meadow-close, AFTER meadow-close, BEFORE meadow-foreground, AFTER meadow-foreground.

Tree repair remains separate: both overview repeats regress from sparse crown volume. PRD591 now has explicit texture paths (selected web and desktop 300-frame case pass), real five-world splat export/staging, and game sampling/material callbacks retaining core ordered blending (36 loader tests and core build pass). Callback runtime, actual preview migration, measured bands and five-world look acceptance are still open. Overall original PRD tally remains 5/12; full CI and the three failing runtime budgets are not green.

@jonit-dev jonit-dev added the prd:0% No verified implementation phase complete label Oct 10, 2026
PRD-592. Bound LOD simplify workers, reuse accessor metadata and buffers,
cook only LOD0 for terrain chunks and batch unique writes. Quiet host, 8
alternating runs: 2.760 s -> 2.401 s mean (13.0%), 22/22 files SHA-256
identical. The 30% AC-5 target is not met and stays open.
…rated stale

The previous commit's hook rewrote the capability manifest, reference and API
surface from a stale view and dropped cookTerrainWorld, applyTerrainSurface
and the terrain ./kit and ./starter exports. Regenerating in this worktree
reproduces the earlier files; capabilities:check passes with 452 entries.
…odule loads

PRD-592. Load the ogg, bvh and xatlas modules only when a pass needs them
(bakeStaticLightmap becomes async; its callers are internal), start the LOD
workers earlier and size the pool to the targets, and reuse the cook's world
package in bakeKit instead of building it twice. Eight alternating runs on a
quiet host against the pre-speedup baseline: mean 1.975 s -> 1.381 s (30.1%),
median 29.6%. 22/22 output files SHA-256 identical. AC-5 stays unticked until
a longer confirmation run.
14 alternating pairs on a quiet host against the pre-speedup baseline 8a228dd:
mean 1.809 s -> 1.256 s (30.5%), median 30.6%, 22/22 files SHA-256 identical.
…snow caps

Game-layer appearance fix for two defects a fresh visual judge ranked on the
tundra player frame. The right-side dark wedge was a terrain/horizon normal
discontinuity and an abrupt transport-mask cutoff, not a shadow: terrain.ts now
fades both. Tundra rocks gain slope-aware snow treatment and kept dark detail
under ACES (propMaterials.ts, biomes.ts). Two regression tests failed first.
Judge verdict on two same-pose runs: IMPROVEMENT, about 4.0 -> 4.8 out of 10;
known remaining: hard white caps, jagged far horizon on the right, dark patch.
@jonit-dev

Copy link
Copy Markdown
Contributor Author

Visual progress: tundra cut-out wedge removed, rocks get snow caps

Judged by a fresh read-only subagent on two same-pose runs (NVIDIA Turing, private Xvfb): IMPROVEMENT, about 4.0 to 4.8 out of 10 against the Gaia references. The run 1 and run 2 player frames match almost pixel for pixel.

Player view, BEFORE left, AFTER right (run 1):
tundra player

Player view, second run:
tundra player run 2

Overview, BEFORE left, AFTER right:
tundra overview

What changed (game layer, +100 / -9 lines, two regression tests failed first):

  • The hard dark wedge on the right was a terrain and horizon normal discontinuity plus an abrupt transport-mask cutoff, not a shadow. It is faded now and nothing replaced it.
  • Tundra rocks were near-black glossy blobs. They now carry slope-aware snow caps and keep dark detail under ACES.
  • Player-view GPU median 3.24 to 3.14 ms (no cost).

Honest remaining defects the judge named: rock caps read as hard white polygons and look stamped, the far horizon on the right is slightly jagged with weaker haze, a dark brown patch and a straight shadow band remain, and the stream is still a flat cyan decal with a blown reflection. The five-world baseline average was about 4.5/10, so the bar of 8.5 is far off. Next in the ranked list: richer ground materials, rocks, water depth and foam, then atmosphere.

70068c7 added the two build-file predecessors to the Three patch pin but the
generate-three-patch spec still asserted 31 pairs. The pin is the source of
truth, so the three length assertions now say 33. Also records in PRD-585 that
the forest destroyed-texture errors did not reproduce in five attempts.
…tiling

A fresh visual judge ranked the repeating brown worm blotches on the coastal
overview beach as the clearest ground defect. The cause was the noise-fragmented
wrack band drawn at any distance; it now fades out between 60 and 120 m
(terrain.ts, game appearance, 4 lines). Judge on two same-pose runs:
IMPROVEMENT, 4.5 -> 5.0 of 10, hillside and desert unchanged (pixel difference
at the noise floor), waterline dashes kept. Larger ripple, strata and snow-drift
candidates were dropped: invisible at the judged resolution.
@jonit-dev

Copy link
Copy Markdown
Contributor Author

Visual progress: coastal beach no longer tiles

Judged by a fresh read-only subagent on two same-pose runs (NVIDIA Turing, private Xvfb): IMPROVEMENT, coastal about 4.5 to 5.0 out of 10 against the AAA island reef reference. The overview beach lost the loud, repeating brown "worm" blotches (cause: a noise-fragmented wrack band drawn at any distance, now faded between 60 and 120 m, 4 lines in terrain.ts). Hillside, water, sky, trees and rocks are unchanged (hillside pixel difference 0.0, desert overview at the noise floor), and the waterline dashes near the player stay.

Overview, BEFORE left, AFTER right, run 1 on top and run 2 below:
coastal overview

Player view:
coastal player

What I tried and dropped, for the record: a larger ground-richness candidate (sand ripples, desert strata, snow drifts, turf variation, about +190 lines). Two judge rounds could not see those gains at the judged resolution and found regular stripes on tundra and alpine snow in the first round, so only the one clearly visible gain shipped.

Honest state of the bar: after the tundra, coastal and sky and lake fixes the average over the five worlds is still about 4.5 to 5 out of 10 against 8.5. The judge's remaining ranked defects are faceted or flat-coloured rocks, water without depth gradient or foam, flat atmosphere and lighting, and cone-shaped foliage with no understory. Those are next, one at a time, each judged before and after.

… and shore

The coastal ocean showed a hard diagonal navy/teal seam and a rectangular
shallow zone in the overview. A square bounds mask switched the seabed depth to
28 m across 4 m (ocean.ts:202 and the mirrored starter sea.ts). Depth now comes
from the corrected heightfield with a smooth edge, the colour ramp uses the
measured 4.1 m seabed range from turquoise to deep blue, the shore turns
translucent over 0 to 2.5 m, and a sparse two-scale foam fades by pixel
footprint. Fresh judge on two same-pose runs, three-way against the first
attempt: IMPROVEMENT over before, better than attempt one, about 5.0 -> 6.6
of 10. Known remaining: murky open sea, almost absent foam band, no seabed
detail. No new texture fetches; GPU pair 21.3 -> 20.7 ms (informational).
@jonit-dev

Copy link
Copy Markdown
Contributor Author

Visual progress: coastal ocean seam fixed, depth gradient and translucent shore

Judged by a fresh read-only subagent on two same-pose runs (NVIDIA Turing, private Xvfb), three builds compared: IMPROVEMENT, coastal frame about 5.0 to 6.6 out of 10 against the AAA island reef reference, and better than my own first attempt (which went grey and flat, 5.8, and was not shipped).

Cause: a square bounds mask switched the seabed depth to 28 m across 4 m (ocean.ts:202, mirrored in the starter sea.ts). That drew the hard diagonal navy/teal seam and the rectangular shallow zone in the overview. Depth now comes from the corrected heightfield with a smooth edge, the colour ramp uses the measured 4.1 m seabed range (turquoise to deep blue), the shore turns translucent over 0 to 2.5 m so sand shows through, and a sparse two-scale foam fades by pixel footprint. 96 added and 32 removed lines over two mirrored files, no new texture fetches, GPU pair 21.3 to 20.7 ms (informational, timings swing here).

Player view, BEFORE left, first attempt middle, final right (run 1 on top, run 2 below):
coastal water player

Overview:
coastal water overview

Full resolution, final player frame:
coastal water full resolution

Honest remaining defects the judge named: the open sea is still murky next to the reference's emerald glow, the foam band is nearly absent, there is no seabed detail, and a soft dark navy blotch sits in the mid-water. The dark pebble speckle on the overview sand disappears in both builds; the earlier wrack-fade commit is the likely cause and I am treating it as intended. Next from the ranked list: rocks, then atmosphere and lighting.

…e local readiness code

PRD-591 AC-2. The preview's spawnReadinessSnapshot and helpers (loading.ts) and
prop streaming's readinessAt and ready flag are deleted; game.ts waits on
whenSpawnReady for nearby prop cells and on prewarm for drawing. Net -116 lines.
A premature gate failed the new regression first. Forest web run is 41 of 44
before and after; only the three known perf budgets fail.
…r texture

Owner feedback: the procedural beach stones were faceted flat-shaded egg blobs
in flat olive. cover.ts now builds smooth indexed stones (about 500 triangles)
with three noise octaves, two softened chisel cuts, seeded stretch and five
variants, buried below the terrain so no skirt shows. Coastal and desert stones
bind the tracked CC0 Poly Haven rock_boulder_dry set (512 px diffuse, normal and
ARM, triplanar at 1.4 m, roughness from ARM.G, clamped AO); a cheap ambient
fill lifts undersides; the grass contact band is off on coastal and tundra
stones; desert stones take a warm tan tint; distant albedo is capped. Tundra
snow caps and the committed cluster density (612 riverrock placements) are kept.
New rocks.spec.ts and prop-surfaces.spec.ts cases failed against broken
generators first. Fresh judge, three-way against the first attempt: IMPROVEMENT,
coastal stones 3 -> 6, tundra 3.5 -> 5.5; known remaining: a lit rim at the
coastal stone base (sun shadow, not geometry) and angular chisel faces.
@jonit-dev

Copy link
Copy Markdown
Contributor Author

Visual progress: better stones with a Poly Haven boulder texture

Owner feedback was "these low poly stones look bad". Fresh read-only judge, three builds compared (BEFORE, my first attempt, the final one), two same-pose runs on NVIDIA Turing: IMPROVEMENT. Stones only: coastal about 3 to 6 out of 10, tundra 3.5 to 5.5, no regression in desert, alpine or the overviews (stones are tiny there, so they are neutral).

What changed (game layer, 452 added / 94 removed lines):

  • Stones were an icosahedron with sine lobes, flat-shaded and non-indexed, in olive mossy_rock. They are now smooth indexed meshes of about 500 triangles with three noise octaves, two softened chisel cuts, seeded stretch and five variants per kind, buried below the terrain so no skirt shows.
  • Coastal and desert stones use the CC0 Poly Haven rock_boulder_dry set (the 512 px diffuse, normal and AO/roughness/metal files already tracked in starter-assets, about 218 KB in total; credit already in starter-credits.json), triplanar at 1.4 m, roughness from the ARM green channel. A cheap ambient fill lifts the dark undersides. Desert stones take a warm tan tint.
  • Tundra keeps its snow caps and its committed stream-cluster density (612 riverrock placements, same count as HEAD). The pale halo and black sides the first attempt caused are gone.
  • New rocks.spec.ts (generator is deterministic, indexed, smooth, buried base, no NaN) failed against deliberately broken generators first; 429 terrain and preview tests pass. One more texture sample per stone fragment (6 to 7). Informational GPU pair at pinned scale: 22.6 to 24.0 ms (+6%), no speedup claimed.

Coastal beach, player view (BEFORE | first attempt | final, run 1 on top, run 2 below):
coastal player stones

Coastal close-up at 1:1, BEFORE:
before

AFTER:
after

Tundra, stream stones:
tundra stones

Honest remaining defects the judge named: at 1:1 the coastal stones still look chiselled, with straight polygon edges and streaked triplanar texture on steep faces; and a jagged lit rim about 15 to 25 px wide sits between each coastal stone and its shadow. Turning the sun off removes it, so it is a shadow bias effect at the base (sky.ts:117), not stone geometry. That rim is the next fix. The tundra frame also has a few thin worm-like shapes at the bottom right that do not read as stones. The five-world average is still far below 8.5.

The rim came from the sun shadow's receiver-plane filter bias (virtual-shadow.ts
receiver-plane term), which is footprint wide and detaches low-relief contacts.
For the coastal sun only, sky.ts now derives normalBias from one fine shadow
texel and turns receiverPlaneBias off. Probes one at a time: bias 0, normal bias
0 and 0.07, radius 0 (acne) and a 4096 map did not remove it; receiver-plane off
removed the broad band. Fresh judge on two same-pose runs: IMPROVEMENT in the
coastal close-up (12-20 px band gone, a 2-3 px pale edge remains). Other worlds
keep their fixed 0.035 bias and default receiver-plane bias: forest and tundra
frames had no ground-level contact views and alpine and desert were not judged,
so a broader change would be unproven. outdoor-shadows.spec.ts pins both sides.
@jonit-dev

Copy link
Copy Markdown
Contributor Author

Visual progress: the lit rim around coastal stones is gone

Follow-up to the stones update. At 1:1 a fresh judge had seen a jagged tan band 12 to 20 px wide between each coastal stone and its shadow, which made the stones look placed on a plinth. A second fresh judge on two same-pose runs: IMPROVEMENT in the coastal close-up. The broad band is gone and the stone sits tighter in the sand.

Cause, found by changing one setting at a time: the sun shadow's receiver-plane filter bias, which is footprint-wide and detaches low-relief contacts. Bias 0, normal bias 0 and 0.07, radius 0 (which adds acne) and a 4096 map did not remove it. Turning receiver-plane bias off did. For the coastal sun only, sky.ts now derives the normal bias from one fine shadow texel and turns that bias off (6 lines, plus a new outdoor-shadows.spec.ts that pins both sides). Informational GPU pair at pinned scale 22.0 to 24.0 ms.

Close-up BEFORE | AFTER (run 1 on top, run 2 below):
rim before after

1:1 BEFORE:
before

1:1 AFTER:
after

Scope, on purpose: the first version of this change also touched forest, tundra, alpine and desert. The judge could not prove "no acne, no peter-panning" there (the supplied frames show no trunk bases or stone contacts, and alpine and desert were not judged at all, while the derived normal bias would have been about 4.5 times larger for them). I narrowed it to coastal, so the other four worlds keep their exact earlier shadow settings. Widening it needs ground-level close-ups first.

Honest remaining defects: a thin pale 2 to 3 px edge still follows the stone base, the shadow silhouette is still blocky and straight on the right, and the stones still look chiselled with streaked texture on steep faces. Coastal stones are about 6 out of 10 by the judge, against a bar of 8.5.

… longer scatters

PRD-591 AC-3. scatterProps and paintCanopy ran inside enter (355 ms of a 764 ms
forest enter). scripts/bake.mjs now runs them and writes a Float32 placement
table per world (gitignored like the other baked world files, regenerated by
pnpm bake); enter loads it. Placement lists, order, counts and canopy arrays are
SHA-256 identical to HEAD in all five worlds. enterMs 764 -> 35 ms, asserted
under 50 ms in terrain.playtest.json. afterFirstFrameTaskMs and timeToReadyMs do
not improve (largest tasks are now buildProps and the terrain mesh build).
Native desktop lane not run; the staging script now includes the tables.
…cenario

The committed enterMs <= 50 ms assertion reads the end-of-run value. In the full
test:terrain:web run, coastal enter takes 218 ms (first visit) and 137 ms (return);
forest 39, tundra 33, alpine 20, desert 20. The earlier tick rested on forest-scoped runs.
Coastal enter took 218 ms (first visit) and 137 ms (return) in the full showcase run
because createWaterMesh ran inside enter. load() now prepares the ocean and water
mesh and enter attaches them. The full scenario now has enterMs 10-45 ms in all six
visits, so the PRD-591 AC-3 assertion passes; AC-3 is re-ticked with the evidence.
@jonit-dev jonit-dev added prd:75% PRD phases in, acceptance open and removed prd:25% PRD phase 1 verified labels Oct 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

critical prd:75% PRD phases in, acceptance open

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant