Skip to content

TrailView ground plan GP12.2a: the smooth wall top: a slope and a wall that vary continuously along the rim #3343

Closed

Description

@timohueser

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 (invariant 8 and the costs). On timosPC: /media/timo/OSM1/tmp/ground-plan/water-pickup/STATE-BAKE.md
(section "Wall tops on #3340"), water-pickup/REVIEW-3340.md (finding N2), the pictures
water-pickup/rc-pics/r3/INDEX.md and rc-pics/r4/INDEX.md, and the held attempt on branch
claude/gp-wall-top-attempt (commit aaa4dd3). Short names: gp/ = host/obc-ground-plan/src/, tv/ =
builder/web/src/lib/trailview/. Code places verified on ground-plan ea4da43.

Goal

Every wall of the ground plan has a smooth top along the wall: no step, no facet, no jog, and its ends taper into the
bank. The slope beside a road has no shading bands. #3340 merges with one accepted wall-top step at m3 (46.820804,
8.386169) and with shading bands at m4; this step removes both by one general rule. It is the first piece of the
risk step: every end face of the block takes this top.

Depends on / blocks

Design

1. Why the top steps today (REVIEW-3340 N2)

fit (gp/faces/heights/mod.rs:966) gives an outline edge piece ONE slope, from the greater need of its two ends, and
a wall at each end up to the cap of Line::wall_max (:379-385; 4.5 m wall_max_m for a wall class, 0 for another).
Its callers are at :1134-1135 and :1291-1292; its WGSL port is h_fit in tv/terrain/heights.wgsl. So along a
rim the slope is a step function: it steps at every piece end. That step is the jog of the wall top at m3 and the
three or four shading bands on the slope at m4. The split by need of #3340 makes the steps smaller and more frequent;
it does not remove them.

2. The rule

  1. A slope that varies continuously along the rim. Each piece end gets its own slope and its own wall from its own
    need (fit per end, with the end's paved height and the terrain where its cone lets go: both are in the outline
    edge words of the records today). Along the piece, the slope and the wall height vary linearly between the two ends.
    Two pieces that share an end share its values, so nothing steps at a piece end.
  2. The top is an envelope against the ground at the rim. The visible top of a wall is the lower of the profile and
    the ground at the rim. A profile that only raises walls stops where the ground at the rim falls below the paved edge
    (at m3 the rail's uphill wall ends at about 0.8 m as a vertical cut). So: top ≤ (ground at the rim − paved edge)
    • wall_taper × the metres along the wall from where that bound binds, on both sides; and the wall falls to zero at
      its ends at the same taper, so no wall ends in a vertical cut. wall_taper is a rule value in plan.json
      heights (the attempt's note uses 0.2).
  3. Cell independence by construction. The rule reads only inputs that two cells hold bit-equal: the piece ends cut
    on the global bin grid and their own needs, and the host line's samples. It reads no piece along the outline within
    some metres: the attempt read the pieces within 10 m, had to grow the records window from 3 to 5 bins, and still
    moved a wall top by up to 0.383 m under a half-bin shift of the cell.
  4. Rust and WGSL change line for line (heights/mod.rs, terrain/heights.wgsl). The records layout does not change
    if the per-end needs come from the existing outline edge words.

3. What the held attempt taught (aaa4dd3)

Attempt Result Lesson
Split the outline edges by need (in #3340) the m3 top does not smooth; more shading bands at m4 more pieces give more, smaller steps: the slope must vary inside a piece
Raise each piece end's wall to the max over the pieces within 10 m along the outline, less a taper m3 still steps where the ground at the rim drops below the rail; w-steep and w-river better the top needs an upper envelope against the ground at the rim, and a read along the outline is not cell-independent

Invariants

  1. No step in a wall top. Check: check::wall_steps (brought from the attempt, heights/check.rs on
    claude/gp-wall-top-attempt): 36 pairs over the fixture at the base, 13 in the attempt; the gate is set at this
    step's count, at most 13.
  2. Two cells give a wall top the same values: the border check per wall top over the fixture, 0 differences; the
    half-bin shift test, worst 0.0 m.
  3. The heights gates of host/obc-ground-plan/tests/heights_fixture.rs (steps with no rule, steep pairs) do not grow.
  4. The Rust heights and the WGSL port agree: the model probe (tests/browser/trailview/model-probe.mjs) at m3, m4.
  5. A wall stays at most wall_max_m (4.5 m) high; above it the face steepens as today (the owner's wall rule).

Decisions already made by the owner that apply

  • Walls integrate at the bottom, at the sides and ends (the height runs to zero into the bank, no cut-off end), and at
    the top (a smooth top line, no stepped top, no visible pattern repeat): "super important".
  • ground plan: outline edges cut at the global bin grid and split where their cones' need varies #3340: "Merge, fix wall later": the m3 step is accepted only until this step.
  • Walls at most about 4.5 m; above that a steep rock face.
  • No special cases; no repair passes; a torn face is the worst fault.

Not in scope

End faces at structures (GP12.2b). The stone texture's repeat (the wall look of #3166). Mapped retaining walls and wall
caps (#3115, deferred).

Proofs and pictures required before review

Cost to measure

Base: ground-plan at the branch point (#3340 merged).

  • The faces stage time, p50 and p95, native over the fixture. The held attempt raised p95 from 84.9 to 118.2 ms on a
    loaded machine: the figure to beat. Measure base and head on one quiet run each.
  • WASM bytes: the attempt added about 5.5 kB gzip. The owner accepts about 15 to 25 kB for the whole block, this wall
    top included; report the bytes.
  • The near block's bytes (no change expected).

Risks and the stop rule

Requirements: the verification console could not be checked from this PC (no agent token here). The orchestrator sets
the pull request's Requirements: line.

Activity

  1. changed the title [-]TrailView ground plan GP12.2: the ground at bridge ends: the proof of today's torn walls, ordinary ends, end faces, the ceiling under a deck[/-] [+]TrailView ground plan GP12.2a: the smooth wall top: a slope and a wall that vary continuously along the rim[/+] on Nov 11, 2026
  2. timohueser commented on Nov 11, 2026

    @timohueser
    OwnerAuthor

    GP12.2a design note: the slope and the wall are values of the rim's vertices

    What I measured first (base ground-plan d97131f)

    A probe along the walls at m3 (heights at both sides of the rim every 0.25 m):

    • The road's 4 m fill wall (line 14) changes by 0.18 to 0.24 m within the first 0.25 m of a piece, then runs on
      straight: a jog of about 1 m/m at the start of each piece. The cause: the two pieces at a vertex have two walls
      there (each piece fits its own slope to the greater need of its ends), and the round cone of the end of the one
      piece runs over the start of the next.
    • The rail's cut wall rises from 0 to 1.44 m over 2.5 m and falls again (0.31, 0.72, 0.61, 0.40, 0.09, −0.26 m/m per
      piece). The wall follows the terrain where the cone lets go (t), and that terrain has a ridge 10 m up the hill.
      This is the stone triangle in m3-near.
    • The 4-unit rim stub of ground plan: rings and seams get a vertex at each tile line by one global rule #3354 reads t along its own normal (45° off the road). So its ends have another need than
      the vertices of its neighbours, and its cone makes the 1.1 m fan.

    So two inputs are not values of a position: the slope (a value of the piece) and t (a value of the rim's
    direction). The rule makes both values of the vertex.

    The rule

    1. A need per vertex. At each piece end v: need(v) = h(v) − t(v). h(v) is the paved field at v (as today). t(v) is
      the terrain where the cones let go, read along the host line's frame, not along the rim: the outward direction is
      the frame's across direction at v (in the mitre quad that holds v; past the line's end, the direction from the end
      sample to v). t(v) is the mean of the terrain on a line along the way at go metres outward, with a tent weight
      over go metres to each side (5 samples). go is the existing metres where the cones start to let go, so this
      adds no rule value. The mean makes a wall follow the hillside, not each bump of it 10 m up the slope.
    2. Slope and wall at a point from the need there. For a point q, the piece gives the need at q's foot on it by
      linear interpolation of its two end needs. The existing no-room fit (fit), now of ONE need, gives the slope and
      the wall at that foot. The piece's cone from that foot is the existing exact cone (edge_cone) with that slope and
      that wall. fit is continuous in the need, so the slope, the wall, the 4.5 m cap and the steeper face past it all
      change continuously along the rim. Two pieces that share a vertex give the same need, slope and wall there,
      whatever their lengths.
    3. The wall's top against the ground at the rim. The step at the rim is already the ground's own height there:
      the slope side is clamp(T_rim, h, h + wall) for a cut wall (the fill side alike). So the visible top is the lower
      of the wall's profile and the terrain at the rim. Both are continuous along the rim, so the top is continuous. Where
      the terrain at the rim reaches the paved edge, the wall goes to 0 at the terrain's own grade along the rim; where
      the need falls below what the steepest face takes, the wall goes to 0 at the need's grade (smooth, because of the
      mean). No piece reads another piece, and no ground stands above the top of the wall: the face above the wall starts
      at the top of the wall.

    Cell independence (by construction)

    Every input of a vertex's values is a value at a global point that two cells hold bit-equal: the vertex (a ring's
    own vertex or a bin-grid cut, global), the paved field there (paved_end through the window's bins, as today), the
    host line's samples and mitres (the same words that give the paved field there), and the terrain at points derived
    from these. Nothing reads along the outline: a piece reads its own two ends. So two cells that hold a piece give it
    the same values, and two pieces that share a vertex agree there.

    Along the piece and across the slope band

    • Along the piece: the need is linear between the ends; slope and wall come from fit at the interpolated need
      (exact for a need that is linear along the piece, also where the fit changes regime inside the piece).
    • Across the band: unchanged. The cone falls at the slope across its piece, lets go at the reach (release), and
      the band fades into the terrain at its outer edge (band_fade_m).

    The cases

    • Rim corner, outward: the round cone at the vertex has the vertex's values, the same as both pieces' ends: no fan.
    • Rim corner, inward: the cones of both pieces overlap; the max (fill) or min (cut) gives the crease of an inward
      corner, as today.
    • Way end: the outward direction past the line's end is the direction from the end sample, so it turns smoothly
      round a cap. A level-change end (square band end at a structure) is GP12.2b's.
    • Junction of two rims (two host lines): each line's pieces have their own values (own frame, own class values); the
      existing soft maximum and minimum of the groups join them, as today.
    • Need changes sign (cut to fill): the fill and the cut each fit their own need; both are continuous through 0.
    • A piece of a few units: its ends are two values of a smooth field a few units apart, so it changes nothing.
    • An end where the terrain is unknown: the mean takes the known samples; with none, the piece takes the other end's
      need; with no known end, the class slope and no wall (as today's most).

    Records and cost

    • Outline edge record: 8 words (32 B) before | 8 words after, same layout. t holds the new vertex terrain; the
      terrain grade outward (toe width) is read along the frame's direction at the piece's middle, so the stub has the
      grade of its neighbours too.
    • GPU, per vertex of the mesh and texel of the far stamp, per outline edge of the bin: 3 fits of one need each
      instead of 3 fits of two needs, and 3 interpolations. About the same work; no new fetches.
    • Records build, per piece end: one frame look-up over the end's bin segments of its host line and 5 terrain reads
      instead of 1, each once per end point (cached).

    The splits

    • SPLIT_NEED_M (0.5 m) goes: the fit at the interpolated need is exact for a linear need, so the need no longer
      needs short pieces.
    • SPLIT_GROUND_M (0.25 m) stays, on the new mean terrain: a linear need needs a ground that is linear along the
      piece. The mean is smoother, so it splits less. I check it with the half-bin cut-shift test, and I remove it if the
      test does not need it.
    • SPLIT_M (the paved field linear along the piece) and the bin cuts stay.

    Checks

    check::wall_steps from the attempt (gate at the measured count, at most 13) and a second gate of the same kind,
    check::slope_steps: the change of the ground's grade along the rim across a piece end between two pieces of one
    straight rim, at 1, 2 and 4 m out (the bands). The half-bin shift test; the border and records checks; the heights
    gates; Rust = WGSL.

    Size: about 150 lines in the crate and 25 in WGSL, plus the two checks. No record format change, no new rule value.
    One deviation from the issue: no wall_taper value. Rule 3 gives the taper by construction (the need's mean and the
    terrain at the rim); I add the value only if the pictures show a cut end that the rule does not remove.


    Generated by Claude Code

  3. timohueser commented on Nov 11, 2026

    @timohueser
    OwnerAuthor

    GP12.2a: amendment to the design note, and the deviations (PR #3379)

    Amendment, after the half-bin shift test. The vertex values alone left the ground cut-dependent: the half-bin shift moved it by up to 1.85 m. Cause: at a cut, the round cone of the vertex beat the neighbour edge's ruled surface wherever the slope changes along the rim (the cone of a gentler point reaches over a steeper stretch). So:

    • At an end where the straight rim goes on with the same host (a bin-grid cut or a split), an edge has no round cone. Its envelope is the straight line's, and past the end's normal it falls by a rock face's slope more than the edge climbs, per metre. At a real corner of the outline the round cone stays.
    • The terrain grade outward (the toe width) is a vertex value too.
    • The outline edge record takes a ninth word (grade at b, flags ON_A/ON_B): 32 → 36 B per edge. MAGIC 0x4f425213.
      Result: shift worst 0.239 m, 995 points over 0.1 m (base 0.41 m, 5,706).

    Deviations.

    • No wall_taper value: the visible top is the lower of the wall profile and the terrain at the rim by construction.
    • wall_steps 40 → 17, not at most 13.
    • Edge steps 114 → 136 (+22 steps of 1 to 4.6 cm with no rule) and steep pairs over 6 m/m 5 → 8: the owner must accept or reject. Without the amendment these stay 112 and 5, but the ground stays cut-dependent.
    • Pictures: better at m3-eye, m4-top, s-top/s-side with ground plan: rings and seams get a vertex at each tile line by one global rule #3354, m3-near, w-river, w-m4; slightly worse at m2-eye (a vertical shading edge on the rail cut). Cause for m2-eye and for the remaining 0.6 m of ground plan: rings and seams get a vertex at each tile line by one global rule #3354's tile-line vertices: a real corner's round cone where the need changes fast. Proposed general fix (not built): a corner's cone covers only its fan, from the turn to the next edge (one more half word per end).
    • The crossing gallery was not shot.

    For #3352 (GP12.2b): the end faces take this top. An outline edge now has 9 words and the ON_A/ON_B flags; a level-change end is a corner (it keeps its round cone), as before.


    Generated by Claude Code

  4. timohueser commented on Nov 13, 2026

    @timohueser
    OwnerAuthor

    Done: merged into ground-plan as #3379 (the slope and the wall are values of the rim's vertices).


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions