Skip to content

Add regression tests for separate-thread perception and CV collision sweep - #23

Draft
cursor[bot] wants to merge 2 commits into
devfrom
cursor/missing-test-coverage-b69d
Draft

Add regression tests for separate-thread perception and CV collision sweep#23
cursor[bot] wants to merge 2 commits into
devfrom
cursor/missing-test-coverage-b69d

Conversation

@cursor

@cursor cursor Bot commented Aug 1, 2026

Copy link
Copy Markdown

Summary

Adds focused regression coverage for high-risk paths that recent async/collision work left thinly tested. Complements (does not duplicate) open draft PRs #17/#20/#22.

Risky behavior now covered

  • Separate-thread async perception (combined_perception_planning=False): creates a dedicated Perception worker; worker_perception fetches its own SensorFrame; planner worker never runs perceive in this mode
  • Slow-path check_collision CV sweep: movers without prediction still get a constant-velocity swept hull when obstacle_polygons is omitted — intentionally diverges from predictor-gated precompute_obstacle_polygons
  • Degenerate trajectories: None / 1-point paths use current-pose BB checks only (no corridor, no CV sweep)

Test files added/updated

  • test/c40_execution/test_c42_sensor_snapshot.py
  • test/c50_common/test_c55_collision_checking.py

Why these tests materially reduce regression risk

Separate-thread mode is the non-default async path and was untested end-to-end for snapshot ownership; a wrong combined gate can either starve perception or double-run it. The slow-path CV sweep is public API and easy to “align” incorrectly with the predictor-gated fast path, which would silently change collision costs for any caller that skips precompute. Short/None trajectories are more common after recent end-of-path tracker fixes.

Validation

pytest test/c40_execution/test_c42_sensor_snapshot.py \
  test/c50_common/test_c55_collision_checking.py -v

All 15 tests passed. No production code changes.

Does not overlap open coverage PRs #17/#20 or bugfix PR #22.

Open in Web View Automation 

cursoragent and others added 2 commits August 1, 2026 10:06
Locks the intentional divergence from predictor-gated precompute:
movers without prediction still sweep under check_collision's slow path,
while one-point/None trajectories stay pose-only BB checks.

Co-authored-by: Majid Khonji <majid-khonji@users.noreply.github.com>
Assert Perception worker creation, dedicated sensor fetch in
worker_perception, and that combined=False keeps perceive off the
planner worker.

Co-authored-by: Majid Khonji <majid-khonji@users.noreply.github.com>
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