Skip to content

Bridges let the ships through: high bridges, bascule spans, railway spans that open between the trains - #581

Open
k06a wants to merge 10 commits into
mainfrom
claude/project-thread-q7vfj0
Open

k06a wants to merge 10 commits into
mainfrom
claude/project-thread-q7vfj0

Conversation

@k06a

@k06a k06a commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Requested by Anton · project thread

What

A ship was found lying across the roadway of a road bridge. #563 (world version 92, contained in this branch) stops such a voyage from being sailed. This PR makes the ways let the ships through instead, in new worlds (SEAWAY_GW, world version 93 here):

  • A road over a sea lane is a high bridge (deck at the water + the air draught of the tallest ship of the lane + a margin, no pier in the lane) or a bascule bridge (a level deck whose two leaves open the whole lane). The seed and the style of the place decide; a road that cannot climb opens; a level city ring always opens.
  • A railway over a sea lane climbs to a high bridge over all its lanes where its stations and crossings let it, otherwise it gets a span that opens between the trains: the round of the voyage becomes a multiple of the headway of the line and its phase a second when no train is at the span or due there.
  • A bascule span is a function of the world clock: lights, then gates, then the leaves behind closed gates, and the reverse to close. Nothing is stored or sent, host and guest see the same span. The generator draws the leaves for the hour a column is made for; a keeper has those columns made again as the pose moves.
  • One stopping rule for everything that waits before a closed way (Shut): level crossings and bascule spans stop cars, buses, taxis and tractors through the same call. The hull physics asks the same span (Seaway.lets).
  • A voyage no way lets through stays in port rather than sailing through a bridge.

Why it went wrong: an order of layers

Lanes and ways were each worked out from the land alone. The order is now fixed, each layer reads only the ones before it:

  1. ports, berths and lanes from the land without the heights of ways (Port.h), clear of the plan lines of roads, rings and railways (Port.planned);
  2. the ways read the lanes (Seaway.cross, Span.navHolds, Seaway.lift, Seaway.rail);
  3. the ships read the ways (Seaway.sails, in the facts step of the worker: Ships.spec; the timetable fitted to the trains rides in the facts).

The rule and its generalisation are in docs/ARCHITECTURE.md, section "A way lets the ships through".

Tests

  • tools/seaway.test.mjs (new): the clock on the page and in a worker, the timetable of a span, the drivers before a closed strip, the choice of form as a unit test, and five worlds (the reported world, a road bascule, a railway span that opens, a railway held high, the world found by the generator critics) sailed second by second: no hull under a deck lower than its masts or under leaves not yet open, no train due while a railway span is not level, the blocks of a span level and open, the same hour gives the same blocks, a second run gives the same crossings.
  • tools/voyage.test.mjs: goes through Ships.spec → Ships.build, counts voyages that stay in port.
  • Golden: worlds of versions up to 92 unchanged, one world of version 93 added.
  • Run locally green: statics, voyage, seaway, port, hull, dock, grade, corridor, navi, rline, seam, rail, railx, xing, water, ways, gen determinism / roads / land / workers / golden.

Known limits

  • In the reported world the two voyages of one port still stay in port: the road over their lane is held down inside the lane and can neither climb nor open there.
  • A railway span whose only voyage stays in port never opens (an idle bascule).
  • Far tiles draw the leaves level; a person standing on a leaf is not carried by it.

Sources

Screenshots come with the release of the build (tools/shots/525.mjs).


Generated by Claude Code

claude added 10 commits December 3, 2026 06:20
…e is checked as a whole with its hull, a hull needs the air over its water

The generator of the sea ports and voyages read the landscape alone. The road out of a town leaves the shore for its bridge at the
very point the town's pier goes out, the ring road of a city crosses its bay over the pier, railways cross bays on viaducts: in 72
worlds 4 ports of 91 had a berth, a turning basin or a lane under a deck, and 7 voyages of 71 swung an end of the hull through the
end of their own pier. The hull physics asked for water round the water line only, so the ship lay across the roadway.

- Port.open: one question for every level that puts a ship somewhere: deep water with no deck over it (Terr.dk) and no pier in it.
- Port.find (worlds since PORT_OPEN_GW, gw 90): the port looks along its shore for a place where nothing is built over its pier and
  its berths (as wide and as long as the biggest ship of its kind).
- Port.swing asks the whole rim of the turning circle a step apart; Port.clear asks open water a step apart; Port.way: the berth,
  the water beside it and the run out to the basin for the very ship; a line is paired only where its ship has a berth at both ends.
- Ships.sound: the passage plan checked as a whole with the hull of its own ship before anybody sails it (the route check of an
  ECDIS, IMO MSC.232(82)); a voyage that fails is not sailed, in the worlds made before too.
- Hull.free / Hull.air: a hull lies only where the air over the water is clear to its own height (the decks of the landscape, and
  the loaded blocks over the water): every hull, whoever made its plan.
- A home voyage is no faster than its turn round the ground allows (SHIP_BEND).

voyage.test: six seeds and the world of the find at both versions; red before on three worlds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdrPosRiH3jGwGMjb6A
…s checked whole)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdu3a3irzU1vcX4FP2P
…ate becomes 92; voyages are made from facts

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdu3a3irzU1vcX4FP2P
… a worker works out

Main moved the ports and voyages into facts (Ships.spec in a worker, Ships.build arithmetic on the page), chose the ship of a voyage
by the room at its berths (Port.room, Ships.fit) and paced a timetable by its tightest bend (Ships.pace). Joined with this branch:
- Port.room asks Port.open (deep, nothing built over it, no pier in it) a step apart, the rim of the turning circle too; Port.way of
  this branch asked the same of the same water and is gone; a berth without a turning basin has no room.
- Ships.fit takes the maker of the facts and accepts a ship only when the voyage planned from them is sound (Ships.sound on Ships.plan,
  the arithmetic Ships.build keeps): the check reads the ground, so it runs with the facts, and a voyage one ship fails goes to the
  next of its list.
- SHIP_BEND gives way to Ships.pace; the pairing of a line no longer asks for the berths of one ship (Ships.fit chooses it).
- PORT_OPEN_GW is 92 (90 is SIZE_GW, 91 QUAY_GW); notes and shots take 524 (517 is another build's).
- voyage.test asks Ships.spec and Ships.build in every world of this branch's list.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UiczdrPosRiH3jGwGMjb6A
…ys gate becomes 93, generator voyages are planned from the facts

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdu3a3irzU1vcX4FP2P
…m has a unit test, new test worlds, note and shots 525

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdu3a3irzU1vcX4FP2P
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdu3a3irzU1vcX4FP2P
@k06a k06a self-assigned this Dec 3, 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants