Skip to content

trailview: a building passage is never a tunnel, also on older tiles - #3489

Merged
timohueser merged 2 commits into
ground-planfrom
claude/gp-passage-not-tunnel
Nov 15, 2026
Merged

timohueser merged 2 commits into
ground-planfrom
claude/gp-passage-not-tunnel

Conversation

@timohueser

@timohueser timohueser commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

The fault

Tiles of an older bake hold a way through a building (tunnel=building_passage) as the kind tunnel, with its tag. The viewer of ground-plan makes every feature of kind tunnel a tunnel line. At a gateway it then builds a hill, puts a grey portal in front and lifts the house onto the hill.

When a live user sees it

The site deploys a new viewer some minutes after a merge into develop. New data goes live only after a separate, approved prod rebake. Between the two, the live site shows the new viewer on older tiles, and users see this fault.

The rule

A feature of kind tunnel with the tag tunnel=building_passage is not a bore. It is a way of its class on the ground, and the building stands over it. Develop's viewer has the same rule.

  • builder/web/src/lib/trailview/terrain/bins.ts, lineType: the default path.
  • host/obc-ground-plan/src/graph/parts.rs, classify: the plan path. The kind and the tags reach the crate, so the same rule applies there (the level is Ground, not Tunnel).

New tiles do not hold this form: the current kind table bakes a passage as a way of its class. Thus the change has no effect on new data.

Proof

New viewer with this change (eef1f75; the second commit only records the WASM size), default path, GPU shots at 1920 × 960, views zebra-tagged and x-tertiary-eye. Pixels whose largest channel differs by more than 8 of 255:

View fix on old data vs. ground-plan on old data fix on old data vs. old data with the 16 passages patched to ways fix on old data vs. develop's viewer on its data fix vs. ground-plan on the ground-plan fixture
zebra-tagged 576,651 0 323 0
x-tertiary-eye 406,825 0 14,912 0
  • On develop's older fixture data, the portal, the hill and the lifted house are gone. The picture is equal to the picture of the old data with the passages patched to ways.
  • On the ground-plan fixture, the default path does not change (0 px in both views).
  • Sheets (local): /media/timo/OSM1/tmp/ground-plan/old-data-house/sheets/fix-zebra-tagged.png and fix-x-tertiary-eye.png (develop | before | after | fix on its own fixture).

Checks

Run:

  • npx vitest run src/lib/trailview/terrain/bins.test.ts: 43 passed (one new test: a line of kind tunnel with tunnel=building_passage is a road, one with tunnel=yes is a tunnel).
  • npm run check: 0 errors, 0 warnings.
  • obc test -p obc-ground-plan (one new test on classify): 136 passed.
  • obc exec cargo clippy -p obc-ground-plan --all-targets -- -D warnings: clean.
  • cargo fmt --all --check: clean.

Left out: the other trailview vitest files (CI runs them); the plan path on old data in the viewer (not shot); the other passage houses of the fixture.

WASM

The plan bridge changes by one condition. Its CI size (wasm-bridges of the first CI run on eef1f75, stable 1.100.0) is recorded in builder/wasm/wasm_size_guard.py, as the guard says:

recorded before this pull request change
gzipped WASM + glue 806,847 B 808,271 B +1,424 B (+0.18 %)
raw WASM 2,087,262 B 2,090,936 B +3,674 B (+0.18 %)

The growth is larger than one string comparison: classify has four callers, and the compiler most likely inlines it into each. I did not measure this.

Public docs: not changed.

Mode: change #3096
Requirements: none

🤖 Generated with Claude Code

Tiles of an older bake hold a way through a building (`tunnel=building_passage`) as the kind
`tunnel` with its tag. The viewer's `lineType` and the plan's `classify` now take such a way as a
way of its class on the ground, as develop's viewer does, so no hill, portal or lifted house shows
at a gateway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 928453c6-c99e-45eb-b685-1207bfcc93e5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The CI build of the bridge with the building-passage rule: 808,271 B gzipped (WASM and glue),
2,090,936 B raw, on stable 1.100.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@timohueser
timohueser marked this pull request as ready for review November 15, 2026 12:58
@timohueser

Copy link
Copy Markdown
Owner Author

Review of #3489 (head 897b4d3, base ground-plan 67092ce)

Verdict: MERGE. No blocking finding. Two body corrections and one note for the tunnel step 2 are below.

1. Viewer rule against develop, every reader

  • lineType (builder/web/src/lib/trailview/terrain/bins.ts:385-387) is token for token develop's rule
    (origin/develop:.../terrain/bins.ts:323-327): bore = kind === 'tunnel' && tags.tunnel !== 'building_passage',
    bridge excludes bore, the order of the type ternary is the same.
  • git grep "'tunnel'" on the head finds only three non-test readers of the kind string: bins.ts:383 (the kind
    list, same as develop:321), bins.ts:385 (the rule) and bins.ts:397 (the profile; same as develop:326, a
    passage has the profile of its class on both). plan/debug.ts:250 reads the level name, not the kind.
  • On develop the only building_passage guard in trailview/ is bins.ts:323. The head has it at the same place.
    No reader that develop guards is unguarded on the head.
  • Every other tunnel reader in trailview/ reads the line type TUNNEL, which only lineType sets
    (addLines, bins.ts:395): the portals (structures/tunnels.ts:59,135, structures/node.ts:36,55), the lamps
    (roads/lamps.ts:99), the arms (roads/arms.ts:118), the stamp flags (bins.ts:1121), isCore (bins.ts:748),
    bins.ts:528,530. lineType has two callers (bins.ts:343 fronts, bins.ts:474 lines); both get the rule.
    culverts.ts:159 reads tags.tunnel on streams only (same as develop).
  • Fronts: the head gives a passage of an older tile to faceRoads as a road; develop did the same (bins.ts:377).

2. The crate rule

  • classify (host/obc-ground-plan/src/graph/parts.rs:98): a passage of kind tunnel is Level::Ground. Correct
    for older tiles: develop's kind table keeps the tag tunnel on kind tunnel (origin/develop:data/trailview/kinds.json:9).
  • New tiles: the head's kind table matches only tunnel=yes for kind tunnel (data/trailview/kinds.json:9), and
    the way kinds do not keep the tag tunnel. A passage is a way without the tag. No effect, as the body says.
  • ground plan GP12.4 step 1: tunnel rules A and B in the bake's levels (no pixel change) #3488 does not read the tag tunnel (diff checked). No interaction now.
  • Note for step 2 (not for this pull request): the head's bake keeps tunnel=yes on a shallow tunnel that it
    makes a ground way (host/obc-trailview-features/src/bake.rs:369-375). An older tile holds a passage as kind
    tunnel with tunnel=building_passage, and this change makes it Level::Ground. If step 2 takes "level Ground
    and tag tunnel not no" as a shallow tunnel, it takes such a passage for a shallow tunnel. Step 2 must read
    tunnel == "yes" (or the way kind), not != "no". The water branch (parts.rs:83) and the debug tool
    (examples/debug/draw.rs:350) already use != "no"; do not copy that test.

3. WASM size

  • The bridge's code changed, and the guard says that such a pull request records its own CI size
    (builder/wasm/wasm_size_guard.py:28). Recording it is correct.
  • Between the last record (0925917) and the base, host/obc-ground-plan and builder/ground-plan-wasm did not
    change; only builder/wasm and one new Cargo.lock entry (obc-fit). So the delta is this change or toolchain noise.
  • The guess is plausible: Tags is a BTreeMap (tile.rs:15), so the added test is one more tree search with
    string compares, inlined per caller. +3,674 B raw is large for one test, but not out of range. Not measured
    (no twiggy run).
  • Body correction: classify has three callers in the bridge's code (parts.rs:458, levels.rs:259,
    level_tags.rs:278), not four. The fourth is the new test, which is not in the WASM.
  • Merge order: ground plan GP12.4 step 1: tunnel rules A and B in the bake's levels (no pixel change) #3488 also edits GROUND_PLAN_MEASURED (806,965 / 2,087,266). The two conflict on that line. The
    pull request that lands second records the CI size of its own run on the merged base.

4. Tests, comments, body, CI

  • Both tests are real: the vitest runs features on a kind tunnel way and checks ROAD against TUNNEL
    (bins.test.ts:563-569); the crate test checks classify levels for both tags (graph/tests.rs:914-922). Each
    would fail without the change.
  • The comment (bins.ts:384, parts.rs:97) states the gotcha and the present rule. No date, no issue number. The
    guard comment adds one clause in the same style.
  • The body is true, except the caller count above.
  • CI on 897b4d3: all run jobs green (fmt, clippy, test, wasm, wasm-bridges, web, web-browser, guards, cairn, ci).

5. Pictures

  • fix-zebra-tagged.png: "before" has the grey portal box and the house raised and darker behind it. "After"
    equals develop: flat gateway strip, house on the ground, the same window line. Nothing of the portal, the hill or
    the lift remains.
  • fix-x-tertiary-eye.png: "before" has the grey portal and the dark lifted house on the right. "After" equals
    develop. Nothing remains. The fourth panel (new fixture) shows the new-data gateway; it is not changed by this
    pull request (0 px in the body).

Not checked

  • I did not run tests, builds or renders. I did not measure the WASM growth with twiggy.
  • The plan path on older tiles in the viewer (the body also leaves it out). The crate test covers classify only.
  • The other passage houses of the fixture.

Generated by Claude Code

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.

1 participant