Skip to content

Borders as records: every border of the world names what crosses it; a seam test over 12 worlds; station beds level again (gw 78) - #532

Open
k06a wants to merge 5 commits into
mainfrom
claude/project-thread-pafmdj
Open

k06a wants to merge 5 commits into
mainfrom
claude/project-thread-pafmdj

Conversation

@k06a

@k06a k06a commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Requested by Anton · project thread

Anton saw a lake cut along a straight line by a wall of earth and asked for requirements on the borders of regions (water, roads and the rest), so that neighbours cannot disagree. This makes the border a first-class record of the hierarchical generator and adds a seam test over many worlds.

What it does

A border is a record both sides read (Lv.edge, src/game/30_lv.js). A border between two chunks of a level is made before both chunks, from the levels above only (an edge that reads its own level is refused). Lv.side(T, id, i, j, d) gives the two neighbours the same object; the audit records a chunk that reads any border but its own four.

The record of today's world (Edge, src/game/39_edge.js). For every border between two settlement cells (320 m):

  • the ports: each road, railway and footpath that crosses, the cells of the border under it, its heights along them, and whether it is on the ground, on a deck or in a tunnel, by the very rule the land is laid by (Span.apply);
  • the natural water along the border with its level (Terr.natC);
  • Edge.gates(T, s): where each road hands over to the streets of a settlement.

The lines come from Roads.all, the one list a cell also draws from (Roads.cell now calls it; golden bytes unchanged).

The seam test (tools/seam.test.mjs, ~75 s). The frame first (one record per border, the audit), then 600 borders of 12 worlds (cliffs, seas, rivers, an island, canyons, volcanoes) against 1.9 million built columns: the same records in any order and copy and from both cells' lists; a surface at every port's height on both sides; no line across a border beside the ports; water at one level on both sides, none where the natural land is dry; a way without a step from the end of every road into its settlement. What it finds is counted per kind against tools/seam.known.json, ceilings that only fall.

What the test found

  1. A fault one generator version old, fixed here (gw 78). In worlds of gw 77 the height along a line comes from the strip between the bisectors (Span.along), which may be the next segment, and the width of the bed came from that segment too, while the distance stayed the one to the nearest. Beside the ends of every station hall the hill stayed: a wall of up to 20 m across the platform, or a pit (39 halls of 39 in four worlds). Span.lay now takes the width of the segment the distance was measured to (SPW_GW = 78); the height still runs along the line. Test written first: tools/bed.test.mjs (red with GW=77, green at 78). Golden world added for gw 78; the old hashes are unchanged (1088 checks).
  2. A world that never finished (seed 271828, a railway region with one town). Main fixed the same loop the same hour (build 487); this branch takes main's fix.
  3. 37 seams of three kinds, counted down by the ratchet, for the threads that own them:
    • 15 × water in road cuttings and skirts below the water level (the ways-and-water work in Ways and water: crossings of watercourses, a road past a village joins its streets (in work) #512 covers these);
    • 16 × two lines laid into each other (a footbridge through a railway embankment on seed 31337; the ring roads and roundabouts of two neighbouring cities on seed 20261129; an airport road above its column);
    • 6 × roads that end at a settlement with no way on (a bridge that ends over the lake at a town on seed 5; a road 105 cells above its village on seed 20261202).

The straight wall across the lake itself is a threshold of the water level in cliff worlds (Terr.nat); it belongs to #512 and is not duplicated here.

Rule

docs/ARCHITECTURE.md, World generator: a meeting of two things made apart is a record both read; nothing crosses beside it. docs/WORLDGEN.md rule 9 (edges before faces) and the seams bullet.

Sources

  • Rune Skovbo Johansen, LayerProcGen (contextual generation: owner plus padding) and his 2015 talk on chunks given criteria by a plan;
  • Plate-Local River Generation (what cannot agree across a border does not cross it);
  • Cohen, Shade, Hiller, Deussen, Wang Tiles for Image and Texture Generation, SIGGRAPH 2003 (edges are chosen before the tiles that meet at them).

Checked

seam (new 15, port 16, gate 6: at the ceilings), bed, lv, gen golden roads (1088 + 1777 checks), genv, undef, conventions, quotes. cone.test is red on main already (a ratchet of another change) and is not touched here.

Screenshots (the same station by gw 77 and by gw 78) are taken by the release workflow from tools/shots/488.mjs.


Generated by Claude Code

…een settlement cells, town gates; a seam test over 12 worlds

A border between two chunks is a record made before both from the levels above (Lv.edge, Lv.side: one object for both
neighbours, audited). Edge (39_edge.js) is that record for today's world: the lines of the network that cross (Roads.all,
the list a cell also draws from) with their heights, and the natural water along the border with its level.
tools/seam.test.mjs walks 600 borders of 12 worlds and holds the built columns to the records; what it finds is
counted down in tools/seam.known.json.

Found by it and fixed: Rail.make laid the same line for ever in a region whose only town was left out (seed 271828);
tools/rail.mjs test catches it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdsWP38p6ohAsRYayXG
…-pafmdj

# Conflicts:
#	build/notes.mjs
#	src/game/99_main.js
…s branch's; notes move to 488

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdsWP38p6ohAsRYayXG
…no wall of land across the platform by a station hall

- Found by tools/seam.test.mjs on the merged main: in worlds of gw 77 Span.apply took the height along a line from the next segment
  (Span.along) and Span.lay took the width of the bed from it too, while the distance stayed the one to the nearest segment. Beside
  the ends of every station hall the hill stayed (39 halls of 39 in four worlds, up to 98 cells off the line).
- Span.lay takes the width of the segment the distance was measured to (SPW_GW = 78); the height still runs along the line.
- tools/bed.test.mjs: every column the line's own rule calls bed stands at the height of the line (red at GW=77, green at 78).
- Golden world for gw 78 (seed 5, town + lake); notes and the shot list of build 488 (the same station by gw 77 and by gw 78);
  the rule in docs/ARCHITECTURE.md names the finding.
- The seam ratchet is back at its floor: new 15, port 16, gate 6.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdsWP38p6ohAsRYayXG
@k06a k06a self-assigned this Dec 2, 2026
@k06a k06a added the queue In the merge queue: lands on main by itself (node tools/merge.mjs <pr>) label Dec 2, 2026 — with Claude
…eue's to set)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdsWP38p6ohAsRYayXG

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

queue In the merge queue: lands on main by itself (node tools/merge.mjs <pr>)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants