Skip to content

car tests: cache hypothesis strategies#3052

Merged
sshane merged 2 commits intocommaai:masterfrom
FelmonFekadu:speedup-test-car-interfaces
Jan 27, 2026
Merged

car tests: cache hypothesis strategies#3052
sshane merged 2 commits intocommaai:masterfrom
FelmonFekadu:speedup-test-car-interfaces

Conversation

@FelmonFekadu
Copy link
Contributor

@FelmonFekadu FelmonFekadu commented Jan 22, 2026

Summary

  • Move hypothesis strategy creation from inside get_fuzzy_car_interface() to module level
  • Strategies are now created once at import time instead of on every test call
  • Strategy creation is expensive, so caching them significantly speeds up test execution

This addresses commaai/openpilot#32536 - "Speedup test_car_interfaces"

Test plan

  • Verify tests still pass: pytest opendbc/car/tests/test_car_interfaces.py
  • Benchmark shows reduced test time per car

🤖 Generated with Claude Code

Move strategy creation from inside get_fuzzy_car_interface() to module level
to avoid recreating strategies on every test call. Strategy creation is
expensive and doing it once at import time significantly speeds up test
execution.

This addresses commaai/openpilot#32536 - "Speedup test_car_interfaces"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added the car related to opendbc/car/ label Jan 22, 2026
@github-actions
Copy link
Contributor

No car changes detected

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing to opendbc! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • include a route or your device' dongle ID if relevant

@sshane
Copy link
Contributor

sshane commented Jan 27, 2026

I'm going to assume Claude didn't profile this. How do we know this is a significant part of the time?

@sshane
Copy link
Contributor

sshane commented Jan 27, 2026

Yours is branch B. From Cursor's Auto, told it to run 20 times and report difference:

Results summary:
Branch B is faster than Branch A
Branch B Statistics:
Mean: 5.06s (vs 5.56s on Branch A)
Median: 5.05s (vs 5.55s on Branch A)
Min: 4.94s (vs 5.46s on Branch A)
Max: 5.30s (vs 5.69s on Branch A)
Std Dev: 0.09s (vs 0.06s on Branch A — slightly more variability)
Performance improvement:
9.00% faster on average (mean)
9.02% faster on median
0.50 seconds faster per run on average
Note: Branch B has slightly higher variance (std dev 0.09s vs 0.06s), but it's consistently faster across all metrics.
All individual run times are listed above for analysis. Both datasets are saved to /tmp/branch_a_times.txt and /tmp/branch_b_times.txt for further analysis if needed.

============================================================
Summary:
============================================================
✓ Branch B is faster in BOTH best and worst cases
  - Best case: 9.51% faster (0.52s)
  - Worst case: 6.88% faster (0.39s)

@sshane
Copy link
Contributor

sshane commented Jan 27, 2026

Looks like we generate the strategy ~3600 times, and each generation costs ~0.2ms, so that's ~700ms. The 0.5s speedup makes sense

@sshane sshane changed the title car tests: cache hypothesis strategies at module level car tests: cache hypothesis strategies Jan 27, 2026
@sshane sshane merged commit dd606ee into commaai:master Jan 27, 2026
13 checks passed
dparring added a commit to dparring/opendbc that referenced this pull request Feb 18, 2026
* gm: Refactor to make branches clearer and remove unreachable `else` (#2948)

gm: Refactor to make branches clearer

* safety: remove redundant checks in psa, rivian, and toyota (#2949)

- Remove redundant address checks in rivian_get_counter, toyota_get_quality_flag_valid, and {psa,rivian}_get_checksum as these functions are securely guarded by the safety whitelist.

* HKG: Add FW for 2023 Kia Sportage Hybrid (#2974)

* CI: use tags for cppcheck update (#2976)

* Add `CarInterface.DRIVABLE_GEARS` attribute (#2978)

* Add CarInterface.DRIVABLE_GEARS gears attribute

* lil less

* Nissan: use MADS enabled status for LKAS HUD logic (#371)

* Update Nissan LKAS HUD logic to use latActive instead of enabled

display the green steering-wheel icon on the hud whenever lat is active instead of when cc is active
this fixes the issue where there is no hud icon when MADS is enabled when cc is disabled

* switch CC.latActive to CC_SP.mads.enabled

(cherry picked from commit 48773fd781be9a8bd3a5ddb66f91a00c7a5156a4)

* Fix formatting of lkas_hud_msg parameters

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* interface: handle `None` parameters gracefully in interface initializations (#335)

* check None params_list

* update parameter handling

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Add ty type checker (#2993)

* Remove mypy configuration and references (#2995)

* ty: less ignores (#2994)

* less ignore

* one more

* one more

* lil more

* ty: Fix typo in ignored rule causing failing CI (#2997)

Fix typo in ignored rule

* Hyundai: document SCC_CONTROL signal preservation for ACC cancel (#2996)

hyundai: document SCC_CONTROL signal preservation for ACC cancel

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* crcmod -> crcmod-plus (#2999)

* test.sh: ensure uv.lock is consistent with pyproject (#3000)

* libsafety: fix building with mutation env (#3001)

* build_env

* default

* conditional

* need it there

* try that

* fix

* rm those

* get mutation tests running on macOS (#2998)

* install mull on macOS

* runs

* run in ci

* more readable

* fail early

* who doesn't have curl

* fix that?

* uv sourcing

* unset that

* mit

* cleanup

* board/ is dead (#3003)

* board/ is dead

* add that back

* Ford: remove unused stock long safety (#3005)

* Chrysler: fix safety build on clang (#3006)

* Chrysler: fix safety build on clang

* misra

* safety: always run tests with UBSAN (#3007)

* safety: single libsafety.so (#3013)

* safety: single libsafety.so

* llvm

* VW PQ: Revert change to gear position VAL table (#3020)

* cleanup CARS.md generation (#3021)

cleanup SecOC doc generation

* VW: Allow PQ/MLB cars to drive on dev builds (#3022)

VW: Allow PQ/MLB cars in dev builds

* Honda - Bump CRV Hybrid to 2026 (#2988)

Bump CRV Hybrid to 2026

* VW MLB: Add FW for 2026 Porsche Macan (#3023)

* VW PQ: Update HCA Status to use Mode 2 (Status 7) (#2722)

* VW PQ: Update HCA Status to use Mode 2 (Status 7)

* VW PQ: update PQ safety test to use HCA status 7

---------

Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>

* Toyota: Lexus LS 500 2018 (#3010)

* Add Lexus LS 2018 platform configuration

* Add fingerprints for Lexus LS ECUs

* Add LEXUS_LS to torque substitute

* Update steer ratio for Lexus LS 2018 configuration

* LS steer ratio back to 13.0

* Update steer ratio for Lexus LS 2018 based on live params

* Add test route for Lexus LS

* Update LS car docs to exclude LSS+ A package

* Fix formatting in Lexus LS 2018 documentation

* Honda: bump Acura MDX to 2026 (#2979)

bump MDX to 2026

* Toyota: whitelist hybrids for standstill resume behaviour (#3009)

* whitelist Toyota hybrids for standstill resume behaviour

* fixed logic for hybrid check

* one check

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Revert "safety: single libsafety.so" (#3030)

Revert "safety: single libsafety.so (#3013)"

This reverts commit f812bf7cde0610d57569f5cc06c3beb79a95be04.

* Reapply "safety: single libsafety.so" (#3030)

This reverts commit c80388aece8a5cc987c9571e4413bcd8ebb19632.

* EV6: add EU specification for alternate harness (#3031)

likely applies to ev6 as well

* tests don't remove extra packages

every time you run an opendbc test it removes any extra packages you might have installed

* Minor Tesla cleanup

* Tesla: support FSD 14 (#2934)

* they switched

* from https://github.com/commaai/opendbc/pull/2860

* from https://github.com/commaai/opendbc/pull/2924

* forgot to flip here

* parameterize

* do safety

* fix

* misra

* ok misra, this is more confusing but sure

* kinda works

* simplify

* same function in safety

* more stuff

* fix

* debug

* clean up

* cmt

* detect fsd 14

* fix

* Revert "EV6: add EU specification for alternate harness (#3031)"

This reverts commit e94b05f7ab1cb2a424017aac19d56ff90d112516.

* Car docs: rm coupler for four (#3034)

rm coupler for four

* Docs cleanup: Inconsistent wording  (#3035)

* change Any to All

* cleanup

* Fingerprint Subaru Impreza G4 (#3033)

* fingerprint subaru impreza g4

* fix

* Tesla: Add FSD active state (#3036)

Add 'ACTIVE_FSD' state to DAS_autopilotState

* Tesla: Brake to ESP_status (#2628)

* docs: Scheduled auto-update CARS.md

* use esp_status

* Update opendbc/safety/modes/tesla.h

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* consistent logic

* docs: Scheduled auto-update CARS.md

* fix formatting

* use esp_status

* Update opendbc/safety/modes/tesla.h

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* consistent logic

* Honda: 25 MDX community doc cleanup (#2655)

remove due to MDX PR 2129

* Toyota: Add FW for 2020 Toyota Yaris (#2656)

* Add Toyota Yaris 2020 EU

* fix sorting

* expand supported model-years

---------

Co-authored-by: Jason Young <jyoung8607@gmail.com>

* docs: Scheduled auto-update CARS.md

* Honda: CRV 2023-2025 (canfd) (#2475)

* init CANFD CRV

* init CANFD CRV Hybrid

* remove

* remove

* remove import for now

* remove import for now

* shane fixes

* rebase fixes

* fix

* update

* remove whitespace

* new test route

* remove CRV Hybrid

* 2025

* rename honda pilot dbc to canfd common

* rename canfd common dbc to canfd common can dbc

* renaming dbc to honda_canfd_common

* updating car specs

* separate steer interface and increase to 5000 per testers

* adding brake_error commands for canFD

* autocalculate alt brake for canfd

* adding canfd safety value

* adding bosch canfd safety value

* canfd required safety changes from pr 2129

* canfd required safety changes from pr2129

* renaming dbc to honda_canfd_common

* typo fix

* fix coding style per CI

* move canfd altbrake to autodetection

* clearer diff, for now

* Adding 24 CRV Hybrid fingerprint

* switch to torque controller

* updating hybrid test route

* applying log-determined values for CRV 6G Hybrid

* updating values from additional log

* updating steer threshold based on log

* udpating values based on log

* found higher numbers in CRV log

* repoint ICE to Hybrid

* typo fix

* typo fix

* remove CRV from car template

* remove CRV from extra cars

* Adding 23 ICE fingerprints (Taiwan market)

* Adding CRV ICE test route

* whitespace fix

* collapse CRV_HYBRID_6G into CRV_6G

* verified max of 2560 from dashcam route

* cleanup

* not seeing data to elevate this above other CAN-FD

* swag after actuator rescale

* it wants a little more SR

* same steerActuatorDelay as the others

* prepare to recreate FW lists

* auto_fingerprint 864613393836f643/00000002--3cef07213f

* auto_fingerprint 51dea302d9d61e22/00000006--f3732a4905

* auto_fingerprint 0a84f6dd8372aef6/00000005--aff7debbbe

* auto_fingerprint ea1fc707f10a580a/00000016--a6e25f0867

* auto_fingerprint c6dc5864bedfeaa9/00000000--b11ca96af3

* auto_fingerprint 63568e3e2f56c8ad/00000001--2c87c755e1

* don't have a verified dongle with MY2023 yet

* adding 2023 to community docs

* auto_fingerprint 472a018ff8fd479a/0000006f--72d838b24d

* Revert "adding 2023 to community docs"

This reverts commit bdaf5bff0a2ca3f1c826dc4257580822f95baf1b.

* Revert "don't have a verified dongle with MY2023 yet"

This reverts commit 0e8b8e300168ab3404cc74980a182bec1d3f50e0.

---------

Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>

* Toyota: Add FW for 2020 Toyota Corolla Sport JDM (#2644)

Japanese Toyota Corolla Sport 2019-22

* HKG: Add FW for 2019 Kia Sorento (#2641)

Kia Sorento Aus 2018/2019

Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>

* Honda: Add FW for 2025 Honda HR-V (#2652)

* docs: Scheduled auto-update CARS.md

* kotarou fingerprint

---------

Co-authored-by: AlexandreSato <AlexandreSato@users.noreply.github.com>

* Tesla: Add FW for Tesla Model 3 (#2658)

added new tesla fingerprint

* HKG: add FW for 2023 Hyundai Kona (#2613)

* Update Hyundai Kona 2022 fingerprints and docs

Added new firmware versions for Hyundai Kona 2022 in fingerprints.py and updated the documentation string to 'Hyundai Kona 2022-23' in values.py to reflect model year coverage.

* ALT_LIMITS

* Revert "ALT_LIMITS"

This reverts commit 9ad75d1d5663354f6cedcdbb433c1f229c1b5bd4.

* fix sorting order

---------

Co-authored-by: Jason Young <jyoung8607@gmail.com>

* HKG: Add FW for 2022 Kia Niro EV (#2102)

Update fingerprints.py

* docs: Scheduled auto-update CARS.md

* Hyundai: fix Kia Sportage test route

the auto-selected segment has a legitimate timeout on the TCS CAN message that was just slipping by the thresholds

* CANParser: determine can_valid on read (#2665)

props

* Torque controller: refactor calculations to be in accel space (#2528)

* gains need to be in lat accel space too (but behavior is still different)

* actually it may make more sense

* use siglin

* fix

* conflict

* cleanups

* more cleanup

* unused import

* remove gravity

* imports

* inverse

* cleanup

* more cleanip

* lint

* whitespace

* more cleanup

---------

Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>

* Fix mutation test timing out for big changes (#2668)

* PSA AEE2010_R3: Initial Platform Support (#2379)

* spam at 100Hz

* try higher STEER_MAX

* delete torque based control

* set measured steerActuatorDelay

* add route

* fix: set static status when lat not active

* clean checksum

* clean: carcontroller

* clean: carstate, interface

* clean: psacan

* clean: values

* fix

* comments

* try 0_3s actuator

* enable lanechange

* implement standstill

* fix: blinkers

* fix: e208 car specs

* fix: set ovveride.toml to angle based

* actuatorDelay to 0.5s

* add: standstill signal

* add: translated DBC

* fix: recuperation

* test: status change

* clean up status ramp

* cleanup

* add: ESP and cruisestate signals

* actuatorDelay to 0.2

* cleanup

* test max angle

* set verified STEER_MAX

* test fingerprinting

* match nissan angle limits

* Revert "match nissan angle limits"

This reverts commit 4ef75889ac9e73127a8ae6dd98b875b52604132b.

* fix tests

* DEBUG: test fingerprint

* actuatorDelay to 0.4

* DEBUG: use non-negative ECU offsetc

* DEBUG: enable Dashcam mode

* DEBUG: try to fix values.py

* Revert "DEBUG: enable Dashcam mode"

This reverts commit 4c632bcbaf78a4185232daa96df845e073764583.

* set more ecu addresses

* DBC: name DIAG frames

* use simple fw request

* cleanup

* fix: rename carname to brand

* swap CAN0/2

* add: carstate signals

* fix: steeringRateSign

* move PSA safety to opendbc

* fix: adhere to new ANGLE_LIMITS

* add: mandatory ignores for chks and counter

* fix: fingerprint

* disable radar ECU

* translate HS2_DAT_MDD_CMD_452 msg

* add ACC cancel request message

* translate HS2_DAT_MDD_CMD_452 signals

* rename to SPEED_SETPOINT

* checksum init

* add acc status msg

* add structure for longitudinal

* update test route

* remove debug code

* fix: ecu version requests

* adjust ActuatorDelay to 0.3

* disable bus multiplexing

* disable radar

* enable longitudinal

* add: artiv (radar) signals

* rename

* implement radar fake messages

* add radar tx safety

* fix

* implement radar spoof

* fix

* disable long signals

* DEBUG: test checksums

* set checksum chk_ini

* fix checksum 2f6

* checksum helper 2f6

* checksum helper 2b6

* fix checksum 2b6

* checksum helper 3f2

* try fixed radar values

* unify checksum script

* enable radar control

* cleanup

* add acc values

* adjust long params

* fix radar msg

* enable resume from standstill

* fix braking threshold

* set standstill cruise false

* set long tuning to default

* DEBUG: test AUTO_BREAKING always on

* DEBUG: AUTO_BRAKING on after 1 s of car startup

* DEBUG: spoof radar after 10 seconds

* sync 2f6 and 2b6 radar signals

* DEBUG: set KiV long tune

* DEBUG: set mult to 1000

* fix fwd hook

* fix interface

* adjust tuning

* ARC STATUS=1

* scale torque multiplier with speed

* scale fix

* use simple acc to torque factor

* use factor 80

* simplify

* cleanup

* set mult to 70

* DEBUG: try kiV

* no kiV, linear accel/brake

* AEB enable test

* AEB always disabled test

* add 100Hz gas pedal

* op long optional

* add acc related signals

* set steerAtStandstill

* fix: dbc message name typo

* add steeringSaturated debug

* adapt to master changes

* safety: set meas_angle

* chg: set steer_driver_allowance to 1.5 Nm

* fix: steering wheel nudge on disengage

* safety: add torque_driver

* DEBUG: enable long

* fix: req_diag_artiv

* disable long

* chg: reduce DRIVER_ALLOWANCE to 1 Nm

* remove longitudinal

* cleanup

* move safety_psa

* fw request

* decrease torque

* fw query

* steerLimitTimer = 0.1

* DEBUG: fix fw query for psa

* query test 1

* query test 2

* fw query test 3

* add ecu versions

* fix fw query

* fix ECU names

* add tester preset

* reactivate brand_matches skip

* adapt to opendbc changes

* fix linter

* fix misra

* fix pytest: add psa fw query timings

* fix: rxchecks

* adapt to master changes

* clean values.py

* DEBUG: fw_versions.py debug print

* Revert "DEBUG: fw_versions.py debug print"

This reverts commit c298f4f1711c055a31600587ba25f89cfbffc0e3.

* use firmware request

* PSA ECUs:  is_tester_present_response exception

* cleanup

* rename dbc

* peugeot 208

* delete opel corsa

* clean

* fix tests

* comments

* align angle rates to values.h

* set rx counters

* refactor

* add checksum and counter hooks

* set chk ini bytes

* remove one message

* fix misra

* fix main bus

* Revert "PSA ECUs:  is_tester_present_response exception"

This reverts commit 3387200097a62b4cda14840f198657876bcdedc8.

* revert fingerprints.py entry

* remove leading empty line

* psa safety ALLOW_DEBUG

* cleanup

* fix tests

* enable fw query for route recording

* Revert "enable fw query for route recording"

This reverts commit f81915ad27f125adb6424de793b87e4b3e40142d.

* add better route

* remove FW Query

* remove DRIVER

* sort alphabetical

* cleanup

* fix test

* clean

* clean

* conservative steerLimitTimer

* fix names

formatting

* psa test setup

add helper to psa test

add more helper

* add StockSafety test

* remove ESP signal

* remove steerFaultPermanent

* fix parse_wheel_speed and gasPressed

* move frequency in rx checks

* to_push/to_send -> msg

* align formatting with values.py

* rm GET_BUS

* rm GET_ADDR

* rm GET_BYTE

* fix some tests

* Update opendbc/car/psa/values.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* use opendbc.car.lateral import

* use opendbc.car.lateral import

* remove legacy fingerprint

* fix misra

* fix CHECKSUM/COUNTER dbc names

* use can packer for psa_checksum

* fix tests

* fix coverage

* Apply suggestions from code review

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* clean psacan

* set steerLimitTimer to 0.1

* Update opendbc/car/psa/carcontroller.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update opendbc/car/psa/carstate.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update opendbc/safety/modes/psa.h

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* add newline in safety_declratations.h

* fix indentation

* remove fwd hook

* Update opendbc/car/psa/carstate.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update opendbc/car/psa/carstate.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* fix main/cam bus naming

* use brake_pressed instead brake_pressure

* fix ruff

* remove manual gear

* fix ChecksumState

* send steering at 20Hz

* replicate stock LKAS behavior

* fix mutations

* Update opendbc/car/psa/carcontroller.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update opendbc/car/psa/carstate.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* fix dbc comment

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>

* HKG: fix 1b5 (#2637)

Update hyundai_canfd.dbc

* docs: Scheduled auto-update CARS.md

* Honda: remove EPS mod support (#2672)

* Nissan: add new fingerprint for Nissan Leaf 2021 UK  (#2669)

* nissan: add new firmware version 476605SH7E to FW_VERSIONS

* fix sorting order

---------

Co-authored-by: chris-moming4k <moming2k@igpsd.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>

* Hyundai: fix CAN errors due to CRUISE_BUTTONS ECU TX jank (#2673)

* Increase timeout if cache not hit (#2678)

* no cache timeout

* hmm

* 90 fine

* [bot] Fingerprints: add missing FW versions from new users (#2677)

Export fingerprints

* Honda: Update package availability for Civic (#2680)

* correcting documentation

* changed to automatic transmission, reads better on website

* Remove automatic transmission requirements

* Honda: Honda City (Brazil only) 2023 (#2425)

* init Honda City

* tmp fix EPB status error

* test route and comments

* updates

* add this

* fix handbrake

* minSteerSpeed

* fix

* change

* fix

* current test route

* follow parking brake signal name change

* i hope this is wrong :(

* wheelbase was wrong, also wants more SR

* rm torque substitute

* add generation to CAR name

* one more ref

* separate config block, rescaled actuator range

* remove, will be restored with #2481

* adjust steeringPressed threshold

* ultra swag due to undetected steer overrides

* one more tweak

* maybe two

* this thing really wants SR

---------

Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>

* docs: Scheduled auto-update CARS.md

---------

Co-authored-by: lukasloetkolben <lukasloetkolben@users.noreply.github.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: mvl-boston <manuel@alumni.virginia.edu>
Co-authored-by: Grzegorz Gajoch <gajoch@gmail.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>
Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
Co-authored-by: Yasuhiro Ohno <84763339+yasu-oh@users.noreply.github.com>
Co-authored-by: Andrew Frahn <andrew@emmertex.com>
Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>
Co-authored-by: Alexandre Nobuharu Sato <66435071+AlexandreSato@users.noreply.github.com>
Co-authored-by: AlexandreSato <AlexandreSato@users.noreply.github.com>
Co-authored-by: Amy Jeanes <mattjeanes23@gmail.com>
Co-authored-by: royjr <royjr96@gmail.com>
Co-authored-by: James Vecellio-Grant <159560811+Discountchubbs@users.noreply.github.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
Co-authored-by: elkoled <elkoled@gmail.com>
Co-authored-by: Chris Chan <moming2k@gmail.com>
Co-authored-by: chris-moming4k <moming2k@igpsd.com>
Co-authored-by: Thales Ceolin <thalesac@users.noreply.github.com>

* Kia Optima Hybrid 2019: add new FW (#3038)

it was out of date range, now we have almost the whole year

* Add issue templates (#3039)

* add some links

* bug template from op

* car-ify it

* more

* more

* more

* isn't

* woops

* Honda: Add FW for 2025 Honda Accord Hybrid (#3042)

* Honda: Add FW for 2025 Honda Accord Hybrid

* can't join a side quest right now

* fix indent to 4 spaces (#3041)

fix indent

* Car diff (#3024)

* Opendbc replay (#6)

* add replay POC

* compare HEAD to master

* split in compare and worker

* copy worker.py

* cleanup

* fix

* apply tesla brake PR

* fix

* fix mutation test

* add panda

* add timestamps

* simplify

* add falling edge

* add remaining carstate

* simple lines

* bump

* rename

* use zst as ref

* ref commit

* cleanup

* formatting

* no failing

* fix git

* clean

* use pool.map

* fix docker build

* clean

* Revert "fix docker build"

This reverts commit da3577441eaa4b7fdc5763f73e779dd32c03a3c3.

* use flat paths

* format

* use azure test instance

* print full diff

* no stderr output

* use GIT_REF

* Revert "apply tesla brake PR"

This reverts commit f377e21f3865c574db5d618be20b4efa86fba66f.

* allow overwrite blobs

* supress stderr

* add error on failed generation (#8)

* Opendbc replay (#129)

* add replay POC

* compare HEAD to master

* split in compare and worker

* copy worker.py

* cleanup

* fix

* apply tesla brake PR

* fix

* fix mutation test

* add panda

* add timestamps

* simplify

* add falling edge

* add remaining carstate

* simple lines

* bump

* rename

* use zst as ref

* ref commit

* cleanup

* formatting

* no failing

* fix git

* clean

* use pool.map

* fix docker build

* clean

* Revert "fix docker build"

This reverts commit da3577441eaa4b7fdc5763f73e779dd32c03a3c3.

* use flat paths

* format

* use azure test instance

* print full diff

* no stderr output

* use GIT_REF

* Revert "apply tesla brake PR"

This reverts commit f377e21f3865c574db5d618be20b4efa86fba66f.

* allow overwrite blobs

* supress stderr

* print upload refs

* add error on failed generation

* Revert "use azure test instance"

This reverts commit ba969ccda452a4841934440d3ced22829861f70f.

* Revert "fix mutation test"

This reverts commit 8f5e01de7743ee38c340df90751cf370634fe2b2.

* detect safety changes

* use logReader

* only use valid platforms

* use local database

* Revert "use local database"

This reverts commit 4ebe9fe0800fb1631efe8672817a8c21b8780b65.

* Reapply "use azure test instance"

This reverts commit e9968a04e4ddee00b69174fd30ee1cdcdfa506fb.

* cutoff diff

* parallel downloads

* enable stderr

* fix interface

* logprint errors

* add comment to PR

* fix

* FORMAT: lines

* FORMAT: plots

* FORMAT: fix

* modules

* Revert "use azure test instance"

This reverts commit ba969ccda452a4841934440d3ced22829861f70f.

* build on forks

* clean

* rename

* replace azure with ci-artifacts

* auto bootstrap

* help

* FORK TEST

* Revert "FORMAT: fix"

This reverts commit 0262b1fad446691d594adef6baf284938d2d115d.

* Revert "FORMAT: plots"

This reverts commit 314417db1fb4c01206d8b3880f240a44d70b5a7e.

* Revert "FORMAT: lines"

This reverts commit 5cdd4c567f0440874a74678ca7cb3b6f909bc0ba.

* clean

* no comment on empty output

* output errors

* fix pr comment

* fix diff more

* increase tolerance

* less files

* one file

* Revert "FORK TEST"

This reverts commit fc691b500c58e76a41c8f5785b6acf89ff4e1573.

* Revert "fix mutation test"

This reverts commit 8f5e01de7743ee38c340df90751cf370634fe2b2.

* fix comment

* fix comment

* move car_diff.py

* Revert "fix mutation test"

This reverts commit 8f5e01de7743ee38c340df90751cf370634fe2b2.

* move car_diff.py

* inline helpers

* inline helpers

* fix ruff

* fix ruff

* use all carstate fields

* add --all

* use all carstate fields

* add --all

* bootstrap

* bootstrap

* Revert "bootstrap"

This reverts commit c3c2ba41e8d1dbdeb74cef8498caf9fd13325fe3.

* add line formatting

* commit workflow

* adjust formatting

* return err

* subprocess

* comma_car_segments

* dead code

* minimal logreader

* remove openpilot

* add deps

* remove all deps

* fix source

* request

* less parallel

* fix push

* bootstrap

* Revert "bootstrap"

This reverts commit b4af0d3bbd31f119ed3f18933329dcc64c9cf634.

* fix graph

* push

* regex

* optimize dict_diff

* reduce tolerance

* use comma_car_segments

* remove

* use requests

* timestamps

* frame_ms

* id

* logreader

* align logreader

* use logreader

* remove requests

* return

* more line

* ruff

* use test pip package

* push on commaai

* use zstandard lib

* clean

* rename

* use decompress

* fix

* index

* lr filter

* union types

* find edges

* group frames

* render waveform

* format timing

* signals

* numeric diff

* boolean diff

* real timestamp

* impreza fingerprint

* Revert "impreza fingerprint"

This reverts commit 692e34c7f8df6540c26eca79799a8eac47f352bc.

* apply tesla brake PR

* honda clear startup fault

* Revert "honda clear startup fault"

This reverts commit 91c4a5d3c896cf0936c5cf00a484127b9665d21c.

* skip unrelated edges

* fix exit

* fix down edge

* use hf pip package

* comment on fail

* fix

* comment

* no exit 1 in CI

* libsafety: switch to clang 18 and only build mull in standalone mode (#3044)

* just switch to 18

* try this

* just clang

* rm that

* try this

* docs: Scheduled auto-update CARS.md

* pin python dependencies (#3047)

* check in uv.lock

* ty fixes

* Subaru: fix RPM size and label neutral (#3048)

fix rpm size and label neutral

* Car diff: fix PR comment (#3045)

fix PR comment

* fingerprint subaru impreza 2019 (#2980)

fp subaru impreza

Co-authored-by: Daniel Koepping <elkoled@gmail.com>

* Honda: Taiwan 2025 HR-V Fingerprint (#2969)

* Taiwan 2025 HR-V Fingerprint

* fix ordering (via auto_fingerprint)

---------

Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>

* Subaru: add additional steering angle and clutch depressed (#3051)

add clutch and angle

* Add misc bug template (#3057)

* misc bug

* rm

* Fixup car differ (#3056)

* start

* start

* carfw

* use existing can fp infra

* run on all

* tqdm is nice to have

* rm

* sort too

* clean up

* exe

* Honda - CANFD Acura TLX 2025 (#3037)

* add 25 TLX fingerprints

* Add 25 TLX values

* temp testroute exception

* temporary torque data until testdrive

* add 2025 TLX initial torque numbers

* adding 25 TLX initial testroute

* fix testroute typo

* increase steermax to 3840

* Increase TLX 2G MMR steermax based on testroute

* Update TLX 2G MMR torque data based on testroute

* Newer TLX 2G MMR testroute

* Revising torque parameters a bit more after hours of driving

* Revising steer ratio a bit more after hours of driving

* Clean test route for Acura TLX 2G MMR

---------

Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>

* Chrysler: correct radar lateral position sign (#3043)

align radar yRel with left-positive convention

Co-authored-by: Daniel Koepping <elkoled@gmail.com>

* Tesla: add FSD 14 failsafe detection (#3053)

* add fsd 14 failsafe detection

* fix logic

* dont perm set if FSD 13 user starts op with FSD/autosteer, engages to get a noEntry, and then swaps to correct TACC

* Honda: Allow manual for 10G Civic (#3025)

* Add manual transmission to CIVIC_BOSCH

* Add 19 Civic Hatchback MT fingerprint

---------

Co-authored-by: Daniel Koepping <elkoled@gmail.com>

* HKG: add FW Hyundai Tucson HEV 2022 EUR (#3061)

* Update fing Update fingerprints.py hyundai Tucson EUR 2022 Hybriderprints.py

The 2022-2024 Hyundai Tucson NX4 Hybrid in the European version with Can-FD and the Hyundai N harness was not detected by the official openpilot branch, it had to be selected manually. After following the steps to create a new fingerprints, I added the corresponding lines to the fingerprints.py file, and now the official branch works on this car model, it automatically selects the model. Also the file values.py was modified to add Ecu.eps to non_essential_ecus

* Update values.py hyundai Tucson EUR 2022 Hybrid

The 2022-2024 Hyundai Tucson NX4 Hybrid in the European version with Can-FD and the Hyundai N harness was not detected by the official openpilot branch, it had to be selected manually. After following the steps to create a new fingerprints, I added the corresponding lines to the fingerprints.py file, and now the official branch works on this car model and it automatically selects the model. Also the file values.py was modified to add Ecu.eps to non_essential_ecus

* Apply suggestions from code review

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Honda - Euro Civic Type R FK8 support (#2986)

* Update fingerprints.py

Added params from here

{'carParams': {'alphaLongitudinalAvailable': False,
               'alternativeExperience': 0,
               'autoResumeSng': True,
               'brand': 'mock',
               'carFingerprint': 'MOCK',
               'carFw': [{'address': 417001457,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'gateway',
                          'fwVersion': b'38897-TBA-A020\x00\x00',
                          'logging': False,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001967,
                          'subAddress': 0},
                         {'address': 416952561,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'eps',
                          'fwVersion': b'39990-TGH-J020\x00\x00',
                          'logging': False,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001776,
                          'subAddress': 0},
                         {'address': 416944369,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'programmedFuelInjection',
                          'fwVersion': b'37805-5BF-E030\x00\x00',
                          'logging': True,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001744,
                          'subAddress': 0},
                         {'address': 416964849,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'combinationMeter',
                          'fwVersion': b'78109-TGH-E310\x00\x00',
                          'logging': True,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001824,
                          'subAddress': 0},
                         {'address': 416950513,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'vsa',
                          'fwVersion': b'57114-TGH-A130\x00\x00',
                          'logging': False,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001768,
                          'subAddress': 0},
                         {'address': 416986609,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'fwdCamera',
                          'fwVersion': b'36161-TGH-A020\x00\x00',
                          'logging': False,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001909,
                          'subAddress': 0},
                         {'address': 416985329,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'fwdRadar',
                          'fwVersion': b'36802-TGH-A030\x00\x00',
                          'logging': False,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001904,
                          'subAddress': 0},
                         {'address': 416961521,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'srs',
                          'fwVersion': b'77959-TGH-E220\x00\x00',
                          'logging': False,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001811,
                          'subAddress': 0},
                         {'address': 417001457,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'gateway',
                          'fwVersion': b'\x0cH2462012\x00\x00\x00\x00                  ',
                          'logging': True,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x12'],
                          'responseAddress': 417001967,
                          'subAddress': 0},
                         {'address': 416952561,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'eps',
                          'fwVersion': b'\x0c BK7G255772C                  ',
                          'logging': True,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x12'],
                          'responseAddress': 417001776,
                          'subAddress': 0},
                         {'address': 416944369,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'programmedFuelInjection',
                          'fwVersion': b'\x0e17-11-06  0131\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
                          'logging': True,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x12'],
                          'responseAddress': 417001744,
                          'subAddress': 0},
                         {'address': 416950513,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'vsa',
                          'fwVersion': b'\x0b72920747323\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
                          'logging': True,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x12'],
                          'responseAddress': 417001768,
                          'subAddress': 0},
                         {'address': 416986609,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'fwdCamera',
                          'fwVersion': b'\x0e11101711261084\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
                          'logging': True,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x12'],
                          'responseAddress': 417001909,
                          'subAddress': 0},
                         {'address': 416964849,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'combinationMeter',
                          'fwVersion': b'\x18H3344390\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
                          'logging': True,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x12'],
                          'responseAddress': 417001824,
                          'subAddress': 0},
                         {'address': 416985329,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'fwdRadar',
                          'fwVersion': b'\x0e04641711160A26\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
                          'logging': True,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x12'],
                          'responseAddress': 417001904,
                          'subAddress': 0},
                         {'address': 416961521,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'srs',
                          'fwVersion': b'\x0bC1DQ009B14Y\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
                          'logging': True,
                          'obdMultiplexing': True,
                          'request': [b'"\xf1\x12'],
                          'responseAddress': 417001811,
                          'subAddress': 0},
                         {'address': 416952561,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'eps',
                          'fwVersion': b'39990-TGH-J020\x00\x00',
                          'logging': False,
                          'obdMultiplexing': False,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001776,
                          'subAddress': 0},
                         {'address': 416986609,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'fwdCamera',
                          'fwVersion': b'36161-TGH-A020\x00\x00',
                          'logging': False,
                          'obdMultiplexing': False,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001909,
                          'subAddress': 0},
                         {'address': 416985329,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'fwdRadar',
                          'fwVersion': b'36802-TGH-A030\x00\x00',
                          'logging': False,
                          'obdMultiplexing': False,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001904,
                          'subAddress': 0},
                         {'address': 416961521,
                          'brand': 'honda',
                          'bus': 1,
                          'ecu': 'srs',
                          'fwVersion': b'77959-TGH-E220\x00\x00',
                          'logging': False,
                          'obdMultiplexing': False,
                          'request': [b'"\xf1\x81'],
                          'responseAddress': 417001811,
                          'subAddress': 0}],
               'carVin': 'SHHFK8790HU003163',

* Update fingerprints.py

Checked over them again

* Update values.py

Added whole new Civic Section

* Update fingerprints.py

CAR.HONDA_CIVIC_TYPE_R_FK8: {
    (Ecu.gateway, 0x18DAF1EF, 0): [b'38897-TBA-A020\x00\x00'], # Gateway
    (Ecu.abs, 0x18DAF128, 0): [b'57114-TGH-A130\x00\x00'], # VSA / ABS / ESP
    (Ecu.eps, 0x18DAF130, 0): [b'39990-TGH-J020\x00\x00'], # Electric Power Steering
    (Ecu.fwdCamera, 0x18DAF1B5, 0): [b'36161-TGH-A020\x00\x00'], # Forward Camera
    (Ecu.engine, 0x18DAF110, 0): [b'37805-5BF-E030\x00\x00'], # Programmed Fuel Injection / ECM
    (Ecu.combinationMeter, 0x18DAF160, 0): [b'78109-TGH-E310\x00\x00'],# Combination Meter
    (Ecu.fwdRadar, 0x18DAF1B0, 0): [b'36802-TGH-A030\x00\x00'], # Forward Radar
    (Ecu.srs, 0x18DAF153, 0): [b'77959-TGH-E220\x00\x00'], # SRS / Airbag
  },

* Update values.py

HONDA_CIVIC_TYPE_R_FK8 = HondaBoschPlatformConfig(
  [
    HondaCarDocs(
      "Honda Civic Type R 2017-21",
      "EU Manual",
      min_steer_speed=12.0 * CV.MPH_TO_MS,
    ),
  ],
  CarSpecs(
    mass=1380,
    wheelbase=2.7,
    steerRatio=15.1,  # Tuned via test drives (started at ~15.38 from stock Civic)
    centerToFrontRatio=0.4,  # Recommended: matches standard Civic Bosch – helps lateral tuning
  ),
  {Bus.pt: 'honda_civic_hatchback_ex_2017_can_generated'},  # Same DBC as other FK8-era Civics
)

* Update fingerprints.py

Put the Honda_Civic_Bosch back as it was

* Update fingerprints.py

From ChatGPT checking

* Update values.py

Added Manual Trans to FK8

* Update fingerprints.py

CAR.HONDA_CIVIC_TYPE_R_FK8: {
  (Ecu.gateway, 0x18daeff1, None): [b'38897-TBA-A020\x00\x00'],
  (Ecu.vsa, 0x18da28f1, None): [b'57114-TGH-A130\x00\x00'],
  (Ecu.eps, 0x18da30f1, None): [b'39990-TGH-J020\x00\x00'],
  (Ecu.programmedFuelInjection, 0x18da10f1, None): [b'37805-5BF-E030\x00\x00'],
  (Ecu.combinationMeter, 0x18da60f1, None): [b'78109-TGH-E310\x00\x00'],
  (Ecu.fwdRadar, 0x18dab0f1, None): [b'36802-TGH-A030\x00\x00'],
  (Ecu.fwdCamera, 0x18dab5f1, None): [b'36161-TGH-A020\x00\x00'],
  (Ecu.srs, 0x18da53f1, None): [b'77959-TGH-E220\x00\x00'],
},

* Update values.py

Added 

flags=HondaFlags.BOSCH | HondaFlags.ALLOW_MANUAL_TRANS,

To FK8

* Keep CTR fingerprints under Bosch Civic

* List FK8 as manual variant within Bosch Civic

* Resort Euro FK8 fingerprints and remove duplicates

---------

Co-authored-by: atmezferix <mez@atmezferix.com>
Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Toyota: Prevent EPS fault during unwind after sharp turn (#2859)

* 2019-2021 RAV4
* 2021-2023 RAV4 Prime
* 2021-2023 Sienna

These Toyota models can experience a rare EPS fault.

After a sharp, low-speed manual turn the human lets go of the wheel.
During or shortly after the unwind the EPS faults. It can be difficult
to reproduce.

PR #24067 "Toyota: remove 100°/sec steering lockout" attempted to prevent
this high angle rate EPS fault by cutting torque if more than 18 frames.
I found reducing this threshold by just one frame fixes the problem.

Co-authored-by: Jason Young <jyoung8607@gmail.com>

* docs: Scheduled auto-update CARS.md

* Added GS_450h ECU details to fingerprints.py file under GS_F (#3015)

* Added GS_450h ECU details to fingerprints.py file under GS_F

* Update opendbc/car/toyota/fingerprints.py

---------

Co-authored-by: Raul Rodriguez Jr <raul91@icloud.com>
Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>

* CarDocs: Update car package name (#3065)

update naming

* Tesla: Add support for Model 3 (#3050)

Co-authored-by: Daniel Koepping <elkoled@gmail.com>

* Car diff: rm except (#3062)

* import to top

* no except

* Honda - support RDX 3G variants with brake booster (alt_brake) (#2973)

Add ACURA_RDX_3G to alternate brake message check

Co-authored-by: Daniel Koepping <elkoled@gmail.com>

* HKG: add FW for 2022 Hyundai Kona Electric (#2981)

Update fingerprints.py

Co-authored-by: Daniel Koepping <elkoled@gmail.com>

* Car diff: add trace (#3066)

* [bot] Update cppcheck to 2.19.1 (#2982)

* [bot] Update cppcheck to 2.19.1

* update table

* try assistance

* not needed with --platform?

* rm

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Shane Smiskol <shane@smiskol.com>

* tesla: add radar CAN parsing and radar interface for model 3 (#3011)

* tesla radar interface

* add cmt

---------

Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>

* docs: Scheduled auto-update CARS.md

* Mazda: Add cruise button events for accel and decel (#3027)

* added button events for accel and decel

* move down

---------

Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>

* car tests: cache hypothesis strategies (#3052)

* car tests: cache hypothesis strategies at module level

Move strategy creation from inside get_fuzzy_car_interface() to module level
to avoid recreating strategies on every test call. Strategy creation is
expensive and doing it once at import time significantly speeds up test
execution.

This addresses commaai/openpilot#32536 - "Speedup test_car_interfaces"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* use cache instead

---------

Co-authored-by: Felmon Fekadu <felmonfekadu@Felmons-MacBook-Air.local>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>

* [bot] Update uv.lock (#3071)

Co-authored-by: Vehicle Researcher <user@comma.ai>

* Car diff: padding (#3068)

padding

* Car diff: skip comment on first timer PR (#3067)

skip comment if tests.yml never ran

* Toyota: clean up alpha long (#3074)

* toyota: clean up alpha long

* yes we have a test

* Toyota: clean up radarUnavailable (#3075)

* toyota: clean up alpha long

* yes we have a test

* not critical

* test the differ

* add more

* this stems back to /one, so maybe they do

* un print

* it doesn't detect

* Car diff: add typing (#3073)

* typing

* add alias

* Toyota: remove NO_STOP_TIMER flag (#3076)

* move inside op long control

* this isn't a real code path anymore

* fully remove NO_STOP_TIMER

* we'll turn this around

* rev

* honda: init class variables in __init__

* Honda: Taiwan Odyssey 2019 (#2985)

* Taiwan Honda Odyssey 2019 Port

* refactor per review comments

* flip

* can do detection, but only if there we support one more car to avoid early generilzation

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* docs: Scheduled auto-update CARS.md

* VW MLB: Add FW for 2023 Porsche Macan S (#3078)

* Tesla: detect missing DAS_settings (#3082)

* detect das_settings

* clean up

* rm

* clean up

* Nissan: Enable steering at standstill (#2812)

* Enable steering at standstill for Nissan cars

* Update LKAS_MAX_TORQUE value to improve steering speed

Increased LKAS_MAX_TORQUE from 1 to 2.54 for better performance.

* Update carcontroller.py

* Revert "Update LKAS_MAX_TORQUE value to improve steering speed"

This reverts commit d490162da4a47cca6683c5c9a710b291cce61080.

* Revert "Update carcontroller.py"

This reverts commit 431b6c021b1f3523e30693e4dcf41819ee8819a1.

* Toyota: Add SnG to Lexus LS, update torque data. (#3080)

* Add Lexus LS 2018 platform configuration

* Add fingerprints for Lexus LS ECUs

* Add LEXUS_LS to torque substitute

* Update steer ratio for Lexus LS 2018 configuration

* LS steer ratio back to 13.0

* Update steer ratio for Lexus LS 2018 based on live params

* Add test route for Lexus LS

* Update LS car docs to exclude LSS+ A package

* Fix formatting in Lexus LS 2018 documentation

* Remove LEXUS_LS mapping from substitute.toml

* Add better torque data for LEXUS_LS

* Modify torque values for LEXUS_LS

Better torque values for LEXUS_LS based on learned values after long drive.

* Add Lexus LS 2018 to sng = true

* Update MAX_LAT_ACCEL_MEASURED for LEXUS_LS

* Toyota SecOC platforms should use torque control (#3086)

* use torque control for secoc platforms

* checked 5 dongles for each platform. sienna was closer to 1.5, but within margin of error

* Remove angle RAV4 platform from PID list (#3085)

* rm

* just

* rm

* Remove RAV4 2022 from PID lateral control (#3087)

* this platform doesn't have any known special eps fw

* bump down to 1.9

* Car diff: add CarParams (#3077)

* signals from refs

* use vals as prev

* show all waveforms

* get nested

* use full refs

* use explicit pr signal

* Update opendbc/car/tests/car_diff.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* var names

* hints

* more

* more

* Revert "more"

This reverts commit aa31c7ddb0cdbc7f236126887ad964f12d731665.

* Revert "more"

This reverts commit b998c6049d68c6a94dec6f7a4a54db647e30d27b.

* Revert "hints"

This reverts commit 1cbfb879b05be572ccf2ddc099c861b3bba175fe.

* add typing

* typing

* add CarParams

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Toyota: make RAV4 TSS2 use torque control (#3091)

* need to do fric

* it's real params

* wrong one

* wtf

* Honda - move brakehold_alt to honda_common (#2758)

* add brakehold_hybrid_alt

* remove brake hold

* add STEERING_DIRECTION bit to gwm_haval_h6_phev_2024.dbc (#3093)

* add STEERING_DIRECTION bit to gwm_haval_h6_phev_2024.dbc

* add back crc

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Honda: Update to latest community car support (#3089)

Update to latest community car support

* body: optimize CRC-8 checksum with lookup table (#3028)

* body: optimize CRC-8 checksum with lookup table

* Add CRC8BODY lookup table for body checksum

Generate CRC-8 table with polynomial 0xD5 at import time,
following the existing pattern for other CRC tables.

* Use CRC8BODY from crc module in body checksum

Replace hardcoded 256-entry lookup table with import from
shared crc module, following reviewer feedback.

---------

Co-authored-by: Daniel Koepping <elkoled@gmail.com>

* Car Diff: better comment (#3090)

* add explainer

* func

* change text

* icons

* lines

* test changes

* Revert "test changes"

This reverts commit 2b71f820025e6f857ae01e9847859a1b444b80e1.

* test change

* Revert "test change"

This reverts commit d3c4f3d425977965b4cfb8ba96b8dc9c01e79650.

* Update opendbc/car/tests/car_diff.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update opendbc/car/tests/car_diff.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update opendbc/car/tests/car_diff.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Car diff: lazy load (#3092)

lazy load to import from openpilot

* Subaru global: use universal angle signal for angle cars (#3094)

* swap

* self explan

* combine into if right below

* split by lkas angle

* Fix Subaru steering angle rate (#3095)

what is going on

* Subaru hybrid: fix cruise enabled signal (#3097)

* brake or status works

* hmm which name

* better

* rest

* cmt

* cmt

* what

* docs: Scheduled auto-update CARS.md

* Subaru ANGLE_LKAS: fix cruise control signals (#3096)

* outback is always zero?

* move inside

* fix bus

* Clean up Subaru interface/angle cars (#3099)

* clean up

* unset too?1

* prob fine at 0.1

* Subaru: remove unused safety angle measurement (#3100)

* we simply don't use this

* as well

* Fix Subaru message definitions for HighBeamAssist and static messages (#3102)

Co-authored-by: Jacob Waller <jacob.waller@inspire11.com>

* add Subaru angle/hybrid cruise TODO

* typo

route is 38b065e31c0a9ed7/000000cf--a4a20815a6

* Car Diff: wrap output (#3098)

hide changes

* Revert "Toyota: remove NO_STOP_TIMER flag (#3076)"

This reverts commit 1cd92abbf86b50ccd0a5782e6a5d598c14d94e7e.

* Revert "Toyota: clean up radarUnavailable (#3075)"

This reverts commit cbff382e5bb42a705ba880ca8feaf20298df8f7a.

* Revert "Toyota: clean up alpha long (#3074)"

This reverts commit 8a25621e97fc022a56d0f3eb47be691832169cf7.

* [bot] Update uv.lock (#3104)

Co-authored-by: Vehicle Researcher <user@comma.ai>

* replace natsort with lil function (#3105)

* replace natsort with lil function

* sort

* Reapply "Lateral: lower friction threshold (#2915)" (#378) (#394)

This reverts commit a76d28a231dd8a3de11ed47db2d185d3852c6925.

* Revert "Mazda: Parse cruise control buttons (#307)"

This reverts commit 153d90c2e5c246d44d765aa5cb6cd8f9bad4fd32.

* Platform List: sync with latest

* docs: update CARS.md

* ci: disable Car diff

* docs: cleanup for community supported platforms (#396)

* ci: disable Car diff

* hyundai

* gm

* honda

* HKG: add KIA_FORTE_2019_NON_SCC fingerprint (#390)

* Update fingerprints_ext.py

* add missing sport gear

* Apply suggestion from @sunnyhaibin

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Nissan: Parse cruise control buttons (#341)

* Nissan: Parse cruise control buttons

* Remove cancel and resumeCruise buttons

Removed cancel and resumeCruise buttons from BUTTONS list.

* Apply suggestions from code review

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* restore gapAdjustCruise button event handling in Nissan CarState

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Operation GAC (Silverado Tuning) (#3106)

* silverado

* Update interface.py

* quant

* Update interface.py

* Rivian: Add stalk down ACC behavior to match stock Rivian (#363)

* add Rivian Stock feature

* Update opendbc/sunnypilot/car/rivian/carstate_ext.py

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Tesla: remove `TESLA_MODEL_X` from `dashcamOnly` (#258)

* enable tesla mx for SP

* add entry

* remove unused import

* use sp_params to override

* update new fingerprint

* add fingerprint in ext

* update to use community support

* Update opendbc/car/tesla/fingerprints.py

* Apply suggestion from @sunnyhaibin

* Update opendbc/car/tesla/values.py

---------

Co-authored-by: Shengming Yuan <me@theeditorstudio.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Subaru: Add FW for 2020 Subaru Legacy (#3111)

* Revert "Operation GAC (Silverado Tuning) (#3106)"

This reverts commit 62567a24080b08c3972198df1f3610e9c89303f8.

* GM: Sigmoidal Offsets (#3110)

* silverado

* Update interface.py

* quant

* Update interface.py

* Revert "Update interface.py"

This reverts commit 5ef95213e6d71f3cfe2a2ef769c0cd0235f16d10.

* Revert "quant"

This reverts commit 1cc2aebd9f88b29797c00dd37434fce89c1d5f28.

* Revert "silverado"

This reverts commit 560d9aa6fced675c656e3377dff19cd4023aea48.

* GM: add Silverado FP variant (#3116)

add missing

* Subaru Global: update neutral signal name (#401)

* [bot] Update uv.lock (#3118)

Co-authored-by: Vehicle Researcher <user@comma.ai>

* VW MQB: Add FW for 2020 Audi Q3 (#3121)

* VW MQB: Add WMI for FAW-Volkswagen in China (#3122)

* VW MQB: Add FAW-Volkswagen China WMI

* allow FAW-Volkswagen manufacturer for Audi Q3

* also A3 and Q2

* Hyundai Longitudinal: refactor tuning (#359)

* hkg long: refactor long tune

Refactor long tune to add dynamic comfort band logic, reduce reliance on radarUnavailable setters and clean up config.

* test coverage for dynamic comfort band

* show that negative list comprehension is the same as expected format

* deprecate unittest

* blank space

* pytest.approx

* Update test_tuning_controller.py

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Tesla: add fingerprint for Model 3 Performance HW4 (#407)

* Fingerprint Tesla Model 3 Performance HW4

Added Tesla Model 3 Performance HW4 (Highland) Fingerprint

* Tesla Model 3 Performance Fingerprint

Added Fingerprint via fingerprints_ext

* Apply suggestions from code review

* not hyundai

* wrong dir

---------

Co-authored-by: flberger1987 <fb@i-solutions.gmbh>

* Toyota: do not disable radar when smartDSU or CAN Filter detected (#399)

* Toyota: do not disable radar when smartDSU or CAN Filter detected

* gate it

* Revert "gate it"

This reverts commit de21aa77e5d306018841102a0ebca71f2d405187.

* need this

* Toyota: move Enforce Factory Longitudinal Control checks to sunnypilot interface (#411)

* Toyota: move Enforce Factory Longitudinal Control checks to sunnypilot interface

* hmm

* back

* Honda: add missing `GasInterceptor` messages to Taiwan Odyssey DBC (#409)

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* GM: remove `CHEVROLET_EQUINOX_NON_ACC_3RD_GEN` from `dashcamOnly` (#412)

* GM: remove `CHEVROLET_EQUINOX_NON_ACC_3RD_GEN` from `dashcamOnly`

* oops

* docs

---------

Co-authored-by: Matt Purnell <65473602+mpurnell1@users.noreply.github.com>
Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: downquark7 <mail2emn@gmail.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Co-authored-by: dzid26 <dzidmail@gmail.com>
Co-authored-by: Nikita Pylypyuk <147505783+nikitap066@users.noreply.github.com>
Co-authored-by: MVL <manuel@alumni.virginia.edu>
Co-authored-by: T3vl <80123588+tealtwo@users.noreply.github.com>
Co-authored-by: Hacheoy <124492751+Hacheoy@users.noreply.github.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: ugtthis <142481257+ugtthis@users.noreply.github.com>
Co-authored-by: Taku Nishigaki <45715127+tknsgk@users.noreply.github.com>
Co-authored-by: Lukas <61192133+lukasloetkolben@users.noreply.github.com>
Co-authored-by: lukasloetkolben <lukasloetkolben@users.noreply.github.com>
Co-authored-by: Grzegorz Gajoch <gajoch@gmail.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>
Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
Co-authored-by: Yasuhiro Ohno <84763339+yasu-oh@users.noreply.github.com>
Co-authored-by: Andrew Frahn <andrew@emmertex.com>
Co-authored-by: Alexandre Nobuharu Sato <66435071+AlexandreSato@users.noreply.github.com>
Co-authored-by: AlexandreSato <AlexandreSato@users.noreply.github.com>
Co-authored-by: Amy Jeanes <mattjeanes23@gmail.com>
Co-authored-by: royjr <royjr96@gmail.com>
Co-authored-by: James Vecellio-Grant <159560811+Discountchubbs@users.noreply.github.com>
Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
Co-authored-by: elkoled <elkoled@gmail.com>
Co-authored-by: Chris Chan <moming2k@gmail.com>
Co-authored-by: chris-moming4k <moming2k@igpsd.com>
Co-authored-by: Thales Ceolin <thalesac@users.noreply.github.com>
Co-authored-by: eFini <ricklan@gmail.com>
Co-authored-by: Javier Fernandez <javier.fernandez@universidadeuropea.es>
Co-authored-by: atmezferix <mez@atmezferix.com>
Co-authored-by: Warren Togami <wtogami@gmail.com>
Co-authored-by: gs450h <raul91@me.com>
Co-authored-by: Raul Rodriguez Jr <raul91@icloud.com>
Co-authored-by: smurf88sys <smurf88@gmail.com>
Co-authored-by: commaci-public <60409688+commaci-public@users.noreply.github.com>
Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Greg Hogan <gregjhogan@gmail.com>
Co-authored-by: FELMONON <125313419+FELMONON@users.noreply.github.com>
Co-authored-by: Felmon Fekadu <felmonfekadu@Felmons-MacBook-Air.local>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Gavin Phratsachack <37220586+gncnpk@users.noreply.github.com>
Co-authored-by: Kevin Turcios <106575910+KRRT7@users.noreply.github.com>
Co-authored-by: Jacob Waller <jacobwaller@jacobwaller.com>
Co-authored-by: Jacob Waller <jacob.waller@inspire11.com>
Co-authored-by: firestar5683 <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: Shengming Yuan <11619780+ssysm@users.noreply.github.com>
Co-authored-by: Shengming Yuan <me@theeditorstudio.com>
Co-authored-by: flberger1987 <fb@i-solutions.gmbh>
@FelmonFekadu
Copy link
Contributor Author

Sorry for the late reply here. I was heads down finishing a couple of project deadlines and missed the notification on this thread.

Really appreciate you taking the time to benchmark it properly and sanity-check the change. The breakdown around the strategy generation cost and the measured speedup made the improvement much clearer.

Thanks again for the feedback, the cleanup, and for merging it.

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

Labels

car related to opendbc/car/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants