CollisionScorer keeps only the last intersecting actor's class per timestep (result depends on STRtree order / ego heading)

This is Bongjae Moon.

Describe the bug In src/eval/src/eval/scorers/collision.py, CollisionScorer.calculate() resets front_collision, rear_collision and lateral_collision inside the loop over intersecting actors (L47), and appends them after the loop (L54–56). When two or more actors overlap the ego in the same timestep, only the classification of the last actor returned by srt_tree.query(...) survives.

The iteration order follows the spatial layout and ego heading, not the input order. The same physical contact can therefore be scored differently: flipping the ego heading drops a front contact, and because collision_at_fault = collision_front | collision_lateral (aggregation/processing.py), at-fault changes from True to False.

Steps/Code to reproduce bug Standalone snippet that mirrors the scorer’s loop (shapely only):

from shapely.geometry import box, LineString

front_bumper = LineString([(4, -1), (4, 1)]) # ego bbox (0,-1)-(4,1), heading +x

rear_bumper = LineString([(0, -1), (0, 1)])

a_front = box(3.5, -0.5, 5.0, 0.5) # touches front bumper

b_rear = box(-1.0, -0.5, 0.5, 0.5) # touches rear bumper

def current(actors): # same structure as collision.py L45-56

for p in actors:

f, r, l = False, False, False

if p.intersects(front_bumper): f = True

elif p.intersects(rear_bumper): r = True

else: l = True

return f, r, l

print(current([a_front, b_rear])) # (False, True, False) front contact lost

print(current([b_rear, a_front])) # (True, False, False) rear contact lost

We also reproduced this with the real CollisionScorer and eval.data ActorPolygons using synthetic boxes. Mixed contacts keep a single class:

Contacts in the same timestep Class kept
front + rear front only
front + lateral lateral only
rear + lateral lateral only
front + rear + lateral lateral only

With the same front+rear contact, mirroring the layout or flipping the ego heading changes which class survives.

Expected behavior Per-timestep flags are the OR over all intersecting actors, and they do not depend on iteration order, spatial layout or ego heading. Single-actor results stay as they are.

Suggested fix: initialise the three flags once before the loop, keep the per-actor if front / elif rear / else lateral rule, and append once per timestep. With this change, all the cases above return the union, collision_any does not change, and single-actor results are identical.

Environment overview (please complete the following information)

  • Deployment: Docker Compose (single machine)
  • Renderer backend: NuRec (default)
  • Driving policy under test: custom (end-to-end student policy). The scorer bug is independent of the policy.
  • Scene / dataset used: NuRec scenes from the PhysicalAI-AV set. The bug is reproducible with synthetic boxes alone, without any scene.
  • Affected gRPC service(s), and image/tag if applicable: none. This is offline eval (src/eval, CollisionScorer). Image alpasim-base:0.134.0, commit affc2ea.

Environment details

  • Hardware: NVIDIA GB10 (DGX Spark), 1 GPU, unified memory
  • Operating System: Ubuntu 24.04.4 LTS (aarch64)
  • CUDA / NVIDIA driver version: CUDA 13.0, driver 580.159.03
  • Docker / Docker Compose versions: Docker 29.2.1, Docker Compose v5.0.2

Additional context