Skip to content

Safety tests: cover angle rate limits around zero - #3734

Closed
joedlai wants to merge 1 commit into
commaai:masterfrom
joedlai:bounty/tx-fuzz
Closed

Safety tests: cover angle rate limits around zero#3734
joedlai wants to merge 1 commit into
commaai:masterfrom
joedlai:bounty/tx-fuzz

Conversation

@joedlai

@joedlai joedlai commented Sep 10, 2026

Copy link
Copy Markdown

Superseded by #3740 to submit this work from khchen428. The code and commits are unchanged. Please continue review on the replacement PR.

The existing angle-command tests advance in five-degree increments and miss the asymmetric rate limits at zero and one CAN unit. Add a shared test that transmits a previous command of -1, 0, or +1 CAN units, then checks acceptance at each rate boundary and rejection one unit beyond it. This catches both overly permissive windup and overly restrictive unwind limits.

Remove the two corresponding mutation survivors from the allowlist. The equivalent 250000U to 250001U interval mutation remains. No production safety behavior changes.

Validation on Apple Silicon macOS:

  • 555 affected Nissan, Toyota, PSA, and Tesla safety tests run: 483 passed and 72 skipped.
  • Both sign-boundary mutants survive the old enabled-angle tests and fail the new test on all three applicable brands; baseline passes without either mutation.
  • Five warm repetitions: the three new tests take a median 1.14 ms, versus 689 ms for the three existing enabled-angle tests.
  • Full ./test.sh passes: 3,981 tests run, 3,275 passed and 706 skipped; Ruff, ty, codespell, cpplint, and MISRA checks pass. git diff --check passes.

Related to commaai/openpilot#32425. This is a focused boundary-coverage contribution, not the complete route-based TX fuzzer. The surviving-mutant gap was noted in #3723; the boundary test and mutation verification here were implemented independently.

@github-actions

Copy link
Copy Markdown
Contributor

Car behavior report

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

✅ No changes detected

@github-actions github-actions Bot added the car safety vehicle-specific safety code label Sep 10, 2026
@joedlai
joedlai marked this pull request as ready for review September 10, 2026 05:18
@joedlai joedlai closed this Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car safety vehicle-specific safety code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant