#1502
Grading: a motorway viaduct rises where its slip roads pass under it near the abutment (#1496)
Slip roads ran into the A1 viaduct at Pitești (#1496)
Fixes #1496.
The A1's 4.6 km viaduct at Pitești starts at ground level 29–36 m before two of its own slip roads (ways 26436280 and 1391260724) pass under it. Motorway and trunk approaches are never raised (APPROACH_SKIP). Roads under a bridge chain longer than 120 m are never lowered (_lower_underpasses). So the deck sat 1.3–1.6 m over those roads, and cars drove into its side.
The change (server/grading.py, BNE_FREEWAY_LONG_LIFT, on by default)
A motorway or trunk abutment now takes the lift the clearance asks for (_end_lift), but only when both of these hold:
- The deck chain is longer than 400 m (
FREEWAY_LONG_DECK_M,_deck_chain_m). That makes it a viaduct, not a single long span. - A road crosses under the deck between
APPROACH_FLAT_Mand about 70 m from that end (FREEWAY_CROSS_NEAR_M,_crossed_near_end). About 70 m isUNDER_CLEAR_M / 2atDECK_MAX_GRADE: nearer than that, the deck's own climb leaves the road under half its clearance.
Decks over water and decks with measured or solved heights keep their own rules.
How it works:
_freeway_rampslays one cosine ramp (approach_add) along the motorway behind the abutment (_fast_landings/_landing_chain), across however many plans that road is split into. It is cached per cell (_memo_put, only when the read was complete)._apply_freeway_rampsraises the freeway's own plans along that line. This runs after thebeforesnapshot, so the ramp envelope runs on them.ramp_envelope(..., lifted=...): a raised freeway's nodes become a floor, not a ceiling. It also joins nodes within its half width, because the westbound diverge's link ends 4.6 m off the motorway's end. The links then come up to meet it.
Left as before:
- Single long spans: Storrow Drive's 155–165 m decks at the Bowker Overpass.
- Viaducts whose first crossing is farther in: Charlesgate, 98 m.
- The street right at an abutment: Boylston Street, 10 m inside Charlesgate's deck end.
BNE_FREEWAY_LONG_LIFT=off restores the old behaviour.
Results
- Pitești: 8.48–8.69 m between the slip roads and the deck (was 1.31–1.63 m).
- The other 29 drivability sites: identical to dev.
- New drivability site
pitesti_a1_1496: fixture plus baseline. test_freeway_lift: checks the headroom on the replay, with the switch on and off.- New
test_ramp_envelopecases: lifted nodes, a link placed beside the lanes, and_project_on. PLANS_FORMAT74 → 75, with thebake_formatsgolden re-recorded.- Tests: grading, seam, ramp, junction, determinism, plan-neutral and bake-format modules all pass.
- Speed: no measurable change.
Not yet checked in game.
🤖 Generated with Claude Code