Summary
StatePerturbation._check_aug_validity (introduced in #98) rejects ego-state augmentations when the ego polygon intersects any lane left/right boundary segment.
In complex map regions this creates false positives even on the unperturbed GT ego pose. When GT itself already “collides” under this rule, almost every nearby perturbation is also rejected, so augmentation never fires on those scenes — even though the trajectory is legitimate.
Related PR (source of the check): https://github.com/tier4/Diffusion-Planner/pull/98/changes
Visualization (GT ego already flagged)
The plot below is the original (unperturbed) ego at the origin. Blue segments are lane L/R boundaries that _segments_intersect_rect reports as intersecting the ego rectangle. No neighbor overlap is involved.
Example from local odaiba/shinagawa validation (path_list index ≈ 300, vx ≈ 5.3 m/s, large ego ~7.2 × 2.4 m):
x2_dev/2231_odaiba_shinagawa_copied_from_xx1/valid/2026-01-15/13-42-45/13-42-45_00000000_00000331.npz
- Neighbor SAT: clear (nearest ≈ +1 m)
- Lane L/R check: fail (3 segments of
lane[0] LEFT boundary cut through the ego box)
- Those segments sit well inside the ego footprint (e.g. midpoints near
(1.8, 1.1), (2.4, 0.0), (3.0, -1.0))
- The offending “lane” corridor is very wide (~8 m), i.e. an adjacent / merging / intersection polyline — not “ego drove off the road”
Why this happens (root cause)
The check treats every lanes left/right boundary as a hard obstacle:
left = lanes[..., :2] + lanes[..., 4:6]
right = lanes[..., :2] + lanes[..., 6:8]
reject if any consecutive segment intersects ego rectangle
Problems with that assumption:
- Lane boundaries ≠ road borders. Lane lines routinely pass near or through the ego box in valid driving (lane change, wide vehicle, dense lane graph).
- All lanes are checked, including adjacent, merge, and intersection polylines that geometrically cross the ego footprint without meaning “off-road”.
- Zero margin / no “worse than GT” comparison. If GT already intersects, every small augmentation is rejected.
- Large ego shapes (bus/truck-sized
ego_shape) make intersections much more likely.
On a stride-50 scan of the local odaiba/shinagawa valid list (~309 samples):
| Metric |
Approx. rate |
GT ego already fails _check_aug_validity |
~44% |
Same, among |vx| ≥ 2 (augmentation-eligible) |
~43% |
So this is not a rare edge case — it systematically disables augmentation on a large fraction of eligible scenes.
Where it shows up in our data (examples)
These are the scene types where false positives are especially common:
1. Teleport station / station-area intersections
Dense crossing lane polylines around the station square. Ego sits in a valid corridor while neighboring lane L/R offsets still clip the ego rectangle (as in the figure above).
2. General intersections
Multiple incoming/outgoing lanes and connectors. Left/right boundaries of non-ego lanes often cut across the ego box under the current “any segment ∩ ego” rule.
3. Avoidance scenes
Ego is deliberately offset toward a lane line (or slightly over it) to avoid an obstacle / parked object / construction. GT is intentional; the check still rejects because a lane boundary intersects the polygon.
4. Trajectories that deliberately ride the lane boundary
Example: 青海一丁目左折したらの植栽回避 — after the left turn at Aomi 1-chome, ego hugs / crosses the lane marking to avoid roadside planting. That is a valid demonstration trajectory, but lane-boundary intersection makes augmentation (and even “GT validity”) fail.
Expected vs actual behavior
|
Expected |
Actual |
| Neighbor polygon overlap |
Reject augmentation |
OK (this part is fine) |
| Crossing road border (drivable-area edge) |
Reject augmentation |
Not checked today |
| Touching / crossing ordinary lane lines in GT-valid scenes |
Allow (or only reject if worse than GT / off-road) |
Rejected → false positives |
Suggested direction (discussion only — no fix in this issue)
Prefer checking road borders from line_strings ([..., 3] road-border one-hot), consistent with the training road-border penalty, instead of (or in addition to, with much weaker weight than) all lane L/R boundaries. Keep the neighbor SAT check.
Optional hardening:
- Only reject if the augmented pose is worse than GT under the same metric
- Add a small clearance margin
- Restrict geometry to route / current-lane borders if lane lines must be kept
Repro sketch
# Load a complex-scene NPZ (e.g. station / intersection / avoidance)
# Run StatePerturbation._check_aug_validity on the UNPERTURBED ego_current_state
# Observe collision=True from lane L/R segments while neighbor check is clear
Local debug artifact used while investigating: ego box + hitting lane segments for an odaiba valid sample (index 300 in the local path list).
Impact
- Augmentation acceptance collapses on station / intersection / avoidance / lane-hugging scenes
- Training under-represents exactly the hard cases we care about
- Neighbor collision filtering remains useful; the lane-boundary term is the false-positive source
Summary
StatePerturbation._check_aug_validity(introduced in #98) rejects ego-state augmentations when the ego polygon intersects any lane left/right boundary segment.In complex map regions this creates false positives even on the unperturbed GT ego pose. When GT itself already “collides” under this rule, almost every nearby perturbation is also rejected, so augmentation never fires on those scenes — even though the trajectory is legitimate.
Related PR (source of the check): https://github.com/tier4/Diffusion-Planner/pull/98/changes
Visualization (GT ego already flagged)
The plot below is the original (unperturbed) ego at the origin. Blue segments are lane L/R boundaries that
_segments_intersect_rectreports as intersecting the ego rectangle. No neighbor overlap is involved.Example from local odaiba/shinagawa validation (
path_listindex ≈ 300,vx ≈ 5.3 m/s, large ego~7.2 × 2.4 m):x2_dev/2231_odaiba_shinagawa_copied_from_xx1/valid/2026-01-15/13-42-45/13-42-45_00000000_00000331.npzlane[0]LEFT boundary cut through the ego box)(1.8, 1.1),(2.4, 0.0),(3.0, -1.0))Why this happens (root cause)
The check treats every
lanesleft/right boundary as a hard obstacle:Problems with that assumption:
ego_shape) make intersections much more likely.On a stride-50 scan of the local odaiba/shinagawa valid list (~309 samples):
_check_aug_validity|vx| ≥ 2(augmentation-eligible)So this is not a rare edge case — it systematically disables augmentation on a large fraction of eligible scenes.
Where it shows up in our data (examples)
These are the scene types where false positives are especially common:
1. Teleport station / station-area intersections
Dense crossing lane polylines around the station square. Ego sits in a valid corridor while neighboring lane L/R offsets still clip the ego rectangle (as in the figure above).
2. General intersections
Multiple incoming/outgoing lanes and connectors. Left/right boundaries of non-ego lanes often cut across the ego box under the current “any segment ∩ ego” rule.
3. Avoidance scenes
Ego is deliberately offset toward a lane line (or slightly over it) to avoid an obstacle / parked object / construction. GT is intentional; the check still rejects because a lane boundary intersects the polygon.
4. Trajectories that deliberately ride the lane boundary
Example: 青海一丁目左折したらの植栽回避 — after the left turn at Aomi 1-chome, ego hugs / crosses the lane marking to avoid roadside planting. That is a valid demonstration trajectory, but lane-boundary intersection makes augmentation (and even “GT validity”) fail.
Expected vs actual behavior
Suggested direction (discussion only — no fix in this issue)
Prefer checking road borders from
line_strings([..., 3]road-border one-hot), consistent with the training road-border penalty, instead of (or in addition to, with much weaker weight than) all lane L/R boundaries. Keep the neighbor SAT check.Optional hardening:
Repro sketch
Local debug artifact used while investigating: ego box + hitting lane segments for an odaiba valid sample (index 300 in the local path list).
Impact