Skip to content

selfdrive: add fuzzy TX safety coverage for control-state transitions#38070

Open
liangtovi-debug wants to merge 2 commits into
commaai:masterfrom
liangtovi-debug:codex/bounty-32425-tx-fuzz
Open

selfdrive: add fuzzy TX safety coverage for control-state transitions#38070
liangtovi-debug wants to merge 2 commits into
commaai:masterfrom
liangtovi-debug:codex/bounty-32425-tx-fuzz

Conversation

@liangtovi-debug
Copy link
Copy Markdown

Summary

  • add test_panda_safety_tx_fuzzy in selfdrive/car/tests/test_models.py
  • fuzz control-state transitions (controls_allowed, cruise engaged, cancel/resume, lat/long active)
  • assert every emitted tx CAN frame passes panda safety_tx_hook
  • keep runtime bounded (max(50, MAX_EXAMPLES // 3)) and deterministic via Hypothesis replay

Why

Issue #32425 asks for generic/extendable tx fuzzing that can catch mismatches between openpilot tx output and panda tx safety logic.

Test status

  • local run attempted: python3 -m pytest -q selfdrive/car/tests/test_models.py -k tx_fuzzy -n0
  • blocked in this environment (No module named pytest)
  • expecting CI to validate on project runners

Closes #32425

@github-actions
Copy link
Copy Markdown
Contributor

Process replay diff report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ 0 changed, 66 passed, 0 errors

@liangtovi-debug
Copy link
Copy Markdown
Author

Quick follow-up now that CI has completed: all required checks are green, and the process replay diff report shows 0 changed / 66 passed / 0 errors. Happy to adjust the approach if there is a preferred direction for the TX fuzz coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car vehicle-specific CI / testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_models: add a test that fuzzes the tx messages

1 participant