Repository navigation
Description
Status: proposed
Part of #3105 (GP12, the crossing block of #3096). One pull request into ground-plan.
The steps of the block, in build order: GP12.1 #3342, GP12.2a #3343, GP12.2b #3352, GP12.3a #3344, GP12.3b #3353, GP12.4 #3345, GP12.5 #3346, GP12.6 #3347, GP12.7 #3348, GP12.8 #3349.
Read first: #3105 (words, invariants, the gallery, the costs, the owner's decisions), and GP12.3a (what the crate
builds). Short names: gp/ = host/obc-ground-plan/src/, tv/ = builder/web/src/lib/trailview/. Code places
verified on ground-plan ea4da43.
Goal
Near the eye, every bridge is one deck with an edge, an underside, a parapet or a railing on its free outline and
piers that never stand on a way below; it throws its shadow. The deck starts on a straight end line past the junction.
With too little room the deck gets thinner; with no room the two ways are ground ways and the smaller one ends. Past
the mesh range the old bridge mesh stays the far look until GP12.6, with no doubled and no missing deck.
Depends on / blocks
- Depends on: GP12.3a (storey records, storey mesh, shell corners), GP12.1 (states, ladder), GP12.2b (ordinary ends).
- Blocks: GP12.4, GP12.5, GP12.6, GP12.7.
Design
1. Storey 0 follows the states
in_level(.., 0) (gp/faces/mod.rs:197-206) reads the states of GP12.1 for bridge ways and for the ways that a bridge
way interrupts on ladder step 3: a DECK station is on its storey, an OPEN station on storey 0, a HIDDEN station on
none. Tunnel ways keep today's level until GP12.4. The piece of a bridge way between its tag end and A (the stub) is a
ground way of storey 0 and ends on A with GP12.2b's ordinary end.
2. The ladder for decks
- Step 1, Full: the deck with its full depth. Step 2, Thin: first the depth goes down to
deck_least_m, then the
clearance. Step 3, Closed: both ways are ground ways of storey 0; the smaller way (GP12.1) is HIDDEN over the
other's body and ends with GP12.2b's ordinary end; the door is GP12.5's. Step 4, At grade: a junction or a level
crossing (exists). - GP2's synthetic decks (a path over a stream wider than a pipe,
CrossingKind::Footbridge; an untagged way over a
way) are decks of this step. This step moves the start of the synthetic deck over a way (gp/graph/crossings.rs: 386-400) from the lower way'sclearance_mto the least room of the pair; betweensnap_height_mand the least room
the pair staysStacked(step 3).
3. Drawing the storeys and the shell
- The WASM bridge hands the storey runs and the shell corners to the viewer (GP12.3a's option on).
tv/plan/corners.wgslgives a shell corner its height: the height function of its label plus its offset, and the
lower of two where it has two labels.tv/plan/piece.wgsldraws the storey runs and the shell with the looks of the
table: the deck top with its way's look (markings run on over the deck), the edge faces and the underside concrete
(timber for an unpaved deck, steel for acabledeck), parapets concrete, railings steel or timber by class.- Shadows: today the pieces draw no shadow casters (
tv/plan/pieces.ts); the structure meshes do
(tv/structures/structures.ts). New: a caster draw of the pieces for the storey runs, the shell and the piers.
4. The old near deck stops, and the interim far look (a new mechanism)
- On the plan path the deck sheets replace
bridges()(tv/structures/bridges.ts:39) and the corridor plan
decksOf/teesOfoftv/roads/decks.tsnear the eye. - Until GP12.6 builds the far forms, the old bridge mesh stays the far look. It is built per owner node into
far.mesh(tv/structures/node.ts) as whole solids, so a vertex test cannot cut it. New: the structure pipeline
binds the plan cells (tv/plan/cells.wgsl, as the terrain does) and discards a fragment of an old bridge mesh where
plan_meshedholds at its position: there the cell's mesh draws, and so do its sheets. Nowhere else does a sheet
draw.structures.wgsldiscards already (:259,:263), so this adds no new loss of the early depth test. The
mechanism goes in GP12.6. - The default path keeps
bridges.tsandroads/decks.tsuntil GP19 (TrailView ground plan GP19: the ground plan becomes the only path, the old code goes, docs, budgets, merge into develop #3110).
Invariants
- One deck per sheet at every place near the eye: no old deck where a sheet draws, no gap where it does not. Check:
three views of one bridge from before, inside and past the range of the meshed cells, and a top view at that line. - Parapets and railings stand only on the free outline (
A2,p01,B10,N1in the gallery). - The deck's underside lies over the ground under it by at least
ceiling_gap_m, except where the ladder put it over
a way or water. Check: crate test on the fixture (GP12.3a's records with the Rust heights). - Every drawn shell part has its thickness and closed faces (GP12.3a's closure test holds for what is drawn).
- The default path does not change.
Decisions already made by the owner that apply
- "Side-by-side bridges as one deck, small bridges and footbridges, viaducts and the far forms: do as proposed."
- "Overlapping bridges are a super frequent issue."
- With no room at all, a railway never ends; the smaller way ends.
- "End walls and tunnel frames taller than 4.5 m: yes of course."
- Structure parts are never paper-thin sheets.
Not in scope
Bores (GP12.4). The framed door (GP12.5). The far forms and the end of the interim mechanism (GP12.6). Covered bridges
(GP12.7). Rails on a deck (#3106). Guardrails on the approaches (#3115). Lamps on a deck (#3116). The footbridge hump
(deferred, #3108).
Proofs and pictures required before review
- The crossing gallery, all 50 places, before | after (TrailView ground plan GP12: bridges, tunnels, underpasses and galleries: decks, bores and roofs with the ladder (the contract of the crossing block) #3105's rule), with the verdict table.
- Must turn BROKEN to GOOD or IMPERFECT:
A2(one deck, no "M"),W1(one deck plan where the ramps meet). - Must improve:
p01,B10,N1(one deck, walls on the outer edge only),B09(no pier on the track bridge; a
railing on the track bridge),B04(the deck from A past the junction; a parapet of 0.35 m),T15(no crossed
walls on the deck end; the end in the air stays, TrailView ground plan GP12: bridges, tunnels, underpasses and galleries: decks, bores and roofs with the ladder (the contract of the crossing block) #3105 open point 1),R09(no slit at the deck start; the step
of the heights stays, GP12.8). - Must stay GOOD:
B06,B07,B12,B14,N3. Heights-bound, judged whole only:S4,N4.
- Must turn BROKEN to GOOD or IMPERFECT:
- Labelled shots of the fixture's bridges for the owner: eye and top at
bridge-top,under-bridge-top,
stream-under-bridge-top,footbridge-top,cliff-walk-top,free-decks-top; the views of invariant 1. - The owner sees the sheets and gives his OK before the merge.
Cost to measure
Base: ground-plan at the branch point; develop's head for the frame.
- Frame:
walk,valley-driveandluzwith the caster draw. - The corners' pass time on the GPU (
plan-timing.html) with the shell corners. - WASM bytes, gzip and raw (the block's 15 to 25 kB).
Risks and the stop rule
- Stop and report if the shell needs a second height function on the GPU, or a per-frame cost beyond the corners'
pass and one more draw. - Stop and report if the frame reaches twice its base, or the block's WASM passes 25 kB.
- After two failed review rounds, stop and report.
Requirements: the verification console could not be checked from this PC (no agent token here). The orchestrator sets
the pull request's Requirements: line.
Deviations (GP12.3b part A, PR #3470)
- The WASM cuts:
graph::levelsruns in the feature bake (revision 18). The zoom-13 tiles carry each road way's
states and end lines (levels), the storey of a deck over a deck (storey) and the slab on ladder step 2 (slab);
the device reads them (graph::level_tags::read). The bake uses the rule tables of its own build: a change of a
level rule or of the levels' code takes a new bake, a new revision and a fixture rebake (the fixture test
the_tiles_carry_the_levels_of_each_cellfails until then). - The slab depth and the storey are per feature (the least and the highest over its cells), not per way piece. A
way of a cell's margin reads the levels of the cell that owns it. A way with a part that has no alignment has no
levels. - Cut 3 is not done in part A: one encode pass for all storeys (not simpler than the merge, a risk to storey 0's
bytes) and the deck stroke through the ground path (its general form is the split of the way graph at the end
lines, which is the stub of part B). The decks measure +34.7 kB of gzip over the base (local build), not 20 to 30 kB.
Deviations (GP12.3b part B, PR #3482)
- Storey 0 follows the states by a split of the way graph, not by
in_level(.., 0):graph::build_levelled
(level_tags::split) splits each bridge way at the end lines that the tiles carry. A DECK stretch is a deck way, an
OPEN stretch a ground way (the stub, which ends on A with the ordinary end), a HIDDEN stretch goes. Tunnel ways are
not split (GP12.4). So a deck is one whole way and its stroke goes through the ground path (cut 3). - The ladder runs in the bake (part A); the device reads its results from the tags. Not done: §2's start of the
synthetic deck over a way at the least room of the pair (graph/crossings.rsis unchanged). - An end of a deck is open where a ground way, or a deck on another storey, meets it at a junction or a joint,
whatever other decks end there. The split puts each stub at its deck's height, so the rule needs no height test.
A junction with an arm on another level is no point of a storey: each deck arm ends there open, as at a joint (no
corner round across the other arm). Where a deck's free outline lies on a paved face of the ground whose line lies
within 0.1 m of the deck's, it stays open, and a parapet, railing or post ends where its inner side would stand on
such a face within a parapet's height: the deck goes on into that way. - Crossing A lines of one deck group move in together, in the bake (
graph::levels::merge_a, revision 19): each A
moves in along its way to where its centre line meets the line normal to their mean direction into the decks
through the farthest one in; its end line stays square to its own way, so on two ways at an angle the end lines can
still cross or leave a wedge. One pass; a cell merges the A lines that it sees. Box B: 4 of 168 zoom-13 tiles
change, the A lines move 0.01 to 1.5 m. - Two deck ways side by side on a sheet are one deck; where their lines lie more than a parapet's height (1 m)
apart at either point of an edge piece, each has its own edge face and parapet or railing there. This is new: a
slot there was a wall from one deck to the other (Acheregg's arched footbridge, Brunnen's walkway under the road
deck). Each piece decides from its own two points, so two cells decide alike; a parapet's or railing's chain stays
on one deck way. - Each shell corner has one label (the shell repeats a corner per label). What a deck is made of follows the rule of
the old bridges (segmentofstructures/bridges.ts) per deck way (faces::deck::DeckWay::build): a road on
beams and a railway are concrete, a bridge that hangs (bridge:structuresuspension, simple-suspension or
cable-stayed) is steel, any other (a path's, a covered one) timber; a railing is timber on timber, else steel; a
top that the old viewer did not count as paved (main, road, oneway) is of planks on such a bridge. The device
writes it into the storey line's finish word (bits 21 to 23; the material narrows to 4 bits), the corners pass
copies it into the storey corners' look word, and the shell draws the timber, steel and plank looks. A rail deck has
a railing (the class grouprailjoins path, steps and track insections.rs). - The old bridge mesh's faces are their own index range (
MeshBuilder.bridge) and draw with their own pipeline that
discards where a cell's mesh draws, by the same dither as a cut piece's fade (plan_share); their casters discard
there too. The structures bind the plan cells at their own binding by an include swap (plan/cells-buffer.wgsl,
structures/plan-cells.wgsl). A covered bridge's walls and roof stay beside the storey's deck
(MeshBuilder.beside).roads/decks.tsdraws nothing on the plan path (the corridors get no features there). - Piers: each cell reads the sheet at the point of its own square nearest the pier's point, and the line, the
ground and the tests of the foot at the pier's whole ring, so the two halves of a pier on a cell line are one
solid. A pier's foot without a label stands on the stamp's ground (no drawn page). - The slab's hollow at an open A line: the shell leaves the A line open; storey 0's end face on that line closes it
where the ground under the deck lies lower than the deck. Where a stub meets its deck, the deck's end takes storey
0's mesh points on the end line, and its corners there take the label of the stub's paved face or shoulder, so the
two meshes stand at one height (invariants 4 and 5). Not on: a band over the stub's verge or slope, a deck that
ends at a bend of its way (its stub leaves at an angle), and a few stub points inside a deck's end piece (17 seams
on the fixture, a budget intests/storeys.rs). - N-a: the storey stays per deck group of the bake (part A); a group that crosses itself lies on one storey. Rule
5 separates side-by-side decks of one storey that lie apart in height. No self-crossing group shows a fault at the
Lucerne interchange. - The pictures use my own box B bake of the features (revision 19) over the checkpoint 5 release, with live stamps.
- A bridge's abutment is concrete, not stone: a wall beside a bridge's ground stretch (a stub; its record line
carriesBRIDGE_GROUND, bit 20 of the finish word), and a wall within 3 m of a deck's stroke over storey 0 (its
ceiling line), as at a junction at the deck's end. Its height is GP12.8's (abutments). - A storey's top paints a rail deck's sleepers and rails at any distance (no faces of
tracks.tsstand on a deck).
Activity
timohueser commentedon Nov 11, 2026
From GP12.1 (PR #3367): what this step can read, and what differs from the plan
graph.levels.runscovers every tagged way (non-synthetic deck way, non-water tunnel way) once, in order; untagged ways that end on step 3 also have runs (HIDDEN under the body, OPEN elsewhere).in_levelis unchanged.graph.levels.end_lines(A, Portal, Closed); merged lines list each member way with its station on the merged line, and the members' runs are moved to that station.edge_band_min GP12.1's sheets (the block has no wall value): GP12.4 should add one tostructures.deck(upper)of an untagged upper way is itsdeck_least_m.A1east,p04). The rule "the floor is at or under the terrain" may need a tolerance before doors are drawn (GP12.4, GP12.5).Generated by Claude Code
timohueser commentedon Nov 12, 2026
From GP12.2b part 2 (PR #3396), for GP12.3b
CEILINGline after the lines of storey 0 (finish bit 12; word 10 = drop = depth +ceiling_gap_m; words 4 and 5 = the flat-end normal per end; the samples' half-width = paved layers +edge_band_m). The stroke ends flat on the end line of the ground way that ends there (within 45°).MAT_CAP. The old deck still draws: atA2the slit across the road at the deck start is now dark, not light.held_over_caplists those steps (fx-today: 472 listed, 109 with no room).face_maxbeside it. Stone cut walls stand under the R11 slab and ground rises beside the deck; at B09 the bank beside a low deck over a brook is cut into sharp facets.Generated by Claude Code
timohueser commentedon Nov 12, 2026
From the review of PR #3396 (GP12.2b part 2): points for this step
The review (
crossings/REVIEW-3396.mdon timosPC) gives these non-blocking points to GP12.3b. PR #3396 does not fix them.face_maxper metre), andmin(ground, ceiling)adds a second crease where it starts to bind. Under a low deck over a bank this gives angular facets, and the water shows in angular patches. A general softening:smin(h, ceiling, k ≈ 1 m)inby_label(Rust) and inheight_relative(WGSL), identical in both. It moves heights at every place where the ceiling binds, so it needs the fixture gates and the B09 pictures again. Not done in ground plan: deck ends with end faces under the decks' ceilings #3396.lines()marks a ground arm's endDECKat anyLevel::Deckarm, buton_deckleaves water decks out. A ground way at a joint with a water deck gets the round slope end and theEndFacelabels, but no ceiling. Use one predicate.HeldOverCaponly labels the steps; aHeldstep does not get the wall's limit yet (W1's 6.57 m step stays). This step must own theHeldlimit, and the gatesHELD_OVER_CAP_MAX(74) and the 51 steep triangles at paved ends must fall to 0 here.FLAT_TURN_DEG). If the drawn deck ends square to its own chord, a skewed end leaves a triangle of ground held at the bound with no deck over it (up to h × h·tan θ). Check this when the storey faces draw the deck.Generated by Claude Code
timohueser commentedon Nov 13, 2026
From GP12.3a (PR #3464): what this step can read, and what differs from the plan
cell::build_storeysbuilds the storeys after storey 0 (graph::levels, thenrecords::storeys); the bridge's featurestoreys(off) runs it and givesMeshInput::storeys()(the bytes ofmesh::shell::StoreyMesh) andCellPlan::storey_times().ground-planff484a4 (levels included; local toolchain), the device without it +6.4 kB. That passes the block's 15 to 25 kB by far: this step must shrink the storey code (candidates' deck branches,faces::deck,records::storeysmerge,mesh::shell) or ask the owner before it turns the feature on.STOREY, storey in the leg bits); a storey's height segments, discs and centre-line segments come last in each bin. A storey-0 reader of the WGSL must stop at aSTOREYline as at aCEILINGline (h_present), the ceiling (h_ceiling) must skip theSTOREYitems at the end of a bin, and the paint must not take aSTOREYline as a way of storey 0. A storey-k label's storey is its material line's.findon a storey, list them.StoreyMeshbytes: headHEAD16 words (MAGIC0x4f425301, counts, triangles per part ofPARTStop, underside, edge, parapet, railing, post, pier), corners of 3 words (x, y with the 25-bit label, offset f32), triangle runs per part, slot runs (tops' slots, then the undersides' risers). The cell mesh and its bytes are unchanged.l_max_mof the deck faces (the storey splits its edges by its sheet faces alone).Surface::DeckEdge, rank of slope) of the free outline; the free outline leaves out cell lines and open end lines (EdgeKind::DeckEdgeon the storey's plan).room − least + deck_least_m, at leastdeck_least_m. The ceiling still holds the ground under the tile's depth.crossings/gp123a/sheets/on timosPC (12 places, from above and oblique, Rust heights).Generated by Claude Code
timohueser commentedon Nov 13, 2026
From the review of PR #3464 (GP12.3a): three points for this step
faces::deck,ground_at). So side-by-side decks that end together at an abutment junction get an edge face where the ground road goes on. The fixture has 3 closed way ends. Check this against the stubs that this step draws.StoreyMesh::open), for storey 0 to meet. Something must close the slab section of depthdeckthere: GP12.2b's end face under the stub's end, or a free-end face of this step. Decide which, and test it with the shell closure check (mesh::shell::closure).find), so for a pier on a cell line the two cells read the ground at two points. And a pier whose point lies in the neighbour cell is built only by the cell that holds its point (the sheet over it is looked up at that point): its part in the other cell is missing. Read the ground and the sheet at the pier point in both cells (the point is in both cells' inputs).Generated by Claude Code
timohueser commentedon Nov 13, 2026
Owner decision, 2026-11-13: "Cut, allow ~60 kB".
The WASM allowance of the whole crossing block (GP12: decks, bores and portals, far forms, roofs) is about 60 kB gzipped on the device, in place of the earlier 15 to 25 kB. That estimate was wrong by about 3 times: the review of #3464 measured +62.1 kB gzipped for the deck code alone when the device links it (the shell about 42 %,
graph::levels25 %, the deck faces and the records merge 29 %).The cuts come first. They are part of GP12.3b (#3353), before the device links the storeys:
graph::levelsmoves into the bake (planned for GP12.8): about −16 to −26 kB.Each step of the block reports its measured device size against the base, from the CI build, and the sum against the 60 kB.
Generated by Claude Code
timohueser commentedon Nov 13, 2026
From the delta review of PR #3464: a pier on a cell line is half a solid. The cell that holds the pier point clips the pier's box to its square, and
closuredoes not check faces on a cell line, so the pier shows an open side there; the other cell builds no part, because the sheet lookup at the pier point fails in that cell (mesh::shell,piers). The fixture has no such pier. Fix: in each cell, find the sheet at the centre of the clipped ring (the directionalong(top, pt)and the clip aboutptalready agree in both cells).Generated by Claude Code
timohueser commentedon Nov 13, 2026
From the review of PR #3470 (GP12.3b part A): points for part B
graph::levels, soCrossing.ladderis always None there. No device code reads it today. Anything that part B (or GP12.4) needs of a ladder, for example the start of a synthetic deck at the least room of the pair or theStackedcrossings that close, must come from a tag that the bake writes.slabtag is the least slab over all the crossings of the OSM way on ladder step 2, and it holds for the whole way: a 1 km viaduct with one thin crossing is thin over its full length. This removes the step in the underside at a cell line that the per-piece rule gave, but it is a change of look. Show it in the pictures of part B. A per-run slab (one slab per DECK run inlevels) would keep both.levelsdraws as a synthetic deck (storey 1, full depth, no ladder). On box B every deck copy inside the bounds has the tags; the 11 without them lie past the bounds in the buffer of an edge tile, whose neighbour tile is not in the archive, so no cell of the bake holds them. On a release older than revision 18 every bridge has nolevels. Part B decides the default for that case.Generated by Claude Code
timohueser commentedon Nov 13, 2026
From the delta review of PR #3470: two more points for part B
Generated by Claude Code
timohueser commentedon Nov 14, 2026
Part B is in
ground-planthrough #3482 (head 0925917, merge 46793ba), on the owner's word "Merge as it is" of 2026-11-14. Joined bridges draw as one deck; rails, timber and steel are kept; the old near decks stop where the plan draws.Known faults that landed with it:
The crossing chain is at about 49 kB gzipped of the owner's allowance of about 60 kB.
Generated by Claude Code
timohueser commentedon Nov 20, 2026
Closed in the backlog cleanup: part A (#3470) and part B (#3482) are merged. The known faults have owners: shards at deck ends → #3484; tall faces at Hergiswil and W1, and the Brunnen walkway → #3349. The two last items (section 2: the synthetic deck still starts at the old place; a deck group that crosses itself lies on one storey) are now in a comment on #3349.
Generated by Claude Code