Skip to content

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

Open
khchen428 wants to merge 1 commit into
commaai:masterfrom
khchen428:bounty/tx-fuzz
Open

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

Conversation

@khchen428

Copy link
Copy Markdown

Replaces #3734 to submit this work from khchen428. The code and commits are unchanged.

The validation described below applies to these unchanged commits and includes results from the original PR. CI for this replacement PR is pending.

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
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.

2 participants