arXiv:2610.02825cs.CVOct 2026

Manuscript Offprint

arXiv:2610.02825

TerrainForge: Physics-Grounded road geometry Editing for Counterfactual Autonomous Driving

Yang Chen, Yicheng Zhu, zhenning Li, Tao Li, Zilin Bian

Abstract

Road geometry (e.g., crests, sags, and speed humps) and surface conditions (e.g., wet or icy pavement) affect how vehicles move, what drivers and onboard cameras observe, and how much clearance remains between vehicles. Editing these properties in a driving scene therefore requires corresponding changes in vehicle motion. Capturing these differences in a driving video requires a road edit to propagate to vehicle motion, camera viewpoint, and the clearance between vehicles. We present TerrainForge, a framework for generating road geometry-focused counterfactuals from reconstructed multi-vehicle driving episodes. A unified road model connects scene deformation with four-wheel vehicle dynamics, allowing crests, sags, speed humps, and friction changes to propagate through vehicle motion, camera viewpoint, and inter-vehicle clearance. Vehicle dynamics are evaluated against CarSim, and prescribed road geometry is verified in reconstructed Waymo scenes. Across 18 episodes, leaving surrounding vehicles on their recorded trajectories instead of recomputing their responses produces median peak differences in predicted ego-lead distance of 1.52 m for crests and 1.41 m for sags. We further simulate the ego response to 15,758 road edits across 983 braking episodes, pairing each edit with its safety outcomes relative to an unedited replay. These pairs train a first-stage screening surrogate that takes the original driving context and candidate road-edit parameters as input and predicts the resulting change in the ego's terminal gap. On held-out scenes, this prediction achieves 22–40% lower mean absolute error than predicting no change, so candidates can be screened cheaply before the full multi-vehicle rollout.

1 Introduction

A vehicle braking behind a lead car can stop with different margins depending on the road beneath it, even when its control inputs remain unchanged. A crest or sag changes road grade and tire loading, while a speed hump excites the suspension and reduced surface friction limits the forces available for braking. These effects alter vehicle motion and camera viewpoint. Vehicles encountering the same road feature at different speeds or times may respond differently, changing the clearance between them. For autonomous-driving evaluation, such cases motivate a controlled comparison: change the road geometry or surface conditions in a recorded episode and examine how the vehicles and their observations change (Figure 1).

Controllable driving generation provides considerable flexibility in scene appearance, road layouts, and traffic configurations. Road maps, vehicle layouts, camera parameters, and text can specify the content of generated scenes[Gao et al., 2024, Wen et al., 2024, Yang et al., 2026]. Risk-aware trajectory prediction provides a complementary view of how future vehicle motion and driving behavior can be modeled[Ning et al., 2025, Liao et al., 2024b]. Reconstruction-based approaches have also begun to connect scene editing with explicit models of vehicle physics[Zhou et al., 2026a, Chen et al., 2026]. The question considered here concerns the consequences of a road change across a recorded traffic episode: how the vehicles sharing that road respond, how their relative motion changes, and how those changes appear in the resulting video.

Answering this question requires the edited road to determine the physical conditions experienced by each vehicle. Road shape affects wheel contact and loading, while surface friction constrains the tire forces that produce motion. The resulting changes in position and attitude must then be reflected in the rendered scene. Surrounding traffic is part of this calculation. Leaving neighboring vehicles on their recorded trajectories would combine ego motion produced on the

Existing driving generation methods

Focus on traffic agents and scene layout.

Figure

agent actions

traffic layout

interactions

Road geometry is typically fixed background

Road geometry and surface conditions shape driving outcomes

Road changes affect vehicle motion, camera observation, and inter-vehicle clearance.

Crest

Sag

Speed hump

Curve

Figure

camera visibility

speed / load response

suspension / pitch response

lateral motion / clearance

TerrainForge: controllable road counterfactuals

One road intervention drives consistent visual and physical responses.

Road intervention

Visual change

• crest / sag / speed hump

• position / height / length

• road surface type

• curve (radius / direction)

...

Figure

edited scene

camera motion

same traffic context

Physical response

Figure

vehicle dynamics

multi-vehicle response

safety outcomes

Beyond traffic editing: change the road, then recompute how vehicles respond.

Figure 1: TerrainForge edits the road while preserving traffic context, propagating each intervention to scene geometry, vehicle motion, and inter-vehicle clearance.

edited road with traffic motion produced on the original road. The estimated clearance would consequently depend on which vehicles were allowed to respond to the edit.

We introduce TerrainForge, a framework for constructing these road counterfactuals from reconstructed driving episodes. A unified road model represents elevation, gradient, and tire–road friction, accommodating continuous crest and sag curves, local features such as speed humps, and changes in surface condition. The geometry specifies how the Gaussian scene is deformed; the geometry and friction together supply road inputs to a four-wheel model with coupled longitudinal, lateral, and vertical dynamics. Each tracked vehicle retains its initial state and the control sequence inferred from its recorded motion while its trajectory is recomputed on the edited road. Updated vehicle poses and camera motion then drive rendering. Holding these inputs fixed allows paired simulations to isolate the road-induced changes under the vehicle model.

Evaluation covers both the accuracy of the edits and their effects on traffic. Vehicle responses are compared with CarSim, recovered road profiles are checked against real-road observations, and prescribed geometry is verified in reconstructed Waymo scenes. The multi-vehicle experiments show that surrounding vehicles' responses affect the estimated consequences of an edit. Across 18 episodes with usable ego-lead pairs, retaining the recorded motion of surrounding traffic produces median peak ego-lead gap discrepancy of 1.52 m for crests and 1.41 m for sags relative to recomputing its physical response. Accounting for the road's effect on the ego vehicle alone can therefore give a different assessment of the clearance between vehicles.

The resulting intervention–response pairs also provide supervision for predicting the effects of candidate road changes. These effects depend on the traffic encountering the edited region: the same road feature may have different consequences at different speeds, vehicle separations, or braking strengths. A bank of 15,758 road edits across 983 braking episodes, in which only the ego is re-simulated, supports surrogate models that take the original driving context and road-edit parameters as input. The models predict changes in terminal gap relative to an unedited replay and identify edits with material effects on safety-related outcomes. On held-out scenes, terminal-gap prediction achieves 22–40% lower mean absolute error than predicting no change. The surrogate is a first-stage ego-response screen: it prioritizes candidates, and the full multi-vehicle rollout gives the final result. Our main contributions are:

• We introduce TerrainForge, a physics-grounded real-to-counterfactual framework that treats road geometry as a controllable intervention in recorded driving scenes. By preserving the recorded traffic context and recovered vehicle controls while changing the road, TerrainForge generates paired counterfactual episodes for road edits such as crests, sags, and speed humps.

• We develop a unified road model that drives both visual and physical changes from the same intervention. The same road field governs Gaussian-scene deformation, camera motion, and coupled four-wheel vehicle dynamics, allowing the edited terrain and the responses of multiple vehicles to remain physically synchronized.

• A scene-disjoint intervention–response dataset and first-stage surrogate models that predict the ego’s terminal-gap change and identify consequential road edits, screening candidates cheaply before the full multi-vehicle rollout.

Figure

Figure 2: Overview of TerrainForge. TerrainForge converts a reconstructed real-world driving episode into an editable, physics-grounded counterfactual environment by recovering per-vehicle driving actions and allowing interventions to road geometry and surface conditions. Each intervention jointly determines the reconstructed scene geometry and the physical excitation experienced by all vehicles. Replaying the recovered vehicle controls on the intervened road produces synchronized vehicle trajectories, camera observations, rendered videos, and physical states, enabling paired analysis of road-induced changes in motion and inter-vehicle safety outcomes.

References (88)