Skip to content

One net of ways: railway and road faults fixed in the generators (gw 71) - #504

Merged
k06a merged 26 commits into
mainfrom
claude/project-thread-kl5tv2
Dec 2, 2026
Merged

k06a merged 26 commits into
mainfrom
claude/project-thread-kl5tv2

Conversation

@k06a

@k06a k06a commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Requested by Anton · project thread

Lands after #466 (this branch contains its commits: the faults were found when it moved the tests to the current worlds).

What was wrong, and where it is fixed

The navigator and railway tests, moved from old worlds to the current ones, found faults that were kept as ratchets (KNOWN in tools/rail.mjs and tools/navi.test.mjs). Each one is now a rule of the generator that makes the way, with a test that catches the old world. Worlds made since generator version 71 follow them.

Railways (src/game/35_track.js, 35_span.js)

  • 🛤️ A station stands where the line can reach its neighbours. Rail.reachW forecasts the closed line exactly as it is laid (control polygon, bends, corner rounding) before the stations are placed, and slides each station along its platform to the nearest place from which every settlement and the next platform are within the grade. A town that no place brings within reach is left out of the loop. East Plaza (seed 99) is level; a town 20 m above its neighbours is no longer joined to them by a cliff.
  • 🌉 A crossing moves a track only within its band. Rail.slack measures the room from the line's own height to every hold, and counts the other crossings nearby as holds too (two crossings share the grade between them). A road that crosses in a corridor with a greater road holds the track at the track's height. A road held at its town's level that the track cannot pass over or under within the band crosses level (Österdal, seed 99: the track went 24 cells up beside a level crossing two points on).
  • 🔁 A road that crosses one line twice close by crosses it the same way (Rail.twin): the "level crossing" at -3535,-4706 with the road 9.6 cells above the rails is a bridge.
  • 📉 Two holds that touch do not make a step (Span.hold, SP_TOL): bands that miss each other by a rounding error meet in the middle. No track of the test worlds has a step steeper than twice its grade (30 before), and rail.mjs test fails on any.

Roads, villages, footpaths (35_roads.js, 35_span.js, 34_vill.js, 73_navi.js)

  • 🧭 The roundabout islands of a road are the same before and after its profile (Xing.isls); a route goes round the islands of every road it uses.
  • 🏘️ The streets of a village are one net (pieces joined shortest first); a footpath that comes to a village goes on to a street.
  • 🚶 A footpath crosses a road level with it or with 3.2 m of room under the deck, and goes round islands. No car is routed over a footbridge.

Drivers (src/game/74_town.js)

  • 🚛 The look-ahead of a driver measures the way ahead from the way's own height (Town.wallAhead). Measured from the middle of a long vehicle on a deck climbing at 1/9, its own road looked like a wall: a lorry with a trailer stood for minutes at the viaduct into Königsstadt (seed 20261129). This was reported as a covered bridge the vehicles stop at; the bridge and its clearance are right, the fault was the look-ahead, the same for every kind of vehicle.

Results

before now
rail.mjs test, known faults 3 (+3 on worlds of gw 66-70) 0, list removed
steep steps in tracks 30 0
navigator outside grown towns: routes off the net or with a car on a walker's way 89 0
navigator outside grown towns: samples off the net 1.02 % 0.07 %

One ratchet is left, and it is scoped: inside the towns that grew (34_weave.js, worlds since gw 66, landed while this was in work) a road that comes to the town is not always met by a street, and a route crosses the bare plan. navi.test counts those routes apart (TOWNS: 218 routes, 2.4 % of samples) and is strict everywhere else. The towns' own PR (#499) continues every road to a street; the counter goes to zero after it.

Tests

  • tools/ways.test.mjs (new): parts slack, cliff, band, twin, moves, isls, vill, foot, each with the old generator version it catches.
  • tools/climb.test.mjs (new, browser): every kind of road vehicle climbs the steepest stretch of a road into a town without standing; a wall of blocks across it still stops a lorry.
  • tools/rail.mjs test, tools/navi.test.mjs: known lists removed (see above). tools/gen.test.mjs golden: a world of gw 71.
  • Rules: docs/ARCHITECTURE.md, "The ways are one net" and "A driver's look-ahead measures the way from the height of the way".

Built on

Screenshots come with the release of the build (tools/shots/469.mjs: the lorry on the viaduct, a village net, East Plaza, the twin crossing).

https://claude.ai/code/session_01Uiczdw3KUitNgtCeCv9tDM


Generated by Claude Code

claude added 25 commits December 2, 2026 16:27
…ed, an old world asks once to rebuild its surroundings

GFLOOR next to GENV (75_seed.js): every gw/gh/gl gate at or below it keeps only the current rule; the old
branches, their constants and comments are gone (~40 constants, 460 lines in src/game). A save below the floor
shows one card (Save.ask, #regen): Not now / Rebuild the surroundings (the lot kept, numbers lifted by
Seed.lift / Seed.liftCode). The seed rows ghx/glx/gwx carry the version numbers past 63.

Proof: golden worlds below the floor lifted to the current numbers with hashes written by main before the
collapse; all 41 worlds and the villa/roomy house hashes are equal after it. genv.test fails on leftovers
of collapsed gates and on tools that pin a number below the floor; regen.test checks the card in the browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
…trees of the lot

The big trees of a lot are placed on Poisson-disk sites drawn from the lot seed alone,
taken in order where the house leaves room (40_house.js LOTTREE_GL). Before, the roomiest
spot was searched again for every house, so another house moved most of them
(layers.test: 70 of 240 kept with the current house metrics). Now 190 of 240.

- GENV gl 9, chronicle line; gl 8 lots unchanged (villa/roomy hashes at gl 8 equal)
- golden: two gl 9 worlds; villa/roomy GOLD for gl 9
- layers.test ratchet 60% -> 70%; rule 5 in docs/ARCHITECTURE.md
- release notes 457: stable lot trees

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
…ssings, stations within reach, islands on every route, one village net, footpath crossings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdw3KUitNgtCeCv9tDM
…es build 459

- 35_roads.js: Roads.on stays the method (dupkeys.test caught a merged on: true flag)
- 34_settle.js: P.ug carries the world version again (35_under.js UG_LADDER_GW reads it);
  gen:land found shaft rungs without their stile; a golden city with manholes in its
  middle columns, hashed by main's code, now guards it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
…mes build 464

genv.test pins only world numbers: a gw: 0 of a pen gate (herd.test) is not a generator version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
…ild 465

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
…loor becomes build 466

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
…ossings share the grade, corridor crossings hold the track at its height; long vehicles measure the way ahead from its own height

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdw3KUitNgtCeCv9tDM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
…s the builders' network test on main)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdw3KUitNgtCeCv9tDM
…es build 468

nature.test no longer asks Farm.on (the farming year is in every world above the floor).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
… of ways is gw 71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdw3KUitNgtCeCv9tDM
…evel over water crosses level), touching holds meet in the middle (Span.hold SP_TOL): no step in any track; build 469 notes and shots

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdw3KUitNgtCeCv9tDM
…d airports and 31_terrgeo (as lava.test)

The collapse removed the gw >= 5 guard in front of Roads.on in Terr.at, so the harness
that loads only the terrain must name Roads. With 31_terrgeo the test measures the land
the game makes (the counts of caves and streams are those of the real land now).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
…f gw 66 has no streets on the fake land)

Main pins this test to gw 21 and gives the same result there; with gw 70 it throws on main too.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
…of a new world asked to rebuild on every reload

Save.stale asked a save's options for gh and gl, which a saved world never holds (its house and lot are stored as built),
so every save looked old. Seed.old / Seed.lift take the layers (Seed.LAYERS for a seed, Seed.SAVED for a save).
regen.test opens a save of a new world again and expects no card; genv.test checks both key sets.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdvJyHJBSpA2HKuTs6m
…r routes across the bare plan of a grown town; the rules of the band and of touching holds in ARCHITECTURE.md

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdw3KUitNgtCeCv9tDM
@k06a k06a self-assigned this Dec 2, 2026
…merge queue)

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

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

⏱ Performance: this PR against main

Scenarios of src/game/98_perf.js, the two builds by turns on one runner (tools/perf.mjs, CPU side, draws counted not drawn).

✅ No regression against main

scenario metric main PR Δ threshold
– no change beyond the noise
scenario CPU mean p95 max slow/min spikes/min miss sync gens draws top systems (ms/frame)
idle 4.58 7.85 28.1 0.00 15.0 0% 6.00 377 BigMap.sample 0.60, Town.update 0.55, Land.drawPass 0.44, Walk.casters 0.32
night 3.87 6.75 22.9 0.00 5.99 0% 0.50 344 Land.drawPass 0.49, Town.update 0.43, BigMap.sample 0.30, Walk.casters 0.22
drive 25.0 61.0 209 180 225 27% 110 130 Land.lightTick 9.71⚠️, Land.gen 2.71⚠️, Land.meshChunk 1.42⚠️, BigMap.sample 1.40
flight 12.0 30.5 321 64.9 152 0% 29.5 53.5 Land.lodData 2.41, BigMap.sample 1.72, Folk.update 1.53, Town.update 0.93
tunnel 9.52 34.0 191 64.9 180 0% 0.00 272 Land.lightTick 1.67⚠️, Land.lodData 0.89, Land.meshChunk 0.85, Land.drawPass 0.68

Over budget (ms/frame, budget): drive Land.lightTick 9.71 > 1 · drive Land.gen 2.71 > 0 · tunnel Land.lightTick 1.67 > 1 · drive Land.meshChunk 1.42 > 1 · night Land.gen 0.01 > 0


Generated by Claude Code

k06a pushed a commit that referenced this pull request Dec 2, 2026
…), where its ratchet was counted

In towns that grew (gw 66+) 262 routes leave the network against the 89 of the ratchet; PR #504 counts and fixes those
and moves the test to the current numbers.

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

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Screenshots of build v477

🌉 🌉 The road at -3535,-4706 (seed 4242) crosses the line on a bridge, as at its other crossing close by; it used to come down to a level crossing 10 cells above the rails

🌉 The road at -3535,-4706 (seed 4242) crosses the line on a bridge, as at its other crossing close by; it used to come down to a level crossing 10 cells above the rails

🚛 🚛 A lorry with a trailer climbs the viaduct into Königsstadt: it used to stand here for minutes, taking its own road ahead for a wall

🚛 A lorry with a trailer climbs the viaduct into Königsstadt: it used to stand here for minutes, taking its own road ahead for a wall

🏘️ 🏘️ Leeuwijk from above: the footpaths that come to the village go on as lanes to its streets, and the streets are one net

🏘️ Leeuwijk from above: the footpaths that come to the village go on as lanes to its streets, and the streets are one net

All of them are assets of the v477 release.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants