test_models: add tx fuzzy test
resolve #32425
Uses FuzzyGenerator to generate fuzzy CarControl messages
hypothesis example generation is extremly slow.
Thanks for contributing to openpilot! 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
- the change is something we merge
- include a route or your device' dongle ID if relevant
Let me know when you want a review!
Nice work - it's a great sign that it's finding bugs!
Bounty locked!
hypothesis example generation is extremly slow.
Might be worth looking into https://github.com/commaai/openpilot/issues/32693
yeah, ideally, I want to create a list of CarControl messages rather than only one such as now, but it takes nearly 18min on my machine to finish half the tx_fuzzy test.
Might be worth looking into https://github.com/commaai/openpilot/issues/32693
Our current Hypothesis is already the faster version, the latest release of hypothesis is 2x slower :).
Might merge tx fuzzy with carstate fuzzy.
Occasionally catches https://github.com/commaai/panda/pull/1948. Not entirely sure why hypothesis doesn't consistenly repro that failed data generation
@sshane ready for review
I don't think we merged all your bugfixes yet, so how is this passing? Are we not getting good coverage on a single run?
I don't think we merged all your bugfixes yet, so how is this passing? Are we not getting good coverage on a single run?
Nissan max steering angle [issue](https://github.com/commaai/openpilot/issues/32978) is opened and included in this PR
Tesla [issue](https://github.com/commaai/openpilot/issues/32999): This might happen with a few runs, and I suspect that if run locally, hypothesis will try to recreate that failing examples pretty consistently. That requires a more thoughtful fix, which I'm hesitant to open a fix PR since I'm not familiar with the expected behaviour of the platform
The Nissan speed issue is addressed here:
# Nissan calculate vEgoRaw with avg speed of 4 wheels
# while panda get vehicle_speed from rear wheels only,
# so there might be a big enough difference between the two
if self.CP.carName == "nissan":
panda_vehicle_speed_last = self.safety.get_vehicle_speed_last() / VEHICLE_SPEED_FACTOR
if abs(self.CI.CS.out.vEgoRaw - panda_vehicle_speed_last) > 0.2:
cs_msg = self.CI.CS.out.to_dict()
cs_msg["vEgoRaw"] = panda_vehicle_speed_last
self.CI.CS.out = car.CarState.new_message(**cs_msg).as_reader()
This realistically shouldn't happen front wheels and rear wheel speed should be close
Can you rebase?
This PR was closed because of a git history rewrite. Please read https://github.com/commaai/openpilot/issues/33399 for what to do with your fork and your PRs.