Compare commits

..

3320 Commits

Author SHA1 Message Date
firestar5683 7306f36323 Update testingupstreamsync to verified AGNOS 20.6.1 2026-11-28 17:44:42 -06:00
firestar5683 6d1a93f093 Keep Model Lab Image Copies on QCOM 2026-11-28 16:47:35 -06:00
firestar5683 5831d50bbd Refresh Dom Model Source Pin 2026-11-28 16:47:35 -06:00
Adeeb Shihadeh e830015e87 mici: move side panel to the left (#39317) 2026-11-28 16:44:58 -06:00
Nick 87ce6be4f9 mici: better alert color clarity on sidebar icons (#39461) 2026-11-28 16:43:37 -06:00
Nick bb46a514c9 mici: retouch lead car and distance indicator (#39456) 2026-11-28 16:43:36 -06:00
Nick 9a7d6109c1 mici: clean up onroad wheel colors (#39452) 2026-11-28 16:43:36 -06:00
Nick 6356d48e1b mici: return onroad fade transitions to previous generic speed (#39460) 2026-11-28 16:42:15 -06:00
Adeeb Shihadeh 7b7629c775 mici: fade everything with status_fade (#39356) 2026-11-28 16:42:14 -06:00
Adeeb Shihadeh 8a1e87e412 mici: steady status colors (#39336) 2026-11-28 16:42:14 -06:00
Nick 09b9b9e3ef mici: keep long indicator through ignition (#39466) 2026-11-28 16:41:36 -06:00
Adeeb Shihadeh 4c70b2483f mici: show disengaged side panel offroad (#39347) 2026-11-28 16:41:36 -06:00
Adeeb Shihadeh d6e5a2155b ui: emoji in labels (#39370) 2026-11-28 16:40:52 -06:00
Nick d936d2ad41 mici: show path and lead unless openpilot can't drive (#39459) 2026-11-28 16:39:40 -06:00
Nick f3b4f8b993 disengaged path (#39453) 2026-11-28 16:39:39 -06:00
Adeeb Shihadeh 939bdbf000 mici: no override blink, static lead car when disengaged (#39335) 2026-11-28 16:38:53 -06:00
ferb-comma 651f2f36dd mici: orange wheel on steerRequired alerts while engaged (#39441) 2026-11-28 16:38:34 -06:00
Adeeb Shihadeh 37f0dbbf8d mici: green wheel when engaged (#39316) 2026-11-28 16:38:33 -06:00
Adeeb Shihadeh accae6d370 mici: night mode (#39134) 2026-11-28 16:37:51 -06:00
firestar5683 7e1718cec7 Restore Hyundai Safety Test Fixtures 2026-11-28 16:36:08 -06:00
Nick c61990389f mici: speed dial icon for stock ACC (#39455) 2026-11-28 16:35:03 -06:00
firestar5683 7a1b13987d Type Check Each Tinygrad Runtime 2026-11-28 16:24:17 -06:00
Adeeb Shihadeh 601135b5ad mici: wake animation on home (#39331) 2026-11-28 16:23:24 -06:00
firestar5683 ce69935bdd Run Locked Ty in an Isolated Environment 2026-11-28 16:23:24 -06:00
firestar5683 d33a77c6d9 Bundle Crumbly Cheddar as the Default Model 2026-11-28 16:20:19 -06:00
firestar5683 48b0b8c281 Qualify Model Runtime Producer Source 2026-11-28 16:20:17 -06:00
Adeeb Shihadeh 24522ac28c bump tinygrad (#39484) 2026-11-28 16:20:16 -06:00
ferb-comma 8bfa5c0997 test_power_draw: wait for each stage's power to settle (#39403) 2026-11-28 16:18:35 -06:00
firestar5683 b132b4f1a9 Adopt Ty 0.0.112 2026-11-28 16:17:37 -06:00
firestar5683 529d4bb41d Refresh Car State Build Receipt 2026-11-28 16:10:50 -06:00
firestar5683 77ca9cb944 Validate Test Alert Types 2026-11-28 16:10:50 -06:00
firestar5683 2523e4c87d Narrow Card and Selfdrive Receipts 2026-11-28 16:10:50 -06:00
firestar5683 bdb7d47ad7 Refresh Typed Fixture Build Receipt 2026-11-28 16:09:08 -06:00
firestar5683 408c32b159 Share Typed Settings Owner Fixtures 2026-11-28 16:09:07 -06:00
firestar5683 de1e20bc4e Share Typed Galaxy Fixtures 2026-11-28 16:09:07 -06:00
firestar5683 3c66c03f5c Guard Camera and Model Rendering Inputs 2026-11-28 16:06:24 -06:00
firestar5683 504db82cd2 Validate UI Tool Lifecycles 2026-11-28 16:06:23 -06:00
firestar5683 442991ce9b Refresh Typed Owner Build Receipt 2026-11-28 16:05:24 -06:00
firestar5683 bd727e7a20 Narrow Galaxy and Network Owners 2026-11-28 16:05:23 -06:00
firestar5683 ac8c717406 Narrow Speed Limit Inputs 2026-11-28 16:05:23 -06:00
firestar5683 49e31b402d Narrow UI Projection Inputs 2026-11-28 16:05:23 -06:00
firestar5683 f01acb505f Refresh Vision Build Receipt 2026-11-28 16:03:36 -06:00
firestar5683 ba84f072bb Narrow Vision Detector Backends 2026-11-28 16:03:36 -06:00
firestar5683 6fe3b9aad5 Refresh End to End Sidebar Build Receipt 2026-11-28 16:03:29 -06:00
firestar5683 ac029670b5 Correct End to End Sidebar Icons 2026-11-28 16:03:28 -06:00
firestar5683 3e9ae7d997 Refresh Shared Test Fixture Build Receipt 2026-11-28 16:00:46 -06:00
firestar5683 8e8d0f2d8e Share Typed AOL and Galaxy Test Fixtures 2026-11-28 16:00:44 -06:00
firestar5683 562d83e558 Refresh Perception Test Build Receipt 2026-11-28 15:54:50 -06:00
firestar5683 c453f4bf4f Check Optional Perception and Display Fixtures 2026-11-28 15:54:45 -06:00
firestar5683 7d319b50a1 Refresh Planner Test Build Receipt 2026-11-28 15:54:09 -06:00
firestar5683 81e00cf60d Type Check Longitudinal Profile Fixtures 2026-11-28 15:54:03 -06:00
firestar5683 59153b404f Check Speed Limit Decision Objects in Tests 2026-11-28 15:53:39 -06:00
firestar5683 48c5ff1562 Refresh GPS and Replay Build Receipt 2026-11-28 15:51:36 -06:00
Adeeb Shihadeh b4d158aeb1 bump ty to 0.0.112 and fix the type errors it finds (#39506) 2026-11-28 15:50:42 -06:00
firestar5683 5e088c8494 Refresh Runtime Cleanup Build Receipt 2026-11-28 15:46:18 -06:00
Adeeb Shihadeh ab5aa18859 bump ty to 0.0.112 and fix the type errors it finds (#39506) 2026-11-28 15:45:56 -06:00
firestar5683 6052661140 Verify End to End Preview Captions 2026-11-28 15:44:47 -06:00
Adeeb Shihadeh 3bbda2d485 ui: fix the type errors newer ty finds (#39505) 2026-11-28 15:44:03 -06:00
Adeeb Shihadeh ad714cbc62 raylib typing fixups (#39503) 2026-11-28 15:44:03 -06:00
firestar5683 53f8caf929 Refresh Athena Build Receipt 2026-11-28 15:40:36 -06:00
Adeeb Shihadeh e6f0b1a0fc athenad: run each connection in its own process for instant network changes (#39500) 2026-11-28 15:36:30 -06:00
firestar5683 7c1be48202 Refresh Safety Test Build Receipt 2026-11-28 15:33:38 -06:00
firestar5683 f9fa1e7f60 Reset Safety Test Experience Before Mode Selection 2026-11-28 15:32:41 -06:00
firestar5683 3a95b33dd7 Build Matching Pandad Artifacts 2026-11-28 15:29:37 -06:00
firestar5683 a9ed3c4cec Model Healthy Subscriptions in Speed Nudge Tests 2026-11-28 15:28:29 -06:00
firestar5683 db8c0babf3 Align End to End Previews and Translations 2026-11-28 15:25:14 -06:00
firestar5683 61c03b6fdc Restore Matching Producer Build Inputs 2026-11-28 15:25:13 -06:00
firestar5683 cab31c7f0e Cover Volkswagen Cruise Main Off Release 2026-11-28 15:24:08 -06:00
firestar5683 05654bd0d1 Update End to End Fixture Expectations 2026-11-28 15:24:08 -06:00
firestar5683 cb85aae9c0 Preserve Immediate End to End Speed Reductions 2026-11-28 15:24:07 -06:00
firestar5683 c66b1c63e8 Preserve Qualified FLM Producer Sources 2026-11-28 15:24:07 -06:00
firestar5683 720e714b53 Preserve Reserved Cereal Alert Schema 2026-11-28 15:24:05 -06:00
firestar5683 29eb284005 Format Panda Build Test Invocation 2026-11-28 12:30:35 -06:00
firestar5683 a14daee043 Build Panda Register Maintenance 2026-11-28 12:28:55 -06:00
firestar5683 cf40373a6a Verify Isolated Panda Fault Test Builds 2026-11-28 12:28:04 -06:00
Daniel Koepping cf99309c9b release build tests (#2506) 2026-11-28 12:25:51 -06:00
Adeeb Shihadeh d2d27d821c board: delete unused macros and tags (MISRA 2.4, 2.5) (#2525) 2026-11-28 12:25:51 -06:00
Adeeb Shihadeh 46ad2b8792 board: unique names for the I2C register parameters (MISRA 5.3, 5.6, 5.7) (#2522) 2026-11-28 12:25:51 -06:00
Adeeb Shihadeh 4aeb675778 MG: get to 100% branch coverage (#3970) 2026-11-28 12:25:51 -06:00
firestar5683 cac2074bb2 Refresh Prebuilt Source Receipt 2026-11-28 12:20:49 -06:00
firestar5683 e8b39340ff Clarify Training Disengagement Copy 2026-11-28 12:20:01 -06:00
firestar5683 0e65cda536 Preserve Onboarding Debug Default 2026-11-28 12:19:48 -06:00
Adeeb Shihadeh c0b3f8ea35 long mpc: add acados solver type stub so it type checks without a build (#39502) 2026-11-28 12:18:58 -06:00
firestar5683 c04969a0ae Close Training Photo Workers Cleanly 2026-11-28 12:18:01 -06:00
Adeeb Shihadeh a49523bc68 mici: update startup text (#39424) 2026-11-28 12:16:47 -06:00
firestar5683 ec975eaa0d Initialize Font Fixture for Training Review 2026-11-28 12:15:37 -06:00
firestar5683 b81d884fbf Preserve Training Guide Texture Coverage 2026-11-28 12:15:02 -06:00
Adeeb Shihadeh c526f8c495 ui: tizi training guide refresh (#39467) 2026-11-28 12:14:21 -06:00
firestar5683 bab553f05e Build Panda Safety Maintenance Artifacts 2026-11-28 12:12:20 -06:00
Harald Schäfer f7a4ab77c5 Remove unused longitudinal maneuver setup (#39102) 2026-11-28 12:10:21 -06:00
Adeeb Shihadeh 381e95ba9f misc cleanups (#39501) 2026-11-28 12:10:20 -06:00
Henry 62bca1ceb2 disable dac before stop mode (#2419) 2026-11-28 12:08:40 -06:00
Adeeb Shihadeh bf06ad7f1b board: include guards instead of #pragma once (MISRA 1.2) (#2518) 2026-11-28 12:08:40 -06:00
Adeeb Shihadeh b46cde70a1 safety: include guards instead of #pragma once (MISRA 1.2) (#3976) 2026-11-28 12:08:31 -06:00
Daniel Koepping 22a9840f8a safety tests: lagging RX checks (#3917) 2026-11-28 12:08:28 -06:00
Daniel Koepping fa1ceca721 libsafety: trap UBSan errors (#3943) 2026-11-28 12:08:27 -06:00
Shane Smiskol 7a8cd847ed ui: everything through received_since_started (#39383) 2026-11-28 12:06:41 -06:00
Shane Smiskol 3e5fe0ad0e ui: share alert logic between comma four and comma 3X (#39223) 2026-11-28 12:06:41 -06:00
firestar5683 a8b2149495 Merge Current Testing Vehicle Fixes 2026-11-28 12:06:41 -06:00
firestar5683 38f33a5441 Build Alert Schema Artifacts 2026-11-28 12:01:14 -06:00
firestar5683 3296da6391 Qualify i30 and Prius native safety paths 2026-11-28 12:01:07 -06:00
firestar5683 56acbbf501 Check Startup Cruise After Vehicle Events 2026-11-28 11:58:37 -06:00
stef 6c19559921 ui: move BigPillButton into button.py (#39297) 2026-11-28 11:58:37 -06:00
Shane Smiskol 0a15fa12ab mici: keep the chestnut failed icon when its USB drops (#39362) 2026-11-28 11:58:37 -06:00
Shane Smiskol 1ff0759520 Play disengage chime when booting while engaged (#34884) 2026-11-28 11:58:37 -06:00
firestar5683 dcce4eee55 Verify System and Driver Critical Sounds 2026-11-28 11:58:37 -06:00
Adeeb Shihadeh 2a95f6473e soundd: separate driver critical sound (#39337) 2026-11-28 11:58:36 -06:00
Adeeb Shihadeh 7228d6a4e0 setup: show failure on any HTTP error (#39324) 2026-11-28 11:58:36 -06:00
stef 0b35031a88 webrtc: reorganize (#39216) 2026-11-28 11:58:36 -06:00
Daniel Koepping c2c2948858 process replay: use format_report from opendbc (#39395) 2026-11-28 11:58:36 -06:00
firestar5683 9c895aa389 Refresh Prebuilt Source Receipt 2026-11-28 11:58:35 -06:00
firestar5683 9662e3aa32 Preserve CAN Signal Geometry Compatibility 2026-11-28 11:58:35 -06:00
Adeeb Shihadeh 2e59d571c1 Rivian: counters count 0 to 14 in the packer and parser (#4077) 2026-11-28 11:58:35 -06:00
firestar5683 70c655c025 Refresh Prebuilt Source Receipt 2026-11-28 11:52:48 -06:00
Nick 6f8168e2fe fix stock acc speed dial icon 2026-11-28 11:52:48 -06:00
firestar5683 b2021e9595 Build Panda Firmware and Host Artifacts 2026-11-28 11:50:23 -06:00
Adeeb Shihadeh aa1f234ad9 safety: reset heartbeat mismatches on every engagement (#4102) 2026-11-28 11:50:20 -06:00
ferb-comma 16c98b4b2e mici home: right corner never opens settings (#39447) 2026-11-28 11:50:19 -06:00
Nick d46d7cff29 ease wheel angle on ignition change (#39458) 2026-11-28 11:50:19 -06:00
Shane Smiskol 5d326f2aa2 mici: start the wheel at 0 instead of the last drive's angle (#39358) 2026-11-28 11:50:19 -06:00
Shane Smiskol b34334dbbd ui: one helper for received since started (#39382) 2026-11-28 11:50:19 -06:00
Adeeb Shihadeh 43b1759b2c reflash_internal_panda: support the upstream kernel's GPIO numbering (#2494) 2026-11-28 11:50:19 -06:00
Daniel Koepping 36e5d2bd14 reflash: give the bootloader time to start before SPI (#2530) 2026-11-28 11:50:19 -06:00
Daniel Koepping c4a2445692 check comma four id strap (#2513) 2026-11-28 11:50:18 -06:00
Daniel Koepping 18ce6dbe3f halt on an unknown board before current_board is used (#2500) 2026-11-28 11:50:18 -06:00
Daniel Koepping b3095eaaff can loopback only on debug builds (#2496) 2026-11-28 11:50:18 -06:00
Daniel Koepping 2f79817938 test_models: cache API logs by path (#4066) 2026-11-28 11:50:18 -06:00
YassineYousfi 7ee907cc72 rivian: tmp steer fault on H_CAN_EPSS_ToiFlt (#4045) 2026-11-28 11:50:18 -06:00
Daniel Koepping 48e5ef8093 car diff: universal format_report (#4046) 2026-11-28 11:50:18 -06:00
Daniel Koepping 33c7c0a6c0 PSA: EPS LKA defect is a steering fault (#3913) 2026-11-28 11:50:18 -06:00
Daniel Koepping 2f51d56d81 PSA: driver torque in Nm (#3911) 2026-11-28 11:50:17 -06:00
Daniel Koepping d3a9a0cd91 PSA: fix steering rate sign and scale (#3910) 2026-11-28 11:50:17 -06:00
Shane Smiskol 38edf1828e Ford: set espActive from ABS active (#3909) 2026-11-28 11:50:17 -06:00
Sebastian Turner 72930b3090 can: fix off by one in learned message frequency (#3889) 2026-11-28 11:50:17 -06:00
Tschäff Reisberg 76d80fb5a2 Tesla: add Model 3 EPS fingerprint EL014.21.2 (#3873) 2026-11-28 11:50:17 -06:00
Nick 4ecdddd3f9 mici: add initial max speed button icon (#39462) 2026-11-28 11:50:17 -06:00
Shane Smiskol 22664fd1e5 mici: fix review training guide crash (#39359) 2026-11-28 11:50:17 -06:00
Shane Smiskol 079c178f91 mici: grey DMoji while driver monitoring isn't running (#39363) 2026-11-28 11:50:16 -06:00
rav4kumar 15fbbc5e22 Add optional Enhanced BSM for TSS2 Prius 2026-11-28 11:36:46 -06:00
firestar5683 1daaf6ec93 Add guarded 2026 Hyundai i30 stock cruise steering 2026-11-28 11:31:35 -06:00
firestar5683 1391294dc9 Build Rednose Nanobind Runtime 2026-11-28 11:23:11 -06:00
Adeeb Shihadeh dfdee91db4 bump rednose (#39279) 2026-11-28 11:23:11 -06:00
Adeeb Shihadeh aa2b969c65 prep for mainline kernel (#39481) 2026-11-28 11:23:10 -06:00
firestar5683 79ccd9aa4b Merge Current Testing Vehicle Fixes 2026-11-28 11:13:07 -06:00
firestar5683 c2c0fd39dd Damp shallow highway curves on Ioniq 5 HDA II 2026-11-28 11:12:07 -06:00
firestar5683 3ef89b3750 Refresh Planner Sync Build Receipt 2026-11-28 11:09:36 -06:00
Harald Schäfer ff3b2ef1ca op setup: openpilot's own venv in a uv workspace, find op.sh's checkout from outside (#39237) 2026-11-28 11:09:35 -06:00
firestar5683 e0a091f6c8 Verify Ordinary End to End Cruise Smoothing 2026-11-28 11:09:35 -06:00
Harald Schäfer 469480faf2 Smooth cruise acceleration with a 1-second filter (#39266) 2026-11-28 11:09:35 -06:00
firestar5683 c0d0555cc1 Build Offroad Parameter Reset 2026-11-28 11:07:37 -06:00
Shane Smiskol 78c84376e8 pandad: don't set safety mode from previous drive's params (#39207) 2026-11-28 11:07:37 -06:00
firestar5683 cb233d373b Build Upstream Camera and Logger Updates 2026-11-28 11:05:37 -06:00
Adeeb Shihadeh 8e479b33e3 camerad: sync cameras only after each has settled on FSIN (#39378) 2026-11-28 11:05:35 -06:00
stef 885598f9dc encoderd: no wait on live stream encoder (#39220) 2026-11-28 11:05:35 -06:00
Adeeb Shihadeh 1776a3dac4 camerad: an ISP IOMMU handle of 0 is valid (#39376) 2026-11-28 11:05:35 -06:00
Shane Smiskol 0a6d476b68 loggerd: fix git_src_commit path after the nested openpilot move (#39311) 2026-11-28 11:05:35 -06:00
firestar5683 2581c8bf46 Refresh Sync Follow-up Build Receipt 2026-11-28 11:04:07 -06:00
firestar5683 0e1d17768a Finish Kona ccNC stop, MAIN, and standby display 2026-11-28 11:02:53 -06:00
firestar5683 4d0fa59f72 Recognize 2025 Subaru Impreza Base firmware 2026-11-28 11:02:39 -06:00
firestar5683 c23cdfc7a1 Run CI on the Upstream Sync Branch 2026-11-28 11:02:33 -06:00
firestar5683 de6aabcede Clean Romanian Catalog Formatting 2026-11-28 11:02:33 -06:00
James f88a40c2d5 Multilang: keep connect's "add new device" label in English (#39284) 2026-11-28 11:02:33 -06:00
Tăbîrță Adrian 8ecc442b03 added Romanian localization (#39075) 2026-11-28 11:02:33 -06:00
Shane Smiskol 0d7a7ef693 selfdrived: show Dashcam Mode when openpilot is disabled on an unrecognized car (#39226) 2026-11-28 11:02:32 -06:00
Shane Smiskol b53e48e7c7 comma four: don't show stale alert from previous onroad session (#39222) 2026-11-28 11:02:32 -06:00
Shane Smiskol 7f5dc98584 comma four: fade out UI-made alerts (#39221) 2026-11-28 11:02:32 -06:00
Shane Smiskol 2227d4e3a9 launch: set /dev/snd permissions before micd and soundd start (#39244) 2026-11-28 11:02:32 -06:00
firestar5683 d86afad493 Show End to End Slowdown Reasons on Both Displays 2026-11-28 11:02:32 -06:00
Adeeb Shihadeh 40b6114938 mici: fix update failed alert layout (#39348) 2026-11-28 11:02:32 -06:00
Adeeb Shihadeh 95a431a8c4 mici: lowercase labels (#39322) 2026-11-28 11:02:32 -06:00
Adeeb Shihadeh 8acbc7b7db ui: forward only raylib's warnings past window setup (#39482) 2026-11-28 11:02:31 -06:00
firestar5683 ad8c193b8c Add Volkswagen MQB cluster takeover chime toggle 2026-11-28 11:00:52 -06:00
firestar5683 9e5cf0f450 Refresh Upstream Sync Build Receipt 2026-11-28 10:55:10 -06:00
firestar5683 56ad61f7de Verify End to End Signal Label 2026-11-28 10:54:25 -06:00
firestar5683 eac7f5141e Exercise Personality Boost Through the Planner 2026-11-28 10:53:57 -06:00
firestar5683 d4f8032a68 Use End to End in Recorded Drive Labels 2026-11-28 10:53:57 -06:00
Leo Camus 176807a60d ui: decode HTML character references in HtmlRenderer (#39084) 2026-11-28 10:53:57 -06:00
firestar5683 fb7c88aa40 Verify End to End Planner Boundaries 2026-11-28 10:53:57 -06:00
Adeeb Shihadeh 15997d73ea ui: fix render with an empty nav stack (#39343) 2026-11-28 10:53:57 -06:00
Adeeb Shihadeh 8b49048825 ui: skip rendering under a covering nav widget (#39341) 2026-11-28 10:53:56 -06:00
Adeeb Shihadeh d601c6a8a0 ui: wifi/cellular managers reuse one worker thread (#39339) 2026-11-28 10:53:56 -06:00
Adeeb Shihadeh 52f4c3b012 model replay: don't cache master's ref (#39487) 2026-11-28 10:53:56 -06:00
ferb-comma 780e326116 tools: point unauthorized error at op auth (#39405) 2026-11-28 10:53:56 -06:00
Adeeb Shihadeh 273d5da6cc mici: cap tethering password at 63 characters (#39369) 2026-11-28 10:53:56 -06:00
Adeeb Shihadeh e1d9073941 mici: fix torque bar crash on out of range torque (#39325) 2026-11-28 10:53:56 -06:00
firestar5683 31fd2e6187 Complete End to End Labels 2026-11-28 10:53:56 -06:00
firestar5683 ddf0efc8d7 End to End Planner Presentation 2026-11-28 10:53:55 -06:00
Armand du Parc Locmaria 810486b8fe long mpc: use model predicted lead traj (#39445) 2026-11-28 10:53:55 -06:00
Jimmy a8f109a1b6 better personalities: boost the model's acceleration on standard/aggressive (#39248) 2026-11-28 10:53:55 -06:00
John Belmonte 7b5c8f1c5f cabana UI fixes (#39333) 2026-11-28 10:53:55 -06:00
James 242169408d Multilang: fix tr "metered" translation (#39282) 2026-11-28 10:53:55 -06:00
James e92f554407 Multilang: fix uk "TEMP" and "add new device" translations (#39283) 2026-11-28 10:53:55 -06:00
Shane Smiskol 987d5f6937 auto_translate: fix repo root after the nested openpilot move (#39312) 2026-11-28 10:53:55 -06:00
Lukas Heintz e7a4933efc tools: remove pandas dependency from can_table, speed up can_print_changes (#39290) 2026-11-28 10:53:54 -06:00
dzid26 9a28565710 jotpluggler: fix custom series loading (#39188) 2026-11-28 10:53:54 -06:00
Adeeb Shihadeh 36efabddc8 loggerd: fix test_loggerd encoderd flake (#39276) 2026-11-28 10:53:54 -06:00
James 4960ad55f8 Multilang: fix uk translation errors (#39272) 2026-11-28 10:53:54 -06:00
James 84b4aab460 Multilang: fix tr "CONNECTING..." translation (#39271) 2026-11-28 10:53:54 -06:00
James 37dc841deb Multilang: fix th translation errors (#39270) 2026-11-28 10:53:54 -06:00
James a957569156 Multilang: fix fr translation errors (#39269) 2026-11-28 10:53:54 -06:00
James 7e77e343a2 Multilang: fix es translation errors (#39268) 2026-11-28 10:53:54 -06:00
James 53af2a175b Multilang: fix de translation errors (#39267) 2026-11-28 10:53:53 -06:00
firestar5683 3a1bcc1a88 Refresh prebuilt receipt after companion bot update 2026-11-28 10:30:29 -06:00
natehuby76 225185d3e7 show reporter in companion forum previews 2026-11-28 10:34:27 -05:00
firestar5683 adca218266 Supply pinned OpenCV to custom pytest jobs 2026-11-28 01:31:21 -06:00
firestar5683 92e09398e8 Cover relative lead speed in the StarPort layout test 2026-11-28 00:38:43 -06:00
firestar5683 19d1cab0b3 Qualify default controller replay expectations 2026-11-28 00:21:42 -06:00
firestar5683 c6f6f64e77 Qualify Panda safety checks and restore fresh-install defaults 2026-11-28 00:18:40 -06:00
firestar5683 50e07e8eef Repair vehicle and Galaxy regression contracts 2026-11-28 00:14:41 -06:00
firestar5683 b7953cf4a0 Restore replay execution and align CI fixtures with current settings 2026-11-27 23:56:18 -06:00
firestar5683 df7d67c39f Restore Kona ccNC steering and smooth enhanced stops 2026-11-27 23:32:19 -06:00
firestar5683 439ac2274e Use camera brake hold on Corolla TSS2 hybrids 2026-11-27 23:13:04 -06:00
firestar5683 1066c1e0f2 Restore legacy Sportage lane warning display 2026-11-27 23:10:24 -06:00
natehuby76 76b76080f5 allow saving searched places 2026-11-27 23:56:04 -05:00
firestar5683 64fdc72c1e Honor LKAS wheel action assignments across vehicles 2026-11-27 22:55:28 -06:00
firestar5683 3831031635 Recover Sportage lane display after camera steering release 2026-11-27 22:51:31 -06:00
firestar5683 27aeb44b41 Damp rapid highway steering feedforward on ninth-generation Accord 2026-11-27 22:47:57 -06:00
firestar5683 988217726f Smooth Palisade steering corrections at mid speeds 2026-11-27 22:45:44 -06:00
firestar5683 954edb60af Damp large Tucson steering corrections at city speeds 2026-11-27 22:44:50 -06:00
firestar5683 20bef284c6 Honor Palisade LKAS wheel action assignments 2026-11-27 22:44:26 -06:00
firestar5683 c194a0c092 Build steering torque earlier into curves on the Yukon XL 2026-11-27 22:43:54 -06:00
Danny 54fa1a1875 Build 2026-11-27 18:58:46 -08:00
Danny a46a504450 Galaxy: Reuse the ready pill and test phone internet states 2026-11-27 18:54:58 -08:00
Danny d47bf5e636 Restore Android Network Sharing 2026-11-27 18:54:58 -08:00
Danny 8aa143deb0 Galaxy: Accept phone internet when the phone starts sharing
The Galaxy web card that turned phone internet on is gone, and the Android app now offers the switch in its own connection options. A heartbeat from a phone on the Galaxy hotspot now turns sharing on, so the comma accepts the phone without a separate setting. The phone's own opt-in, with its disclosure, is the consent. LAN, remote and second-phone heartbeats are still refused.
2026-11-27 18:54:58 -08:00
Danny 3d6d69b70d Build 2026-11-27 18:49:21 -08:00
Danny a43597aefe MDNS: Add to Comma Menu and Galaxy 2026-11-27 17:44:45 -08:00
Danny 6d5d6c249f Galaxy: Open by galaxy.local on Every Network, Including the Hotspot 2026-11-27 17:44:45 -08:00
Danny de8f420d95 Galaxy: Hold Connection Slots Only While a Request Runs 2026-11-27 17:44:45 -08:00
firestar5683 37f9e1a9d5 Retain Hyundai classic AOL intent through stock cruise off lag 2026-11-27 15:36:55 -06:00
firestar5683 27a4566309 Retry EPS firmware discovery for manually selected Honda Accord 2026-11-27 15:12:35 -06:00
firestar5683 f60c2147c0 Restore Kona standby cruise display and soften final stops 2026-11-27 15:10:27 -06:00
firestar5683 240edccfd6 Release confirmed stopped lead departures through turns 2026-11-27 15:02:17 -06:00
firestar5683 26e0f927bd Ease Elantra cruise corrections near set speed 2026-11-27 15:01:10 -06:00
firestar5683 4bf630534f Damp Tucson highway wobble and honor Hyundai LKAS wheel mappings 2026-11-27 15:00:39 -06:00
firestar5683 6db575bded Retain Mazda AOL through the first EPS block frame 2026-11-27 14:57:08 -06:00
firestar5683 b7d2723bf0 Recognize Sportage camera warnings across one frame of timing skew 2026-11-27 14:54:13 -06:00
firestar5683 9b545fa585 Keep Mazda AOL armed while steering permission is pending 2026-11-27 14:49:19 -06:00
firestar5683 d0904dfaaf Match higher speed limits on Redneck Cruise SET 2026-11-27 14:47:42 -06:00
firestar5683 6938b22db9 Damp Camry Hybrid highway corrections near lane center 2026-11-27 14:44:49 -06:00
firestarsdog b56e624681 Drop unused lead distance and stop-light color from Aethergauge 2026-11-27 13:11:25 -05:00
firestarsdog 48717d2b08 Remove Aethergauge unused transitions 2026-11-27 13:05:51 -05:00
firestarsdog c3f5283aa4 Large UI Font Discovery Cleanup 2026-11-27 12:30:28 -05:00
firestarsdog 04df2317fb Weird sizing cleanup on Large UI 2026-11-27 11:45:37 -05:00
firestarsdog 13c6a58ad2 Enlarge Large lead text and thicken lead line for readability 2026-11-27 10:16:48 -05:00
firestar5683 a73d8c0724 Damp Tucson steering oscillation in steady shallow curves 2026-11-27 00:13:43 -06:00
firestar5683 6b79f7a227 Soften Tucson steering feedback in shallow curves 2026-11-27 00:10:21 -06:00
firestar5683 bdef37d674 Default torque steering to StarPilot and Ford to BluePilot Angle 2026-11-27 00:04:17 -06:00
firestar5683 e01e382f81 Reduce residual highway steering oscillation on ninth-generation Accord 2026-11-27 00:02:56 -06:00
firestar5683 a11067b1a7 Cut repeated steering feedback work in Card 2026-11-26 23:58:15 -06:00
firestar5683 03d4f4678b Damp Palisade HDA II off-ramp corrections 2026-11-26 23:54:54 -06:00
firestar5683 bdf5acef74 Recognize the Tucson NX4 with the CW010 camera 2026-11-26 23:47:38 -06:00
firestar5683 58581e40b8 Keep Model Y no-lead departures within normal acceleration 2026-11-26 23:44:54 -06:00
firestar5683 108ab4c931 Apply highway steering damping to the Kona EV SE 2026-11-26 23:42:18 -06:00
firestar5683 a6cd443b63 Release Corolla TSS2 brakes promptly after the planner clears a stop 2026-11-26 23:39:46 -06:00
firestar5683 b074188701 Add Russian offline speed map regions 2026-11-26 23:39:05 -06:00
firestar5683 2614a5bec6 Require factory SET or RESUME before Kona SE engagement 2026-11-26 23:37:36 -06:00
Prabhaav Pillai e4dd33148d build params 2026-11-26 23:46:34 -05:00
Prabhaav Pillai 586da8495e fix default mismatch values for ForceStops and LaneCentering in params and tests 2026-11-26 23:42:57 -05:00
firestarsdog 3db077ff93 Replace lead chevron with shared path lead and stop lines for both UIs 2026-11-26 15:35:36 -05:00
firestar5683 3c93f81677 Smooth Kona CCNC stops and correct standby cruise status 2026-11-26 12:34:36 -06:00
firestar5683 e81f4ff1c7 Latch mixed HDA II AOL after factory Cruise Main is ready 2026-11-26 12:30:01 -06:00
natehuby76 553f2f8cd0 add icons and descriptions to the staff action picker 2026-11-26 13:26:54 -05:00
firestar5683 ab02163241 Recognize the 2026 European Hyundai i30 2026-11-26 12:24:06 -06:00
natehuby76 4ee3010f0d restore AI summaries for companion report titles 2026-11-26 13:18:19 -05:00
natehuby76 9acdd6f0ad clean up companion report titles 2026-11-26 13:00:54 -05:00
firestar5683 26cb9ba73c Fill missed Kona steering slots with neutral output 2026-11-26 11:14:44 -06:00
firestar5683 ea5143fe2c Smooth the final rolling stop on Kona CCNC 2026-11-26 11:10:44 -06:00
natehuby76 ca9adfd5f3 skip reports already moved to driving support 2026-11-26 12:08:07 -05:00
Danny 4d721e9cc7 Build 2026-11-26 08:56:01 -08:00
Danny e33a942745 CI: Build once and run balanced custom and vehicle test shards in parallel 2026-11-26 08:55:20 -08:00
ryan 090eabda53 Leapmotor: add the B10 (angle steering, alpha longitudinal) 2026-11-26 10:46:37 -06:00
firestar5683 4ff8e7a5da Keep Redneck Cruise SET pending until accelerator release 2026-11-26 10:41:25 -06:00
firestar5683 00a65fc19f Allow on-device model downloads on a powered bench 2026-11-26 10:39:25 -06:00
firestar5683 227dffc5b4 Release clear gradual launches on the current model frame 2026-11-26 10:38:30 -06:00
firestar5683 ca17d3963d Smooth Palisade HDA II curve transitions 2026-11-26 10:35:35 -06:00
firestar5683 1bc4c35a0e Keep Mazda AOL armed through brief EPS blocks 2026-11-26 10:32:08 -06:00
firestar5683 b13976776a Keep Palisade HDA II lateral armed when stock ACC pauses 2026-11-26 10:30:37 -06:00
firestar5683 0413e9baa9 Confirm gradual launches while acceleration builds 2026-11-26 10:30:03 -06:00
firestar5683 ed82ef5fde Increase highway steering damping on ninth-generation Accord 2026-11-26 10:25:52 -06:00
firestar5683 0eb7b7f820 Keep manual MQB AOL armed through source recovery and Cancel 2026-11-26 10:25:12 -06:00
Jason Wen 76e2b275f8 HKG: Car Port for Kia Carnival 2027 (HDA II) 2026-11-26 10:24:55 -06:00
firestar5683 e8cab33282 Resume on sustained straight model launches 2026-11-26 10:24:10 -06:00
ryan 763d32b415 aol: drop the Leapmotor CAN2 interrupt-rate exemption
The fault comes from the harness leaving panda bus 1 unconnected, not
from the B10's traffic, so it doesn't belong in the port.
2026-11-26 10:49:05 +01:00
ryan 487227cea9 leapmotor: cap the EPS effort word at the stock maximum
The low-speed boost still deepens the ramp while the wheel lags, but no
further than stock LCC's 46 steps (0x4A5D); the panda limit follows. The
boost past 46 can come back later with its own data.
2026-11-26 10:49:05 +01:00
Prabhaav Pillai 4ecf06649b update test to check for improprerly spaced buttons and fix them 2026-11-26 00:10:49 -05:00
Prabhaav Pillai c33241ba7e incorporate advanced setting levels 2026-11-26 00:10:49 -05:00
firestar5683 3ca28e6f24 Restore parked PID steering evidence and checkpoint replay 2026-11-25 22:55:21 -06:00
firestar5683 8c34e34701 Support 2023 Kona Electric SE conventional cruise 2026-11-25 22:54:46 -06:00
firestar5683 ebb76dce4e Restore Kona stopping ramp and synchronize the cruise display 2026-11-25 22:46:34 -06:00
firestar5683 06ea4e1913 Restore Kona steering requests on the Panda host transport 2026-11-25 22:16:37 -06:00
firestar5683 33f726c85d Recognize the 2023 Kona Electric SE in dashcam mode 2026-11-25 22:10:28 -06:00
ds-sebastian 0730feecc9 RAV4 radar: keep the ACC target receiver under alpha long's radar disable 2026-11-25 22:09:06 -06:00
firestar5683 250c0917bb Soften Palisade HDA II friction feedback 2026-11-25 22:07:50 -06:00
firestar5683 0dc219edba Ask for a Discord report after PR checks pass 2026-11-25 21:58:25 -06:00
firestar5683 12b51d0308 Keep Subaru AOL armed through paddle-exit gear transitions 2026-11-25 21:57:44 -06:00
firestar5683 7d3815dbb5 Close pull requests targeting testing 2026-11-25 21:52:03 -06:00
firestar5683 542b4f463a Dampen Ioniq 6 steering corrections at highway speed 2026-11-25 21:51:00 -06:00
firestar5683 7ff81a0ffb Keep Subaru AOL armed across an early paddle denial 2026-11-25 21:40:33 -06:00
firestar5683 1317718b6d Reduce highway steering chatter on ninth-generation Accord 2026-11-25 21:39:18 -06:00
Sam Yau 6d40f1b0a5 Subaru SNG: accept any counter advance for captured source validity 2026-11-25 21:37:42 -06:00
Prabhaav Pillai aadc1f5700 VASM logs 2026-11-25 20:56:50 -05:00
ds-sebastian 7f8c0301d5 RAV4 radar: ACC target is the only ARS510 receiver
configure_radar() already selects only the ACC-target receiver, so the
object-list receiver (ars510_radar.py) and its ARS510_FUSED flag could
no longer be reached. Remove both, with their tests and their branches
in the radar interface and the angle, EPS8, pedal and filter-AOL checks.
get_params() rebuilds the flags on every start, so no saved value can
bring the old bit back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:55:44 -05:00
ds-sebastian a147e084dc RAV4 radar: keep the ACC target receiver under alpha long's radar disable
Alpha long without a CAN filter disables the radar with UDS
CommunicationControl (28 01 01 to 0x750/0x0F). That stops the radar's
car-bus (bus 0) output only; the radar bus (bus 1) keeps running at full
rate, ACC target 0x235/0x237/0x239 included (RAV4s on 8821F0R03100, one
a 26 min drive; a C-HR Hybrid 8821FF410500 on opendbc's 22 min
"openpilot longitudinal, radar disabled" route).

configure_radar() used to clear the receiver and mark the radar
unavailable in that case, so alpha long without a CAN filter ran
vision-only. Keep the receiver on instead. The radar-torque AOL check
allows ARS510_RADAR on the RAV4 2022 with or without openpilot
longitudinal, as the filter, angle, pedal and EPS8 checks already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:43:47 -05:00
ds-sebastian 3b73537247 RAV4 radar: ARS510 DBC from commaai/opendbc#3860
TARGET_ID is 6 bits (61|6); the radar's support frames (0x100 PCS
state, 0x190 cycle clock, 0x191-0x194 target summaries, 0x195/0x196
event pair, 0x202 alive, 0x24F boot, 0x680) are documented. The ACC
target frames the receiver reads are otherwise unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:43:47 -05:00
Prabhaav Pillai c9bd6fa000 build 2026-11-25 20:42:19 -05:00
Prabhaav Pillai 749878055a device-wide simple advanced preference (this commit does NOT make any toggles simple or advanced and only introduces the feature) 2026-11-25 20:37:42 -05:00
firestar5683 f2b5c13620 Use the correct wheelbase for the 2018 Yukon XL CC 2026-11-25 16:52:00 -06:00
firestar5683 5e7287a796 Keep verified steering evidence from shorter windows 2026-11-25 16:45:47 -06:00
firestar5683 139d8cbe03 Tolerate Model Y launch prediction noise at stops 2026-11-25 16:42:20 -06:00
Sam Yau 3670055c6b Subaru SNG: accept any counter advance for captured source validity
capture() stores only the CANParser's newest accepted sample per batch,
so when pandad batches two Throttle frames (100 Hz) into one packet the
stored counter advances by 2 and the strict previously-stored + 1
validity check flaps False for a tick. Each flap hard-resets StopAndGo's
standstill clock, which needs 51 consecutive ready frames, so the 3 kph
hold pulse never fires and EyeSight's standstill timeout drops ACC --
on essentially every SNG standstill. Replay of the 2026-11-24 incident
segment through the real interface/controller: the counter check was the
only failing gate (71/544 stop ticks) and the clock peaked at 24/51.

Validity now means the stored sample is the parser's current accepted,
checksum-verified sample whose counter advanced from the previously
stored one. A counter that does not advance is still never stored or
validated, and the sender's freshness gates still retire stale
samples. The panda keeps enforcing the strict +1 sequence on the raw
bus, where it sees every frame, before passing any modified frame.

Tests: capture() unit tests for batched delivery (including wraparound
and stalled counters), and a caller-level test with jittered Throttle
batching that reaches the hold pulse -- a delivery pattern the existing
caller harness cannot represent, since it feeds exactly one frame per
message per tick. With this change the incident replay produces hold
pulses (speed=True on 45 calls, clock peak 55, 17 spoofed frames)
instead of none.
2026-11-25 12:49:58 -08:00
firestar5683 b022663e6e Test Volt resume cadence with a controlled clock 2026-11-25 12:40:25 -06:00
firestar5683 4b70f5be81 Test Galaxy save ordering across concurrent logout 2026-11-25 12:19:54 -06:00
firestar5683 d1baceb3ef Split Galaxy component styles to keep assets within CI limits 2026-11-25 12:05:20 -06:00
firestar5683 dfa5c3490f Bump testing version to 7.0.3 2026-11-25 12:03:34 -06:00
Danny 4d6e2a3780 Build 2026-11-25 10:00:10 -08:00
Danny 2f508d507c Connections Page Polish 2026-11-25 09:58:34 -08:00
firestar5683 aec40a8288 Refresh prebuilt receipt for Companion Bot 2026-11-25 11:54:05 -06:00
natehuby76 ab0b4ccf54 move old starport reports to companion support 2026-11-25 12:43:07 -05:00
firestar5683 6cd506c47a Refresh prebuilt receipt for Companion Bot 2026-11-25 11:22:05 -06:00
natehuby76 6ef1123e86 separate staff messages from bot instructions 2026-11-25 11:56:45 -05:00
firestar5683 9ade0195e9 Fix Galaxy log relay lint failures 2026-11-25 10:49:26 -06:00
Danny b9f349c72d Show Fork name in Warning 2026-11-25 07:57:58 -08:00
Danny bb2cd1407e Build 2026-11-25 07:38:24 -08:00
natehuby76 83ebdc716b include android beta and request fresh app logs 2026-11-25 10:27:06 -05:00
natehuby76 e495c527ca request testing on the latest public iphone beta 2026-11-25 10:24:57 -05:00
natehuby76 7547aeeb5c reserve phone tags for mobile app reports 2026-11-25 10:17:41 -05:00
natehuby76 b4c2dfd8b2 unfollow the staff member who closes a ticket 2026-11-25 10:14:02 -05:00
natehuby76 1437f6b8f5 summarize issues in companion thread titles 2026-11-25 09:51:31 -05:00
natehuby76 0d8918edf8 send galaxy diagnostic summaries with staged logs 2026-11-25 09:49:00 -05:00
Danny 670e65d35a Build 2026-11-25 05:55:22 -08:00
Danny 0c52893246 Reporting: Make Clear to User Post Bug post is not yet live 2026-11-25 05:55:00 -08:00
ryan 4dbf3f18f5 leapmotor safety: limit the EPS effort word while openpilot steers
ADAS_LKA.LCC_RAMP sets how much effort the EPS may use to follow the angle
request. While LCC_STEERING_ACTIVE_COPY is set, the panda now only lets it
range from idle (0x7801) to 56 steps deep (0x4071), the deepest value the
car code's low-speed boost sends. Stock LCC goes to 46 steps. When openpilot
is not steering, the field is the camera's own value and is passed on.
2026-11-25 13:50:50 +01:00
ryan e6acb363ed leapmotor safety: cover every branch of the camera accel history
Ported from the upstream PR (commaai/opendbc#3936), where master now
requires full branch coverage and no surviving mutants. The history index
step is an explicit wrap instead of a modulo, where a decrement was an
equivalent mutant. Only rx-checked frames reach the hook, and on the camera
bus that is only ADAS_LKA, so the address check there could not be false.

New tests: every history slot starts inactive (not raw 0, -5 m/s^2), the
stock brake floor uses the least braking request anywhere in the history,
the inactive request is always allowed, another camera frame is not a
camera request, and without the longitudinal flag the request is not
checked.
2026-11-25 10:50:50 +01:00
ryan eb9f52a9fe leapmotor: announce a cruise cancel the car makes by itself
The B10's camera drops ACC on its own, for example when the front
passenger unbuckles (route 00000018, 21:25 CET): cruise turns off and
unavailable in the same frame, and openpilot only showed pcmDisable and
wrongCarMode, a soft chime and no message, at 52 km/h.

Such a cancel is now cruiseDisabled: TAKE CONTROL IMMEDIATELY, "Car
Cancelled Cruise". The driver's own cancels also make ACC_STATE 1, so
braking and the stalk pushed up (now reported as the cancel button) keep
the usual disengage. Replayed on the logged CAN: the passenger cancel and
two others on route 00000017 (18:47, 19:06) are announced; a brake cancel
and a stalk cancel are not.
2026-11-25 10:50:50 +01:00
ryan f0886a5a23 leapmotor: use the stricter override rule whenever the wheel follows openpilot
The bend rule (a89037f) only applied past 15 deg with the EPS pushing into
the turn, and removed 13 of the 38 let-gos after which the wheel sprang back.
Most of the rest happened at small angles. A driver who steers moves the wheel
off openpilot's angle first: all 101 let-gos that came with the wheel 3 deg or
more off are unchanged, including the driver holding it straight against a
12 deg command (route 00000010 23:18:35). With the rule applied whenever the
wheel follows within 3 deg, 37 of the 38 no longer happen at that moment.

A model of the EPS torque needed hands-off did not separate the cases: at
every kind of let-go the EPS was 60-70 above it.
2026-11-25 10:50:50 +01:00
ryan 704d27bfce leapmotor: keep steering through a held bend when the driver only rests a hand
In a held bend the EPS pushes 60-175 into the turn and the driver-torque
reading follows less of it than the EPS-share estimate assumes; the rest
looked like the driver turning further in, and the EPS set its own override
flag with it. openpilot let go mid-bend, the wheel sprang back 7-18 deg and
the car drifted wide (route 0000000a 12:30-12:31).

While the wheel is past 15 deg, within 3 deg of openpilot's angle and the
EPS pushes into the turn, torque in the EPS's direction counts only as far
as the raw reading shows it, and the flag needs torque against the EPS too.
Anywhere else the previous rule applies. Replayed on 8 drives: 13 of 218
let-gos removed, the wheel sprang back after every one; none removed where
the wheel stayed where the driver held it.
2026-11-25 10:50:50 +01:00
ryan fe89adeca1 leapmotor: offer the camera's speed limit to the speed limit controller
ROAD_SIGNS.SPEED_LIMIT, the limit the cluster shows, becomes the dashboard
source (DASH), expiring with the camera's frames. On route 00000010 it
followed the road signs, while the vision source held a misread 25 km/h
for 26 minutes.
2026-11-25 10:50:50 +01:00
ryan 25da2438a3 car: wrap the Platform union under the line limit 2026-11-25 10:50:50 +01:00
ryan 541af7124d leapmotor: describe the 56-step ramp boost as tested 2026-11-25 10:50:50 +01:00
ryan 81e08eb4f8 leapmotor: keep the ramp boost below the EPS's own override torque
Past about 150 of STEER_TORQUE_EPS the EPS sets DRIVER_OVERRIDE with the
driver's hands off and openpilot lets go: engaged frames with the flag were
0-1% below 130, 9% at 130-160 and 50% above 160 (route 00000005). In a
tightening turn at 25 km/h the boost drove the EPS to -167..-218 three
times; it let go each time and the wheel sprang back 25-30 deg. The boost
now holds from 100 and backs off from 120.
2026-11-25 10:50:50 +01:00
ryan 4b1644d4a6 leapmotor: treat the B10's CAN2 interrupt-rate fault as diagnostic
The B10's CAN-FD traffic keeps the panda's interruptRateCan2 fault set on
every pandaStates sample (also on upstream-based drives, where engagement
worked). Dom blocks engagement on any panda fault, so route 00000002 had
controlsMismatch from startup. Exempt only that fault for the B10, as Dom
does for qualified Honda, Hyundai and GM profiles; all other faults block.
2026-11-25 10:50:50 +01:00
ryan cf296a2c5d schema policy: review leapmotor @40 as a second SafetyModel addition
The policy allowed a single reviewed enum field per schema (teslaPreap @39).
It now takes a list of fields.
2026-11-25 10:50:50 +01:00
ryan fcb9fd0d39 leapmotor: curb weight 1780 kg, from the owner 2026-11-25 10:50:50 +01:00
ryan 544b9c0d6c leapmotor: add the Leapmotor B10 port to Dom
Car code, DBC, fingerprints and panda safety from the opendbc Leapmotor port
(commaai/opendbc#3936), with alpha openpilot longitudinal and the low-speed
ramp boost to 56 steps.

Adapted to Dom:
- safety mode 40 (39 is Tesla pre-AP here)
- CRC-8H2F through crc8_update, rx checks const
- CarSpecs mass (Dom still uses it)
- no steering-wheel button events for wheel_actions
2026-11-25 10:50:49 +01:00
firestar5683 caa3b2a0f3 Bind Hyundai publication fixture to platform enum 2026-11-25 02:31:51 -06:00
natehuby76 944e513e9f add official testing instructions to comma support 2026-11-25 01:16:59 -05:00
natehuby76 13ab471cc5 open private staff actions in older report threads 2026-11-25 01:02:49 -05:00
firestar5683 72aa8b89e1 Test Galaxy layout schema version 17 2026-11-25 00:01:06 -06:00
natehuby76 14babc867a open staff actions from the saved referral 2026-11-25 00:45:41 -05:00
natehuby76 69acfbb085 open staff actions privately from a ticket command 2026-11-25 00:41:25 -05:00
natehuby76 d4ddf420a5 match ticket colors and link fixes to testing requests 2026-11-25 00:33:35 -05:00
Raymond Nguyen 73eb7961d7 Honda Accord: angle steering for the modified EPS firmware 2026-11-24 23:29:49 -06:00
natehuby76 273f8b12e8 explain moved tickets to the reporter 2026-11-25 00:28:03 -05:00
natehuby76 cc36b77b65 share referral replies in the companion bot thread 2026-11-25 00:27:22 -05:00
natehuby76 3ab9f67c83 register the companion referral message command 2026-11-25 00:20:37 -05:00
firestar5683 df47158568 Fix Galaxy and C4 static analysis regressions 2026-11-24 23:11:51 -06:00
natehuby76 bc68e381ae recover companion referrals and confirm phone platform 2026-11-25 00:07:39 -05:00
Prabhaav Pillai f15af75c3a Adj Spot Monitoring for C4 2026-11-25 00:02:35 -05:00
natehuby76 1868dd0b90 update galaxy reporting and companion bot 2026-11-25 00:01:25 -05:00
firestar5683 5b21a4ba70 Retain stock MQB lateral intent after a fresh ACC Main cycle 2026-11-24 22:59:33 -06:00
firestar5683 6d5466a32f Scope Kona handoff helpers to supported builds 2026-11-24 22:52:34 -06:00
firestar5683 5dbc1d51b6 Qualify Kona factory steering handoff 2026-11-24 22:37:06 -06:00
firestar5683 48971bc6f9 Fix Galaxy route polling and CI regressions 2026-11-24 22:24:27 -06:00
firestar5683 6a958352e2 Restore continuous Kona factory steering handoff 2026-11-24 22:14:05 -06:00
firestar5683 bf8efea392 Recognize European 2019 Grand Cherokee diesel firmware 2026-11-24 21:34:19 -06:00
Danny 8f40396736 StarPort: Capture Brightness and Headunit Config in Logs 2026-11-24 17:52:26 -08:00
Raymond Nguyen b51d18fd56 honda: tidy the Accord carcontroller
Drop an extra blank line and a comment about an older tree; the prebuilt
receipt is refreshed for the source change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 17:44:47 -08:00
Raymond Nguyen ac77f9a20c honda: rebuild the panda firmware for the Accord angle setpoint check
Built from 25323cef46 with the ARM64 device build container (DEBUG cert, as the
tracked images are), and the prebuilt receipt refreshed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 17:26:38 -08:00
Raymond Nguyen 25323cef46 Honda Accord: angle steering for the modified EPS firmware
The 2020 Accord with EPS firmware 39990-TVA,A16C takes an angle setpoint in the
steering message. openpilot sends the setpoint, limited last by the 3.589 m/s^2
lateral acceleration and jerk limits, and the panda blocks any angle frame that
exceeds them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 17:22:01 -08:00
firestar5683 b094bcb4f7 Make the Lead Indicator editable in Galaxy 2026-11-24 19:19:31 -06:00
firestar5683 ca16979a38 Keep Model Y pedal handoff smooth through coast 2026-11-24 19:11:53 -06:00
firestar5683 fa0914406f Dampen Palisade HDA II steering corrections 2026-11-24 19:10:24 -06:00
natehuby76 f86381d823 refresh prebuilt receipt for galaxy changes 2026-11-24 18:17:04 -05:00
natehuby76 206a8554db update galaxy support, connections and parked sentry alerts 2026-11-24 17:49:43 -05:00
firestar5683 b32fc5ec98 Verify Galaxy Bluetooth and Uniden preview behavior 2026-11-24 15:33:39 -06:00
firestar5683 22d4d34405 Move Card CAN callbacks into a dedicated module 2026-11-24 14:31:33 -06:00
firestar5683 0b18c93532 Improve moving Model Y accelerator handoff 2026-11-24 14:01:04 -06:00
firestar5683 0f8f2a5ace Prepare steering feedback before Card enters its control loop 2026-11-24 13:53:50 -06:00
firestar5683 a1084ad630 Reduce straight-line steering oscillation on Sienna with four-byte smartDSU 2026-11-24 13:53:11 -06:00
firestar5683 6509fa1a00 Recognize stock Corolla CAN mirroring during startup 2026-11-24 13:52:59 -06:00
firestar5683 f06a781387 Smooth Palisade HDA II exit steering 2026-11-24 13:51:36 -06:00
firestar5683 5c20480f13 Soften Model Y scroll-wheel acceleration transitions 2026-11-24 13:48:26 -06:00
firestar5683 13b4344a06 Test Palisade idle forwarding and expiry 2026-11-24 13:21:51 -06:00
firestar5683 be196c0baa Check the current FLM source-time disclosure 2026-11-24 12:53:53 -06:00
firestar5683 bf0344ffd7 Repair testing safety and static CI regressions 2026-11-24 12:46:18 -06:00
firestar5683 24b5235ed5 Default lane centering to off on new installs 2026-11-24 12:40:28 -06:00
firestar5683 725a530d8e Refine Ioniq 5 HDA I steering damping 2026-11-24 12:36:09 -06:00
firestar5683 1a53844575 Damp steering transients on Ioniq 5 HDA I 2026-11-24 12:33:02 -06:00
firestar5683 eaeb680b0a Keep HKG HDA II steering streams exclusive 2026-11-24 12:21:38 -06:00
firestar5683 7e9e2b43b3 Fix Palisade HDA II steering handoff 2026-11-24 11:57:55 -06:00
firestar5683 d0a212be98 Finish FLM recording queues without redundant reads 2026-11-24 11:48:34 -06:00
dirwin31 c9fea63596 Merge pull request #346 from dirwin31/Uniden
Uniden Radar Muting and Screen Integration
2026-11-24 09:19:57 -08:00
Danny 8852c7bce6 Build 2026-11-24 09:16:56 -08:00
Danny 71a9228954 Uniden: Integration 2026-11-24 09:16:53 -08:00
firestar5683 63fe5bb3e1 Pause highway smoothing while steering is limited 2026-11-24 10:31:29 -06:00
firestar5683 697dcf29e0 Show repeated steering requests in FLM drive reviews 2026-11-24 09:44:02 -06:00
firestar5683 591c5fcf53 Resume Corolla TSS2 from a PCM hold behind moving traffic 2026-11-24 09:35:27 -06:00
clementatt 78303dda84 Translate StarPilot into Simplified Chinese 2026-11-24 09:30:29 -06:00
clementatt fb4468b347 Translate StarPilot into Simplified Chinese
Complete app_zh-CHS.po for the device UI and Galaxy (5565 entries,
all translated).

Rebuild the Noto Sans CJK SC subset from the upstream font so it
covers the original cmap plus every character in app_zh-CHS.po, and
record the source and subset hashes in Noto-SOURCE.txt.

app_zh-CHS.po now exceeds the 120 KiB text limit, so add it to the
large-file allowlist alongside the other catalogs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:28:11 +09:00
firestar5683 c707dd4938 Repair GM, Palisade and Galaxy CI fixtures 2026-11-24 01:18:20 -06:00
firestar5683 698a203cbc Test preference reset with the real navigation owner 2026-11-23 23:48:12 -06:00
firestar5683 db79a4620d Align Subaru and Toyota CI with current vehicle contracts 2026-11-23 23:43:42 -06:00
firestar5683 48fb24ee48 Repair alert and Galaxy test fixtures 2026-11-23 23:37:59 -06:00
firestar5683 22f010c1ac Requalify FLM source provenance after navigation changes 2026-11-23 23:27:58 -06:00
firestar5683 d89f221d06 Repair static analysis and settings CI regressions 2026-11-23 23:26:32 -06:00
firestar5683 07331b33e8 Keep Kona handoff compliant with native safety lint 2026-11-23 23:19:22 -06:00
natehuby76 951beb26be Merge pull request #347 from natehuby76/smooth-nav-braking 2026-11-24 00:15:40 -05:00
firestar5683 683435ac68 Cover Kona handoff and Subaru sibling alerts in safety CI 2026-11-23 23:11:17 -06:00
firestar5683 241e0a43d4 Fix Galaxy local pairing with a new password 2026-11-23 22:59:05 -06:00
natehuby76 fad5a9faaf keep nav turns from canceling lane changes 2026-11-23 23:58:46 -05:00
firestar5683 19b7edf344 Keep stock MQB AOL armed through the first Panda acknowledgment 2026-11-23 22:54:38 -06:00
natehuby76 ab02d5a44c smooth navigation braking between gps fixes 2026-11-23 23:46:51 -05:00
firestar5683 8a9f7a084c Revert second-Panda Hyundai HDA2 stock cruise fallback 2026-11-23 22:46:29 -06:00
firestar5683 e59fa4930a Keep second-Panda Hyundai HDA2 on stock cruise at startup 2026-11-23 22:42:06 -06:00
firestar5683 855dfb3a17 Smooth tight-curve steering on Ioniq 5 HDA II 2026-11-23 22:33:32 -06:00
firestar5683 026ce00b72 Add device restart to Galaxy 2026-11-23 22:30:31 -06:00
firestar5683 3728cea591 Fix switching software branches in Galaxy 2026-11-23 22:14:35 -06:00
firestar5683 bc1edc500d Restore Save Me cleanup in Galaxy 2026-11-23 21:48:54 -06:00
firestar5683 330a302aa1 Keep stock Prius CAN healthy when the gap button signal is absent 2026-11-23 21:46:54 -06:00
firestar5683 6e879b55da Remove Galaxy reset that erases Wi-Fi settings 2026-11-23 21:39:06 -06:00
firestar5683 059612c13a Retain Subaru AOL when Panda sees the paddle shift first 2026-11-23 21:37:53 -06:00
firestar5683 bbe680c127 Allow remote Galaxy factory reset requests 2026-11-23 21:34:06 -06:00
firestar5683 ceb0bea247 Add the native factory reset to Galaxy 2026-11-23 20:22:45 -06:00
AngusBell97 35c80054d3 Add Tesla Model 3/Y wheel controls and comma-set dashboard speed 2026-11-23 20:15:03 -06:00
firestar5683 6cfa8b9f25 Restore Honda Fit steering after extended EPS pauses 2026-11-23 20:10:22 -06:00
firestar5683 919363f4fa Keep classic Ford discovery on the normal CAN harness 2026-11-23 20:09:55 -06:00
firestar5683 131ad10d63 Allow on-road startup without cloud registration 2026-11-23 19:54:30 -06:00
firestarsdog 47346ad98b Jetlink +tici support in controller 2026-11-23 20:11:19 -05:00
firestar5683 9c5a5e5b86 Preserve Mazda AOL intent at a complete stop 2026-11-23 18:16:19 -06:00
firestar5683 ce47ff1da3 Set a minimum width for automatic lane changes 2026-11-23 18:15:00 -06:00
firestar5683 55269d0856 Port Frogger900’s 2025 Subaru HUD and AVH features 2026-11-23 17:04:41 -06:00
firestar5683 0da55d93ae Ramp Honda Fit steering torque after EPS pauses 2026-11-23 17:01:30 -06:00
firestar5683 6f73fad098 Port Frogger900’s 2025 Subaru HUD and AVH features 2026-11-23 16:58:09 -06:00
firestar5683 9da91c24af Apply Coast Downhills changes during the drive 2026-11-23 16:56:49 -06:00
firestar5683 bd2e523bfe Default second-generation Niro EV to StarPilot steering 2026-11-23 16:37:53 -06:00
firestar5683 70de2df8f2 Refine Palisade HDA2 camera timing and highway response 2026-11-23 16:32:15 -06:00
firestar5683 d461cad223 Soften Sonata low-speed center corrections 2026-11-23 16:25:26 -06:00
firestar5683 a8d1dd1d91 Confirm manual MQB startup steering within its deadline 2026-11-23 16:18:57 -06:00
firestar5683 2151b3c77b Fix model selection on the large device UI 2026-11-23 16:13:32 -06:00
dirwin31 e555faacc1 Merge pull request #345 from dirwin31/StarPortAdapterCarLogging
StarPort: Add Logging
2026-11-23 14:09:50 -08:00
Danny e7f5d5fd4e StarPort: Log why an adapter has no car and name the car that tried to connect 2026-11-23 14:08:52 -08:00
Claude 9a32c18941 Regenerate cereal's C++ files for the Tesla schema additions
custom.capnp gained stepUnits, sourceTeslaGesture, the TeslaGesture struct
and the cruiseStep action, but the generated files kept beside it were not
updated. The build rewrote them, so the complete custom pytest catalog job
saw built trees that differed from the commit and rejected all 32 passing
shards. These are the files the build's own capnpc command writes
(Cap'n Proto 1.0.1, the version that reproduces stable's copies exactly).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 22:07:39 +00:00
firestar5683 aafa97df61 Stabilize Palisade HDA2 steering and camera status 2026-11-23 15:51:25 -06:00
firestar5683 4f07a1ea4a Dampen longitudinal oscillation on four-byte filter Sienna 2026-11-23 15:49:30 -06:00
firestar5683 cf26c720f0 Restore the proven Kona steering handoff 2026-11-23 15:48:36 -06:00
firestar5683 ef38e75164 Preserve armed AOL through the speed ceiling 2026-11-23 15:48:29 -06:00
firestar5683 0ecbad2a41 Time out Connect registration during startup 2026-11-23 15:26:59 -06:00
firestar5683 ff9f0f0b33 Restore Kona factory steering while StarPilot is idle 2026-11-23 15:20:16 -06:00
firestar5683 d24bfcd0f3 Match Camry SE radar filter idle cruise messages 2026-11-23 15:18:23 -06:00
firestar5683 17ea1c3c3e Add independent TEMP gauge units to Galaxy 2026-11-23 15:11:39 -06:00
firestar5683 4ef3b1c2b4 Auto-detect the 2018 SASCM Volt CAN layout 2026-11-23 15:09:27 -06:00
firestar5683 f9bc75a3fd Clear stale Honda Fit steering integral after driver override 2026-11-23 15:05:38 -06:00
Claude f67edb6529 Tesla Model 3/Y: controls work with nothing saved, and three recovery fixes
- The input worker never parsed its settings on an install where CarControlAssignments had never been saved, so no
  scroll, stalk press or nudge reached the comma until a Wheel Controls row was changed. It now starts from the
  defaults.
- Saved assignments are used on either model: a Model 3 and a Model Y have the same controls. Before, a document
  saved on the other model gave no controls and locked every Wheel Controls row.
- Speed sync no longer waits for the Tesla's own speed to change after unanswered requests once the comma's speed is
  on the other side of the Tesla's (the Tesla had been at its own lowest or highest set speed).
- The UI restarts a stopped input worker after a wait that grows from 2 s to 30 s, instead of at most three times a
  drive. A first start that fails is retried on the same wait, not every frame.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 20:12:29 +00:00
firestar5683 fa66e9baac Show StarPilot release versions in update prompts 2026-11-23 12:57:37 -06:00
firestar5683 6dea0ec66c Allow downhill coasting from 1 percent grade 2026-11-23 12:37:02 -06:00
firestar5683 3fa425f769 Add Coast Downhills to Long Planner 2026-11-23 12:33:37 -06:00
Claude 7dbbb43c3b Add Tesla Model 3/Y wheel controls and comma-set dashboard speed
Everything here is limited to Tesla Model 3 and Model Y; other cars are unchanged. Most of it needs the Tesla CAN
add-on cable (Vehicle CAN).

Wheel Controls
- Right scroll wheel nudge left / right and holding either, right stalk half and full press while engaged, and a
  three-finger tap on the Tesla screen as assignable actions. Scroll up / down and stalk Down / Up are shown grayed,
  the scroll rows with their step (1, or to the next 5 for a fast scroll).
  Nudge right starts on Cycle Driving Personality.
- The three-finger tap's Always On Lateral on/off is chosen on its own row here: the Three-Finger AOL Tap row leaves
  Vehicle Settings, and TeslaAOLScreenTap is saved on by default.
- The Short press and Hold step rows are left out on a Model 3/Y, where StarPilot never steps the set speed from
  cruise buttons.
- A receive-only worker reads the wheel, stalk and screen frames. It only runs on a Model 3/Y with the cable.

Vehicle Settings
- Tesla CAN add-on cable row: detected or not, with buy and install links.
- Comma can set speed on Tesla dashboard (TeslaSpeedSync): off by default, experimental, needs the cable and Alpha
  Longitudinal, not offered on release builds. Takes effect within a second, without a restart.

With the switch on
- StarPilot keeps its own set speed; the right scroll wheel changes it by 1, or to the next multiple of 5.
- The Tesla's set speed is scrolled to match with right-scroll-wheel frames on Vehicle CAN, and scrolled back if the
  Tesla changes it.
- Speed Limit Controller writes the limit plus offset into the set speed instead of capping beneath it. Adopt limits
  early writes it early, and back again if the Maps preview is withdrawn. After an accelerator override: with Hold the
  speed you reached, lifting off above the limit makes the speed reached the set speed until the limit changes.

With the switch off, Speed Limit Controller and the set speed behave as before.

Also adds the Tesla dashboard speed limit (DAS_fusedSpeedLimit) as a Speed Limit Controller Dashboard source.

Panda: adds opendbc/safety/modes/tesla_speed_sync.h and safety-param bit 4096 (debug builds only), with tests. The bit
is set at startup on every eligible Model 3/Y so the switch works without a restart, so the images need rebuilding.
Always On Lateral's two exact-word checks accept the new bit. test_screen_recovery_callers.py and
test_tesla_screen_integration.py expect the bit on a car with the cable and StarPilot longitudinal.

Schema: SlcAction.ControllerCruiseAction gains stepUnits @13 and sourceTeslaGesture @14 (new TeslaGesture struct),
SlcAction.Kind gains cruiseStep @13. Settings keys: TeslaSpeedSync, CarControlAssignments.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 18:32:41 +00:00
firestar5683 777df8f6d8 Keep MQB AOL through a held-brake source handoff 2026-11-23 12:32:41 -06:00
firestar5683 f29ab3c676 Preserve Mazda lateral authority through Cancel deadline overlap 2026-11-23 12:31:11 -06:00
firestar5683 d197e09d3b Preserve Honda Fit AOL intent through EPS feedback reordering 2026-11-23 12:22:39 -06:00
firestar5683 24f65c6feb Recognize official StarPilot startup channels 2026-11-23 12:12:06 -06:00
firestar5683 cf2ddc0734 Complete verified FLM curve quieting trials 2026-11-23 11:55:09 -06:00
firestar5683 3693294b10 Show live thermal readings in Galaxy 2026-11-23 11:30:12 -06:00
firestar5683 0ea99a0128 Add Toggle Screen Off to Wheel Controls 2026-11-23 11:21:05 -06:00
firestar5683 981455ecc6 Keep parked FLM reads waiting for fresh status 2026-11-23 11:18:20 -06:00
firestar5683 2c53700269 Add a navigation turn slowdown distance slider 2026-11-23 11:14:41 -06:00
firestar5683 3393b7d698 Smooth Model Y manual cruise speed changes 2026-11-23 11:12:13 -06:00
firestar5683 ec4c158e20 Record Safe Mode in the route settings snapshot 2026-11-23 11:06:35 -06:00
firestar5683 1c087154ae Show detected stoplights while armed AOL is stationary 2026-11-23 11:01:37 -06:00
firestar5683 a46f9941e7 Keep Honda Fit AOL armed through delayed EPS feedback 2026-11-23 11:01:37 -06:00
firestar5683 47bbc2e1bf Show manual and learned FLM settings together 2026-11-23 10:51:54 -06:00
dirwin31 c0d7eeb09c Merge pull request #341 from dirwin31/HondaStarportToggles
Add Honda Starport Toggles
2026-11-23 07:44:03 -08:00
Danny 16786b6517 Build 2026-11-23 07:23:21 -08:00
Danny 00be4586e2 StarPort: Add wired hands-free toggle for cars that need it, and remove the Fit fix 2026-11-23 07:22:32 -08:00
firestar5683 0b0f216dff Rebalance lifecycle CI using current hosted timings 2026-11-23 02:15:32 -06:00
firestar5683 404ef33a96 Rebalance lifecycle CI using current hosted timings 2026-11-23 01:51:06 -06:00
firestar5683 b119731ad2 Recognize factory Camry radar and mirrored startup traffic for AOL 2026-11-22 23:58:51 -06:00
Sam Yau e71059b2d1 Subaru AOL: manual-mode ratio gears pause output, not intent 2026-11-22 23:54:37 -06:00
firestar5683 288027a08d Clarify Toyota factory ACC setting 2026-11-22 23:20:57 -06:00
firestar5683 0b5e75d9c5 Set StarPilot testing version to 7.0.2 2026-11-22 22:47:02 -06:00
firestar5683 9b25c7c0cc Share early Subaru steering and Cruise MAIN AOL 2026-11-22 22:33:21 -06:00
firestar5683 6ccf23ddb6 Share early Subaru steering and Cruise MAIN AOL 2026-11-22 22:31:35 -06:00
firestar5683 bb4840ab89 Restore early Crosstrek steering and Cruise MAIN AOL 2026-11-22 22:23:25 -06:00
firestar5683 7848780457 Restore early Crosstrek steering and Cruise MAIN AOL 2026-11-22 22:21:42 -06:00
firestar5683 b5931c365d Restore Toyota factory cruise selection in Vehicle Settings 2026-11-22 22:14:27 -06:00
firestar5683 6c2f6fc048 Show early Subaru Crosstrek in vehicle selection 2026-11-22 22:10:44 -06:00
firestar5683 3f5068a19b Retain Honda Fit AOL through brief EPS torque refusals 2026-11-22 22:04:12 -06:00
firestar5683 f7ef9b117c Capture parked status when an FLM read is interrupted 2026-11-22 22:03:37 -06:00
firestar5683 0972ef0d44 Keep Ford AOL armed through the Cancel safety echo 2026-11-22 22:02:26 -06:00
Sam Yau 459d2e6b94 Subaru AOL: manual-mode ratio gears pause output, not intent
In paddle/manual mode the Subaru transmission reports the simulated
ratio instead of D, which parses as GearShifter.unknown. The generic
disarming_fault() treated the resulting soft wrongGear event as a
disarming fault and cleared the AOL latch; with no fresh MAIN edge on
the return to Drive, AOL never resumed (pre-7.0 it resumed
automatically).

Add a Subaru-scoped intent_disarming_fault() that filters the soft
wrongGear event for qualified cars at unknown gear, dispatched like
the existing Volkswagen/Chrysler overrides. Output stays paused in
manual mode through the normal runtime and panda gates; only the
intent revocation is removed. Generic classification is unchanged.

Tests: openpilot/starpilot/car/subaru/tests/test_aol_manual_gear.py
2026-11-22 19:45:56 -08:00
firestar5683 e366cb0170 Make the Park-to-Drive audio test use a deterministic clock 2026-11-22 19:20:21 -06:00
firestar5683 81c66ef1ac Align camera, Ford and Mazda CI fixtures 2026-11-22 18:20:59 -06:00
firestar5683 645cca2086 Use real car state in the radar alert fixture 2026-11-22 17:24:29 -06:00
firestar5683 5ab912b3d4 Cover current Mazda admission in Switchback tests 2026-11-22 17:13:26 -06:00
firestar5683 1ffb6314f2 Pin the Bolt regen gear wire field in schema compatibility tests 2026-11-22 16:49:46 -06:00
firestar5683 791e9ee4ad Carry Bolt regen gear on the StarPilot car-state message 2026-11-22 16:40:27 -06:00
firestar5683 7da988976c Label Bolt L2 and L3 as regen gears in alerts 2026-11-22 16:26:18 -06:00
firestar5683 b94119ec3e Keep Honda Fit AOL independent of cruise minimum speed 2026-11-22 16:21:26 -06:00
firestar5683 cce15c82dc Restore executable mode on the process replay script 2026-11-22 16:10:52 -06:00
firestar5683 ede0735ffd Make replay startup alerts independent of the checkout channel 2026-11-22 16:08:09 -06:00
firestar5683 d98dfb489d Align unit fixtures with current alert and settings contracts 2026-11-22 15:47:31 -06:00
firestar5683 29b703d207 Restore executable mode and trim speed-limit help text 2026-11-22 15:20:16 -06:00
firestar5683 fce3f7d436 Keep HKG wheel AOL available with Alpha Long 2026-11-22 14:53:52 -06:00
firestar5683 a24192a582 Recover FLM reads after late status and unreadable endings 2026-11-22 14:51:16 -06:00
firestar5683 1f06ce685c Restore Niro EV AOL with camera-SCC Alpha Long 2026-11-22 14:49:21 -06:00
firestar5683 dda32b141c Maintain factory ACC Bolt brake demand until standstill 2026-11-22 14:27:25 -06:00
firestar5683 75757ab021 Set up Python for TrueNAS documentation checks 2026-11-22 14:15:32 -06:00
firestar5683 6da9182f6c Run testing documentation checks on TrueNAS 2026-11-22 14:14:29 -06:00
firestar5683 870bd63ff4 Refresh the prebuilt receipt after StarPort and speed limit updates 2026-11-22 14:10:32 -06:00
firestarsdog 2535ee3901 Make SLC follow the newest speed limit instead of switching sources on dropouts 2026-11-22 15:06:17 -05:00
dirwin31 6d4b357e1f Merge pull request #334 from dirwin31/FixHeadunitFix
StarPort: Add experimental phone services fix for 2018 Honda Fit
2026-11-22 11:48:55 -08:00
firestar5683 68ef096322 Damp highway curve steering on Ioniq 5 HDA II 2026-11-22 13:42:05 -06:00
firestar5683 d8439a094b Use standard startup reminder on official StarPilot channels 2026-11-22 13:39:18 -06:00
firestar5683 2a2594b697 Keep full-range GM ACC active below its entry speed 2026-11-22 13:34:47 -06:00
firestar5683 2223a9d371 Keep factory ACC Bolt braking below the cruise entry speed 2026-11-22 13:33:34 -06:00
firestar5683 b25bbb8c78 Allow low-speed steering on verified Mazda CX-5 EPS swap 2026-11-22 13:32:39 -06:00
leomonde 16806d8a93 Integrate Volvo V60 (EUCD) support 2026-11-22 13:28:17 -06:00
firestar5683 ae4df1725c Show the Low gear requirement on early Bolt pedal profiles 2026-11-22 13:23:41 -06:00
firestar5683 f2c632ef11 Update Mazda, GM and Auto Learn regression fixtures 2026-11-22 13:13:18 -06:00
Danny ea17311f8c StarPort: Add experimental phone services fix for 2018 Honda Fit 2026-11-22 11:13:08 -08:00
firestar5683 a3c73c70e5 Keep legacy Mazda discovery on normal CAN wiring 2026-11-22 12:54:46 -06:00
leomonde 5fbcdffece Merge remote-tracking branch 'upstream/testing' into volvo-v60-eucd 2026-11-22 15:45:18 -03:00
firestar5683 972dd457c5 Restore stock cruise engagement and AOL on legacy Mazda CX-5 2026-11-22 12:15:53 -06:00
firestar5683 19122ea4e2 Report FLM verification and parked interruptions clearly 2026-11-22 11:55:14 -06:00
firestar5683 46c17cc1aa Keep exact Honda Nidec discovery on bus zero 2026-11-22 11:54:12 -06:00
firestar5683 d3f179e766 Update testing to verified AGNOS 20.5.5 2026-11-22 11:53:18 -06:00
firestar5683 cd65e68b60 Discover Honda Fit firmware on normal CAN bus 2026-11-22 11:48:58 -06:00
firestar5683 31f8918db7 Roll Testing back to AGNOS 20.5.3 2026-11-22 11:08:18 -06:00
firestar5683 e4f363003b Fix disabled Alpha Long startup and busy Bluetooth recovery 2026-11-22 10:57:08 -06:00
firestar5683 f36af88b54 Skip torque-only parked review for non-torque steering 2026-11-22 10:52:19 -06:00
firestar5683 ec59d25227 Keep the UI running when camera EGL import is unavailable 2026-11-22 10:49:07 -06:00
firestar5683 8687966c6d Extract Card native AOL handler selection 2026-11-22 10:42:10 -06:00
firestar5683 91683efbf6 Restore the two Firestar AGNOS mirrors 2026-11-22 01:06:38 -06:00
firestar5683 73e593514d Verify AGNOS mirror fallback and cruise initialization order 2026-11-22 00:19:10 -06:00
firestar5683 549a28fa9f Fix AGNOS staging expectations and restore source size limits 2026-11-21 23:54:09 -06:00
firestar5683 ea704cb66d Match fresh speed limits on Redneck Cruise SET 2026-11-21 23:45:33 -06:00
Frogger900 fd9cd41a68 Package Frogger900’s 2025 Subaru Legacy port 2026-11-21 23:44:15 -06:00
Frogger900 d4fac91919 Integrate Frogger900’s 2025 Subaru Legacy port 2026-11-21 23:39:18 -06:00
firestar5683 80c21b10dc Read current radar lead state in Redneck Cruise 2026-11-21 23:12:13 -06:00
firestar5683 50e0e7241a Update testing to verified AGNOS 20.5.4 2026-11-21 23:10:13 -06:00
firestar5683 d7f509b98a Enable speed limit settings for Redneck Cruise 2026-11-21 22:10:05 -06:00
firestar5683 5561759a77 Verify the Highlander sDSU engagement floor in factory tests 2026-11-22 03:35:21 +00:00
firestar5683 3e34e48f91 Separate FLM tracking tests from release receipt validation 2026-11-21 21:07:10 -06:00
firestar5683 cf1ecc9aff Verify Highlander lateral permission through braking 2026-11-21 21:03:55 -06:00
firestar5683 9f954d2909 Exercise Highlander low-speed lateral checks with stock ACC 2026-11-21 20:47:35 -06:00
firestar5683 c8abbd740b Allow low-speed engagement on Highlander with supported sDSU 2026-11-21 20:36:20 -06:00
firestar5683 1f0455554b Cover Outback release safety configuration rejection 2026-11-21 20:31:54 -06:00
firestar5683 730713bb89 Enable stock cruise steering on the 2015–17 Subaru Outback 2026-11-21 20:23:31 -06:00
firestar5683 85a2f5b786 Enable stock cruise steering on the 2015–17 Subaru Outback 2026-11-21 20:18:49 -06:00
firestar5683 b739b32844 Allow reported CAN2 diagnostics on stock CAN-FD Hondas 2026-11-21 20:15:20 -06:00
firestar5683 403c79eaff Align steering controller regression fixtures 2026-11-21 19:49:04 -06:00
firestar5683 87a57e5359 Expose calibrated steering controller choices in developer parameters 2026-11-21 19:26:35 -06:00
firestar5683 4603d87068 Align Panda and AGNOS tests with current firmware checks 2026-11-21 18:14:06 -06:00
firestar5683 0db704125d Prefer Dropbox for AGNOS downloads 2026-11-21 17:14:02 -06:00
firestar5683 0c57d72897 Update AGNOS test fixtures for mirror downloads 2026-11-21 17:07:58 -06:00
firestar5683 2cf77aa2de Use AGNOS mirrors for download failover 2026-11-21 17:04:58 -06:00
firestar5683 19a135ff10 Keep Trax braking below the cruise engagement speed 2026-11-21 16:50:07 -06:00
firestar5683 08c2199599 Build Panda firmware for MQB HUD ownership 2026-11-21 16:31:45 -06:00
firestar5683 122a248050 Give the MQB cluster one lane assist HUD source 2026-11-21 16:28:47 -06:00
firestar5683 c67b1c074a Recover incompatible internal Panda bootstubs 2026-11-21 16:22:30 -06:00
Frogger900 d91e913953 subaru: fix subaru_avh_count MISRA width and Legacy 2025 startup dash test assertions 2026-11-21 17:11:53 -05:00
firestar5683 d907949650 Preserve internal Panda identity across recovery reset 2026-11-21 16:06:07 -06:00
leomonde 6738edad1a Keep the V60 out of the shared CMA/V40 test fixtures 2026-11-21 18:50:22 -03:00
firestar5683 c1f7468fff Use normal diagnostic wiring for mixed CAN Palisade startup 2026-11-21 15:39:59 -06:00
leomonde ba10c64889 Fix fleet coverage count and wrap long line for the V60 2026-11-21 17:10:04 -03:00
firestar5683 6bf5e14704 Run full CI for Stable pull requests 2026-11-21 13:53:08 -06:00
firestar5683 b2e84e4a11 Model the C3 mount root in storage tests 2026-11-21 13:49:21 -06:00
leomonde ede83a74d1 Volvo V60 (EUCD): add platform 2026-11-21 16:37:28 -03:00
firestar5683 80aae010ee Allow legacy C3X Panda flash erase to complete 2026-11-21 13:14:17 -06:00
firestar5683 91a070023d Migrate legacy C3X Panda firmware during startup 2026-11-21 12:55:51 -06:00
firestar5683 28a6cf1133 Show mounted tici NVMe storage in Galaxy 2026-11-21 12:49:14 -06:00
firestar5683 ee7b5d66be Refresh prebuilt receipt after Polaris copy update 2026-11-21 12:27:50 -06:00
zikeji 058f28ed2f Merge pull request #331 from StarPilotHQ/polaris-about-text
Update the Polaris model info: not tied to RDFv4, link polaris.firestar.link
2026-11-21 13:25:36 -05:00
firestar5683 faef0b43ee Use real vehicle params in SLC settings tests 2026-11-21 12:24:34 -06:00
firestar5683 193835d88d Use real vehicle params in optional feature tests 2026-11-21 12:09:16 -06:00
firestar5683 4218e46640 Fix Hyundai safety and regression checks 2026-11-21 12:08:19 -06:00
Zikeji c0a70d3d87 Update the Polaris model info: not tied to RDFv4, link polaris.firestar.link 2026-11-21 12:59:28 -05:00
firestar5683 64e4411939 Restore Redneck Cruise for conventional cruise Hyundai profiles 2026-11-21 11:27:31 -06:00
firestar5683 f06dfafff0 Build matching Panda firmware for Gen2 Bolt pedal state 2026-11-21 11:20:41 -06:00
firestar5683 5bf72b4a2c Accept the Bolt Gen2 CC interceptor state 8 2026-11-21 11:18:20 -06:00
firestar5683 e9d7d1610f Add longitudinal developer tuning controls 2026-11-21 11:15:12 -06:00
firestar5683 e44319a142 Allow FLM analysis during Force Offroad 2026-11-21 11:07:14 -06:00
firestar5683 94473780e8 Fix Kona dash handover and wheel assignment display 2026-11-21 11:06:14 -06:00
Frogger900 cb3ebdd09e subaru: add 2025 Legacy AOL, angle control, HUD/DBC, AVH, twitch guard, and standstill BSM mute 2026-11-21 10:18:43 -05:00
firestarsdog 81dc63dac6 Torque Bar: Stop Fill Crossing Center 2026-11-21 03:53:16 -05:00
firestarsdog 448a673630 Modem: Disable SIM Detection on comma 3 to Fix Missing SIM 2026-11-21 03:19:21 -05:00
firestar5683 9d88359d20 Lead the testing README with StarPilot 7.0 features 2026-11-21 01:35:27 -06:00
firestar5683 8c0826a61f Wait for Volvo readiness publication in lifecycle tests 2026-11-21 01:16:48 -06:00
firestar5683 008b0cbcf1 Wait for Volvo readiness publication in lifecycle tests 2026-11-21 01:16:44 -06:00
firestar5683 8d487d0dc5 Preserve Mach-E stock ACC steering through bounded source waits 2026-11-21 00:38:31 -06:00
firestar5683 4241d07dc8 Set StarPilot testing version to 7.0.1 2026-11-21 00:38:06 -06:00
firestar5683 1faca4bed4 Invite PR authors to open a StarPilot Discord ticket 2026-11-20 23:42:08 -06:00
firestar5683 1aa4f9ce50 Verify manual Volkswagen reverse startup against its steering deadline 2026-11-20 21:31:10 -06:00
firestar5683 bd2dba096c Verify low-speed cruise refresh after a Card settings read failure 2026-11-20 21:31:10 -06:00
firestar5683 6d9b146eea Describe low-speed cruise start in Galaxy 2026-11-20 20:07:02 -06:00
firestar5683 ec9cd685b9 Add an optional vehicle-minimum cruise start 2026-11-20 19:55:08 -06:00
firestar5683 3508aba53d Wait for healthy manual MQB startup before arming lateral 2026-11-20 19:49:02 -06:00
firestar5683 ef3b03444c Keep Galaxy widget previews visible while editing 2026-11-20 19:15:36 -06:00
Danny e29879ca79 Bluetooth: Fix Home indicator showing off when a paired iPhone is cached 2026-11-20 19:07:50 -06:00
Danny 14fe0d040d Speed Limit: Keep the Confirmation Steady Through Map Dropouts 2026-11-20 19:07:49 -06:00
Danny 602b54181c Widgets: Load Faster, Keep Scenes in Sync, Tighter Speed Outline, Fix Clicking on Desktop 2026-11-20 19:07:48 -06:00
Danny c82db4bc03 StarPort: Default AA Fallback, Fallback IP, and Skip Step 1 for Unofficial Dongles 2026-11-20 19:07:47 -06:00
Danny d7b3560862 StarPort Logs: Require a Note, Warn on Custom Forks, Log the Repo 2026-11-20 19:07:46 -06:00
firestar5683 256924b83c Keep FLM learning with inactive legacy GM tunes 2026-11-20 17:49:26 -06:00
firestar5683 028cbb9df4 Explain saved GM settings that pause FLM 2026-11-20 17:31:16 -06:00
firestar5683 92f4cbe228 Pass explicit source paths in FLM identity tests 2026-11-20 15:55:56 -06:00
firestar5683 829c5ce6c8 Preserve historical FLM identity guard regression coverage 2026-11-20 15:53:55 -06:00
firestar5683 ee3aa066f8 Keep FLM active with a fixed manual proportional gain 2026-11-20 15:41:49 -06:00
firestar5683 ee82c843ca Expose controller-bound proportional gain in steering settings 2026-11-20 15:15:52 -06:00
firestar5683 9e869ef085 Extract lateral pause conditions under the source size limit 2026-11-20 15:12:51 -06:00
firestar5683 212b1d7eef Initialize Turn Assist in the shared Controls test fixture 2026-11-20 15:01:34 -06:00
firestar5683 57135a1f28 Preserve MQB lateral intent through brake withdrawal 2026-11-20 15:00:43 -06:00
firestar5683 f8e110a1ac Opt in before signaling in automatic turn tests 2026-11-20 14:18:09 -06:00
firestar5683 64a28c5877 Update replay expectations for signaled Turn Assist 2026-11-20 14:05:38 -06:00
firestar5683 f84e678554 Keep FLM findings and manual choices for the same vehicle fingerprint 2026-11-20 13:53:26 -06:00
firestar5683 b00d753a24 Recover Polestar stock relay after a receive backlog 2026-11-20 13:50:54 -06:00
firestar5683 4e0e99039a Explain why FLM findings cannot be accepted 2026-11-20 13:42:44 -06:00
firestar5683 5da0140842 Repair turn fixtures and StarPort layout validation 2026-11-20 13:23:21 -06:00
firestar5683 43b1ea1b34 Bound Tesla radar callback regression tests 2026-11-20 13:17:57 -06:00
firestar5683 508409e6ba Update FLM clock provenance for reviewed model turn guidance 2026-11-20 13:17:56 -06:00
firestar5683 aef357ce92 Select ION buffers for device camera builds 2026-11-20 13:03:36 -06:00
firestar5683 be463c0905 Show torque and delay learning percentages 2026-11-20 12:58:48 -06:00
firestar5683 013d9753e0 Calm RAV4 TSS2 low-speed center corrections 2026-11-20 12:58:47 -06:00
firestar5683 b5b3b8b80f Keep FLM vehicle status stable and explain parked analysis waits 2026-11-20 12:27:05 -06:00
firestar5683 5a88d1c7c1 Separate automatic turn initiation from low-speed turn assistance 2026-11-20 11:52:45 -06:00
firestar5683 08d23a48e9 Add optional steering wheel rotation to Big UI 2026-11-20 11:42:01 -06:00
firestar5683 7181662d12 Model explicit tuning locks in FLM browser fixtures 2026-11-20 11:18:52 -06:00
firestar5683 eac912d9ad Bound Volvo and Tesla HW1 native callback regressions 2026-11-20 11:18:52 -06:00
firestar5683 06f2da46ad Distinguish confirmed FLM changes from manual overrides 2026-11-20 11:04:54 -06:00
firestar5683 38e7b89f66 Exercise Tesla initialization in isolated native regressions 2026-11-20 09:03:28 -06:00
firestar5683 03d6f7b445 Bound Tesla native checksum callback regressions 2026-11-20 08:58:37 -06:00
firestar5683 84592f6012 Cover Toyota AOL hold experience combinations 2026-11-20 08:53:43 -06:00
firestar5683 3bbd0280a6 Check individual Toyota wheel-speed quality faults 2026-11-20 08:42:06 -06:00
firestar5683 fbc192941d Keep stopped Ford leads out of independent light holds 2026-11-20 08:40:48 -06:00
firestar5683 2568d806e4 Keep FLM findings available across drive analyses 2026-11-20 08:26:51 -06:00
firestar5683 8a301fa02f Restore wheel personality callbacks and repair Developer tests 2026-11-20 08:09:54 -06:00
firestar5683 6232db5ce0 Cover Honda transmit bounds and Toyota filter profiles 2026-11-20 08:09:54 -06:00
firestar5683 555dac7d12 Restore Ford steering-wheel speed-limit confirmation 2026-11-20 07:55:17 -06:00
firestar5683 cb3bfc720b Preserve stopped Subaru AOL intent after brake release 2026-11-20 07:49:06 -06:00
firestar5683 6709d6743d Renew SPI reply timeout after valid CAN backpressure 2026-11-19 22:48:05 -06:00
Prabhaav Pillai 4e86f60665 Cleanly restore Reset Driver Monitoring and Reset Calibration into Developer 2026-11-19 23:03:21 -05:00
firestar5683 8af946ac09 Retry speed-limit wheel actions within their original lifetime 2026-11-19 21:54:35 -06:00
firestar5683 1cd4feed89 Cover Honda callback bounds and RDX gas limits 2026-11-19 21:50:55 -06:00
firestar5683 e5ea759719 Separate usable steering samples from complete native history checks 2026-11-19 21:33:27 -06:00
firestar5683 cf4c99e7fa Fix stopped-traffic departure chimes 2026-11-19 21:30:25 -06:00
firestar5683 0e8e2bc468 Cover Honda alternate steering and supplemental payloads 2026-11-19 21:29:26 -06:00
firestar5683 033f8725f4 Record modem initialization failures in route logs 2026-11-19 21:20:38 -06:00
firestar5683 df9be543f4 Cover Honda safety configuration bounds 2026-11-19 20:42:18 -06:00
firestar5683 046e084c86 Requalify the Volkswagen producer source pin 2026-11-19 20:31:21 -06:00
firestar5683 10cb116607 Keep transport comments within lint limits and assert visible sign bounds 2026-11-19 19:41:57 -06:00
firestar5683 d4decb9018 Recover manual MQB AOL transitions and match Polaris steering filtering 2026-11-19 19:21:50 -06:00
firestar5683 ed9e871b35 Reconcile Mazda input and repair the speed slider regression test 2026-11-19 19:10:26 -06:00
firestarsdog cc2ff90032 Remove redundant speed limit actions widget and status line 2026-11-19 19:40:20 -05:00
firestar5683 63f4b4b07c Restore the working Polestar counter fix 2026-11-19 18:37:33 -06:00
firestar5683 6fc0173aad Include registered vehicle callers in safety mutation tests 2026-11-19 18:01:58 -06:00
firestar5683 782a00c69f Build strict Polestar steering status counters 2026-11-19 17:56:29 -06:00
firestar5683 4cd84f603c Preserve Subaru AOL intent while waiting for steering authority 2026-11-19 17:40:07 -06:00
firestar5683 39de0fe3e6 Restore strict Polestar steering status counters 2026-11-19 17:39:24 -06:00
firestar5683 bd9206cc83 Restore Galaxy driving toggles to Developer 2026-11-19 17:27:55 -06:00
Michael Tawata 9dee2cb5ae fix agnos download status output 2026-11-19 14:16:40 -08:00
firestar5683 36c071f878 Refresh the qualified timezone source receipt 2026-11-19 16:14:07 -06:00
prabhaavp 6a7e462a4b Merge pull request #325 from dirwin31:TimeZoneLookup
Time: Set the timezone automatically from GPS
2026-11-19 16:55:19 -05:00
Prabhaav Pillai 107c3a0bfc add error checks in timezone grid and update tests 2026-11-19 16:54:12 -05:00
firestar5683 c4c7918066 Validate mutation baselines and cover blended gesture reset 2026-11-19 15:47:27 -06:00
prabhaavp dc1eef9f6a Merge pull request #324 from dirwin31/NetworkJetlinkWidgets
Widgets: Connections widget and Big model widget
2026-11-19 16:37:18 -05:00
Prabhaav Pillai 45e696673c Refactor signal handling and improve widget scaling logic; enhance Bluetooth and network signal tests 2026-11-19 16:36:27 -05:00
firestar5683 e5acca9a4e Cover Volvo C1 standstill and individual brake bits 2026-11-19 15:21:21 -06:00
prabhaavp 8f02bf3553 Merge pull request #323 from dirwin31:HotspotDriveJoin
Network: Join phone hotspots during drives without long pauses
2026-11-19 16:16:12 -05:00
prabhaavp 2002676bbb Merge branch 'testing' into HotspotDriveJoin 2026-11-19 16:15:53 -05:00
Prabhaav Pillai 14f802360a Enhance drive join functionality with cancellation support and improved logging 2026-11-19 16:14:37 -05:00
firestar5683 76be59d31a Include vehicle alias suites in safety mutation tests 2026-11-19 15:14:22 -06:00
firestar5683 f9f5a6bfab Preserve unowned CCNC faults in interface coverage 2026-11-19 13:50:58 -06:00
firestar5683 453bf0ff61 Keep curve braking distinct and reserve CPU for browser checks 2026-11-19 13:16:34 -06:00
firestar5683 eb73e3d031 Refresh the qualified SLC planner source receipt 2026-11-19 12:49:18 -06:00
firestarsdog 9272ea86cb Soften the brake onset after SLC overshoots 2026-11-19 13:18:41 -05:00
firestar5683 b0090d08a7 Keep AOL source within the lint size limit 2026-11-19 12:05:51 -06:00
firestar5683 537f76118a Preserve Honda AOL through Cancel and brake handoffs 2026-11-19 12:01:36 -06:00
firestar5683 d4e19a6879 Restore Kona Electric CCNC display support 2026-11-19 11:53:33 -06:00
firestar5683 1b1bcb6058 Finish browser profile cleanup without hiding test errors 2026-11-19 11:24:08 -06:00
firestar5683 4793397f75 Remove the added stationary light-release countdown 2026-11-19 10:29:03 -06:00
firestar5683 22a3945dec Keep Subaru diagnostics valid with AOL disabled 2026-11-19 10:28:01 -06:00
firestar5683 6c600907c4 Collect every Subaru EPS recovery ordering case 2026-11-19 10:06:16 -06:00
firestar5683 ed496af008 Preserve Subaru AOL across temporary steering event joins 2026-11-19 09:47:12 -06:00
firestar5683 99bf32fc5d Keep CI fixtures isolated and browser capture fast 2026-11-19 09:40:22 -06:00
Danny 50d34d3537 Time: Set the timezone automatically from GPS 2026-11-19 07:36:27 -08:00
firestar5683 8a5d1f1157 Soften Ioniq 6 highway friction corrections 2026-11-19 09:10:20 -06:00
firestar5683 ab3379d544 Restore speed display adjustment 2026-11-19 08:58:56 -06:00
firestar5683 1468cd47d0 Enable optional cooperative steering for Tesla Model Y 2026-11-19 08:56:14 -06:00
firestar5683 58d2b955f7 Hold CCNC warning ownership through lateral pauses 2026-11-19 08:49:46 -06:00
Danny cfe3a8f5ef Network: Keep older Connections layouts on screen after the card grew 2026-11-19 06:05:22 -08:00
Danny 92359abdd3 Network: Connections widget with Wi-Fi, cellular and Bluetooth status 2026-11-19 06:05:22 -08:00
Danny 1e7839f936 JetLink: Big model widget shows which model drives and the Jetlink or Chestnut state 2026-11-19 06:05:22 -08:00
Danny 0563f12f7b Network: Join phone hotspots during drives without long pauses 2026-11-19 05:25:27 -08:00
firestar5683 384f789634 Extract the cruise receipt helper and type the sidebar fixture 2026-11-19 01:56:17 -06:00
firestar5683 1b1bc10d57 Recognize default GitHub CI package setup 2026-11-19 01:52:48 -06:00
firestar5683 c6f4ed5705 Bound CI package mirror network waits 2026-11-19 01:33:41 -06:00
firestar5683 4950b6f2c1 Reduce browser CI round trips without relaxing checks 2026-11-19 00:41:37 -06:00
firestar5683 1eb46394e1 Review additive perceived-stop schema in incumbent compatibility tests 2026-11-19 00:30:07 -06:00
firestar5683 6083bb4737 Bind manual MQB startup arming to fresh Drive feedback and its original deadline 2026-11-19 00:16:30 -06:00
firestarsdog 30a9e4e250 Show upstream offroad alerts and update prompts on the StarPilot home
The StarPilot home replaced upstream's home without its offroad alert
check, so alerts such as Offroad_ExcessiveActuation (which blocks
engagement until acknowledged) and update prompts never appeared.

Large UI: the StarPilot home now runs upstream's 10 s alert refresh and
draws upstream's UPDATE / ALERTS header pills. While an alert or update
panel is open, upstream's home renders instead, with its Close,
Acknowledge, Snooze and Update buttons; Close returns to the StarPilot
home. Upstream HomeLayout moves its refresh into _update_state and its
pills into _render_notifs so both homes share them unchanged.

Compact UI: the StarPilot home draws upstream's alerts pill, and a tap
in upstream's alerts zone scrolls to the alerts page (settings when no
alert is active).
2026-11-19 01:10:28 -05:00
firestar5683 afcbe5bcf6 Reapply "app download reminder UI with improved dismissal options and updated messaging"
This reverts commit 347e078fd3.
2026-11-19 00:05:53 -06:00
firestar5683 fb7c158245 Keep Ford PCM cruise buttons separate from SLC confirmation 2026-11-18 23:56:52 -06:00
firestar5683 256b6062f2 Start C3 UI in the background before graphics 2026-11-18 23:36:01 -06:00
firestar5683 b6676c937c Qualify the scoped Ford and Volkswagen target build 2026-11-18 23:24:36 -06:00
firestar5683 82daba5053 Fix Ford AOL receipt ordering and scope Volkswagen lookup 2026-11-18 23:14:26 -06:00
firestar5683 fd052d15fb Retain fresh braking proof for confirmed stop signs 2026-11-18 17:55:38 -06:00
Codex 7c3dc20ea9 Qualify StarPort radio monitoring and Canadian map package 2026-11-18 17:46:47 -06:00
firestar5683 0926c7e82b Extract StarPort shared-radio watcher without changing session behavior 2026-11-18 17:35:56 -06:00
Dom f709a0717d Restore executable modes for Python entry points 2026-11-18 17:30:41 -06:00
Prabhaav Pillai 347e078fd3 Revert "app download reminder UI with improved dismissal options and updated messaging"
This reverts commit 34dfc79ddb.
2026-11-18 18:12:47 -05:00
firestar5683 5304bd7422 Accept Canadian province catalogs while preserving legacy validation 2026-11-18 17:09:46 -06:00
Codex afcd2179fc Add Canadian province and territory offline map choices 2026-11-18 16:51:41 -06:00
Prabhaav Pillai 34dfc79ddb app download reminder UI with improved dismissal options and updated messaging 2026-11-18 17:49:38 -05:00
Dom cfe7f009e2 Clarify regression-test types without changing runtime behavior 2026-11-18 16:46:30 -06:00
Codex 897a5b3ffe Bind VIN-unknown learning to registered-device ECU configuration 2026-11-18 16:29:32 -06:00
OpenAI 20f595be4d Preserve Honda stock ACC AOL through EPS recovery 2026-11-18 22:19:12 +00:00
Codex 5b9d3f393e Bind VIN-unknown learning to registered-device ECU configuration 2026-11-18 16:18:32 -06:00
Dom ab5d56e978 Reconcile Honda EPS recovery with current lateral callers 2026-11-18 16:06:30 -06:00
Codex 4d8acf425a Bind VIN-unknown learning to registered-device ECU configuration 2026-11-18 16:01:57 -06:00
Codex 1b10495880 Bind VIN-unknown learning to registered-device ECU configuration 2026-11-18 16:00:25 -06:00
Codex 5fd484638d Bind VIN-unknown learning to registered-device ECU configuration 2026-11-18 15:59:56 -06:00
firestar5683 66edd7e1df Encode legacy Kona SCC14 acceleration bounds 2026-11-18 15:58:35 -06:00
firestar5683 aa2584380f Keep live steering settings reads out of the control cycle 2026-11-18 15:56:40 -06:00
Dom 7fc0a17c63 Preserve Honda stock ACC AOL through EPS recovery 2026-11-18 15:48:08 -06:00
Codex 1469d5ba8f Show parked analysis progress and refresh findings before explicit acceptance 2026-11-18 15:33:44 -06:00
Dom 0b47a7cbd1 Preserve Honda AOL across stock ACC EPS recovery boundaries 2026-11-18 15:30:58 -06:00
firestar5683 0da29b965d Refresh qualified Galaxy wiki-link prebuilt receipt 2026-11-18 15:20:34 -06:00
Codex 15aa844a60 Bind VIN-unknown learning to registered-device ECU configuration 2026-11-18 15:18:02 -06:00
Codex 12eb1528fb Show parked analysis progress and refresh findings before explicit acceptance 2026-11-18 15:16:49 -06:00
Codex 3a9e8f90c7 Show parked analysis progress and refresh findings before explicit acceptance 2026-11-18 15:15:37 -06:00
Prabhaav Pillai f22542bedf Update the app link to firestar link and also add wiki links galaxy wide 2026-11-18 16:13:34 -05:00
Dom 81c26d893a Retain Honda stock ACC AOL through bounded EPS recovery 2026-11-18 15:05:59 -06:00
firestar5683 7ade6bc471 Keep uptime persistence out of the hardware health loop 2026-11-18 14:59:42 -06:00
Codex 57c7f9ebf7 Show parked analysis progress and refresh findings before explicit acceptance 2026-11-18 14:55:06 -06:00
Danny d71d6623bf StarPort: Ask for one tap to set up touch on cars that report video pixels 2026-11-18 14:53:04 -06:00
Dom 69f6b08c07 Recover intact dashboard route coverage without completed-drive claims
Adapt dashboard-only recovery from squilliam2's dom fork. Preserve strict completed-drive evidence, source repair replacement, bounded offroad work and existing diagnostics.
2026-11-18 14:52:48 -06:00
firestar5683 e0d1e051cb Refresh qualified Theme Maker prebuilt receipt 2026-11-18 14:51:11 -06:00
Codex 42ba4843bf Show parked analysis progress and refresh findings before explicit acceptance 2026-11-18 14:44:45 -06:00
Codex 5ba72533f7 Show FLM drive-analysis progress and refresh findings before saving 2026-11-18 14:40:30 -06:00
prabhaavp cb27d90dad Merge pull request #320 from dirwin31:ThemeMakerAdjustments
Theme Maker: PiP ordering and locks, shrinking editor, Safari Bottom bar fixes
2026-11-18 15:38:22 -05:00
Prabhaav Pillai 6fb38daba5 The outside-click handler treated Undo/Redo as outside the editor, clearing selection and hiding widget controls. It also misclassified “Add to layout” after its button was removed during the click. Both broke browser workflows. Fixed using the event’s original propagation path to identify clicks inside the editor.
Opening Edit after deselection showed a blank picker and no coordinate controls.	Fixed by selecting an active widget, with a fallback to the first widget.
2026-11-18 15:38:13 -05:00
Dom b79af6c8f8 Align CI fixtures with published models and native error-log routing 2026-11-18 14:20:02 -06:00
Codex 09fec63cc0 Show parked analysis progress and refresh findings before explicit acceptance 2026-11-18 14:10:30 -06:00
Codex 7ea1edb628 Show parked analysis progress and refresh findings before explicit acceptance 2026-11-18 14:00:10 -06:00
Codex 440e0c5f17 Show parked analysis progress and refresh findings before explicit acceptance 2026-11-18 13:58:05 -06:00
Danny e3a733a9fb StarPort: Ask for one tap to set up touch on cars that report video pixels 2026-11-18 11:45:47 -08:00
firestar5683 6b0d0d4e49 Restore shaped button deceleration on gas Highlander TSS2 2026-11-18 13:34:38 -06:00
Danny f7de6153d1 Bottom Bar: Move down, 1 px, edit at top 2026-11-18 11:29:00 -08:00
Danny 9b53f0e6cc PiP: Lock Each Independently 2026-11-18 11:29:00 -08:00
Danny a3f4d9719f Theme Maker: Shrink editor, tighten edit pages, remember list position 2026-11-18 11:29:00 -08:00
Danny 83bfab6496 PiP: Restore Ordering, Add Lock and Transparent Overlays 2026-11-18 11:10:35 -08:00
Codex 87a36360e2 Keep highway wobble detection independent of window phase and steering offset 2026-11-18 12:49:45 -06:00
Codex fed7dbbf5b Run recorded maneuver regressions and approve the reviewed producer source 2026-11-18 12:36:44 -06:00
Codex 4420ec79fa Cover source-run edges when detecting sustained tracking wobble 2026-11-18 12:23:11 -06:00
Codex 6fa398fb4e Qualify turn forecasts and producer clocks alongside highway wobble detection 2026-11-18 12:21:26 -06:00
Codex c1e83f616d Detect sustained highway tracking wobble between straight and curve classifications 2026-11-18 12:14:24 -06:00
Codex 42418bfb70 Limit initial Galaxy model list to 15 rows 2026-11-18 12:04:10 -06:00
Dom cfb0cd61d1 Restore explicit guarded Excessive Actuation recovery in both native UIs
Add the missing compact acknowledgement action and confirm recovery in both UIs. Require fresh ignition-off noOutput Panda and stopped-device evidence, preserving the persistent safety latch until explicit acknowledgement. Qualify with 47 focused tests and native headless renders.
2026-11-18 11:19:52 -06:00
Dom b47931d71d Release CEM stationary launch from bounded model prefix noise 2026-11-18 11:10:40 -06:00
Dom d3fe4c2c5f Integrate qualified Honda EPS recovery with shared AOL fixes 2026-11-18 10:58:55 -06:00
firestar5683 b6dfa29932 Preserve Subaru armed intent through stopped and temporary steering pauses 2026-11-18 10:51:45 -06:00
Dom a5e4b31dd8 Preserve Honda AOL through EPS re-pulses and brake release 2026-11-18 10:45:13 -06:00
firestar5683 8117682bc1 Use legacy FCA11 integrity for the early Kona EV radar 2026-11-18 09:58:19 -06:00
firestar5683 62df79bd63 Distinguish forecast-confirmed turns from lane changes 2026-11-18 09:47:42 -06:00
firestar5683 070bc1fdf8 Show updater failures and restore Software error details 2026-11-18 09:13:51 -06:00
firestar5683 7e37c44d40 Keep active Subaru angle assistance through the AOL admission boundary 2026-11-18 09:09:58 -06:00
Codex 62076ee6c2 Limit initial Galaxy model list to 15 rows 2026-11-18 09:05:12 -06:00
Dom 15d43b56d4 Restore informational CEM stop-scene indication in AOL and Chill
Keep display perception independent of reset control detector. Preserve control authority and active braking border semantics. Append reserved custom cereal field only. Both native UI paths covered; 558 local regression tests and 116 independently rerun tests pass.
2026-11-18 08:47:59 -06:00
Dom c6885c220e Fix PR reminder comment permission scope 2026-11-18 08:43:00 -06:00
firestar5683 c70f8b4374 Avoid maximum launch pulses on gas Highlander TSS2 2026-11-18 08:41:47 -06:00
firestar5683 f2e6711cde Bundle Cheddar as the default driving model 2026-11-18 08:29:31 -06:00
Dom c4f95c945e Review unidentified FLM drives without mixing vehicle profiles 2026-11-18 08:23:30 -06:00
firestar5683 e4822ac42c Restore fresh lead distance in classic Hyundai SCC messages 2026-11-18 08:11:22 -06:00
firestar5683 ce8f31562a Restore the qualified source-only build receipt 2026-11-18 08:02:58 -06:00
Dom 98563b6c9d Cover unidentified drive isolation and preserve typed diagnostic contracts 2026-11-18 07:55:58 -06:00
Dom 73e5a7e5ab Review unidentified FLM drives without mixing vehicle tunes 2026-11-18 07:51:57 -06:00
firestar5683 99478f3403 Fix UI typing and complete Galaxy section translations 2026-11-18 02:55:01 -06:00
Prabhaav Pillai a214a29163 Simplified tune backups to Download tune and Import; removed redundant Share code.
Standardized Galaxy notice and toast padding.
Renamed Selected Profile to Use global preset.
Clarified parked power behavior with Stock and Custom limits.
Reorganized settings:- Device & System is the last tab.
- Display moved to Visual.
- VOACC and Always Hold Enhanced Stops moved to Longitudinal.
- Merged cloud, remote access, and data uploads.
- Added separate Manage entries for StarPort, Browser preferences, and Localization.
Removed classic StarPort setup and its toggle; guided setup is now the default.
Consolidated backup, resets, and route deletion into concise groups, collapsed by default.
Improved mobile widget-editor scrolling.
Made PiP cameras render above other widgets and corrected right-camera placement for C3X.
Improved weather location handling, retry behavior, and missing-data display.
Standardized paired titles to use &.
2026-11-18 02:46:12 -05:00
Dom f747dd4e01 Separate archived EV6 replay provenance from active manifest 2026-11-18 01:30:33 -06:00
Dom 7fdd1646ac Review EV6 replay expectation for restored driver yield 2026-11-18 00:54:21 -06:00
Dom f1adde06b7 Keep static test fixtures typed and split settings authority tests 2026-11-17 23:45:44 -06:00
firestar5683 306a715285 Preserve selfdrived executable mode 2026-11-17 22:28:12 -06:00
firestar5683 39d6212d27 Update settings fixtures for Enhanced Stops control 2026-11-17 22:26:29 -06:00
firestar5683 7e0e749d39 Consume late Malibu Hybrid state before deciding control axes 2026-11-17 22:02:30 -06:00
firestar5683 76cf9331ef Show effective profiles in Galaxy acceleration and deceleration selectors 2026-11-17 21:52:05 -06:00
Dom 32641a8882 Restore qualified FLM native primitive artifact
Restore the exact pre-Honda-rebuild artifact matching the unchanged source and ABI binding. Do not requalify or blindly rebind the unrelated rebuild. Native loader guards and build validator checks pass; canonical receipt regenerated.
2026-11-17 21:37:11 -06:00
Dom 7e3d9fe0d7 test: refresh Ford panel fixture and audited updater expectations 2026-11-17 21:29:28 -06:00
firestar5683 ffad68897a Avoid live HKG media profile mask allocation 2026-11-17 21:12:32 -06:00
firestar5683 cb31a6d02c Avoid duplicate same-frame Switchback wheel map reads 2026-11-17 21:02:58 -06:00
firestar5683 2b63e11578 Update testing to verified AGNOS 20.5.3 2026-11-17 20:58:31 -06:00
OpenAI 082819b208 Integrate qualified Honda AOL EPS recovery 2026-11-17 20:54:18 -06:00
OpenAI 66b97efe57 Build matching artifacts for Honda AOL EPS recovery 2026-11-17 20:53:15 -06:00
Danny 44b14a3261 BlueZ: Restore Comma BT advertising Name 2026-11-17 20:50:43 -06:00
OpenAI 8e325a87e0 Integrate Honda AOL EPS recovery with current testing 2026-11-17 20:49:55 -06:00
firestar5683 4182a40242 Preserve the latest stable source in the migration pin 2026-11-17 20:35:55 -06:00
firestar5683 fc390c8f6a Recover rejected Bolt pedal counters without retrying actuation 2026-11-17 20:32:39 -06:00
firestar5683 1d923059be Pin the final legacy Stable migration release 2026-11-17 20:28:38 -06:00
firestar5683 8cc4f3fe0e Prepare the qualified legacy Stable channel and manual docs checks 2026-11-17 20:26:01 -06:00
Dom 2d4265438c ci: preserve PR Discord reminder on testing 2026-11-17 20:24:15 -06:00
OpenAI 670a8df468 Retain Honda AOL intent across short EPS recovery receipt joins 2026-11-17 20:16:12 -06:00
firestar5683 616c8e5bac Delay ordinary navigation turn slowdowns with reachable braking 2026-11-17 20:14:00 -06:00
firestar5683 d73a87119f Remove channel notices from the homepage 2026-11-17 20:04:06 -06:00
Dom e7e028990e test: align EV6 default with restored driver torque allowance 2026-11-17 19:17:57 -06:00
Dom 5823b87d1d Restore executable modes for controlsd and modeld 2026-11-17 18:38:18 -06:00
firestar5683 3ebcfddee6 Follow Testing for development and setup documentation 2026-11-17 18:27:37 -06:00
firestar5683 40a5b52dd1 Keep FLM learning around individual manual locks and accepted findings 2026-11-17 18:22:48 -06:00
firestar5683 4b47d85938 Restore HKG CAN-FD driver torque override behavior 2026-11-17 18:16:45 -06:00
firestar5683 2c9a556f58 Branch-Migration: Dom -> testing (8d4de4abd82f4a85ba262e8ab45fc511) 2026-11-17 18:10:54 -06:00
firestar5683 d49eef473c Migrate fresh installs despite a previous channel preference 2026-11-17 18:10:54 -06:00
firestar5683 91241e6183 Keep existing channels usable before migration activation 2026-11-17 17:59:45 -06:00
firestar5683 702a1cc552 Prepare one-shot stable and testing channel migration 2026-11-17 17:37:31 -06:00
firestar5683 fa578e8abf Restore matched target filtering and timing for gas Kona 2026-11-17 17:20:28 -06:00
firestar5683 139cf7e00d Preserve ordered HKG camera health within a CAN batch 2026-11-17 17:14:37 -06:00
firestar5683 c599f28256 Retain actionable FLM diagnostics across drives and restarts 2026-11-17 17:10:36 -06:00
Dom 268700ae5f test: complete developer hold toggle fixtures and inventory 2026-11-17 16:56:59 -06:00
Dom c6e0a6bd99 hyundai: use static integer masks for live CAN FD profile checks 2026-11-17 16:36:28 -06:00
Danny 825018c0d8 BlueZ: Restore Comma BT advertising Name 2026-11-17 14:26:07 -08:00
Dom 436f18ccdf hardwared: isolate blocking SoM power telemetry from health publication 2026-11-17 16:21:02 -06:00
firestar5683 4ad9fd478a Add developer option to always hold Enhanced Stops 2026-11-17 15:29:51 -06:00
firestar5683 08d688eace Start ordinary navigation turn slowdowns slightly later 2026-11-17 14:45:41 -06:00
Dom f1885cdb50 Refresh canonical prebuilt receipt after Di integration
Regenerated on the validated final tree; no native build inputs changed.
Receipt checker and all seven release receipt regression tests pass.
2026-11-17 14:29:02 -06:00
Dom da7718e07c Merge Di's StarPort touch, Networks, and layout magnifier PRs (#315, #316, #317)
Includes regression-tested prompt hotspot recovery after failed Wi-Fi joins, validated network-order inputs, and network module type corrections.
2026-11-17 14:25:35 -06:00
Dom 140a0d0e02 Allow resizing StarPort side cameras and navigation card 2026-11-17 14:06:19 -06:00
Danny 6e0126d837 Layout Squeezed Text 2026-11-17 11:31:29 -08:00
Dom c048992e9c Complete offline vehicle and evidence fixtures for current snapshots
Test-only fixture repair: real isolated Params and schema CarParams retain specified values, unavailable learning payloads retain missing freshness, and stock ExperimentalMode tests explicitly select STOCK. All assertions retained.340 related tests pass on reconciled814b795; baseline30fail/30pass. Ruff/ty pass. No production/native or receipt changes.
2026-11-17 13:21:03 -06:00
firestar5683 814b795aa2 Align developer settings navigation and source-read expectations 2026-11-17 13:19:15 -06:00
dirwin31 56cb80cdb7 Log Starport touch input and channel diagnostics 2026-11-17 11:16:27 -08:00
dirwin31 d95be12744 Fix omitted touch action default in Starport 2026-11-17 11:01:55 -08:00
Dom 7ec86177c7 Add independent native turn-by-turn widget controls 2026-11-17 12:58:02 -06:00
Dom dae5600cfa Refresh release inventory after README link update
Canonical inventory-only refresh after README-only change. Parent receipt valid; all code/native artifacts unchanged.9 receipt/runtime checks, static artifact validation and vendor layout checks pass. Preserve documentation changes.
2026-11-17 12:36:13 -06:00
prabhaavp 81afb6ef8b Change App Store and Google Play links
Updated App Store and Google Play links in README.
2026-11-17 13:34:19 -05:00
firestar5683 3ac334352c Show learned steering values beside developer settings 2026-11-17 12:30:18 -06:00
Dom 06a113f41a Use complete isolated vehicle and settings fixtures for snapshots
Test-only repair after delay snapshots began reading bounded saved preferences. Preserve all assertions and original vehicle values; leave shared fakes and production unchanged.259 focused runtime snapshot, SLC retention/UI and history tests pass. Baselines reproduce73retention,10snapshot and4history failures. No learned-values feature changes; no native or receipt changes.
2026-11-17 12:23:58 -06:00
Danny d1b65dcb65 Layout: Show a magnified view clear of your finger while dragging widgets on touch 2026-11-17 10:05:22 -08:00
Danny 6ef441c73c Networks: Seperate Scan and Current, add Modal 2026-11-17 09:58:37 -08:00
Danny 3d0a89c33f Networks: Scan, join, connect and forget Wi-Fi from Galaxy 2026-11-17 09:58:37 -08:00
Danny d0857e4018 Networks: Tidy Page 2026-11-17 09:58:36 -08:00
Danny e0434a8ac5 StarPort: Join Wi-Fi under its own control during a drive 2026-11-17 09:58:21 -08:00
Danny f7dc16211a Galaxy: Let the hotspot stand down briefly while the comma joins Wi-Fi 2026-11-17 09:58:21 -08:00
Danny 501c40fc61 Galaxy: Networks page with preferred Wi-Fi, cellular data and the hotspot 2026-11-17 09:58:20 -08:00
Danny 6e6702961b Network: Reconnect apps after the comma changes networks 2026-11-17 09:58:16 -08:00
Danny ecce9caaa0 StarPort: Record Wi-Fi firmware restarts in stall captures 2026-11-17 09:58:16 -08:00
dirwin31 7c0b4bf06b StarPort: Keep A Home Wi-Fi Join That Already Connected
- When the car's acks stall right after the comma's own Wi-Fi changes, stop the join only if it has not connected yet.
- A join that already connected (only its address left) is kept and logged as other_wifi_join_kept; the 8 s grace still reconnects the car if acks never return.
- 2026-11-16: stopping a connected iPhone hotspot join lost the hotspot and still dropped the car, while a joined hotspot streamed alongside the car for minutes.
2026-11-17 09:58:15 -08:00
Danny 3d6c33e720 Starport: Auto Wifi Rejoin Fix 2026-11-17 09:58:15 -08:00
firestar5683 8173afa129 Follow developer menu in saved torque editor integration test 2026-11-17 11:57:28 -06:00
firestar5683 8940ba4721 Complete delay descriptions and applied telemetry schema review 2026-11-17 11:54:32 -06:00
Dom ec570f7ced Make highway smoothing available across steering controllers 2026-11-17 11:49:17 -06:00
firestar5683 cb207db76b Simplify developer steering controls and delay copy 2026-11-17 11:29:37 -06:00
firestar5683 22dc5f1681 Add manual steering delay and developer parameters 2026-11-17 11:10:52 -06:00
firestar5683 36b6f05a47 Clarify the default Hyundai LKAS button explanation 2026-11-17 11:01:54 -06:00
firestar5683 1d74639b72 Show autotune controls only for torque steering 2026-11-17 10:07:48 -06:00
Dom e7f1725e0e Merge pull request #314 from dirwin31/StarPortPolestar-Dom
StarPort: Polestar 2 video fix and patient adapter connect option.
Preserve both compatibility options default-off and refresh source-only release receipt.
2026-11-17 09:44:29 -06:00
firestar5683 93a4e50dc0 Rebuild pandad with qualified Kona Alpha AOL profiles 2026-11-17 09:27:39 -06:00
firestar5683 c9fd30bfee Preserve MQB AOL across startup and Cancel publication ordering 2026-11-17 09:22:47 -06:00
Dom 36b211de7b Make curve target narrowing explicit for static analysis
Redundant None check preserves at-cap semantics: selected already requires a target.21 runtime tests pass; broader curve suite90pass with one cloud AF_UNIX status test block.540 expression-equivalence checks, project ty, Ruff and static device artifact validation pass. No native changes; canonical inventory refreshed.
2026-11-17 05:55:54 -06:00
whoisdomi d3663a46f0 CSC update 2026-11-17 04:49:32 -06:00
Dom 7ad60d971b Refresh inventory after Galaxy source refactor
Canonical inventory-only refresh; native device artifacts unchanged.102 nonbrowser JS contracts and32 changed JS syntax checks pass, static artifact validation passes. Browser qualification remains pending: cloud Chromium socket unavailable and previous hosted flow stopped at stale receipt. Preserve failed local artifact and unchanged hosted browser gate; no browser-pass claim.
2026-11-17 02:20:40 -06:00
Prabhaav Pillai f4bf190e7c Modularize Galaxy access setup, centralize app links and step styles, and unify disclosure transitions with shared height animations 2026-11-17 03:13:02 -05:00
Dom b39e1abbf7 Align PQ migration test with explicit Alpha choice preservation
Keep exact archived and saved canonical booleans, verify later opposite choice persists, and add five absent or malformed choice controls proving no implicit enable. Production behavior unchanged.58 focused PQ/first-start/handoff tests pass; static artifact validation passes and canonical inventory refreshed.
2026-11-17 02:09:35 -06:00
Dom 9f02039fcb Refresh release inventory after companion app migration
Canonical source inventory refresh only. Native device artifacts unchanged from qualified 4907701c; static artifact validation, bridge80, receipt/runtime9 and vendor layout checks pass. No native rebuild or runtime inference claim.
2026-11-17 01:15:56 -06:00
Prabhaav Pillai 955ac9d2ae Remove migrated companion apps and refresh docs, update credits for app developers, and production app store links 2026-11-17 02:12:46 -05:00
Dom 4907701c7d Align retained intent and display fixtures with current contracts
Preserve all cadence denial checks with cruise on and off; verify fresh damping 3 and expired fallback 100. Cover Subaru plus VW delay reset and accepted SLC rendering on every frame. Repair Toyota integration caller after CCM test rename. Focused checks pass: 180 cadence/damping, 111 Jetlink/SLC, 116 dedicated HKG negatives, 64 fresh-camera, stale-camera and Toyota integration. Combined extra suites remain blocked by cloud AF_UNIX logging; no aggregate pass claimed. Production/native files unchanged; canonical receipt refreshed.
2026-11-17 00:35:26 -06:00
firestar5683 7d89f373ce Keep Kona Alpha Long AOL through SET and cruise-only withdrawal 2026-11-16 23:54:48 -06:00
Dom e006ed0a59 Isolate bookmark cleanup in manager default fixtures
Keep all absent-default and saved-choice assertions; prevent unrelated bookmark cleanup from triggering the existing after-defaults sentinel early.29focused UI tests pass in supported headless cloud runtime with approved test-only harness that captures/prints only the known empty TuningPreparationState warning; unknown warnings/errors remain untouched. Same harness reproduces both failures without this patch. No logging shim committed, no production/native changes, no aggregate-pass claim.
2026-11-16 23:38:52 -06:00
Dom 070ea1cee8 Match Sierra disabled-longitudinal fixture to stock owner
Preserve active owner expectations and all RX/TX assertions. Disabled mode explicitly checks existing NO_ACC, pcmCruise, cleared CC_LONG, stock profile, enable speed and no auto-resume.30admission/layout checks pass; four unchanged runtime cases remain locally environment-blocked and await hosted CI. No production/native changes; canonical inventory refreshed.
2026-11-16 23:23:05 -06:00
Dom 286a932b52 Model captured Tensor output in Jetlink warp fixture
Keep production captured-output guard intact and preserve coherent-move/fallback assertions. Match fixture to required Tensor protocol and add missing/non-Tensor rejection checks.18warp tests,Ruff and typing pass; broader adapter check42pass/6missing-clang environment blocks. No production/native changes; canonical inventory refreshed.
2026-11-16 23:17:54 -06:00
Dom af3a533aeb Align acceleration and retired mode tests with current contracts
Keep Tesla lateral-independent longitudinal and brake checks with current 3.5 limit and CAN quantization. Cover normal versus faster ceilings while retaining braking, stop, saved-cap and cornering checks. Verify saved CCM maps to CEM and retain native projected radar veto through CCM policy. 37 focused checks pass; broader48-case run has46 pass and2 environment socket blocks. No production/native changes; canonical inventory refreshed.
2026-11-16 23:14:58 -06:00
Dom 482033518c Align vehicle fixtures and avoid reserved unittest loader name
Test an unsupported two-count Polestar replica lag while preserving RX/TX rejection. Match current GM stock-owner flags without removing any parser-validity assertion. Rename the imported laboratory fixture so unittest does not invoke a module as load_tests. 125 combined focused checks pass;7 unittest checks independently pass; Ruff passes. Production and native artifacts unchanged; canonical inventory refreshed.
2026-11-16 23:13:15 -06:00
Dom af201f1a35 Align Subaru model join fixture with combined smoothing input
Retain all eight owner/tau cases and original acceleration, stop-state and single-application assertions. Supply zero Volkswagen smoothing for this Subaru-only fixture. No production or native changes. Subaru and Volkswagen focused suites:44 passed; Ruff passed. Refresh canonical validated inventory.
2026-11-16 23:11:10 -06:00
Dom f932fc8a18 Make exact numeric guards and existing platform skip type-check
Preserve exact builtin numeric admission, bool/subclass rejection, overflow handling and existing non-Linux ELF skip exception. 68 focused acceptance/MPU tests pass; Darwin-target project type checking and Ruff pass. Native outputs unchanged; refresh validated inventory only.
2026-11-16 23:09:29 -06:00
Dom ffd70cafe3 Align Toyota caller tests with current acceleration boundaries
Keep production and native artifacts unchanged. Test exact +/-3.5 limits, preserve 2.001 coverage, reject just-outside limits and retain stock longitudinal denial. Both caller suites pass 96 DEBUG/RELEASE checks in the cloud host runtime; Ruff passes. Refresh validated parent inventory for test-only edits. Full aggregate environment remains limited by AF_UNIX socket permissions; no gate or test bypassed.
2026-11-16 22:53:27 -06:00
firestar5683 8bfad84748 Keep turn hold until near-path steering demand is met 2026-11-16 22:31:06 -06:00
firestar5683 91524cad18 Observe current classic Hyundai warning before forwarding 2026-11-16 22:23:44 -06:00
firestar5683 4d063cd615 Keep FLM recording with selected-controller identities 2026-11-16 22:22:53 -06:00
firestar5683 1b0df8bcc8 Preserve fresh HDA1 camera steering damping 2026-11-16 22:04:22 -06:00
firestar5683 9f4e07a240 Restore Hybrid pedal physical Cancel passthrough 2026-11-16 21:25:23 -06:00
Peter Nguyen 5e44b4bd34 Merge pull request #261 from trung791997/bosch-a-parser-Dom 2026-11-16 21:02:37 -06:00
firestar5683 b96152aa1c Align Toyota safety boundary tests with Faster Takeoffs limits 2026-11-16 20:44:54 -06:00
firestar5683 355929ba09 Skip unrelated GM longitudinal and pedal profile checks 2026-11-16 20:33:38 -06:00
trung791997 8aedcd56c4 2026-11-16 Merge StarPilotHQ Dom into bosch-a-parser-Dom
Resolves the one conflict in _create_bosch_a_can_parser: keeps Dom's
per-frame signal filter (it lists exactly the signals the updated parser
reads) and the bus comment from this branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 20:25:46 -06:00
firestar5683 ee122139f4 Correct Malibu Hybrid driver pedal and OEM buttons 2026-11-16 20:24:09 -06:00
Danny ce34ddefef StarPort: Add unacknowledged video fix for the Polestar 2 and a patient adapter connect option
Co-authored-by: Jericho Adler <60821753+jericho-adler@users.noreply.github.com>
2026-11-16 18:06:39 -08:00
firestar5683 e5dde0e0ea Limit direct HKG angle commands to the EPS step rate 2026-11-16 18:59:01 -06:00
firestar5683 9b127466d5 Recover archived dashboard history after migration 2026-11-16 18:31:38 -06:00
firestarsdog 52656c9a04 Name repeated SLC arithmetic and drop a redundant check 2026-11-16 19:02:49 -05:00
firestarsdog 2d3d723af4 Let a renamed SLC schema field fail loudly 2026-11-16 19:02:41 -05:00
firestar5683 b7636454c9 Remind mobile Galaxy browsers to download the app 2026-11-16 17:58:22 -06:00
firestar5683 bc8ef0796a Preserve dashboard history during migration 2026-11-16 17:35:04 -06:00
firestar5683 e2fe14935b Restore supported Polestar rack counter lag 2026-11-16 17:23:07 -06:00
Dom dcba9becc9 Type the dynamically loaded bookmark test helper
Preserve existing assertions and explicitly narrow the optional checkpoint. Focused ty and Ruff checks and all 29 bookmark tests pass. Refresh receipt for test-only changes; production source and native artifacts remain unchanged.
2026-11-16 17:18:46 -06:00
Dom 49705f179a Number bookmark feedback per drive with restart-safe counts
Preserve the native large and compact notifications, reset offroad, and checkpoint same-drive counts in isolated volatile storage. Qualified 271 tests and exact production imports in the ARM runtime.

Receipt resealed under the Python-only qualification workflow: native inputs, artifact blobs and modes are identical to valid b5137ef. No native rebuild performed.
2026-11-16 16:55:59 -06:00
firestarsdog e658344ea4 Check SLC identifiers without a per-character scan 2026-11-16 17:10:08 -05:00
firestarsdog 6f11023a43 Keep SLC input validation in one place 2026-11-16 17:02:17 -05:00
firestar5683 b5137efa47 Return Polestar to stock transport on unsupported steering status 2026-11-16 15:19:28 -06:00
firestarsdog 6f4cabf0f5 SLC Cleanup 2026-11-16 15:55:37 -05:00
Dom 8688217e10 Label StarPilot branch as Stable on Home 2026-11-16 12:28:24 -06:00
firestarsdog 2bdbade5d1 Firefox memory allowlist 2026-11-16 13:24:50 -05:00
firestar5683 064420831e Restore verified HDA1 display ownership and clear disengagement popup 2026-11-16 11:35:31 -06:00
firestarsdog bddfb7f513 Arabesque AGNOS bump 2026-11-16 12:25:19 -05:00
firestar5683 e20c8bd884 Preserve Toyota lateral intent during gas source interruptions 2026-11-16 11:07:09 -06:00
firestar5683 3b829ab48b Preserve unclassified HDA1 camera fault indications 2026-11-16 10:47:07 -06:00
firestar5683 a1dcea640f Preserve regional settings during migration 2026-11-16 10:37:09 -06:00
firestar5683 1abbbc6d19 Verify release artifacts on StarPilot 2026-11-16 00:50:49 -06:00
firestar5683 cf181c959c Review bounded portions of long FLM drives 2026-11-16 00:42:41 -06:00
firestar5683 f29d891948 Use the canonical repository for fleet status 2026-11-16 00:38:59 -06:00
firestar5683 3b2ee42a10 Keep FLM profile suggestions separate from automatic fit eligibility 2026-11-16 00:26:30 -06:00
firestar5683 afd524830f Keep vehicle preferences during the upgrade 2026-11-16 00:15:49 -06:00
firestar5683 d868327c7e Report StarPilot release adoption 2026-11-16 00:06:53 -06:00
firestar5683 66dd8ed4d2 Read original asynchronous FLM steering commands correctly 2026-11-16 00:03:17 -06:00
firestar5683 c96ca8dc8a Restore current FLM capture and simplify saved tuning text 2026-11-15 23:48:27 -06:00
firestarsdog 51c8394c4d Add top scrim and text halo so the HUD stays readable on bright views 2026-11-16 00:44:54 -05:00
firestar5683 c1a3553992 Guide old Galaxy pages through migration 2026-11-15 23:43:41 -06:00
firestar5683 e003fabf20 Run release checks on StarPilot 2026-11-15 23:19:47 -06:00
firestar5683 a71e204e11 Defer legacy OS staging to the hardware-aware launcher 2026-11-15 23:13:58 -06:00
firestar5683 aa08848a42 Restore manual Golf PopV2 steering target timing 2026-11-15 23:06:15 -06:00
firestar5683 d8491e239a Launch AGNOS updater with compatible UI 2026-11-15 22:59:08 -06:00
firestar5683 33818c84eb Preserve compatible FLM tunes and scan larger drive libraries 2026-11-15 22:47:54 -06:00
firestar5683 062a440150 Align GM native tests with disabled speed control ownership 2026-11-15 22:42:20 -06:00
firestar5683 72aaecddcb Preserve saved Toyota security keys during migration 2026-11-15 22:39:13 -06:00
firestar5683 6486b6b51d Recognize complete 2025 Impreza camera firmware identity 2026-11-15 22:37:51 -06:00
firestarsdog 5152974184 Stop set speed steps at SLC limit plus offset 2026-11-15 23:30:55 -05:00
firestar5683 ea8da5ec9e Preserve GM lateral tuning with stock cruise ownership 2026-11-15 22:29:41 -06:00
firestar5683 c150fe86b5 Retain stock cruise ownership when GM speed control is disabled 2026-11-15 22:25:39 -06:00
firestar5683 41b9f6f959 Stabilize Honda radar association through vision outliers 2026-11-15 22:21:07 -06:00
firestar5683 cfafb8ca72 Match layout qualification to current native geometry 2026-11-15 21:57:20 -06:00
firestar5683 96602a0edc Keep MQB AOL through braked startup and accelerator Cancel 2026-11-15 21:54:11 -06:00
firestar5683 2dc0647a79 Qualify Model Lab tests across runtimes 2026-11-15 21:34:46 -06:00
firestar5683 c3c275f9b8 Preserve longitudinal choice and onboarding during migration 2026-11-15 21:24:13 -06:00
firestar5683 b57bdebcda Back up and restore compatible FLM tunes with explicit review 2026-11-15 20:58:44 -06:00
firestar5683 0eb66482aa Smooth stopped-lead acceleration after Conditional Experimental handoff 2026-11-15 20:57:23 -06:00
Dom 0013547181 Refresh receipt after speed limit display documentation change 2026-11-15 20:31:47 -06:00
firestarsdog b2cca153d9 Drop LAST from the speed limit sign; the source label already says where it came from 2026-11-15 21:13:45 -05:00
firestar5683 ded8410a88 Hold HDA1 display ownership through camera release 2026-11-15 20:06:19 -06:00
firestar5683 4729e74239 Preserve FLM saved settings across drive reviews 2026-11-15 19:39:50 -06:00
Dom 834e1856e0 Merge pull request #310 from dirwin31/Spotify-AAC-Dom
Spotify AAC Support. Refresh prebuilt receipt for the merged inventory.

Validated: 20 media audio tests including real AAC encoding; targeted ruff and ty.
2026-11-15 19:27:22 -06:00
firestarsdog db6196e7ea Publish AOL services in device replay so lat-active border shows green 2026-11-15 20:14:56 -05:00
firestar5683 0a4590e2ff Offer classic and 2025 openpilot sounds 2026-11-15 19:08:08 -06:00
Dom a85a015a0c Refresh build receipt for Galaxy layout v15 tests 2026-11-15 19:03:07 -06:00
firestarsdog 4a3158f1e2 Accept layout v15 in Galaxy so Manage opens 2026-11-15 19:38:05 -05:00
firestar5683 d021cb21a0 Reduce Model Lab replay overhead 2026-11-15 18:17:10 -06:00
firestarsdog 098deaf3fd Enlarge large-UI speed group and align numbers on one row 2026-11-15 19:04:33 -05:00
firestarsdog 63d850a692 Center SET and the speed limit sign on one line on the large UI 2026-11-15 18:58:52 -05:00
firestarsdog 85f8650d02 Separate the Vienna in-use ring from the red ring with a gap 2026-11-15 18:58:52 -05:00
firestarsdog 6c9dbd5398 Thicken the Vienna in-use ring to match the US sign outline 2026-11-15 18:58:52 -05:00
firestarsdog 5b631e9c57 Document the simplified speed limit display 2026-11-15 18:58:52 -05:00
firestarsdog 4e8166ac1f Update UI tests for the plain sign and accepted-limit display 2026-11-15 18:58:52 -05:00
firestarsdog c866e100d1 Show the accepted limit SLC uses so rejected or missing readings never replace it 2026-11-15 18:58:52 -05:00
firestarsdog 412055750c Draw the speed limit as a plain sign and show only OVERRIDE under SET 2026-11-15 18:58:52 -05:00
firestarsdog 8b3ae969b7 Add a thick green outline and Vienna ring to mark the followed limit 2026-11-15 18:58:52 -05:00
firestarsdog b1daa297b5 Count an equal SET as limiting, compared in displayed units, to stop outline flicker 2026-11-15 18:58:52 -05:00
firestar5683 18c8a68e74 Narrow Model Lab test requests 2026-11-15 17:40:33 -06:00
firestar5683 03c3cde96e Use typed fixtures in standstill launch geometry tests 2026-11-15 17:38:37 -06:00
Danny 772b6cefc9 StarPort: Save AAWireless syslog and add H.265 test toggles 2026-11-15 17:22:20 -06:00
firestar5683 8124d81707 Retain confirmed stop signs while following a braking lead 2026-11-15 17:09:00 -06:00
firestar5683 1837b76919 Queue model selections without parked restrictions 2026-11-15 17:04:36 -06:00
firestar5683 620ed4d9ca Separate auto-learned settings from provisional FLM suggestions 2026-11-15 16:53:50 -06:00
Jeffrey Wong 0a0f0d99bd athena: upload requests without headers are accepted again 2026-11-15 16:51:17 -06:00
firestar5683 665f89e011 Keep Model Manager visible while saving 2026-11-15 16:47:26 -06:00
firestar5683 8cf99c94f5 Reduce Model Lab camera copy cost 2026-11-15 16:40:12 -06:00
firestar5683 caa6fae169 Reset Highway Smoothing to off once 2026-11-15 16:34:45 -06:00
firestar5683 5b5ea7b330 Keep verified Ram startup discovery on normal CAN wiring 2026-11-15 16:30:13 -06:00
firestar5683 ab0b4f9f08 Fix active HKG lane-centering warning ownership 2026-11-15 16:19:35 -06:00
firestar5683 1e7b72cc0c Clear coherent standstill launches despite model prefix jitter 2026-11-15 16:01:13 -06:00
firestar5683 7dd495afdd Move CAN ignition preference beside Remote Start 2026-11-15 15:51:14 -06:00
firestar5683 40575b9cf3 Reduce Honda Bosch-A radar decoding overhead 2026-11-15 14:29:04 -06:00
firestar5683 2538b194b7 Enable existing Ioniq 5 camera-SCC AOL profile 2026-11-15 13:59:25 -06:00
firestar5683 23238d51c4 Check current HKG acceleration boundaries 2026-11-15 13:52:07 -06:00
firestar5683 33253a890d Fix remote-wake fake Panda typing 2026-11-15 13:11:14 -06:00
firestar5683 e1d7f942f1 Release parked FLM analysis memory before driving 2026-11-15 13:01:35 -06:00
Danny bb8a202d90 Spotify AAC Support 2026-11-15 10:46:58 -08:00
firestar5683 c7a9bf284b Restore remote wake for Auto vehicles and comma four 2026-11-15 12:18:14 -06:00
Dom 8fa9684f98 fix(hyundai): preserve EV6 AOL for remapped LKAS actions 2026-11-15 12:06:19 -06:00
firestar5683 3e57276216 Fix Impreza route coverage and crawl test parametrization 2026-11-15 10:28:33 -06:00
FuriouslyRed 6db4bd592d Integrate qualified 2025 Impreza recognition and lateral control 2026-11-15 09:59:07 -06:00
FuriouslyRed 11b6fa4b50 Add isolated 2025 Subaru Impreza platform 2026-11-15 09:13:17 -06:00
Dom 577dc95d44 Exercise PQ native callers in instrumented safety coverage 2026-11-15 06:14:12 -06:00
firestar5683 31eb6f8d09 Count original route identities once in neutral reviews 2026-11-15 05:54:31 -06:00
firestar5683 50f281b816 Retain verified neutral tunes and continue automatic learning 2026-11-15 05:42:03 -06:00
firestar5683 06d25fc158 Offer speed-matched deadband advice for identified steering chatter 2026-11-15 04:38:19 -06:00
firestar5683 5c2cb742b2 Use valid Ioniq 6 profiles in lateral independence checks 2026-11-15 04:29:32 -06:00
Dom 3e0a9f99ae Register author-provided Envision route and SDGM docs contract 2026-11-15 04:23:49 -06:00
firestar5683 06ad4b11b5 Fix PID tune direction and broaden applicable FLM recommendations 2026-11-15 03:31:49 -06:00
Dom be05b5f043 Cover fresh paddle-only dashboard lease without actuation authority 2026-11-15 03:15:56 -06:00
firestar5683 d151e4d535 Allow fresh qualification after a legacy inconclusive FLM timeout 2026-11-15 02:22:15 -06:00
firestar5683 c842f41625 Expose speed-supported friction curve advice for recorded notchy steering 2026-11-15 02:10:15 -06:00
firestar5683 856f5a38e6 Pool supported FLM maneuver suggestions beyond fitting cohorts 2026-11-15 01:38:54 -06:00
Dom 571761d5ae Keep stock-only Envision vision authority expectation explicit 2026-11-15 01:20:59 -06:00
firestar5683 8f2698e744 Keep explicit FLM setup context across original limiter masking 2026-11-15 01:12:36 -06:00
firestar5683 a810662907 Record the actual FLM frame map and show observed drive graphs 2026-11-15 00:58:59 -06:00
firestar5683 c123eb6942 Align classic HKG EPS recovery tests with independent intent 2026-11-15 00:50:49 -06:00
Dom 61f082d082 Extract availability session and complete Honda caller fixture
Move AvailabilityPause with identical executable AST and late original-module globals; preserve public imports and retention behavior. Keep120KiB gate. FullAOL12872pass,34fail reproduced unchanged onbaseline; complete missing lateralArmed inHonda syntheticfixture clears32 failures with72Honda tests passing. Remaining2Sonata veto failures preserved forowner. Fulltype/lint and independent reviews pass.
2026-11-15 00:46:04 -06:00
firestar5683 00e6ace3a8 Preserve classic HKG AOL intent after temporary EPS recovery 2026-11-15 00:11:46 -06:00
firestar5683 bbf230e318 Keep inconclusive FLM tunes and offer supported early steering suggestions 2026-11-15 00:08:31 -06:00
Dom 3dbeb4c2fe Keep Volkswagen fixture typing and transport module within CI contracts
Narrow optional fixture owners and preserve exact epoch mutation with all veto checks. Move unchanged pure CarParams identity helper to existing transport session module, reexporting old path. No safety predicate changes.344 caller checks,final165MQB checks,fulltypecheck/lint and independent review pass.
2026-11-14 23:38:41 -06:00
firestar5683 5aed0f951d Retain provisional FLM findings from intact partial-drive sections 2026-11-14 23:10:53 -06:00
firestar5683 0d5bad10bc Preserve Volkswagen AOL through cruise withdrawal and startup 2026-11-14 23:02:21 -06:00
firestar5683 3898578738 Keep source-bound FLM suggestions across recent drives and trial outcomes 2026-11-14 22:59:56 -06:00
Dom 9f59081a8f Repair CSC static checks and active numeric gauge fixture
Wrap curve-slowing expression without AST changes. Narrow optional horizon before existing tolerance assertion. Activate numeric footprint fixture under current curve-slowing gate; preserve inactive suppression and geometry assertions.146 relevant tests,full Ruff/typecheck and independent review pass.
2026-11-14 22:55:14 -06:00
firestar5683 86463d1654 Restore StarPilot HKG CAN-FD friction calibration 2026-11-14 22:37:35 -06:00
firestar5683 e0b72f9220 Restore checked stock HDA-II steering damping 2026-11-14 22:17:45 -06:00
Dom 0e59261e7b Expect retired CCM controls absent from analytics schema
Align schema assertion with explicit conditional/ccm UI retirement in b834a932. Keep CEM presence, privacy, read-only and runtime/radar coverage unchanged.92 analytics,Galaxy and preference tests pass. Matching receipt refreshed.
2026-11-14 21:51:18 -06:00
crazyb123 2cf3aa7478 feat(gm): Add OEM-Grade Retrofitted SDGM & Cross-Flashed ADAS Stack Support for 2016 Buick Envision (Chinese Spec) 2026-11-14 21:28:01 -06:00
whoisdomi 61fda7b9cc CSC rebase and UI fixes 2026-11-14 21:24:58 -06:00
Dom edcf4105ef Fix spelling in BlueALSA patch description
Preamble-only spelling correction for codespell; actual C patch and bundled binaries unchanged. Refresh matching prebuilt receipt.
2026-11-14 20:06:40 -06:00
Dom 5b167b90fe Complete serial CI workloads and refresh audited graphics provenance
Allow twenty minutes for the complete custom pytest step: shard 28 estimates994 seconds and was killed at900 seconds with1285 passed cases and120 still unrun. Preserve35-minute job cap and all completion gates.

Re-audit exact existing GPU/map source fingerprints after software EGL changes. No capability nodes, skip guards or test assertions broadened.155 CI contract tests and workflow lint pass. Refresh matching prebuilt inventory.
2026-11-14 19:46:45 -06:00
whoisdomi 2ffc883a6f Bluetooth Fix
Fix random car-audio dropouts: the BlueALSA ALSA plugin tested an
uninitialised value for its "disconnected" marker, so it falsely
dropped the Bluetooth output every few minutes. Rebuilt plugin with
patches/0001; see the patch for details.
2026-11-14 19:34:32 -06:00
Dom 42670a1e27 Extract compact layout and transport session without changing behavior
Preserve original-module late global lookups and public imports. Keep CI file-size limits unchanged. Qualified by 12781 AOL tests, 213 compact UI tests, full typecheck and lint, and independent AST-equivalence review.
2026-11-14 18:14:40 -06:00
firestar5683 f72a822744 Preserve precise lane tracking without opposing upcoming curves 2026-11-14 17:56:54 -06:00
firestar5683 7f909f50d3 Review intact FLM sections without treating incomplete drives as qualified 2026-11-14 16:09:06 -06:00
Dom 0fc15d14d6 Resolve Ioniq6 keepalive bus from confirmed CarParams 2026-11-14 15:44:01 -06:00
firestar5683 211c1f3fd0 Preserve idle stock GM startup intent through source gaps 2026-11-14 14:44:05 -06:00
Dom ff5342caac Resolve test readback functions from the active EGL context 2026-11-14 13:47:04 -06:00
Dom 3483a61e33 Align media audit tests with nonblocking idle contract 2026-11-14 13:41:56 -06:00
Danny 9df511a6ed StarPort: Copy AAWireless syslog while connected 2026-11-14 09:57:43 -08:00
firestar5683 f1aecc4770 Match Ioniq6 AOL steering status in stock cruise mode 2026-11-14 11:54:14 -06:00
firestar5683 4de7c1ed73 Keep provisional FLM ideas and make room for new learned setups 2026-11-14 17:39:24 +00:00
firestar5683 d86638a210 Stage Ioniq6 startup readiness before disabling ADAS 2026-11-14 11:35:38 -06:00
Danny 87b4292996 StarPort: Save AAWireless syslog and add H.265 test toggles 2026-11-14 09:32:45 -08:00
firestar5683 5c0ff43d90 Decode reserved CAN-FD blind-spot indications correctly 2026-11-14 10:51:02 -06:00
firestar5683 fc7cf1b64c Keep FLM learning when review history fills up 2026-11-14 16:15:09 +00:00
Dom a468bb75b9 Align VW Cancel contract with independent lateral intent 2026-11-14 10:02:27 -06:00
firestar5683 37dd44ba06 Default Highway Smoothing to 70 percent once 2026-11-14 09:46:04 -06:00
firestar5683 5a62d76315 Remember Subaru MAIN through the temporary steering guard 2026-11-14 09:12:03 -06:00
Dom 5bc34966f6 Run pixel-level graphics tests with test-only software EGL 2026-11-14 08:18:37 -06:00
Dom 56198eaf17 Wait for asynchronous SLC history persistence in planner test 2026-11-14 07:22:03 -06:00
Dom fdb35903a0 Make model and now-playing test fixtures type safe 2026-11-14 06:25:50 -06:00
Dom 4548353178 Use explicit tuning preparation choices in Galaxy tests 2026-11-14 05:56:51 -06:00
Dom d76d7efc4f Isolate planner and routing test fixtures from global state 2026-11-14 04:14:15 -06:00
firestar5683 9d1751f8ef Restore Sharan PQ AOL with matching Panda firmware 2026-11-14 02:51:20 -06:00
Dom 089de87811 Wrap reset fixture dependency selection and refresh source receipt 2026-11-14 02:44:37 -06:00
firestar5683 7fe19d9c3e Restore qualified Sharan PQ always-on lateral control 2026-11-14 02:41:55 -06:00
Dom 0e82572c96 Fix navigation dependencies in external reset test fixture 2026-11-14 01:38:32 -06:00
firestar5683 1482651e01 Preserve stronger evidence before skipping overlapping sign reads 2026-11-14 00:50:56 -06:00
firestar5683 bea8362cc4 Avoid redundant numeric reads after consistent small-sign evidence 2026-11-14 00:34:38 -06:00
firestar5683 d0e7b72633 Refresh modem status while eSIM profile work is pending 2026-11-14 00:33:58 -06:00
Dom ad66c8270b Cover large camera lead display contract without relaxing paint checks 2026-11-13 23:59:37 -06:00
prabhaavp 55aeb4ef93 Merge pull request #306 from dirwin31/StarPort-Spotify-Dom
StarPort: Cover Wash music widget and Spotify handoff when driving
2026-11-14 00:56:03 -05:00
Prabhaav Pillai 18a86ba285 artwork URL validation and enhance touch handling for favorites overlay 2026-11-14 00:50:27 -05:00
prabhaavp 747aa3c5c9 Merge pull request #305 from dirwin31:ModelManager
Model Manager: Combine the Models page and Model Laboratory
2026-11-14 00:32:54 -05:00
Prabhaav Pillai e5dac7456d - Added the Toggles-style directional swipe between Single model and Model pair.
- Fixed Developer’s transition, including when entering from Vehicle.
- Aligned reverse-proxy fields and Save spacing using shared Galaxy styles; no new CSS.
- Updated the Jetlink guide URL which was broken.
2026-11-14 00:32:11 -05:00
firestar5683 59567a88d1 Keep classic Bosch Honda discovery on normal CAN wiring 2026-11-13 23:19:43 -06:00
firestar5683 a39fb5bc7d Keep ACC Bolt dashboard status through physical paddle input 2026-11-13 23:17:27 -06:00
Dom bf68447214 Isolate Toyota planner notification params in test 2026-11-13 23:11:24 -06:00
prabhaavp 7bb100ea68 Merge pull request #304 from dirwin31:AddGoogleandAppShare
Google Maps and Share to StarPilot Navigation
2026-11-14 00:08:44 -05:00
Prabhaav Pillai d85355fc20 Setup incorrectly said Google cannot search places fixed. buttons duplicated shared CSS. A few minor touch-ups. 2026-11-14 00:08:30 -05:00
Dom 535fe0f5f3 Clear UI model management lint regressions 2026-11-13 20:48:47 -06:00
Danny 3f6e239cc5 ModelManager: Cleanup 2026-11-13 18:23:26 -08:00
Danny a1581a833e Model Manager: Fold Model Laboratory into the Models page 2026-11-13 18:23:26 -08:00
Danny 137b1a55a5 Model Manager: Refresh model controls and show download progress
Co-authored-by: AngusBell97 <124716116+AngusBell97@users.noreply.github.com>
2026-11-13 18:23:26 -08:00
FuriouslyRed 1d5fa9a805 Add isolated 2025 Subaru Impreza platform
- Register SUBARU_IMPREZA_2025 (Gen2 angle, subaru_d harness) with 2025
  Impreza RS specs: 1,486 kg, 2.67 m wheelbase, Subaru's 13.0:1 steering
  ratio.
- Add captured firmware IDs (abs, eps, fwdCamera, engine) so the car matches
  exactly instead of being forced onto SUBARU_CROSSTREK_2025.
- Introduce SubaruSafetyFlags.IMPREZA_2025_ANGLE (8192) selecting an
  Impreza-specific 13.0 angle VM profile in panda safety. The Crosstrek 2025
  entry and its 17.0 geometry are left untouched, so this is isolated.
- Wire the platform through GEN2_ANGLE_PORTS, ANGLE_CARS,
  SCOPED_CANDIDATES, carstate cruise sourcing, jacobw angle limiting and AOL
  admission.
- Add torque substitute, firmware-identity and output-contract coverage.

Tests: opendbc/car/subaru/tests (207 passed), opendbc/car/tests interface
(713 passed), docs/config/limits/vehicle-model (604 passed).
2026-11-13 20:48:44 -05:00
Dom c8c5a5e567 Keep GM planner notification settings in temporary test params 2026-11-13 19:18:45 -06:00
Danny 14044e97f0 Navigation: Tidy shared route hardening and fix type errors 2026-11-13 17:01:12 -08:00
Dom 1c1a3c033c Recover modem ports after AGNOS udev removal 2026-11-13 19:00:12 -06:00
Danny 18f0ad2579 Option to automatically move Spotify to StarPilot when device goes onroad 2026-11-13 16:48:07 -08:00
Danny d2260cf6d6 StarPort: Cover Wash music widget with big and small sizes
Co-authored-by: Peter Nguyen <trung791997@gmail.com>
2026-11-13 16:44:55 -08:00
Danny 49c1634c05 Navigation: Harden shared routes 2026-11-13 16:33:40 -08:00
Dom f625d1a7ed Start verified Ioniq 6 neutral traffic before selfdrive events 2026-11-13 18:27:50 -06:00
Danny fd32ee3924 Navigation: Allow Stopping of Navigation from App Sent Directions 2026-11-13 16:21:52 -08:00
Danny aadacb8854 Navigation: Less Zooming 2026-11-13 16:21:49 -08:00
Danny 678afedb51 Navigation: Fix Static Analysis Type Errors 2026-11-13 16:14:37 -08:00
Danny 4aa1de2d57 Navigation: Add Mapbox Setup Guide 2026-11-13 16:14:37 -08:00
Danny 33236b62fc Navigation: Add Support for Sharing from Waze 2026-11-13 16:14:37 -08:00
Danny 3adb73f702 Navigation: Billing wording and Limit Gaurdrail 2026-11-13 16:14:37 -08:00
Danny b31cf76e57 Clearer Google Setup 2026-11-13 16:14:37 -08:00
Danny f2ff176439 Navigation: Wait for Load Before Showing Needs Key 2026-11-13 16:14:36 -08:00
Danny db98ca20ee Navigation: Easy sharing and cleaner pages 2026-11-13 16:14:36 -08:00
Danny d87411b874 Navigation: Google map and traffic routes 2026-11-13 16:14:36 -08:00
dirwin31 512ec97f45 Navigation: End navigation when parked at the destination 2026-11-13 16:14:36 -08:00
Dom 24a9134b77 Append schema test field after departure-alert ordinals 2026-11-13 18:12:57 -06:00
firestar5683 f061b1f2a9 Read posted speed signs above amber driver feedback displays 2026-11-13 17:54:11 -06:00
Dom c15a1ea551 Refresh receipt after navigation layout adjustment 2026-11-13 17:51:54 -06:00
firestarsdog 8286d1ab48 Large Nav Card Size Adjustment 2026-11-13 18:32:07 -05:00
Dom 4479bc679d Complete three visible speed-limit purple pulses 2026-11-13 17:27:09 -06:00
firestar5683 fa5d114a4c Restore optional green-light and lead-departing alerts 2026-11-13 17:22:34 -06:00
firestarsdog 9cea3a32eb Show lead info above the Large UI lead marker 2026-11-13 17:59:50 -05:00
firestar5683 69667edae6 Preserve Subaru MAIN rearming through brake and signal pauses 2026-11-13 16:59:21 -06:00
Dom b2f0af723a Include Ioniq 6 startup hook in GM test doubles 2026-11-13 14:27:06 -06:00
Dom a2d72bc1fb Restore selfdrived executable mode 2026-11-13 14:11:20 -06:00
Dom 87cd9c5194 Type Model Laboratory AST statements explicitly 2026-11-13 14:08:14 -06:00
firestar5683 cd14e49eac Cover MQB MAIN heartbeat recovery in native safety tests 2026-11-13 14:00:52 -06:00
firestar5683 c5a07fb544 Build matching Panda firmware for MQB MAIN and Cancel recovery 2026-11-13 14:00:51 -06:00
firestar5683 206bb821ad Merge qualified MQB recovery with current Dom 2026-11-13 14:00:48 -06:00
firestarsdog 0f8619b16e Add model management to the large Driving Model page 2026-11-13 14:51:46 -05:00
firestar5683 768a7c476e Restore MQB MAIN arming and lateral-only Cancel 2026-11-13 13:46:53 -06:00
firestar5683 c46de23878 Release turn-signal guidance after completed stops 2026-11-13 13:28:11 -06:00
firestar5683 d016eb74ae Restore Model Laboratory page loading 2026-11-13 13:14:56 -06:00
firestar5683 0bb3553777 Fix Model Laboratory startup and reviewed source bindings 2026-11-13 12:05:48 -06:00
firestar5683 8053cec8a1 Publish Ioniq 6 startup readiness before model events 2026-11-13 11:50:02 -06:00
firestar5683 f54c1a8d8e Protect AOL callbacks with the Panda memory guard 2026-11-13 11:40:45 -06:00
firestar5683 a07638d130 Maintain neutral Ioniq 6 cruise traffic during model startup 2026-11-13 11:32:52 -06:00
firestar5683 a7b2d2aae6 Help Experimental reach set speed after weak recovery 2026-11-13 11:08:09 -06:00
firestarsdog cc490a1090 Fix linux desktop ui 2026-11-13 11:50:03 -05:00
firestar5683 ac8f8e63c5 Continue FLM analysis after interrupted recordings 2026-11-13 16:38:19 +00:00
firestar5683 02dab00034 Soften Ioniq 6 friction response to highway hunting 2026-11-13 10:27:17 -06:00
firestar5683 5661cecedf Preserve armed Subaru intent through stopped feedback gaps 2026-11-13 10:22:39 -06:00
firestar5683 f9b9550942 Remove redundant Laboratory runtime section 2026-11-13 10:16:33 -06:00
firestar5683 6c438e0490 Show Galaxy tuning preparation as a toggle 2026-11-13 10:15:37 -06:00
firestar5683 6b329d83f5 Restore HKG startup handoff and independent lateral recovery 2026-11-13 10:10:48 -06:00
firestar5683 b834a9327a Simplify Driving Modes to Automatic, Chill and Experimental 2026-11-13 10:05:09 -06:00
Dom 94538a3d4f Restore first-generation EV6 wheel media controls
Restore the pre-rebase selected E-CAN 0x448 mapping for KIA_EV6 only, including HDA I and offset buses. Keep freshness and gesture guards and avoid borrowing Ioniq-specific AOL policy.
2026-11-13 09:39:49 -06:00
Dom ab468b8ecd Preserve Highway Smoothing scale guidance in Galaxy description 2026-11-13 00:58:43 -06:00
Dom bae4d19e55 Supply extracted reset helper to real-handler test fixture 2026-11-13 00:16:27 -06:00
Dom 813b5829c5 Repair CI lint, fixture initialization and UI module size without changing driving behavior 2026-11-12 23:43:26 -06:00
jacobwaller 242917ae63 Integrate Jacob Waller hackathon Subaru angle steering 2026-11-12 22:46:39 -06:00
jacobwaller de2df523a1 --claude-ese, move test to test_subaru.py 2026-11-12 22:44:35 -06:00
jacobwaller a5f9c31a65 SR 17 -> 13 2026-11-12 22:44:35 -06:00
jacobwaller 24fb006c36 Subaru: 2025 Crosstrek angle steering support 2026-11-12 22:44:34 -06:00
firestar5683 0373665e7b Make Highway Smoothing increase from zero 2026-11-12 22:06:39 -06:00
firestar5683 4cef332aeb Remove duplicate Galaxy torque reset actions 2026-11-12 22:01:10 -06:00
firestar5683 667d050f31 Isolate corrupt drive inputs without blocking valid FLM analysis 2026-11-13 03:44:13 +00:00
firestar5683 5817fccf80 Update AGNOS to 20.5.2 with C3 and Bluetooth startup repairs 2026-11-12 21:41:00 -06:00
firestar5683 0db76dabfe Build matching artifacts for drive-mode and cooling settings 2026-11-12 21:17:11 -06:00
firestar5683 3b917fe0a7 Place vehicle drive-mode and cooling settings in their sections 2026-11-12 20:59:15 -06:00
whoisdomi 8f7d59fe18 Aggressive Cooling toggle for 3/3X 2026-11-12 20:45:51 -06:00
whoisdomi a6b9871260 Match Drive Mode button to accel/decel profile 2026-11-12 20:44:15 -06:00
whoisdomi 5df51fc211 Highway Smoothing 2026-11-12 20:41:58 -06:00
gotens87 be278565fa Radar lat sign fix (leads were mirrored) 2026-11-12 20:21:45 -06:00
firestar5683 81a9e19e33 Match faster approaching STOP signs in display-only confirmation 2026-11-12 19:36:40 -06:00
firestar5683 fa4531b393 Preserve ordinary acceleration when fading Traffic profiles 2026-11-12 19:31:23 -06:00
firestar5683 19d4aef2f8 Recover small speed signs while retaining existing detector outputs 2026-11-12 19:21:18 -06:00
firestar5683 7f9904af5c Confirm approaching STOP displays without relaxing braking evidence 2026-11-12 18:49:41 -06:00
firestar5683 f8da463831 Improve speed sign recall while preserving confirmation boundaries 2026-11-12 18:37:17 -06:00
firestar5683 d3c322e578 Describe saved steering values without promising current application 2026-11-13 00:17:09 +00:00
firestar5683 d988ba3e8b Keep learning when derived steering history reaches its storage bound 2026-11-13 00:00:05 +00:00
whoisdomi e4c6f50f77 Auto Time correction and Car date/time use
Uses car date/time (hkg signal) if gps/wifi doesn't provide a date and time.
This will prevent old date/time and log from being erased.
2026-11-12 17:26:01 -06:00
firestar5683 3eb56a495c Retain narrow sign reads meeting the original height and area floors 2026-11-12 16:57:57 -06:00
firestar5683 c743b04705 Read visible median speed signs when the right sign is obstructed 2026-11-12 16:53:58 -06:00
firestar5683 419d3b28bc Keep supported steering suggestions steady and use growing drive evidence 2026-11-12 22:43:41 +00:00
firestar5683 2c260caec2 Keep Faster Takeoffs type checks clean 2026-11-12 15:56:08 -06:00
firestar5683 9802e9ed71 Keep pinned FLM candidate validation independent of Dom pushes 2026-11-12 21:49:47 +00:00
firestar5683 28685bbe2d Allow global Faster Takeoffs up to 3.5 m/s² 2026-11-12 15:46:01 -06:00
firestar5683 446c450e09 Allow stronger optional Faster Takeoffs 2026-11-12 15:03:28 -06:00
firestar5683 14f4140562 Reject conditional speed numerals inset in informational boards 2026-11-12 14:54:30 -06:00
firestar5683 3cd3b09d92 Retire mismatched Tesla radar object pairs 2026-11-12 14:20:11 -06:00
firestar5683 559101efc5 Keep regression fixtures valid under CI checks 2026-11-12 14:12:12 -06:00
firestar5683 6305678462 Preserve HDA1 cluster equipment alongside lateral icons 2026-11-12 14:05:34 -06:00
firestar5683 9e102e8f12 Isolate Laboratory tests from bundled model verification 2026-11-12 14:05:33 -06:00
Dom 16dad59361 Finish speed-limit highlights across retained-sign transitions 2026-11-12 13:59:11 -06:00
firestar5683 2064eb078f Show Hyundai lateral activity independently of cruise engagement 2026-11-12 13:56:49 -06:00
firestar5683 d260cc07ad Restore observed GEN1 Rivian radar tracks without changing actuation 2026-11-12 13:56:48 -06:00
firestar5683 ca3bd0070d Review ordinary-cruise response in Hyundai planner replay 2026-11-12 13:56:48 -06:00
firestar5683 dbe6cf56ea Avoid control-loop waits in settings and message reads 2026-11-12 13:49:35 -06:00
Danny 91782d7917 StarPort: Main-tier H.265 and answer the car's UI config request 2026-11-12 13:39:42 -06:00
firestar5683 2036c092ec Wait for the C3 Panda without requiring udev 2026-11-12 13:35:24 -06:00
firestar5683 48575ee24d Retain lane-position feedback through curves and line transitions 2026-11-12 13:30:23 -06:00
firestar5683 ebb562d1a1 Show Enhanced Stop and reduce onroad UI settings work 2026-11-12 12:38:30 -06:00
firestar5683 e38f9208b6 Retain bounded single-line corrections through path disagreement 2026-11-12 12:19:35 -06:00
firestar5683 d79e0ba3e4 Keep Faster Takeoffs strong beyond the first few mph 2026-11-12 12:18:39 -06:00
Dom 494958f74f Synchronize HTTP drain capacity regression test 2026-11-12 12:16:49 -06:00
Danny d5367c9cf2 StarPort: Main-tier H.265 and answer the car's UI config request 2026-11-12 09:41:48 -08:00
firestar5683 ad7b0f5845 Include HDA1 LFA status in RELEASE vehicle qualification 2026-11-12 11:25:49 -06:00
firestar5683 f39dd417db Track sustained lane-position error through curves 2026-11-12 11:22:46 -06:00
firestar5683 8672982076 Keep offline map coverage when adding regions 2026-11-12 11:19:46 -06:00
firestar5683 db3f6f61ef Update retained AGNOS image to 20.5.1 2026-11-12 11:05:07 -06:00
firestar5683 c768e38928 Preserve HDA1 LFA status and optional speed units 2026-11-12 10:57:06 -06:00
firestar5683 aea2e0b628 Soften ordinary cruise acceleration after speed increases 2026-11-12 10:47:52 -06:00
firestar5683 c83affa422 Trust StarPilot with AGNOS 20.5.1 compatibility 2026-11-12 10:27:47 -06:00
firestar5683 518664f822 Trim redundant transport pause comments 2026-11-12 10:17:21 -06:00
firestar5683 3c81634df0 Test filtered SLC correction during source loss 2026-11-12 10:02:19 -06:00
firestar5683 68590afba4 Stabilize SLC dashboard speed correction 2026-11-12 09:43:39 -06:00
firestar5683 805acabc4c Preserve Subaru AOL through brake joins and show armed stops 2026-11-12 09:16:22 -06:00
firestar5683 b0f6b622e4 Allow Canada and Japan offline map downloads 2026-11-12 08:39:46 -06:00
firestar5683 da8e66d61a Bind native mutation fixtures and guard callback memory safety 2026-11-12 08:19:51 -06:00
firestar5683 c974c96c7d Test Honda legacy authority deadlines and axis masks 2026-11-12 03:07:13 -06:00
firestar5683 06c5add1ef Verify Honda required RX alternatives by profile 2026-11-12 03:01:45 -06:00
firestar5683 11ecb582a3 Preserve coverage notes in safety build cleanup tests 2026-11-12 02:55:29 -06:00
firestar5683 744c49e3ac Cover every Toyota stock AOL profile 2026-11-12 02:51:51 -06:00
firestar5683 b47f8b6133 Keep safety mutation runs isolated and bounded 2026-11-12 02:42:07 -06:00
firestar5683 7e6d08187b Preserve fresh native fixture state while retaining Debug mutations 2026-11-12 01:37:42 -06:00
firestar5683 680b234f49 Keep mutation fixtures on active native code and test Honda boundaries 2026-11-12 01:29:25 -06:00
firestar5683 97b0d287b2 Provide real Honda parsers in Card engagement fixture 2026-11-12 00:53:33 -06:00
firestar5683 5f63265d52 Keep safety mutation targets separate from test fixtures 2026-11-12 00:22:08 -06:00
firestar5683 e2d0362316 Run complete safety test catalog and cover internal source guards 2026-11-12 00:16:52 -06:00
firestar5683 68f13877e4 Cover Honda AOL EPS and driving gear boundaries 2026-11-12 00:06:33 -06:00
firestar5683 03e93fc072 Test Honda interceptor command boundaries and callback completion 2026-11-12 00:03:17 -06:00
firestar5683 7206a876ff Keep AOL intent documentation within source budget 2026-11-11 23:59:27 -06:00
firestar5683 6e3738760d Preserve Honda lateral request when cancelling cruise 2026-11-11 23:46:36 -06:00
firestar5683 4771e387c1 Preserve Honda lateral request when cancelling cruise 2026-11-11 23:38:41 -06:00
firestar5683 97b16df57c Hold stopped radar leads and soften CR-V crawl steering feedback 2026-11-11 23:28:48 -06:00
firestar5683 426fac53c4 Preserve the full Chromium check deadline in its parent runner 2026-11-11 21:55:41 -06:00
firestar5683 b209f63f1f Separate HKG steering and qualified dashboard status contracts 2026-11-11 21:52:58 -06:00
firestar5683 e73002219e Align saved AOL preference and Galaxy test fixtures 2026-11-11 21:47:47 -06:00
firestar5683 ab52c4fdcd Bound replay provenance without duplicating historical records 2026-11-11 21:21:21 -06:00
firestar5683 07bd9beea6 Run browser UI contracts once and identify stalled requests 2026-11-11 21:11:18 -06:00
firestar5683 112a04d02b Preserve speed-limit presentation contracts and startup expectations 2026-11-11 21:02:49 -06:00
firestar5683 abae95422e Correct AOL async save regression types 2026-11-11 20:48:29 -06:00
firestar5683 207eaec128 Calm standard Ioniq 6 friction feedback 2026-11-11 20:42:33 -06:00
firestar5683 df785f59f7 Restore EV6 HDA1 AOL and global master configuration 2026-11-11 20:41:21 -06:00
firestar5683 9fa80a78e7 Restore Malibu Hybrid physical SET engagement 2026-11-11 20:34:39 -06:00
firestar5683 fbaddd5ddd Align runtime test fixtures with current presentation and planner inputs 2026-11-11 20:29:45 -06:00
firestar5683 f1ceae914a Reduce CAN-FD state parsing overhead without changing flag decisions 2026-11-11 20:19:04 -06:00
firestar5683 9c8c8361bd Restore FLM capture for the qualified paired-model producer 2026-11-12 01:31:40 +00:00
firestar5683 a9821f4741 Retain stock AOL intent through expired host requests 2026-11-11 19:28:16 -06:00
firestar5683 ada7a40e47 Remove temporary sampling from the Card control loop 2026-11-11 19:10:59 -06:00
firestar5683 1fe327817c Accumulate steering evidence across completed drives 2026-11-11 23:48:33 +00:00
firestar5683 2638564c72 Show only model names on the home screen 2026-11-11 17:45:29 -06:00
firestar5683 67c71a504e Move Vehicle toggles after Localization 2026-11-11 17:32:06 -06:00
firestar5683 85df762e34 Fix Laboratory startup and steering availability display 2026-11-11 17:20:00 -06:00
firestar5683 e0623c7622 Tidy Galaxy model history and group vehicle controls under Toggles 2026-11-11 16:41:30 -06:00
Matt Purnell bf0880f064 Subaru: the high-angle guard hands back on the angle alone 2026-11-11 16:13:22 -06:00
firestar5683 9dadd4e4a8 Enable Enhanced Stops by default on new installs 2026-11-11 16:09:42 -06:00
firestar5683 0ffe5859ff Show Laboratory model pairs and selection status 2026-11-11 16:05:50 -06:00
firestar5683 b14b12fb34 Show initialization status before steering can engage 2026-11-11 15:47:41 -06:00
firestar5683 fff5278ca2 Clarify shared test helper types and require sign bounds 2026-11-11 15:37:50 -06:00
firestar5683 39ef918cbb Give Faster Takeoffs its full low-speed acceleration budget 2026-11-11 15:29:50 -06:00
firestar5683 947c045b66 Keep shared CAN FD lateral status aligned with active steering 2026-11-11 15:24:10 -06:00
firestar5683 0c544bac01 Soften Carnival crawl-speed centering corrections 2026-11-11 15:17:02 -06:00
firestar5683 76d69dfc8d Reject yellow advisory panels as speed limits 2026-11-11 15:15:12 -06:00
firestar5683 241f7f4b86 Apply modeld low-speed curvature floor to catalog models 2026-11-11 15:00:11 -06:00
firestarsdog fda184225d Correct sign size/sign size + offset sizes 2026-11-11 15:55:00 -05:00
firestar5683 267c2bb2ce Keep unconfirmed stop forecasts current until explicit stop intent 2026-11-11 14:16:09 -06:00
Dom dc60049a25 Fix static CI contracts without changing runtime behavior 2026-11-11 13:26:36 -06:00
firestar5683 e76c6937d4 Review eight recent drives in logger order 2026-11-11 19:01:37 +00:00
firestar5683 894a0978d2 Finish pending completed-drive reviews after newer trips 2026-11-11 18:47:22 +00:00
firestar5683 208ef1d8cd Keep shared HKG lateral through longitudinal cancel handoffs 2026-11-11 11:51:01 -06:00
firestar5683 0408331664 Match the inactive-session test collector to its reader contract 2026-11-11 17:46:52 +00:00
firestar5683 c62f082fc6 Preserve Ioniq 5 PE stop targets through distance braking 2026-11-11 11:42:19 -06:00
firestar5683 4311ecce8d Keep steering observations continuous across analysis windows 2026-11-11 17:29:39 +00:00
firestar5683 1a5f1830b5 Log vision producer session reset reasons 2026-11-11 11:24:04 -06:00
firestar5683 72f17eeaa4 Preserve historical Ioniq 6 replay calibration references 2026-11-11 11:07:32 -06:00
firestar5683 b70f2f5980 Avoid unused speed-sign material masks 2026-11-11 11:04:12 -06:00
firestar5683 18f296956d Wrap FLM source checks to satisfy lint 2026-11-11 11:02:13 -06:00
firestar5683 33f60615ea Damp 2025 Ioniq 6 highway steering oscillation 2026-11-11 10:57:51 -06:00
firestar5683 c68461e3b3 Review original sections of long drives without discarding usable evidence 2026-11-11 16:42:47 +00:00
gotens87 60ad5281af Do not treat Camry LDA status as an LKAS press 2026-11-11 10:21:02 -06:00
firestar5683 8e93603f13 Allow long completed drives to finish bounded FLM analysis 2026-11-11 16:09:45 +00:00
firestar5683 0ac28099d1 Rename Force Stops to Enhanced Stops 2026-11-11 10:06:50 -06:00
firestar5683 bc2917050d Retry interrupted vision clock sampling once 2026-11-11 09:45:38 -06:00
firestar5683 1a957f5fcb Preserve exact lane geometry in the combined UI projection 2026-11-11 09:13:47 -06:00
firestar5683 666f86fe8b Skip unused compact sidebar work and invisible polygons 2026-11-11 09:10:05 -06:00
firestar5683 6e51802ad5 Skip reads for unadmittable speed-sign proposal suffixes 2026-11-11 09:08:49 -06:00
firestar5683 740b590ba9 Reduce redundant UI layout and lane projection work 2026-11-11 09:01:13 -06:00
firestar5683 1305ad346c Restore the original compact HUD while retaining speed-limit controls 2026-11-11 08:22:22 -06:00
firestar5683 4954cf4d16 Skip terminal sign reads that cannot be admitted 2026-11-11 08:04:38 -06:00
firestar5683 31c350f09a Preserve warning context when checking speed signs 2026-11-11 06:52:59 -06:00
firestar5683 10b9c7aef3 Make drive findings and tuning status clear in Galaxy 2026-11-11 08:28:05 +00:00
firestar5683 419d32286a Split guided setup styles below the source size limit 2026-11-11 00:05:54 -06:00
firestar5683 098b00dc78 Register Ford brake regressions in host suites 2026-11-10 23:41:09 -06:00
prabhaavp 914c0827a8 Merge pull request #291 from dirwin31:StarportPoleStar
Starport PoleStar, Spotify Buffer, Wifi Drop Fix
2026-11-11 00:28:57 -05:00
Prabhaav Pillai f56aac4516 guarded callback for supervisor 2026-11-11 00:28:11 -05:00
firestar5683 6d3fe67579 Restore selfdrived executable mode 2026-11-10 23:11:21 -06:00
firestar5683 a69891d7bd Preserve Polestar stock CAN cadence while inactive 2026-11-10 23:09:33 -06:00
firestar5683 1d4bd99a02 Keep Ford source fault alerts on the ordinary timer 2026-11-10 23:07:59 -06:00
Dom 8507c129c7 Place Model Laboratory pair controls above the catalog 2026-11-10 22:51:58 -06:00
firestar5683 d19bfa5a59 Fix Ford brake handoff and late source fault timing 2026-11-10 22:49:18 -06:00
firestar5683 e85ededb8f Resynchronize Polestar angle commands on engagement 2026-11-10 22:42:05 -06:00
firestar5683 ded2aceced Preserve independent HKG lateral across cancel deadline joins 2026-11-10 22:36:34 -06:00
firestar5683 4c5de70635 Refresh numeric classifier asset metadata 2026-11-10 20:53:06 -06:00
Dom 6b9c18a341 Type the dynamic Galaxy navigation test namespace 2026-11-10 20:12:48 -06:00
firestar5683 d5854a96e5 Avoid dominated final numeric sign reads 2026-11-10 20:11:26 -06:00
firestar5683 8082751dce Expose vehicle settings in Galaxy and Android Auto navigation 2026-11-10 19:33:42 -06:00
firestar5683 fa9ff611e9 Align integration fixtures with reviewed schema and planner behavior 2026-11-10 19:24:16 -06:00
firestar5683 621cc55ea4 Use scoped mocks in vision reader tests 2026-11-10 19:20:32 -06:00
firestar5683 7f2273aabf Avoid numeric reads that cannot change sign results 2026-11-10 18:53:34 -06:00
firestar5683 d574b959c1 Retain brake-release intent across a matched warning handoff 2026-11-10 18:35:26 -06:00
firestar5683 391c8a5dfc Retain AOL intent through repeated warning and native recovery joins 2026-11-10 18:26:01 -06:00
firestar5683 ad04b2d7ff Show recorded tuning recommendations independently of automatic saving 2026-11-11 00:20:39 +00:00
firestar5683 17354b120b Cover ordinary Tesla AOL in exhaustive profile isolation tests 2026-11-10 18:18:21 -06:00
firestar5683 80e008d5a5 Restore executable mode and keep the UI within its size limit 2026-11-10 18:14:17 -06:00
firestar5683 84c8ed1284 Include the longitudinal plan in schema evolution expectations 2026-11-10 18:06:53 -06:00
firestar5683 4bb9dabdf5 Restore Tesla AOL for standard and screen harnesses with matching firmware 2026-11-10 17:49:38 -06:00
firestar5683 99c3e82d28 Preserve guard interfaces and make runtime types explicit 2026-11-10 17:37:25 -06:00
firestar5683 10f4de8369 Preserve Toyota lateral control during early gas withdrawal 2026-11-10 17:36:10 -06:00
firestar5683 dd532d607e Restore Tesla AOL without the optional screen harness 2026-11-10 17:31:30 -06:00
firestar5683 3d7a0d392b Preserve STOP confirmation history across expiry gaps 2026-11-10 17:26:41 -06:00
firestar5683 64c8c7f664 Include bus validation in Ioniq preflight test extraction 2026-11-10 16:56:01 -06:00
firestar5683 0b1a773181 Align model runtime types while preserving source guards 2026-11-10 16:50:00 -06:00
firestar5683 82b845dbc1 Fix Ioniq Force Stop placement and smooth final braking 2026-11-10 16:38:58 -06:00
firestar5683 b6d2afbc2a Keep terminal Force Stop targets closed during range refinement 2026-11-10 16:34:06 -06:00
firestar5683 8fa58cf8a8 Preserve current Force Stop sign ranging with Ioniq distance braking 2026-11-10 16:31:00 -06:00
firestar5683 717b8f93c6 Keep fixed Force Stop endpoints latched 2026-11-10 16:28:02 -06:00
firestarsdog 37cb8fe772 Build Assets 2026-11-10 17:15:31 -05:00
whoisdomi 2a854471fc Stabilize low-speed steering and force-stop behavior
Consolidates commits authored by whoisdomi:

- 64df004be1 No twitch test?
- 3426045d1e twitch 2
- 2a4676dfca Force Stop fix
- 233a386ab4 twitch 2 fix
- f831010290 force stop edge case
- 00d46b482d Force Stop: use Vision Stop distance
- ec0221c16f twitch 3
- c86a4ac8d6 Force Stop Signs behind leads
- d7d1fa02a1 Twitch 5
- 7e72a4bd8e Force stop fix 2

Keep the model action curvature floor at 2.5 m/s, matching bluescreensonly4.
2026-11-10 17:14:15 -05:00
firestarsdog 6a469e232b Rework speed-limit control, integration, and HUD
Consolidates source, test, documentation, and UI asset changes authored by firestarsdog:

- 5f3ea81785 SLC Squish
- e54b3f9e36 Normalize stopped speeds to preserve SLC overrides
- fc981552b3 Clarify SLC targets and confirmation prompts
- 891454e47c Align speed HUD for clearer SLC prompts
- 4e4d258ad3 Visual Polish + Suppress "LAST" in UI
- 5b896476d6 rm historic adopted speed on engage

Generated device build outputs are recorded separately after the source commits.
2026-11-10 17:14:15 -05:00
firestar5683 87bef90abf Fix Force Stop preview tracking and requested braking release 2026-11-10 16:08:35 -06:00
firestar5683 9f45afd3ec Track moving Force Stop previews and ease requested braking release 2026-11-10 16:01:29 -06:00
firestar5683 960bc90d73 Align CI fixtures with radarless braking and model runtime support 2026-11-10 16:00:19 -06:00
firestar5683 5f9d63494a Preserve classic HKG lateral intent across cruise cancellation health updates 2026-11-10 15:49:25 -06:00
firestar5683 682b3fee0c Limit Laboratory pairs to one Big model 2026-11-10 15:26:01 -06:00
firestar5683 5f2457c177 Update reviewed external-Panda radar replay manifest 2026-11-10 15:21:22 -06:00
Danny e095271b2a StarPort: Music Pipe, Network Join And PoleStar Support 2026-11-10 13:17:16 -08:00
Danny d8534a0eb1 Spotify: Audio Routing And Resampling Quality 2026-11-10 13:17:15 -08:00
firestar5683 b629f70ce6 Enable Model Laboratory pairs 2026-11-10 15:10:24 -06:00
firestar5683 eefae213bc Extract rear-fog snapshot updates from the runtime UI 2026-11-10 15:00:25 -06:00
firestar5683 c4c32e0068 Restore Original Stop Sign Indicator 2026-11-10 14:58:08 -06:00
firestar5683 4b133c8785 Repair integration CI fixtures and reviewed radar reference 2026-11-10 14:49:55 -06:00
firestar5683 736a90396d Make Confirmed Stop Signs Clearly Visible 2026-11-10 14:47:03 -06:00
firestar5683 96168aaf6c Keep inconclusive FLM trials eligible for bounded evaluation 2026-11-10 20:32:08 +00:00
firestar5683 4e41b13a21 Build Civic AOL recovery against current Dom 2026-11-10 14:22:57 -06:00
Dom 5114f466a4 Preserve Civic AOL intent through temporary EPS restrictions 2026-11-10 14:20:55 -06:00
firestar5683 9fc9484022 Refresh Galaxy browser assets without losing pairing 2026-11-10 14:15:53 -06:00
firestar5683 bf92602a4f Build AOL audio fix against current Dom 2026-11-10 14:14:07 -06:00
Codex 46fdb2d853 Confirm effective lateral activation before engagement chimes 2026-11-10 14:11:09 -06:00
firestar5683 34e74abdec Allow Ford stock conventional cruise with always-on lateral 2026-11-10 14:07:51 -06:00
Danny a825f50b0f Build Sentry integration against current Dom 2026-11-10 13:10:04 -06:00
Danny 6bc586567c Merge current Dom into hardened Sentry integration 2026-11-10 13:07:43 -06:00
Danny fd0f043123 Build hardened Sentry camera integration 2026-11-10 13:07:17 -06:00
firestar5683 c8e629571b Show every recorded model on the Galaxy dashboard 2026-11-10 13:05:09 -06:00
firestar5683 6a6ee5cb33 Tighten Sentry camera test fixture types 2026-11-10 13:03:56 -06:00
Sentry Validation ab7bcd93bc Merge commit '9f4401f29447687d7a853075ed3cd6f97366d103' into HEAD 2026-11-10 12:57:45 -06:00
firestar5683 9f4401f294 Retain fresh HKG AOL arming through stopped-engine EPS pauses 2026-11-10 12:56:03 -06:00
firestar5683 551b781a26 Use the native clock fallback for Ford fog previews 2026-11-10 12:52:59 -06:00
Sentry Validation d957963090 Merge commit '31c7f5ad8e91ed527a36b12c5e63496beed41cd0' into HEAD 2026-11-10 12:44:04 -06:00
Codex d0d7d31687 Merge remote-tracking branch 'origin/Dom' into sentry-exposure-hardening 2026-11-10 12:40:12 -06:00
Codex 354dbcff06 Bind parked snapshot readiness to fresh camera evidence
Harden the Python-only Sentry snapshot improvements from #289 while retaining Danny’s original commit. Require sustained, frame-matched exposure evidence; revoke readiness on contradictory metadata; preserve bounded fallbacks and selfie behavior. Bound batch readers to one lease, clean up independently, and prewarm once per motion episode.
2026-11-10 12:38:50 -06:00
firestar5683 31c7f5ad8e Add read-only Ford rear fog indicator and Galaxy widget 2026-11-10 12:37:41 -06:00
Danny 7959ed2412 Cameras: Faster Parked Sentry And Galaxy Snapshots 2026-11-10 10:14:11 -08:00
Dom 2f7c77dad6 Keep automatic modern Tesla discovery on normal CAN wiring
Recognize the modern party/AP CAN topology in the existing bounded passive query-family probe. Query live Tesla VIN and EPS firmware on normal bus 0 instead of the unrelated all-brand OBD mux sweep.

Preserve firmware identity, live CAN fingerprinting, factory safety configuration, and blocking native faults. Add Model 3/Y ISO-TP discovery and negative topology/authority regressions.
2026-11-10 11:59:19 -06:00
Dom bbdc5f72e4 Process physical wheel actions while the display sleeps 2026-11-10 11:43:56 -06:00
Dom 96406a608a Wait for settled wide-camera snapshot frames 2026-11-10 10:13:54 -06:00
firestar5683 c75d6bd3a6 Bind Numeric Reader Test Case Values 2026-11-10 09:20:49 -06:00
firestar5683 eca42cdb05 Skip Saturated Final Numeric Reader Expansion 2026-11-10 09:17:05 -06:00
firestar5683 8bb5e95773 Improve Speed Sign Identity Filtering 2026-11-10 07:42:30 -06:00
firestar5683 b8d223d6ff Reuse exact mixed Hyundai configuration qualification on the control path 2026-11-10 00:16:26 -06:00
firestar5683 9deb33800a Publish Fresh STOP Evidence Before Numeric Reading 2026-11-10 00:09:15 -06:00
firestar5683 cefe49d2fd Fix classic Ford dashboard handoff during lateral pause 2026-11-10 00:06:22 -06:00
firestar5683 4e0942a553 Restore Ioniq 6 Alpha Long compatibility across camera and external Panda layouts 2026-11-09 23:59:52 -06:00
firestar5683 f43de18e00 Reuse Identical Numeric Reader Crops Within A Frame 2026-11-09 22:51:31 -06:00
firestar5683 3edb88f68c Support Ioniq 6 longitudinal control on external Panda 2026-11-09 17:20:54 -06:00
firestar5683 438d015b7a Preserve GM stop-and-go authority at zero minimum speed 2026-11-09 16:28:34 -06:00
firestar5683 822956af74 Avoid Unused Speed Work In STOP-Only Vision 2026-11-09 15:41:32 -06:00
Dom 2933d7f779 Initialize stop-sign verifier state in reset fixture 2026-11-09 13:58:25 -06:00
firestar5683 02bc500f5c Reject non-regulatory signs with shared visual identity checks 2026-11-09 13:16:33 -06:00
firestar5683 8cb8ba18c4 Capture bounded Card publication timing after startup 2026-11-09 13:04:46 -06:00
prabhaavp 0783acb9a7 Merge pull request #287 from dirwin31/VendorPulseAudio
Spotify: vendor PulseAudio client libraries for AGNOS 20
2026-11-09 13:56:28 -05:00
firestar5683 1d02252b43 Fix static checks after Galaxy integration 2026-11-09 12:51:17 -06:00
dirwin31 d29f941ade Spotify: vendor PulseAudio client libraries for AGNOS 20
AGNOS 20.2 no longer ships libpulse0 or libsndfile1, so the vendored
pulseaudio server failed to load (libpulsecommon-16.1.so not found) and
Soloist could not start on any output. Bundle libpulse, libpulse-simple,
libpulsecommon, libsndfile and its codecs from the same Ubuntu 24.04
build, and give the server, pactl, Soloist and the phone relay the
bundled library path.
2026-11-09 10:41:43 -08:00
Prabhaav Pillai efe485f610 build params 2026-11-09 13:35:56 -05:00
prabhaavp 9b9ebaa853 Merge pull request #283 from dirwin31:AddSentry
Add Sentry for Apps
2026-11-09 13:26:20 -05:00
Prabhaav Pillai 574aa45d99 relay enrollment could orphan an installation 2026-11-09 13:26:00 -05:00
firestar5683 51cc3a6a6f Refresh release inventory after StarPort integration 2026-11-09 12:24:40 -06:00
prabhaavp f4795596ee Merge pull request #286 from dirwin31:StarPortFixes-Dom
StarPort Better User Flow + Unique Scenario Setup
2026-11-09 13:20:55 -05:00
Prabhaav Pillai 5f869d701b css minor tweak 2026-11-09 13:19:49 -05:00
firestar5683 490983baaf Reduce lane-centering correction during planner recovery 2026-11-09 12:16:56 -06:00
firestar5683 4f9a680935 Restore PE direct-long steering target envelope 2026-11-09 11:54:40 -06:00
Dom ae78e738dc Keep historical lane preference fixtures schema-accurate 2026-11-09 11:35:54 -06:00
firestar5683 c782605ebc Preserve HKG AOL intent through native withdrawal joins 2026-11-09 10:58:53 -06:00
firestar5683 e1158eb847 Require cruise for automatic lane changes 2026-11-09 10:28:56 -06:00
firestar5683 e2a3802722 Preserve manual tuning descriptions while parked 2026-11-09 16:05:56 +00:00
firestar5683 e0f8b7a118 Preserve Panda power-save state during CAN error recovery 2026-11-09 10:03:08 -06:00
firestar5683 febb4ebdb2 Isolate Model Runtime Caches By User 2026-11-09 15:45:03 +00:00
Dom c6cdc7fa73 Keep FLM proposal regressions within the test file size gate 2026-11-09 03:48:01 -06:00
firestar5683 a9427aba54 Use consistent score units for automatic lateral proposals 2026-11-09 08:52:59 +00:00
firestar5683 13f914a54f Include short turns in automatic lateral proposals 2026-11-09 07:45:00 +00:00
firestar5683 adcf6ca32d Keep all vision worker threads on their owned cores 2026-11-09 00:55:01 -06:00
firestar5683 cf916938dd Retry transient Actionlint download failures 2026-11-09 00:31:41 -06:00
firestar5683 1272c27b8d Restore source-bound classic HKG advisory forwarding 2026-11-09 00:23:41 -06:00
firestar5683 f711833ba1 Preserve classic HKG lateral intent through stock pedal source gaps 2026-11-09 00:07:04 -06:00
Dom 68305fa238 Separate coordinate proposal tests and fix assertion spelling 2026-11-08 23:49:59 -06:00
firestar5683 fc1bdaae7d Consider all thirty lateral knobs from route symptoms 2026-11-09 05:29:58 +00:00
Dom 1b797b7359 Preserve Experimental preference during stock ACC fallback
Keep the full-time Experimental choice across temporary startup and cached UI longitudinal unavailability. Runtime authority and SafeMode checks are unchanged.

Cover stock-to-qualified restart, both native settings layouts, unsupported runtime states and explicit mode changes.
2026-11-08 21:29:22 -06:00
Dom 795799f4ab Split offroad native-output tests below source size limit 2026-11-08 21:14:49 -06:00
Danny 78ca988904 StarPort: Checklist cleanup for car fixes, logs and AAWireless 2026-11-08 18:43:39 -08:00
firestar5683 aae3767d89 Replay unchanged native limits before judging a learned tune 2026-11-09 02:24:36 +00:00
Danny 1489a45207 AAWireless: Static Wi-Fi address and wait for the adapter instead of asking to pair a car 2026-11-08 17:43:40 -08:00
firestar5683 22308dac24 Restore selfdrived executable mode 2026-11-08 18:49:06 -06:00
Danny bdf178effa StarPort: Try experimental fixes is the only switch, off by default 2026-11-08 16:44:46 -08:00
Danny cc51e9e415 Galaxy: Experimental fixes expand under Try experimental fixes 2026-11-08 16:44:42 -08:00
Danny c37cee5e80 StarPort: Phone ping as an experimental on-off toggle 2026-11-08 16:44:40 -08:00
Danny 3b1c908070 StarPort: Phone-style ping for dongles that wait on the phone 2026-11-08 16:44:39 -08:00
Danny 99c8825e3c StarPort: Cars list tool built from Bugsink drive reports 2026-11-08 16:44:38 -08:00
Danny 22f540f84d StarPort: Lint fixes for car-specific fixes 2026-11-08 16:44:36 -08:00
Danny a50a3af8bb StarPort: Report fix outcomes, focus milestones and head-unit versions 2026-11-08 16:44:34 -08:00
Danny 41c03a7d7f StarPort: Advise a car-specific fix in guided setup 2026-11-08 16:44:30 -08:00
Danny d4b781ab17 Galaxy: Car-specific fixes and collapsible Specific car experiments settings 2026-11-08 16:44:27 -08:00
Danny 34c63eef77 StarPort: Car-specific fixes engine with Bolt experimental rule 2026-11-08 16:44:24 -08:00
Danny 97944d4f7b StarPort: Clearer Log Send, Allow DC Followup 2026-11-08 16:44:22 -08:00
Danny 73e912a004 StarPort: Clearer Steps to User 2026-11-08 16:44:21 -08:00
Danny e87be77583 StarPort: Add VASM Monitoring Popups 2026-11-08 16:44:07 -08:00
Danny 72a57f4721 StarPort: Show the real widgets in the theme maker 2026-11-08 16:44:07 -08:00
Danny 15c21ec776 StarPort: Keep saved layouts when an update adds or changes widgets 2026-11-08 16:43:46 -08:00
Danny fca2d5ce78 Theme Maker: Stop the preview jumping when its status notes appear 2026-11-08 16:43:19 -08:00
firestar5683 2cbbbca5e2 Preserve MQB lateral intent through crawl and brake joins 2026-11-08 18:42:31 -06:00
firestar5683 8525214a37 Select feasible steering recommendations before validation 2026-11-09 00:19:14 +00:00
firestar5683 4f78a28b2e Keep CI fixtures aligned with actual controller configuration 2026-11-08 17:37:57 -06:00
firestar5683 f4d3b646f4 Enable openpilot explicitly in FLM source-renewal fixture 2026-11-08 16:36:44 -06:00
firestar5683 496e72ed00 Repair inherited CI contracts and build matching Panda artifacts 2026-11-08 16:08:45 -06:00
firestar5683 9be62987b5 Avoid shadowing Panda heartbeat state in MQB AOL 2026-11-08 15:55:59 -06:00
firestar5683 d39ea5382c Prevent false Ford recovery releases and steering refusals 2026-11-08 15:39:55 -06:00
Danny 364dbdbe5f Sentry: Tidy battery warning and status checks 2026-11-08 13:37:18 -08:00
Danny 55f20d42fd Sentry: Low battery alerts and clearer status when the car is on 2026-11-08 13:23:19 -08:00
Danny a16ecb2b8c Sentry: Poll without Message Resulted in Reset of Countdown 2026-11-08 13:23:19 -08:00
Danny 33ea2ab904 Sentry: Show Armed / Disarmed status clearly 2026-11-08 13:23:10 -08:00
firestar5683 349dde99db Fit actuator-visible steering recommendations before validation 2026-11-08 21:17:25 +00:00
firestar5683 0c9037b243 Cover first-press MQB guards in unittest safety discovery 2026-11-08 15:17:14 -06:00
firestar5683 8626158c5d Restore the rolling stopped-lead guard for MQB Alpha Long 2026-11-08 15:15:13 -06:00
firestar5683 0ae8a445bf Smooth Turn Assist transitions around straight steering requests 2026-11-08 15:11:32 -06:00
firestar5683 746e0da673 Build matching Panda firmware for first-press MQB engagement 2026-11-08 15:06:08 -06:00
firestar5683 1d5508b19d Accept the first MQB SET or RES before the host joins 2026-11-08 15:02:23 -06:00
firestar5683 1e0e06eef4 Preserve Subaru AOL intent through EPS brake event joins 2026-11-08 15:02:04 -06:00
firestar5683 c22785a22f Yield HKG direct-angle fault recovery until driver release 2026-11-08 14:53:53 -06:00
firestar5683 0c37a00b1c Preserve validated AOL metadata during source gaps 2026-11-08 14:45:53 -06:00
firestar5683 495fa11cf6 Keep HKG AOL armed when brake health precedes permission updates 2026-11-08 14:29:17 -06:00
firestar5683 27cc914f54 Track small Subaru Crosstrek angle requests at low speed 2026-11-08 14:25:59 -06:00
firestar5683 52775f1f54 Keep GM AOL armed below the cruise engagement minimum 2026-11-08 14:15:30 -06:00
Dom 9251f9b918 Place C4 startup date beside version and branch 2026-11-08 13:15:14 -06:00
firestar5683 3bdcfe7f52 Build matching Tesla and Palisade AOL firmware 2026-11-08 13:14:14 -06:00
firestar5683 9bbf79766a Preserve Tesla screen intent and Palisade Cancel behavior 2026-11-08 00:08:13 -06:00
Danny 50d12f05b0 Sentry: Show registering status and a testing button for Galaxy app alerts 2026-11-07 17:19:20 -08:00
Danny 57104f165c Stop Duplicate Sentry LIstings, Only Show App registration in app 2026-11-07 17:19:20 -08:00
firestar5683 a9a80d34e7 Build matching Polestar status relay firmware 2026-11-07 18:02:56 -06:00
firestar5683 3093e5b799 Preserve Polestar stock status relay 2026-11-07 17:58:51 -06:00
firestar5683 f633c05b32 Gate Ioniq 6 blind-spot warnings on queued lane changes 2026-11-07 17:33:23 -06:00
firestar5683 1d30dc3434 Align HKG default-controller regression expectations 2026-11-06 22:18:55 -06:00
firestar5683 e1e3be94fe Enable driving in learning regression fixtures 2026-11-06 21:46:34 -06:00
firestar5683 31695937b3 Fix inherited static-analysis failures 2026-11-06 21:35:36 -06:00
firestar5683 7056dcb1fa Preserve HKG angle arming through temporary refusals 2026-11-06 21:23:09 -06:00
firestar5683 68434cf39c Build matching Outback state-zero stop-start firmware 2026-11-06 19:55:36 -06:00
firestar5683 5d6e6afc3e Allow bounded Outback stop-start OFF requests from state zero 2026-11-06 19:48:56 -06:00
Dom 453aa6e0f7 Show C3 recording-drive capacity and available storage in Galaxy
Keep internal storage and the separately mounted recording drive distinct.
Gate added-drive telemetry and both views to C3, recheck filesystem identity,
and report available bytes without counting reserved space as free.

Cover absent drives, mount transitions, read failures, zero free space,
C3X/C4 exclusion, and actual Vue rendering. Refresh the inventory receipt
for JavaScript test-only protected changes; native artifacts are unchanged.
2026-11-06 19:33:47 -06:00
Danny 60ce4eab1b Sentry: Tidy comments and drop swallowed errors 2026-11-06 15:11:43 -08:00
Danny 3ba8d17eba Sentry: Note that test alerts can take up to 20 seconds 2026-11-06 14:53:48 -08:00
Danny a7656afe9d Sentry: Hint How to Remove Phone, Color Armed and Disarmed 2026-11-06 14:43:28 -08:00
Danny f69ca7e75b Sentry: Hide Channel Settings Unless Enabled 2026-11-06 14:43:28 -08:00
Danny 70157478aa Cameras: Show the white balance switch only on the cameras page 2026-11-06 14:43:28 -08:00
Danny dae94d0202 Sentry: Move channel switches into the card headers 2026-11-06 14:43:28 -08:00
Danny e92d6e2758 Sentry: Tidy the events page and phone alerts card 2026-11-06 14:43:28 -08:00
Danny 400843143a Sentry: Mark relay setup steps that are done 2026-11-06 14:43:28 -08:00
Danny d47d0d5539 Sentry: Point one-tap alerts at the hosted relay 2026-11-06 14:43:28 -08:00
Danny be398dbbec Sentry: Skip phones the relay rejects instead of blocking the comma 2026-11-06 14:43:28 -08:00
dirwin31 61f9775803 Sentry: Add automatic relay enrollment 2026-11-06 14:43:28 -08:00
Danny 5ea75564bf PiP: Make White Balance a Toggle and Apply to Other Driver Cam Things 2026-11-06 14:43:28 -08:00
dirwin31 8f0b3d4963 PiP: white-balance the cabin camera's blind-spot crops
The cabin camera has no IR-cut filter, so the window crops come out
magenta. Sample a gray-world gain from each shown crop a few times a
second, smooth it, and apply it in the shader with clipped highlights
left white and a mild desaturation for the remaining cast.
2026-11-06 14:43:28 -08:00
firestar5683 e959f52e25 Display bounded recorded steering graphs without rejecting the report 2026-11-06 19:29:42 +00:00
Dom af342611ef Merge pull request #281 from dirwin31/Starport-Log-Refusal-Bytes
Add Logging for Screen Failure Response
2026-11-06 13:20:23 -06:00
Danny c9dd2b7339 Add Logging for Screen Failure Response 2026-11-06 10:57:58 -08:00
firestar5683 be0f2cf7ba Use original metadata identities for independent route profiles 2026-11-06 18:56:19 +00:00
firestar5683 9fcecdec2a Restore installed commit date on C4 home screen 2026-11-06 12:31:03 -06:00
firestar5683 0fdfd0ddbf Track Ioniq Force Stop braking to the remaining stop distance 2026-11-06 11:45:48 -06:00
whoisdomi 6d7aca20a9 Force Stop fix 2026-11-06 11:45:47 -06:00
firestar5683 9af9f09071 Keep completed-drive windows distinct and retain measured results on failure 2026-11-06 17:39:43 +00:00
firestar5683 359cb9fda6 Add offroad alert volume previews to Galaxy 2026-11-06 11:26:19 -06:00
firestar5683 4f5cf21e9e Keep STOP vision and blind-spot inference on separate cores 2026-11-06 11:16:35 -06:00
firestar5683 dae68ce494 Explain FLM slider effects in Galaxy 2026-11-06 11:04:08 -06:00
firestar5683 52852af602 Preserve stock lateral intent during inhibited longitudinal recovery 2026-11-06 10:47:54 -06:00
firestar5683 7816b003b5 Refresh parked evidence before resuming route analysis 2026-11-06 16:16:53 +00:00
firestar5683 6e0baac46b Keep parked sessions from consuming untested steering tunes 2026-11-06 15:25:57 +00:00
Dom 9a55221ab5 Fix authenticated monitoring test fixtures and CI coverage 2026-11-06 08:38:57 -06:00
firestar5683 b4c3c5d656 Validate independent-drive Recommended profiles before automatic application 2026-11-06 14:34:42 +00:00
firestar5683 d64fb74c31 Preserve authenticated driver monitoring artifacts during builds 2026-11-06 07:46:10 -06:00
firestar5683 a2c96c47d6 Fix route-profile selection, replay verification and recommendation reporting 2026-11-06 12:45:38 +00:00
firestar5683 4e40bff081 Reject conflicting speed reads from expanded crops 2026-11-06 06:03:57 -06:00
firestar5683 97a5e15cc1 Validate offroad tune strength against an independent drive 2026-11-06 06:46:12 +00:00
firestar5683 b29a2ea4f8 Fit offroad tune strength and show completed-drive measurements 2026-11-06 05:19:36 +00:00
firestar5683 7f4e2ca589 Fix completed-drive aggregation and fresh parked result presentation 2026-11-06 03:44:15 +00:00
firestar5683 5d498ccdb9 Restore full-drive tuning recommendations and expose offroad decisions 2026-11-06 02:44:40 +00:00
Dom 7117b85680 Merge pull request #280 from zephleggett/jetlink-v0.9.0
Jetlink v0.9.0: API 4 and Jetlink's own model index
2026-11-05 20:41:37 -06:00
Dom 376d0f5df3 Qualify exact offroad candidates in cloud without temporary branches 2026-11-05 20:16:58 -06:00
firestar5683 3637b23b1c Avoid manual resume alerts for automatic Toyota launches 2026-11-05 20:10:51 -06:00
firestar5683 dc73f431a4 Preserve independent GM steering across speed and input transitions 2026-11-05 19:50:48 -06:00
firestar5683 3160182986 Use received car state for blindspot alert freshness 2026-11-05 19:44:40 -06:00
firestar5683 c0b6b82497 Restore Tesla AP1 Alpha Long cruise engagement 2026-11-05 19:40:53 -06:00
Zeph Leggett 37024b2f3d Jetlink: API 4, choices sized by Jetlink's model index
Jetlink v0.9.0 keeps its own index of comma's big models and the ONNX
each was built from, checked hourly. Active Big's choice, by the ONNX's
hash, is sized from it rather than from comma's LFS, so JetlinkPointers
is no longer read and is dropped.

JetlinkPointers leaves params_keys.h: the native params libraries need
their usual rebuild.
2026-11-05 19:37:27 -06:00
Zeph Leggett 76cb6f414c Jetlink v0.9.0 2026-11-05 19:37:27 -06:00
firestar5683 2b83873371 Add AGNOS 20.2.2 east mirror 2026-11-05 15:34:45 -06:00
firestar5683 e2a417ab1f AGNOS 20.2.2 2026-11-05 15:33:17 -06:00
firestar5683 83ecf50c3b Improve STOP recall while preserving speed detector features 2026-11-05 14:57:38 -06:00
firestar5683 790d9d2a5b Publish matching Dom precompiled artifacts 2026-11-05 14:51:20 -06:00
firestar5683 479da9e7d5 Restore automatic stopped launch for qualified Toyota SDSU profiles 2026-11-05 14:39:49 -06:00
Dom 63137021a1 Align schema and capability fixtures and StarPort types 2026-11-05 14:29:57 -06:00
firestar5683 8aa299daf8 Improve shared traffic-sign features while preserving speed reads 2026-11-05 14:27:57 -06:00
firestar5683 505495a936 Scope offroad checks to all learner and integrated controller source 2026-11-05 14:16:44 -06:00
firestar5683 fa0fd7b57e Add optional onroad weather widget 2026-11-05 14:12:15 -06:00
firestar5683 37df49d937 Check offroad learner contracts independently of unrelated pushes 2026-11-05 14:11:32 -06:00
firestar5683 a7b683d362 Preserve GM ACC startup and routing with blind-spot monitoring 2026-11-05 14:04:50 -06:00
firestar5683 1383968390 Default vehicle-specific tunes to the StarPilot controller 2026-11-05 13:58:13 -06:00
Dom 708dfa8ad5 Restore selfdrived executable mode 2026-11-05 13:50:03 -06:00
firestar5683 4b9e2ada7d Fix offroad learner report types and hosted static checks 2026-11-05 13:46:52 -06:00
prabhaavp 8b1e3066f4 Merge pull request #279 from dirwin31:MavlouPhoneIdentity
Star Port Dongle Compatibility
2026-11-05 14:42:56 -05:00
Prabhaav Pillai 55eae09ad4 Refactor handshake logic and improve comments for clarity 2026-11-05 14:41:46 -05:00
firestar5683 1301d6a566 Build Panda firmware for MQB brake-held engagement 2026-11-05 13:40:31 -06:00
firestar5683 9d3579cbbb Preserve stopped MQB brake-held engagement until brake release 2026-11-05 13:33:58 -06:00
firestar5683 34e23d945c Analyze completed drives and apply bounded next-drive steering tunes 2026-11-05 13:28:41 -06:00
firestar5683 52dcc22a1c Wrap MQB stop regression diagnostics 2026-11-05 13:23:04 -06:00
firestar5683 2e614b456b Pause MQB steering requests below the actuation speed limit 2026-11-05 13:22:11 -06:00
firestar5683 83e86fe022 Restore Subaru steering override reporting 2026-11-05 12:55:17 -06:00
firestar5683 ced757efe2 Distinguish Crosstrek wheel load from steering override 2026-11-05 12:38:13 -06:00
Danny b9d6539aa7 StarPort: Reset handshake forgets the remembered reply 2026-11-05 10:35:00 -08:00
dirwin31 64bc4e9ca2 StarPort: Setup ladder keeps what worked and skips rejected replies 2026-11-05 10:35:00 -08:00
Danny ad47e77a93 AAwireless: Account for Failed DHCP 2026-11-05 10:34:59 -08:00
Danny e96ab43d4c StarPort: Add a phone identity handshake step for unofficial dongles 2026-11-05 10:34:44 -08:00
prabhaavp 0cc9ddddfe Merge pull request #278 from dirwin31:Dom-UI-Maps-Fixes
UI/Maps: lane guidance, map polish. Hotspot and Wi-Fi fixes
2026-11-05 13:16:20 -05:00
Prabhaav Pillai aa631c8e9f backoff logic and improve widget art handling 2026-11-05 13:15:42 -05:00
firestar5683 5c9eeb707a Queue model selections for the next onroad cycle 2026-11-05 12:03:41 -06:00
firestar5683 faf81bb461 Separate stacked speed-limit panels before reading numbers 2026-11-05 11:53:09 -06:00
firestar5683 ac2b90145f Select Continental radar automatically on supported RAV4 profiles 2026-11-05 11:41:20 -06:00
Dom fb8d2c73c6 Align vision and Sierra CI fixtures with existing contracts 2026-11-05 11:05:18 -06:00
firestar5683 19943c7080 Enable vision STOP detection independently of SLC 2026-11-05 10:34:35 -06:00
firestar5683 90ee6b3686 Restore Sierra no-ACC conventional cruise layout 2026-11-05 10:03:48 -06:00
firestar5683 8d9bc972d3 Restore the default Carnival torque controller 2026-11-05 08:51:12 -06:00
firestar5683 d96d023746 Improve night stop detection and reject advisory speed signs 2026-11-05 00:51:32 -06:00
firestar5683 3b6abac814 Keep vision stop updates independent of speed-limit readings 2026-11-04 23:57:40 -06:00
firestar5683 18dc7949aa Register Ford ordering regression in complete CI inventory 2026-11-04 23:01:48 -06:00
firestar5683 6d5624f564 Order StarPilot Ford metadata before same-cycle steering 2026-11-04 22:45:29 -06:00
Dom c08b3249b6 Align Subaru engagement test with transmitted steering history 2026-11-04 19:15:52 -06:00
Dom cb707259be Refresh inventory receipt for schema qualification tests 2026-11-04 18:07:28 -06:00
Dom 49ed51a48f Qualify reviewed vision stop-sign schema addition 2026-11-04 17:53:54 -06:00
Dom e30016c008 Restore familiar torque arc colors and label 2026-11-04 17:25:53 -06:00
firestar5683 c8296b3bd8 Keep Turn Assist helping through braking turns 2026-11-04 17:17:54 -06:00
firestar5683 0571890b8e Integrate confirmed vision stop signs with Force Stop 2026-11-04 17:07:50 -06:00
firestar5683 064a3afb6d Correct steering demand display and add bounded Card timing 2026-11-04 16:49:57 -06:00
firestar5683 95bf946844 Keep Subaru VM steering handoff within native rate limits 2026-11-04 16:47:02 -06:00
Dom 761a47bc69 Provide pinned OpenCV DNN for unit vision contracts 2026-11-04 15:45:44 -06:00
firestar5683 3eb7f3fe29 Preserve Ford lateral intent through initial steering readiness 2026-11-04 15:33:07 -06:00
firestar5683 88566f1887 Add a STOP-capable joint traffic sign model 2026-11-04 14:40:28 -06:00
firestar5683 4b8ca5c379 Match StarPilot Ford demand to native pinion bounds 2026-11-04 14:20:17 -06:00
firestar5683 db1aaa67a2 Show supported years for the Elantra Hybrid refresh 2026-11-04 14:18:18 -06:00
firestar5683 a15b58fc2e Block unresolved Elantra CAN interrupt faults 2026-11-04 13:43:55 -06:00
Dom 3cb38bb9e0 Safely stage the audited legacy StarPilot return 2026-11-04 13:39:59 -06:00
firestar5683 a43e74d7f6 Preserve lateral on the first CANCEL health handoff 2026-11-04 11:28:20 -06:00
firestar5683 29bf269ccc Arm classic HKG lateral after accelerator override clears 2026-11-04 11:17:39 -06:00
Danny aab624393e Cleanup: Fix lint, trim comments, narrow error handling 2026-11-04 08:41:19 -08:00
firestar5683 73d805fafe Coordinate lane-centering nudges with planned turns 2026-11-04 10:26:26 -06:00
dirwin31 0cf1f4f3bb StarPort: rebuild aa0 after NetworkManager restarts, hold home Wi-Fi while projecting
- A NetworkManager restart left the dedicated lease on stale device paths,
  and the rest of the drive fell back to wlan0. A non-timeout aa0 failure
  now rebuilds aa0 once before falling back.
- DedicatedLease lacked `dedicated`, so SharedRadioWatch (and the ACK grace
  for home Wi-Fi changes) never ran.
- When wlan0 loses its network mid-projection, pause its autoconnect (and
  stop a join under way) until the session ends. Each retry took the shared
  radio off the car's channel and stalled video past the ACK timeout.
2026-11-04 08:07:17 -08:00
dirwin31 1bb9e9fc0e Galaxy hotspot: ship hostapd and keep NetworkManager off galaxy0
AGNOS 20.x no longer includes hostapd (agnos-builder 0cf5062), so every
start failed and the worker created and deleted galaxy0 every 15 s. On
2026-11-04 that churn crashed NetworkManager mid-drive and dropped StarPort.

- Ship Ubuntu 24.04's hostapd 2.10 and hostapd_cli (arm64, checksums in
  bin/hostapd.sha256) and run those.
- Check for hostapd before galaxy0 exists.
- Back off repeated failures from 15 s up to 5 min (DFS refusals exempt).
- Write a runtime udev rule (NM_UNMANAGED) before creating galaxy0, and wait
  for wpa_supplicant to let go of it before starting hostapd. Its release
  stopped the AP that hostapd had just started.
2026-11-04 08:07:17 -08:00
Danny 9b377b16f6 Cleanup: Trim comments, drop swallowed errors, fix glow test 2026-11-04 08:07:17 -08:00
dirwin31 f001d80378 Theme maker: allow up to 10 widget art sprites
The compact profile renders 8 sprites and the browser rejected anything over 7
as invalid metadata, leaving only the sketch outlines.
2026-11-04 08:07:17 -08:00
dirwin31 3edf46a991 UI: curve-speed glow, gas-override blink and Theme maker preview
- Steady the curve-speed glow and the gas-override blink on the on-road screen
- Stop the Theme maker preview flapping to "unavailable" and allow for Galaxy tunnel latency
- Carry the widget sprite sheet in a header so it survives the tunnel
2026-11-04 08:07:17 -08:00
dirwin31 54939bf311 Spotify: retry a saved sign-in that failed at startup
- Retry a saved sign-in when the first attempt at boot fails, for example before the clock has synced
- Let the supervisor restart a player that never logged in
- Add connect tests for the retry
2026-11-04 08:07:17 -08:00
dirwin31 11a65c1010 Maps: lane guidance, calmer rotation and steadier navigation layout
- Add lane guidance to the on-road navigation banner, fed by new route engine fields in the custom cereal schema
- Calm map rotation and steady the navigation layout, including the Galaxy layout preview
- Add route runtime, on-road map and navigation tests
2026-11-04 08:07:17 -08:00
dirwin31 1334ce24a5 StarPort: draw the default layer order when none is saved
- Use StarPort's default widget layer order in the car projection when no widgetOrder is saved, so the map no longer draws over the PiP
- Make the layout editor and the car screen agree on that order
- Cover the default order in the projection layout and widget layer tests
2026-11-04 08:07:17 -08:00
Dom 46a872b02f Synchronize sender fixture and narrow startup test callable
Hold the mock background upload until in-flight assertions finish and join it on every exit. Preserve strict completion and payload checks.

Type the dynamically populated startup fixture namespace as object and assert its main entry is callable before invocation. Preserve startup ordering assertions and refresh the canonical protected inventory receipt.
2026-11-04 09:32:22 -06:00
firestar5683 d907c22ac0 Bind each Android Auto startup fixture to its device 2026-11-04 09:12:53 -06:00
Dom 13930a89e5 Share personality alert preference with Android Auto 2026-11-04 09:10:06 -06:00
firestar5683 7c0d1d505a Prioritize driving and audio over Android Auto on every comma 2026-11-04 09:07:25 -06:00
firestar5683 ea27a69c20 Keep Android Auto transport below driving and audio on comma 4 2026-11-04 09:06:20 -06:00
firestar5683 f45fd8ed79 Keep comma 4 display work below driving and audio 2026-11-04 08:43:09 -06:00
firestar5683 1509b5e6b6 Distinguish legacy Toyota radar pre-warning from unavailability 2026-11-04 08:18:37 -06:00
firestar5683 a17e2a963d Preserve HKG lateral through CANCEL status handoffs 2026-11-04 08:01:00 -06:00
Dom c6484123d5 Keep replay provenance manifest within existing size gate
Reduce leading JSON indentation only, preserving every token, value, key and list order, reviewed reference binary and provenance pin. Keep the unchanged 120 KiB lint limit and all validation gates.

Refresh the canonical protected inventory receipt for the formatting-only file change.
2026-11-04 03:23:25 -06:00
Dom aa6207cf90 Qualify replay references and complete hosted CI coverage
Pin seven independently reviewed replay outputs to the unchanged recorded inputs and baseline provenance. Correct Subaru test helper cleanup without changing native admission rules. Declare the exact generated pandad test executable in the build-output inventory.

Run the unchanged whole-target RELEASE workload in sixteen mandatory shards, retaining all cases, assertions, skip and provenance gates, and existing deadlines. Refresh the canonical protected inventory receipt.

Native qualification completed 10,211 passed and 115 existing skips across all sixteen bins; fresh source-bound hosted CI remains required.
2026-11-04 02:23:57 -06:00
Dom 9eab5400a4 Repair hosted display selection and migrated test fixtures
Select the real headless backend for hosted AOL and RELEASE tests. Isolate SpacePilot scripted clocks from unrelated UI readers. Update camera and replay fixtures for existing native APIs, pin the reviewed schema addition, and supply declared CAN batch and throttle inputs.

Preserve production guards, acceptance assertions, selected cases, capability skips and receipt gating. Refresh the canonical protected inventory receipt.
2026-11-04 00:50:22 -06:00
Dom baf883200c Restore selfdrived executable mode after Toyota source update
Preserve the exact published Toyota source blob and restore its prior100755 executable mode. Refresh the canonical protected inventory receipt. No source semantics or test expectations change.
2026-11-03 23:25:25 -06:00
firestar5683 512742ca42 Keep cold Toyota AOL source waits distinct from lost control 2026-11-03 23:08:10 -06:00
firestar5683 1e4fe7c8a4 Damp EV6 near-center steering while preserving turn-in 2026-11-03 22:28:41 -06:00
firestar5683 9b7e8fa5fa Preserve armed HKG lateral through button counter noise 2026-11-03 22:20:04 -06:00
firestar5683 2496b40f84 Preserve armed HKG lateral through button counter noise 2026-11-03 22:02:51 -06:00
Dom 67fde8c695 Refresh audited graphics fixture identities after native binding migration
Re-audit only the GPU/map source and shared fixture fingerprints following the native binding migration. Preserve the exact capability guard, reason, selected nodes and unavailable disposition. Add a real-source fingerprint regression so mocked gate fixtures cannot hide stale source pins.
2026-11-03 21:38:16 -06:00
firestar5683 14534287c1 Detect C-HR CAN filters alongside native radar traffic 2026-11-03 20:22:32 -06:00
Dom 2929a25afe Add parked manual editing for thirty steering coordinates 2026-11-04 02:14:49 +00:00
firestar5683 465db1bc61 Preserve Ford lateral intent across separate brake status receipts 2026-11-03 19:55:37 -06:00
firestar5683 89af8a6569 Preserve Subaru intent through stop and source handoffs 2026-11-03 18:30:19 -06:00
Dom dd4214f8f5 Restore direct LAN DNS entry to Galaxy safely
Discover exact OS/DHCP/PTR identities independently of request Host. Redirect arbitrary aliases only at the direct-local inert landing document, preserving Host, Origin, session and remote boundaries. Refresh the protected-inventory receipt for the documentation-only protected change; native inputs are unchanged.
2026-11-03 17:03:01 -06:00
firestar5683 180f94dc35 Recover firmware reads interrupted by unrelated diagnostics 2026-11-03 16:02:27 -06:00
prabhaavp e997847db0 Merge pull request #275 from dirwin31/CarViewFontFix
StarPort: Missing Fonts
2026-11-03 16:44:04 -05:00
Danny 228534e0cf StarPort: Load fonts in the car screen and log full process commands 2026-11-03 13:37:46 -08:00
firestarsdog 5e02c2387a Arabesque time harden 2026-11-03 16:20:25 -05:00
Dom e6f1ad93ee Exercise native timer and interrupt health in siren harness 2026-11-03 14:43:02 -06:00
Dom 5f2caf8249 Align loader affinity fixture with captured camera dimensions 2026-11-03 14:24:38 -06:00
firestar5683 7b16c71824 Recheck live tuning against the accepted baseline 2026-11-03 13:21:03 -06:00
firestarsdog e381bf6a44 Check offline Firefox against AGNOS 2026-11-03 14:07:29 -05:00
firestarsdog c7b81a5768 More offline Arabesque stuff 2026-11-03 13:41:15 -05:00
firestar5683 7920339796 Prevent same-bus HKG advisory packet retransmission 2026-11-03 12:33:24 -06:00
Dom fc45eb6862 Style Polaris model cards by series 2026-11-03 12:06:50 -06:00
firestar5683 b302c2ef8f Avoid repeated CCNC longitudinal configuration clones 2026-11-03 11:53:35 -06:00
firestar5683 4d804768ab Keep conditional experimental mode independent of planner policy 2026-11-03 11:49:49 -06:00
firestarsdog 9b7f4c6646 Arabesque, include offline depends for install 2026-11-03 12:33:55 -05:00
firestar5683 14205db69d Reset HKG angle recovery gain and rejected command history 2026-11-03 11:33:09 -06:00
firestar5683 4cf5c9e098 Keep Subaru fixed-angle handoff within native rate limits 2026-11-03 11:25:13 -06:00
firestar5683 bf4e27fca5 Build matching Carnival independent lateral and longitudinal firmware 2026-11-03 11:12:56 -06:00
firestar5683 d42ddc3ac5 Restore Carnival ICE independent lateral and longitudinal startup 2026-11-03 11:01:08 -06:00
firestar5683 55d6fb1778 Continue learning after restoring a saved tune 2026-11-03 10:53:50 -06:00
prabhaavp 91dad8b66d Merge pull request #273 from dirwin31:StarPort-AutoSetup-20.2
StarPort: guided setup, a setup ladder, and wireless adapter fixes
2026-11-03 11:22:05 -05:00
Prabhaav Pillai 047294a1d0 Merge Dom into StarPort 2026-11-03 11:19:55 -05:00
firestar5683 a336e65dd8 Improve Tuning and Analysis controls and plot tabs 2026-11-03 10:15:16 -06:00
firestar5683 dd9608eecd Preserve Subaru lateral on fresh input after output expiry 2026-11-03 10:09:06 -06:00
Prabhaav Pillai 123e3c20a0 StarPort setup, reconnect handling, and UI consistency 2026-11-03 10:58:57 -05:00
whoisdomi 80975369ee Force Stop: add dashboard signal back 2026-11-03 09:18:24 -06:00
whoisdomi 7ec8cc721d Hold CEM for cross traffic leads 2026-11-03 09:18:24 -06:00
whoisdomi 1d2d18fa2a Force Stop Temp Hold 2026-11-03 09:18:23 -06:00
firestar5683 42a1244e1b Show retained Auto Learn study progress 2026-11-03 08:28:22 -06:00
Danny f148770788 Build 2026-11-03 05:40:06 -08:00
Danny 755d82a7e6 UI Unification 2026-11-03 05:40:06 -08:00
Danny 7d7bf43fac Account for Starport on Dev Page 2026-11-03 05:40:06 -08:00
Danny 63b05a9294 Fix test for AA wireless 2026-11-03 05:40:06 -08:00
Danny 80f707aa3d StarPort: Review fixes for the stall notice, car forget and car adoption
Reuse atomic_write and the sr-only class, drop dead code, update stale tests
2026-11-03 05:40:06 -08:00
Danny 6d99039382 Test Fixes 2026-11-03 05:40:06 -08:00
Danny cfdcd14ca8 Show car vs app in pairing 2026-11-03 05:40:06 -08:00
Danny 5be95f48df AAwireless: Stop tearing the Session down every 60s 2026-11-03 05:40:06 -08:00
Danny fb9b3516b1 Allow Disconnect from Galaxy for Starport Projecting Car 2026-11-03 05:40:06 -08:00
Danny 15b2612d7f Hold RFComm for a moment, Better Traces. 2026-11-03 05:40:06 -08:00
dirwin31 e99e552f21 StarPort: wait out the comma's own Wi-Fi switching networks, and say so on the car screen
- When the comma's Wi-Fi joins or roams while the car is on aa0, wait up to 8 s for video acks instead of 2.5 s; reconnect at once if the car takes its screen back.
- After a drop it causes, the car screen shows "Reconnected: comma Wi-Fi Joined <network>" (the network's SSID) for 8 s; Galaxy and bug reports name it too.
- Logs ack_grace, ack_grace_recovered and other_wifi_changed events.
2026-11-03 05:40:06 -08:00
dirwin31 f0c5a666c5 Galaxy Bluetooth setup: one systemd reload, after the radio has started
- Link the bridge and discovery units with --no-reload and reload once (was four reloads, 1-3 s each on a comma four).
- Wait (up to 45 s after boot) while starpilot-bluetooth-radio is still activating, so the reload can't stall btattach or bluetoothd.
- Failure handling unchanged; on a comma four this removed the ~20 s Bluetooth boots (now 16.4-16.6 s with stock AGNOS).
2026-11-03 05:40:06 -08:00
dirwin31 3b8d201839 Hide other devices once selected one 2026-11-03 05:40:06 -08:00
dirwin31 067f30dfa4 Bring the purple back to the guided setup's selections
The selected adapter or app segment is solid purple with a soft glow instead
of grey, the selected connection option gets a purple-tinted row and a filled
icon tile, the current step and the primary button glow, and a faint purple
wash sits behind the step track.
2026-11-03 05:40:05 -08:00
dirwin31 1d0525fe41 Keep the guided card open after choosing how the car connects
Choosing a USB cable or a tablet app switches the connection at once, which
counts as setup done, so the card closed under the person's finger and left
no way to change the choice. A choice made in the card now holds it open
until Done. In the guided setup the home card's button reads Change how your
car connects, so the way back is visible.
2026-11-03 05:40:05 -08:00
dirwin31 363d942ec9 Theme the guided setup with Galaxy's own colors, font and icons
Done steps and checks use the theme's success color, the current step and
selection use the primary purple, text uses Galaxy's Inter and weight tokens,
and the connection options use the outline icons the rest of the page uses
(car-front, usb-symbol, usb-c, tablet) on a single primary-tinted tile
instead of Apple's multicolour gradients.
2026-11-03 05:40:05 -08:00
dirwin31 b21952a392 Reuse the existing StarPort list, row and disclosure styles in the guided card
The guided card's lists, paired-car rows, checklist rows and handshake
disclosure now use the page's own gx-starport-list, gx-starport-row,
gx-starport-row__text and gx-starport-wiki classes, restyled once for the
card, instead of parallel guided-only copies. Radii, spacing and motion use
Galaxy's tokens. Only the step track, icon tiles, radio rows, segmented
control and checklist marks remain new, and the block is about a fifth
shorter.
2026-11-03 05:40:05 -08:00
dirwin31 2678e29cb3 Redesign the guided StarPort setup; keep the dropdowns to the classic screens
The guided card is rebuilt in an Apple-style: a three-step track (support,
car, connect) that fills as setup moves along, a large title, inset grouped
lists with coloured icon tiles for how the car connects, a segmented control
for the adapter model and the tablet app, iOS-style checklist rows for the
connection, and one full-width primary button. It uses Galaxy's theme colors
so light and dark both work, and reads cleanly down to a phone.

The classic step 2 and the home card's dropdowns now render only in the
classic setup. The guided card replaces them and hosts the page's own
pairing, cable and app instructions and the Connect button, so nothing is
lost. A finished setup can be reopened from Setup and Pairing, and Done
closes it. Paired cars the page's own list does not show yet are offered in
the card; the rest stay in the pairing step.
2026-11-03 05:40:05 -08:00
dirwin31 75a29d3e71 Put the full report in the logs bundle; turn the Bluetooth-first refusal into a step
The logs bundle, and so the Discord send, now carries report.json: the same
tags and per-session detail a Bugsink report has (setup, offered modes, reach
class, ladder, SDP, strategy) for the newest five sessions, sanitized and
size-capped. It is built best-effort: if it cannot be, the bundle is
unaffected.

The adapter setup's 'Connect your paired car in Galaxy Bluetooth first'
refusal (27 Bugsink reports) now shows a step with a link to Bluetooth, next
to the usual question while setup is unfinished and alone once it is done.
2026-11-03 05:40:05 -08:00
dirwin31 e5a981b5ad Ladder passes are per ignition; car adoption leaves the owner's audio setup alone
The comma can stay powered between drives, so the three passes belong to an
ignition (an onroad start), not to a boot; a reboot still resets them. When a
learned strategy is dropped after two handshake failures the ladder carries
on from the next rung instead of starting at the one that just failed, which
the dongle flip also avoided.

Choosing the only paired Android Auto car from housekeeping runs with nobody
at the screen, and selecting a receiver unselects that device as the
Bluetooth audio output. It now skips a car that is the selected audio device,
or when that cannot be read, leaves it to the setup screen's Use button. It
reports problems once instead of every 20 s and gives the projection role
back, keeping only the standby gateway auto-connect needs.
2026-11-03 05:40:05 -08:00
dirwin31 54eab0df8d Replay the real Bugsink failure texts through the reachability classifier; tag the reply style
The 686 pre-video failures Bugsink showed (54 distinct texts) are kept as a
fixture. The test checks the intended class for each: Host is down and page
timeouts are a sleeping car, refused and unanswered handshakes are not ready,
and anything after the link is up is not a reachability problem. Reports tag
the reply style and Wi-Fi band the working strategy used.
2026-11-03 05:40:05 -08:00
dirwin31 99a9025afe Report how the channel was found and what the ladder tried; wait longer for a slow car
Reports carry the SDP outcome (where the RFCOMM channel came from and how
many retries it took). The Discord post names the handshake options tried
and how each ended. A car that once needed 70 s to be ready now gets that
many stage timeouts to answer the Wi-Fi handshake, never fewer than the
standard wait and capped at nine.
2026-11-03 05:40:05 -08:00
dirwin31 0783710c9a Add the guided StarPort setup behind the New pairing experience switch
A card above the classic steps asks one question (how does the car connect:
built-in wireless, adapter, USB cable or app), shows only the instructions
for that answer, and lists paired cars that offer Android Auto to choose
between when there is more than one. While connecting it shows a live
checklist of the stages (Bluetooth, the car's Wi-Fi, securing the connection,
the dashboard), a list of the handshake options being tried once one has
failed or one is remembered, and a notice that the first connection can take
a few minutes or more than one drive. Every action is one the page already had.

The card is on by default; Use classic setup turns the switch off, and Try
the guided setup turns it back on. Returning drivers see the card only while
a connection is in progress. The state function is pure and tested without a
browser.
2026-11-03 05:40:05 -08:00
dirwin31 3d26454122 Let Galaxy read and change the new pairing experience switch
The setup response carries newSetup, and a new_setup control action turns the
guided setup off or on. It is handled before the StarPort-enabled check and
never calls the daemon, so it works as the way back to the classic screens
when the service is off or broken. It needs a signed-in session and park.
2026-11-03 05:40:05 -08:00
dirwin31 57900f3d73 Add the setup ladder: try handshakes in order, remember the one that worked
One module now decides how to answer a car's handshake, and it is also the
learned profile: the strategy that last worked is the one tried first.

The first pass is today's behavior. Later rungs are knobs that already
existed: the other version reply (the flip the dongle work added, now owned
here), the phone-style reply with both bands and with 2.4 GHz only, a longer
wait for a car that keeps saying not ready, and, for adapters only, the
handshake variations.

A failure advances the ladder only when the car answered the version
exchange, then went silent or refused the Wi-Fi setup, before any video was
acknowledged in the session. A sleeping car, this comma's own Bluetooth
trouble and anything after video (a car shutting off) never move it. Three
passes per boot at most, resuming at the first untried rung on the next
ignition; a learned strategy is dropped after two handshake failures; a
session that streams for a minute makes its strategy the learned one.

State is a small per-car file beside the config (setup_state.json, newest 16
cars, damaged or unreadable means a fresh start, never blocks a connection).
The status exposes the ladder for the setup screen, and reports carry what
was tried, how each rung ended and how long the car took to be ready.
2026-11-03 05:40:05 -08:00
dirwin31 2af7bdd1dd Add opt-in H.265 for a head unit that offers no H.264 mode
Allow H.265 video (Developer > StarPort, off by default) lets a car that
offers only H.265 get H.265. A car with an H.264 mode is chosen exactly as
before whatever the setting; this is replay-tested over several offers.

The hardware encoder library is ABI 4: an HEVC option selects H.265 Main
profile at high-tier level 5 and allows up to 1920x1080 (H.264 stays at
1280x720). The Python side keeps H.265 apart from the H.264 code: its own
codec-config and wire-frame functions for the two-byte NAL header, its own
access unit check, and an encoder subclass. If the car is told H.265 and the
hardware encoder cannot open, the session fails with the reason; there is no
fallback to another codec.

Measured on a parked comma with a scratch copy of the library: H.265 1080p
costs about 13 ms per frame on the NV12 path (30 ms from RGBA), mid-stream
keyframes carry VPS/SPS/PPS, and the H.264 session is unchanged. The
encoder splits every H.265 picture into two slices, which the check allows.
2026-11-03 05:40:05 -08:00
dirwin31 5dbcbb9618 Choose the car automatically when exactly one paired device offers Android Auto
A car that is paired and offers wireless Android Auto but was never chosen
(the pairing window closed first, or it was paired in Bluetooth settings)
is adopted by housekeeping when it is the only candidate. This reads the
cached BlueZ service list, so it never pages a device, and it does not run
during a pairing window or session, for adapter setups, or once a car is
chosen. With several candidates nothing is guessed; they are listed in the
status as car_candidates for the setup screen to offer.
2026-11-03 05:40:05 -08:00
dirwin31 d5f6d6ee72 Only wait on a Wi-Fi interface NetworkManager reports as unmanaged or unavailable
The first version waited on any state below disconnected, which also caught
the unknown state and broke the lease tests. Wait on states 10 and 20 only.
2026-11-03 05:40:05 -08:00
dirwin31 cad0022d3e Wait for NetworkManager to manage a shared Wi-Fi interface and tell stream losses apart
Nineteen Bugsink joins were refused with 'device is strictly unmanaged'.
On a shared interface the join now waits up to 8 s for NetworkManager to
manage it (dedicated mode already waited) and otherwise reports that the
interface is unmanaged and for how long, which the diagnosis already maps
to wifi_not_ready.

Stream losses keep the projection_interrupted category but now carry a kind
(stalled, silent, disconnected) with matching next steps, reported as
aa.loss_kind, so a car shutting off is no longer read as link loss.
2026-11-03 05:40:05 -08:00
dirwin31 dbb1fe6547 Add a StarPort section to the Developer page with the new pairing switch and an H.265 setting
The Developer page gets a heading row, StarPort, that groups the StarPort
settings: the New pairing experience switch (on unless turned off), Stay on
Wi-Fi (moved under the heading, same key, label and default) and Allow
H.265 video (off by default, daemon setting allow_hevc).

The heading is a row whose key starts with heading:, projected with
heading=true. It has no choices, is never available and cannot be changed,
and Galaxy draws it as a label. The new pairing switch is a plain file next
to the other StarPort data rather than a Params key, so it reads and changes
with the StarPort service down and needs no device rebuild; absent or
unreadable means on.
2026-11-03 05:40:05 -08:00
dirwin31 6854118aa2 Wait out an unreachable car by why it was unreachable
Most failed drives in Bugsink never reached video and stopped at Bluetooth,
but one backoff treated a sleeping radio, a service that was not up yet and
this comma's own busy stack alike.

reachability.classify() separates a car that never answered a page (Host is
down, page timeout), a car that answered but refused or reset, and a local
Bluetooth failure. A sleeping car or busy controller now waits at least as
long as before and often longer; other failures wait exactly as before. A
sleeping car no longer makes the comma forget the cached RFCOMM channel.
The class is logged on attempt_failed and reported as aa.reach_class.

The 141 'unknown' failures at the discovering stage now get a diagnosis:
car_asleep, car_not_ready or bluetooth_stack_busy, with next steps.
2026-11-03 05:40:05 -08:00
dirwin31 8e0073f110 Show the chosen setup in the StarPort log send
The Discord post now names the setup type, profile and whether it was
chosen or detected, from the newest session log that recorded one, next to
the car and head unit. The zip already carries the same data in each
session log's session_start and discovery events.
2026-11-03 05:40:05 -08:00
dirwin31 fd660ef6f7 Report the chosen setup, the car's offered video modes and the working strategy
Reports could not tell a built-in unit from a dongle, and offers and
handshakes were only visible in failure text, so there was nothing to
compare working pairings against.

session_start now records the setup type (builtin/adapter/usb/app), the
resolved profile and whether it was chosen or detected. Session reports
carry every video mode the head unit offered, whether the comma's address
reached the car in the pairing request, and, for streaming sessions, the
strategy that worked (window, reply style, Wi-Fi channel type). The drive
report gains low-cardinality tags (aa.setup_type, aa.adapter_model,
aa.profile_source, aa.phone_address_sent); long values stay in contexts.
Old logs without these fields still report. aa.schema is now 3.
2026-11-03 05:40:05 -08:00
dirwin31 745b1e94de Send the comma's Bluetooth address in the head unit pairing request
LeaseAwarePhone (used for every wireless session) had no adapter() method,
so Supervisor._adapter_address() hit AttributeError, swallowed it, and
returned "". The Bluetooth-service pairing request was therefore never sent
(bluetooth_opened always logged phone_address: "").

A 2020 myChevrolet (head unit 2.46.1.6) through an AAWireless Two+ then
accepted and acknowledged video but never showed it. A real phone sends the
pairing request about 1 s into the session; the car shows Android Auto once
its hands-free link to that address is up.

Pass adapter() through to the wrapped BluezPhone. It is a read-only property
lookup, so it needs no phone-role lease, like devices() and device().
_adapter_address() now logs adapter_address_unavailable instead of failing
silently.

Tested on the car (session-000052): phone_address sent, pairing response
received, picture displayed, touch input worked, 20-29 fps fully acked.

Co-authored-by: droobah <34214975+droobah@users.noreply.github.com>
2026-11-03 05:40:04 -08:00
dirwin31 085aa2a173 Send StarPort logs from Logs & Diagnostics
Adds a Send logs card to the StarPort Logs page so a user can report a
problem with all of their reportable logs: an optional note of up to 60
characters, and the same zip as Download all logs, sent from the device to
the developer's log inbox. Each device keeps its own thread, titled with the
car fingerprint and a hashed device tag. Manual sends only; no automatic
failure reports. If the zip is over the 10 MB size limit, it is resent
without the device snapshot.
2026-11-03 05:37:41 -08:00
Danny b8f3bcebcb StarPort: Remember which version reply each v4 head unit started with 2026-11-03 05:37:41 -08:00
Danny 29f498d77e StarPort: Unofficial dongle option, v4 head unit version reply fallback, patience for not-ready cars 2026-11-03 05:37:41 -08:00
firestar5683 31d5868e90 Narrow validated tracking history before indexing 2026-11-03 05:27:45 -06:00
firestar5683 0f57b620ef Keep learner confirmation pending through acknowledgement 2026-11-03 05:13:06 -06:00
firestar5683 bd917d43d8 Continue unfinished tuning studies across maneuvers 2026-11-03 04:07:11 -06:00
firestar5683 be17536f2b Validate only the causal tuning pose interval 2026-11-03 02:35:13 -06:00
firestar5683 ef974ecc66 Keep consumed tuning evidence through publication 2026-11-03 01:48:50 -06:00
firestar5683 10d170e799 Report live steering trials without legacy counter errors 2026-11-03 01:07:00 -06:00
firestar5683 3924bd2e39 Give Auto Learn a clear Galaxy tuner and saved-state status 2026-11-03 00:21:38 -06:00
firestar5683 208dc09bca Build matching HKG coffee-break advisory firmware 2026-11-02 23:17:28 -06:00
firestar5683 ff9b397393 Update AGNOS release receipt 2026-11-02 23:01:34 -06:00
firestar5683 de7c4c30ad Activate C3 firmware chain and AGNOS 20.2.1 2026-11-02 23:01:34 -06:00
firestar5683 507373cb7d Restore HKG coffee-break advisory replacements 2026-11-02 22:57:08 -06:00
firestar5683 58fc0bb4e7 Preserve HKG angle AOL intent through temporary EPS refusals 2026-11-02 22:19:54 -06:00
Dom 112c775a2c Restore executable mode for controlsd entrypoint 2026-11-02 22:11:25 -06:00
Dom a5622e8933 Rebuild Panda firmware for low-speed Ioniq 6 indication policy 2026-11-02 21:44:12 -06:00
Dom fb7592f834 Keep Ioniq 6 injected blind-spot indications neutral below 5 mph 2026-11-02 21:37:07 -06:00
Dom 5f960fba75 Retain Subaru lateral intent across qualified temporary EPS refusal 2026-11-02 18:28:50 -06:00
Dom 4a46f59825 Block incompatible AGNOS bootloader updates on comma 3 2026-11-02 18:16:58 -06:00
Dom 6df20cbb76 Keep Traffic border stable during snapshot settings reads 2026-11-02 17:54:14 -06:00
Dom f5c84b4871 Use repository parameterized helper in modem tests 2026-11-02 17:26:31 -06:00
firestar5683 35f3058ea1 Finish upstream compatibility 2026-11-02 16:38:36 -06:00
firestar5683 8defcc42b5 Build upstream compatibility artifacts 2026-11-02 16:38:36 -06:00
firestar5683 b044e891e9 Use unsigned flash self-test size arithmetic 2026-11-02 16:38:35 -06:00
firestar5683 6bcdbd0e81 Initialize RAM self-test alias storage 2026-11-02 16:38:34 -06:00
firestar5683 7d062147d3 Complete native safety type checks 2026-11-02 16:38:34 -06:00
firestar5683 1ecde54bb0 Complete synchronization test fixtures 2026-11-02 16:38:34 -06:00
firestar5683 f00fc85847 Pin the retained upstream schema contract 2026-11-02 16:38:34 -06:00
firestar5683 1650f86d22 Qualify upstream compatibility 2026-11-02 16:38:34 -06:00
Adeeb Shihadeh 788e655999 up: reset the UP in pandad loopback and can_replay (#39192) 2026-11-02 16:38:34 -06:00
Adeeb Shihadeh 61bc147001 Move HITL tests to UP (#39138) 2026-11-02 16:38:34 -06:00
Adeeb Shihadeh 8e828c2c70 Improve HITL test robustness (#39153) 2026-11-02 16:38:34 -06:00
firestar5683 2e39fc2162 Finish native transport dependency cleanup 2026-11-02 16:38:33 -06:00
Adeeb Shihadeh a61a0873cc replace bridge with webrtc (#39158) 2026-11-02 16:38:33 -06:00
Adeeb Shihadeh e2b90a34a6 remove zmq (#65) 2026-11-02 16:38:33 -06:00
Adeeb Shihadeh 2e6845146b raise max message size (#25) 2026-11-02 16:38:33 -06:00
firestar5683 242e2ac0a0 Warn for sustained high-angle HKG steering requests 2026-11-02 16:37:56 -06:00
firestarsdog f34746452a Add Arabesque clock for offline time recovery 2026-11-02 17:25:51 -05:00
firestar5683 97b5237e94 Build corrected Panda flash self-tests 2026-11-02 16:14:48 -06:00
firestar5683 20da579f92 Check H7 firmware CRC within its actual application flash region 2026-11-02 15:55:53 -06:00
firestar5683 789b5365c0 Preserve HKG lateral through brake receipt ordering during steering override 2026-11-02 15:54:48 -06:00
firestar5683 a931a94f79 Build matching CCNC takeover and resume artifacts 2026-11-02 15:29:25 -06:00
firestar5683 9576fd0c02 Restore CCNC driver takeover, resume and dashboard behavior 2026-11-02 15:23:58 -06:00
firestar5683 ccd9bfc4b8 Build Panda diagnostics 2026-11-02 15:05:15 -06:00
firestar5683 c802cb51a3 Build Panda diagnostic firmware 2026-11-02 15:05:14 -06:00
firestar5683 7125680cd3 Qualify Panda diagnostic requests 2026-11-02 15:03:26 -06:00
Daniel Koepping dea0ca1a91 cereal: name the new panda faults (#39133) 2026-11-02 14:50:47 -06:00
firestar5683 4975f7c387 Build Tesla cooperative steering host and Panda firmware 2026-11-02 14:48:21 -06:00
AngusBell97 63beafc6af Restore Tesla Model 3 cooperative steering 2026-11-02 14:45:21 -06:00
firestar5683 aa397cad54 Refresh safety RX build receipt 2026-11-02 14:20:21 -06:00
firestar5683 962d13da89 Build safety RX firmware 2026-11-02 14:19:45 -06:00
firestar5683 26b75e83fa Preserve fork safety RX configurations 2026-11-02 14:16:48 -06:00
Adeeb Shihadeh ba4d173709 safety: compare speed mismatch in integer units (#3877) 2026-11-02 14:16:45 -06:00
Adeeb Shihadeh 1e91930094 safety: pack RX descriptors (#3872) 2026-11-02 14:16:44 -06:00
Adeeb Shihadeh c7d78e5462 safety: make the RX check tables const (#3870) 2026-11-02 14:16:44 -06:00
Adeeb Shihadeh 2645933f91 safety: keep RX check state only for the active safety config (#3864) 2026-11-02 14:16:41 -06:00
Adeeb Shihadeh 9640b6e049 safety: const CRC lookup tables (#3867) 2026-11-02 14:16:40 -06:00
Adeeb Shihadeh 63944ec1c3 safety: pack CanMsg and CanMsgCheck (#3868) 2026-11-02 14:16:39 -06:00
Adeeb Shihadeh ccf112fb9c safety: integer math for the RX check lag threshold (#3869) 2026-11-02 14:16:39 -06:00
Adeeb Shihadeh fb72658c89 safety: make the remaining TX message lists const (#3863) 2026-11-02 14:16:39 -06:00
firestar5683 bc57fa8eb8 Preserve GM stock-cruise lateral intent through accelerator-held source gaps 2026-11-02 14:13:25 -06:00
firestar5683 d2680ea3db Keep Tinygrad vendor tree exact 2026-11-02 13:44:48 -06:00
firestar5683 a0283d271b Refresh model runtime source receipt 2026-11-02 13:38:46 -06:00
YassineYousfi 55e4f4289a bump tinygrad usb wrap fix (#39204) 2026-11-02 13:38:46 -06:00
YassineYousfi 70f3c8897d modeld: tinygrad jit copies and update tinygrad (#39187) 2026-11-02 13:38:46 -06:00
firestar5683 cfefb493aa Use planner-primary angle demand with bounded symmetric smoothing 2026-11-02 13:33:20 -06:00
firestar5683 05d60a67ea Refresh dependency documentation receipt 2026-11-02 13:03:41 -06:00
Adeeb Shihadeh 9f15200211 slash is the default (#3879) 2026-11-02 13:03:40 -06:00
Shane Smiskol e07299dd9a Car porting checklist (#3803) 2026-11-02 13:03:40 -06:00
firestar5683 ba40d9fe5a Refresh cleanup source receipt 2026-11-02 12:56:09 -06:00
Adeeb Shihadeh f2bac62f71 remove more dead code (#39196) 2026-11-02 12:56:09 -06:00
firestarsdog f27f1f22c2 Arabesque time sync to prevent Firefox issues 2026-11-02 13:55:41 -05:00
firestar5683 d1f4a06744 Refresh shared UI source receipt 2026-11-02 12:54:13 -06:00
Adeeb Shihadeh a4cf46600d ui: share ModelRenderer between tizi and mici (#39198) 2026-11-02 12:52:14 -06:00
Adeeb Shihadeh bfca6d7f3d ui: share CameraView between tizi and mici (#39197) 2026-11-02 12:52:13 -06:00
firestar5683 e094c3b624 Build fleet driver monitoring lock 2026-11-02 12:49:33 -06:00
Harald Schäfer 4f4525e59c Fleet: force always-on driver monitoring (#39169) 2026-11-02 12:46:12 -06:00
firestar5683 6140bd54a6 Update low-speed model action receipt 2026-11-02 12:37:31 -06:00
Harald Schäfer 07606c8f9e modeld: raise low-speed curvature thresholds (#39182) 2026-11-02 12:36:18 -06:00
firestar5683 b409ef52cb Build native message queue bindings 2026-11-02 12:30:26 -06:00
Adeeb Shihadeh fa3138c929 bump msgq: nanobind (#39200) 2026-11-02 12:28:46 -06:00
firestar5683 fa02d93a01 Recover Galaxy updates after gateway disconnects 2026-11-02 11:53:41 -06:00
firestar5683 aa3266824c Refresh modem update receipt 2026-11-02 11:47:13 -06:00
firestarsdog d7b5b8aef2 AGNOS Modem Fix 2026-11-02 12:31:45 -05:00
firestar5683 ad67ae64b4 Verify native UI build receipt 2026-11-02 11:22:15 -06:00
firestar5683 969ab9083c Verify native UI runtime artifacts 2026-11-02 11:20:21 -06:00
firestar5683 3fdd0d122b Build StarPilot native Raylib support 2026-11-02 11:14:49 -06:00
Adeeb Shihadeh 3c9a722083 Switch to nanobind raylib bindings (#39193) 2026-11-02 11:13:02 -06:00
Dom cbd6e1eb52 Use typed Card owners in radar publication tests 2026-11-02 09:57:40 -06:00
firestar5683 f1e5ee7312 Connect large Home dashboard to cached drive history 2026-11-02 09:40:11 -06:00
firestar5683 91c1fee59a Qualify Upstream Python Cleanup 2026-11-02 09:28:07 -06:00
Adeeb Shihadeh c08eb2fc0b remove dead code (#39195) 2026-11-02 09:26:06 -06:00
firestar5683 295374ecec Qualify Faster Unit Tests 2026-11-02 09:24:41 -06:00
Adeeb Shihadeh c710aea5ce faster unit tests (#39202) 2026-11-02 09:24:41 -06:00
firestar5683 e5931a7321 Qualify Radar Publication 2026-11-02 09:22:32 -06:00
firestar5683 25247f09ba Test Radar Publication Fault Semantics 2026-11-02 09:17:59 -06:00
Shane Smiskol 393a6139cf card: only radar CAN errors invalidate radarTracks (#39185) 2026-11-02 09:17:59 -06:00
firestar5683 9ef9ef54b2 Qualify Unix Datagram Logging 2026-11-02 08:57:34 -06:00
firestar5683 3705334acc Build Unix Datagram Logging 2026-11-02 08:57:34 -06:00
Adeeb Shihadeh 63ef69c04b swaglog: replace zmq with unix datagram socket (#39157) 2026-11-02 08:57:32 -06:00
firestar5683 5bbfafa3e7 Qualify AGNOS 20.2 Release 2026-11-02 08:46:49 -06:00
Adeeb Shihadeh ca5cbb342b AGNOS 20.2 (#39178) 2026-11-02 08:44:29 -06:00
firestar5683 8f59bfc56c Restore pre-rebase Prius torque shaping 2026-11-02 08:16:52 -06:00
firestar5683 7bcbee716a Refresh saved UI display flags once per second 2026-11-02 08:14:45 -06:00
firestar5683 8ef661eb59 Build matching Tesla screen lateral safety firmware 2026-11-02 08:13:18 -06:00
firestar5683 2ccc5fa9db Keep Tesla screen lateral off until fresh engagement 2026-11-02 08:11:23 -06:00
firestar5683 97c6040a9f Avoid takeover for expired idle GM cruise-main intent 2026-11-02 08:01:29 -06:00
firestar5683 1c035f3e6d Verify disabled Auto Learn without a runtime 2026-11-02 07:58:56 -06:00
firestar5683 8ff493640d Preserve HKG AOL through temporary EPS during driver override 2026-11-02 07:57:38 -06:00
firestar5683 ffc1aec50b Use planner-primary angle demand with bounded symmetric smoothing 2026-11-02 07:50:07 -06:00
firestar5683 d55e0b01f6 Qualify Integration Test Cleanup 2026-11-02 01:06:38 -06:00
firestar5683 dc6c5868f4 Clean Up Upstream Integration Tests 2026-11-02 01:05:32 -06:00
firestar5683 4d8df1f754 Qualify Camera Client Reuse 2026-11-02 00:55:15 -06:00
firestar5683 1e5f5c6791 Test Reused Camera Client Lifecycle 2026-11-02 00:50:20 -06:00
Adeeb Shihadeh 5808a49a52 UI: cache camera clients (#39166) 2026-11-02 00:48:19 -06:00
firestar5683 77cf37119c Qualify Upstream CAN Updates 2026-11-02 00:48:03 -06:00
Adeeb Shihadeh f7d3dfd037 Rate limit CAN timeout logs (#3898) 2026-11-02 00:46:06 -06:00
Shane Smiskol dea30ba5e2 Tesla: add Model Y EPS firmware (92),Y4003.10.2 (#3891) 2026-11-02 00:46:06 -06:00
Shane Smiskol 69711eb73f VW MEB: add pre-2024 HMS_Status (#3862) 2026-11-02 00:46:06 -06:00
Keenin Krehbiel 50514ff9ec Model 3 fingerprint for 2026.32.7 software (#3839) 2026-11-02 00:46:06 -06:00
Amy Jeanes 88eb1f00af Tesla: add Model Y EPS fingerprint (#3845) 2026-11-02 00:46:06 -06:00
firestar5683 993726afba Qualify Athena Input Validation 2026-11-02 00:43:01 -06:00
firestar5683 30d4b9e23f Preserve Internal Athena Validation 2026-11-02 00:40:42 -06:00
Adeeb Shihadeh 15e63f04f2 athena: validate all rpc params (#39190) 2026-11-02 00:40:42 -06:00
firestar5683 281098b7ab Qualify Upstream Calibration Updates 2026-11-02 00:38:41 -06:00
firestar5683 2c9dced9a8 Test Calibration Identity Changes 2026-11-02 00:36:43 -06:00
firestar5683 849c3715d9 Preserve Calibration Cache Validation 2026-11-02 00:36:14 -06:00
Daniel Koepping 8ef2ce2a0e docs: update safety wording (#39130) 2026-11-02 00:35:35 -06:00
Shane Smiskol fd1eb1662f calibrationd: don't reset calibration on a mock fingerprint (#39172) 2026-11-02 00:35:35 -06:00
Shane Smiskol 939b4889b2 calibrationd: use first block to only seed warp (#39170) 2026-11-02 00:35:35 -06:00
Shane Smiskol 7d6cf4e387 calibrationd: reset calibration when the car changes (#39171) 2026-11-02 00:35:35 -06:00
Adeeb Shihadeh 25830237de pack.py: include opendbc and check zipapps are self-contained (#39137) 2026-11-02 00:35:35 -06:00
firestar5683 b90a0d485c Keep Ford path angle within sign-correct wire bounds 2026-11-02 00:17:54 -06:00
firestar5683 0b7df146f8 Keep Ford controller comments technical and generic 2026-11-02 00:02:19 -06:00
firestar5683 7f630d2358 Qualify Upstream Touch Fixes 2026-11-01 23:29:45 -06:00
firestar5683 4c49768b24 Preserve Keyboard Gradient Compatibility 2026-11-02 05:27:52 +00:00
Shane Smiskol e20a02d930 ui: ignore additional fingers in last_mouse_event (#39144) 2026-11-02 05:27:52 +00:00
Shane Smiskol 04441d6049 ui: decel check on px moved per touch sample, not velocity (#39143) 2026-11-02 05:27:52 +00:00
Shane Smiskol ce9d9492c2 ui: mici keyboard multitouch (#39140) 2026-11-02 05:27:52 +00:00
Shane Smiskol 1376cf9d00 ui: fit fling velocity over the last 6 touch samples (#39142) 2026-11-02 05:27:52 +00:00
Shane Smiskol 9c4be6a6c1 ui: ignore additional fingers in scroll panel (#39141) 2026-11-02 05:27:52 +00:00
Harald Schäfer 7c3bf67791 SCons: avoid premature dependency scans in progress counter (#39131) 2026-11-02 05:27:51 +00:00
firestar5683 f353afa400 Skip disabled Auto Learn work in Controls 2026-11-01 23:19:52 -06:00
Dom 9e2d7594eb Model native receipt observation in selfdrived fixtures 2026-11-01 23:17:30 -06:00
firestar5683 5f741d9887 Keep Mazda source handoffs within the original control lease 2026-11-01 23:04:00 -06:00
firestar5683 865948a00e Preserve mixed HKG AOL after stock cruise disengages 2026-11-01 23:00:18 -06:00
firestar5683 5e92608ab7 Keep first AOL arming available during native startup 2026-11-01 22:41:34 -06:00
firestar5683 f429155f0f Keep StarPilot steering active after ordinary driver release 2026-11-01 22:34:13 -06:00
firestar5683 4e14f14461 Skip disabled Auto Learn CAN observations 2026-11-01 22:26:13 -06:00
firestar5683 2ee94f3643 Use saved vehicle settings in learner recovery tests 2026-11-01 21:57:07 -06:00
firestar5683 9e4cba8695 Test angle demand conditioning in StarPilot Controller 2026-11-01 21:28:45 -06:00
firestar5683 7cb8ea919f Isolate preference and replay clock test fixtures 2026-11-01 21:10:04 -06:00
firestar5683 f2f8cfffa8 Stop Auto Learn when learning is switched off 2026-11-01 21:01:08 -06:00
firestar5683 45c081b181 Balance independent Ford lifecycle cases across CI shards 2026-11-01 19:46:33 -06:00
firestar5683 736580721a Match Heatdeath safety builds and stream source verification 2026-11-01 18:59:11 -06:00
firestar5683 374a4134f6 Complete Honda active observation Card fixture 2026-11-01 18:36:08 -06:00
firestar5683 b16fc29ed5 Match radar isolation fixture to process health API 2026-11-01 18:17:07 -06:00
Dom c1e2b5f181 Complete Card fixtures and make SLC test timing deterministic 2026-11-01 17:44:39 -06:00
firestar5683 2c7f252feb Align developer command tests with JotPluggler alias 2026-11-01 17:25:38 -06:00
firestar5683 e522e5c6a3 Share immutable FLM evidence to bound learning memory 2026-11-01 17:14:56 -06:00
firestar5683 55f23c7fd5 Restore separate StarPilot Ford controller choices 2026-11-01 17:12:54 -06:00
firestar5683 61ad53c61f Keep automatic Tesla AP1 discovery on normal wiring 2026-11-01 16:55:04 -06:00
firestar5683 36e0e37086 Keep driving independent of UI restarts 2026-11-01 16:54:44 -06:00
firestar5683 407288852f Preserve Ford AOL through startup and brake transitions 2026-11-01 16:52:24 -06:00
firestar5683 0384be1253 Keep AOL through Nostalgia paddle handoff 2026-11-01 16:50:51 -06:00
firestar5683 a13b6395d4 Build stable traffic mode icon 2026-11-01 16:46:05 -06:00
firestar5683 e7cca0a136 Keep traffic mode icon stable on C4 2026-11-01 16:44:22 -06:00
firestar5683 c0bbed7762 Launch JotPluggler with juggle shortcut 2026-11-01 16:33:44 -06:00
firestar5683 6df04fa8e0 Detect Prius TSS2 steering rack retrofits automatically 2026-11-01 16:23:55 -06:00
firestar5683 40cd8ca264 Keep selected Tesla discovery on its declared CAN bus 2026-11-01 16:15:36 -06:00
firestar5683 d9b60fddc1 Balance measured Ford lifecycle work 2026-11-01 13:45:31 -06:00
firestar5683 153b95a88f Keep Auto Learn evidence current 2026-11-01 13:13:40 -06:00
firestar5683 5b6bdbe8ef Use typed gradient test fixtures 2026-11-01 12:39:39 -06:00
firestar5683 b70b7e16c4 Batch path gradient interpolation 2026-11-01 12:17:17 -06:00
firestar5683 195b7000aa Keep CI shard capacity and reviewed replay metadata consistent 2026-11-01 00:23:15 -05:00
firestar5683 1c7e21c43e Repair controller observation and current regression contracts 2026-11-01 00:08:07 -05:00
Dom e61c7993af Complete Card test interface fixtures for CAN observation 2026-10-31 23:59:05 -05:00
firestar5683 b158bc378a Preserve Ford expiry guards alongside native-first AOL braking 2026-10-31 23:15:31 -05:00
firestar5683 72f16053b5 Keep Ford curvature handoffs within native steering limits 2026-10-31 22:57:13 -05:00
Dom 1fe202b904 Narrow optional Bolt test intent before latch assignment 2026-10-31 22:40:12 -05:00
firestar5683 33bc40d061 Avoid invisible onroad texture draws 2026-10-31 22:35:49 -05:00
firestar5683 0102ad2a35 Review model producer after lane correction removal 2026-10-31 22:08:42 -05:00
firestar5683 5b0f81caa1 Reconcile queued Mach-E inputs before declaring a source fault 2026-10-31 21:56:17 -05:00
firestar5683 77ff308c76 Preserve GM lateral intent across brief Card source gaps 2026-10-31 21:48:35 -05:00
Dom cd585f55c2 Repair alert fixture and document weather epoch clock 2026-10-31 21:06:07 -05:00
firestar5683 feb1f442c2 Repair Ford BluePilot startup fixtures and native test loader identity 2026-10-31 20:44:19 -05:00
firestar5683 a7f4ba8254 Simplify Ford steering settings and preserve independent lateral intent 2026-10-31 20:36:04 -05:00
firestar5683 0f71f4669f Reduce FLM evidence allocations in Controls 2026-10-31 19:27:54 -05:00
firestar5683 2bc4f59d41 Report current FLM admission blockers 2026-10-31 19:25:18 -05:00
firestar5683 e8256ee5b2 Avoid repeated schema misses in the onroad display 2026-10-31 19:11:51 -05:00
firestar5683 1738b3798d Build Galaxy dashboard weather 2026-10-31 18:21:15 -05:00
firestar5683 d69ba777b5 Show outside temperature on Galaxy dashboard 2026-10-31 18:19:40 -05:00
firestar5683 0206e5dfc1 Default lane-centering model breakaway to fifty percent 2026-10-31 18:18:13 -05:00
Dom ff15fc4fae ci: restore selfdrived executable file mode
Restore the existing shebang script's executable mode without changing its source blob.
2026-10-31 17:57:44 -05:00
firestar5683 83e6132b6d Prefer another FLM coordinate after rejected oscillation 2026-10-31 17:56:27 -05:00
firestar5683 31b34665ce Preserve Ford AOL across gas override and lag recovery 2026-10-31 17:55:34 -05:00
firestar5683 8df7979373 Build matching GV60 HDA1 AOL artifacts 2026-10-31 17:43:02 -05:00
firestar5683 6f88e79025 Support captured GV60 HDA1 Alpha Long AOL 2026-10-31 17:32:21 -05:00
firestar5683 23123aefb4 Keep radar failures from disabling independent lateral steering 2026-10-31 17:25:44 -05:00
firestar5683 ddd67e58bc Reuse exact GM configuration checks in driving hot paths 2026-10-31 17:00:37 -05:00
firestar5683 b6e25bfa6d Match CAN-FD longitudinal parsers to fuel and camera layout 2026-10-31 16:55:25 -05:00
firestar5683 f10a7e229b Preserve stock CAN-FD AOL intent through held-gas recovery 2026-10-31 16:45:21 -05:00
firestar5683 ac318aa31e Fix Prius stop-and-go settings and stopped resume 2026-10-31 16:40:36 -05:00
firestar5683 15134f1ec2 Build Panda host binaries for comma hardware 2026-10-31 16:12:56 -05:00
Dom cb0c1507de test: complete default metadata lookup in remaining preference fixtures
Delegate the isolated Ioniq5PE, Toyota shell and GM pitch mock default lookups to real Params metadata. Preserve existing assertions, no-setting-write checks and runtime behavior.
2026-10-31 15:48:59 -05:00
firestar5683 3926f11699 Avoid unnecessary AOL recovery profile validation 2026-10-31 15:46:58 -05:00
firestar5683 8a760a3381 Scope ordinary Ford native lookup to configured Ford cars 2026-10-31 14:54:27 -05:00
firestar5683 58c38a4834 Honor default AOL buttons on classic HKG 2026-10-31 14:52:46 -05:00
Dom eb56047d57 test: supply real defaults and fresh onroad state in isolated fixtures
Delegate mock default lookup to Params metadata and supply the existing healthy UI fixtures with their post-start receive frame and onroad state. Preserve all runtime code, assertions and negative authority coverage.
2026-10-31 14:45:06 -05:00
alan-polk 67ad8ff05b Merge BluePilot Ford lateral library v0.2.1 2026-10-31 13:51:21 -05:00
firestar5683 fdbce123c8 Build matching BluePilot Ford firmware and host binaries 2026-10-31 13:40:02 -05:00
firestar5683 5235f58e07 Keep FLM trial input tapes current between motion deliveries 2026-10-31 13:39:45 -05:00
firestar5683 f26ab5e7f1 Integrate pinned BluePilot defaults and qualify Ford AOL lifecycle 2026-10-31 13:29:29 -05:00
alan-polk 14acf1ed31 Merge BluePilot Ford lateral library v0.2.1 2026-10-31 13:29:27 -05:00
firestar5683 6d2e382e92 Renew FLM from already received motion during FIFO ingest 2026-10-31 13:06:52 -05:00
firestar5683 fcb59fa1da Validate each FLM binding once per witness call 2026-10-31 12:54:03 -05:00
firestar5683 8c404b3b8a Align AOL reset and favorites fixtures with independent controls 2026-10-31 12:23:09 -05:00
firestar5683 3498e84770 Reuse validated immutable FLM source identity content 2026-10-31 12:15:20 -05:00
firestar5683 72f04816c3 Add metric-aware extra stopped-lead spacing 2026-10-31 12:04:00 -05:00
firestar5683 9068ec74f7 Keep quiet-camera HKG discovery on normal wiring 2026-10-31 11:58:04 -05:00
firestar5683 2df9c98963 Keep bookmark shortcuts working while alerts are displayed 2026-10-31 11:49:51 -05:00
firestar5683 70f523edc5 Renew owned FLM trials when admitted queued input becomes ready 2026-10-31 10:46:02 -05:00
firestar5683 c1f37c8314 Renew owned FLM trials when admitted queued input becomes ready 2026-10-31 10:26:39 -05:00
firestar5683 15ed9799cb Renew owned FLM trials when admitted queued input becomes ready 2026-10-31 09:43:22 -05:00
Dom f9dccd0c67 test(ford): return native transmit outcomes to joined angle fixture
Feed exact emitted steering payloads and their accepted/rejected host-bus receipts on the next parser cycle. Preserve all assertions and runtime behavior.
2026-10-31 09:36:31 -05:00
Dom 6a972ae87e test(gm): feed actual steering transmit receipts in healthy fixtures
Keep existing assertions and runtime behavior unchanged. Model healthy transport by returning only actually emitted steering commands; retain missing, stale, wrong-bus and rejected receipt coverage.
2026-10-31 09:25:04 -05:00
firestar5683 5197fe4568 Fix live network label typing and generated catalog lint policy 2026-10-31 08:51:50 -05:00
firestar5683 642d9d657d Record additive engagement receipt enum in schema compatibility review 2026-10-31 08:42:32 -05:00
firestar5683 cd0f46b9d6 Prevent stale lead handoff from reacquiring a clear stopped hold 2026-10-31 08:38:43 -05:00
firestar5683 a6030fa25d Feed native shadow receipts through Ford angle recovery tests 2026-10-31 08:27:09 -05:00
firestar5683 b8200e7bab Revisit pending FLM motion before another evidence drain 2026-10-31 08:19:02 -05:00
firestar5683 f9b678a7c3 Restore HKG AOL with auxiliary Pandas and default buttons 2026-10-31 08:14:06 -05:00
firestar5683 68fca49aab Avoid repeated static Bolt and empty-fault classification in Card 2026-10-31 08:11:52 -05:00
firestar5683 731a9e6c79 Keep Ford angle handovers quiet and preserve gas-override AOL 2026-10-31 08:09:22 -05:00
firestar5683 f506c8f299 Wait for Bolt steering transmit receipts before advancing counters 2026-10-31 08:04:17 -05:00
firestarsdog 6c38692ff7 Preserve SLC decisions to prevent source churn 2026-10-31 06:13:47 -04:00
firestarsdog 5668bafc4c Fix Vision units to prevent inflated metric speed limits 2026-10-31 04:13:19 -04:00
firestarsdog 859145dd8a Use SLC on RES to match SET 2026-10-31 03:41:55 -04:00
Dom 37341d2bca Fix CI type narrowing, fixtures and executable metadata
Preserve SLC validation behavior with explicit None narrowing, use existing Mock test doubles, and restore controlsd executable metadata without content changes. Keep exact torque gain expectations while matching the existing list representation.

Validated 1095 related tests, targeted ty and Ruff; prior baseline comparison and 4236 guard-equivalence cases preserve existing rejection semantics. Refresh the inventory receipt only for these validated changes.
2026-10-31 00:00:28 -05:00
firestarsdog 23a7b93df0 Rebuild Params and cereal for SLC changes 2026-10-31 00:53:56 -04:00
firestarsdog 7bce4121e5 Drop legacy SLC offsets for simpler setup
Use one saved schedule with editable zero defaults. Preserve current schedules and round displayed offsets and edits to whole units without conversion drift.
2026-10-31 00:24:31 -04:00
alan-polk 5c32d95d7b BluePilot lateral library: v0.2.1
Re-vendored at the v0.2.1 release (2b9dc6c), which adds StarPilot as a host.
Since the last copy: the matrix tests only re-key SAFETY_PARAM when the host's
stock base defines it (IQ.Pilot's iqdbc doesn't; StarPilot's does, so no change
here), and a FORKS.md note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:50:58 -05:00
alan-polk a0d80165df Ford AOL: a rejected host actuator frame doesn't hand the bus to the camera
The previous commit let the camera's actuator through again as soon as one host frame was rejected. Mid-steer
that put the camera's inactive frame (its own counter) on the bus in place of the blocked one, and
the F-150's PSCM ramped out and reported lateral control faulty for several seconds, from a single
blocked frame. Without AOL, static blocking makes a rejected frame a missed one, which the PSCM rides
through.

Block the camera's copy while the host is sending, accepted or not; only a host that has stopped
sending for the AOL host timeout gives the actuator back to the camera.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:50:58 -05:00
alan-polk 67f4250d7e Ford AOL: one steering actuator sender while the host's frames are accepted
With AOL, the camera's actuator (0x3D3/0x3D6/0x3CA) is forwarded unless AOL owns steering, but the
host sends its own every frame, active or not. When AOL isn't steering, the PSCM hears both, with
unrelated counters. On a 2021 F-150 this flipped LatCtlSte_D_Stat between Unavailable and Available
every 50-100 ms for seconds at a time, worst when the two counters ran 1-2 apart: steerFaultTemporary
alerts, the panda's LKA-ready check denying lateral, and AOL dropping its latch on re-engagement.
BluePilot's angle-mode release during a manual turn made it easy to hit.

Block the camera's actuator while the host's last frame was accepted and is within the AOL host
timeout, as static blocking does without AOL. A rejected or stale host frame lets the camera's
copy through again. Permission and display ownership are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:49:32 -05:00
alan-polk ed3b1c4c73 Settings: BluePilot lateral for Fords
On the Steering page, for every Ford that can run BluePilot lateral (not the Transit), in Galaxy and the
native settings alike:
- BluePilot Lateral (off by default), Primary Control (curvature/angle) and Use Pinion Yaw Sensor (platforms
  with a pinion geometry row) change while parked; the switch and the pinion sensor apply at the next vehicle
  startup, and Safe Mode keeps BluePilot lateral off.
- the tuning rows of the current mode change any time, since the library reads them every frame; rows that
  depend on Lane Positioning or the custom profile wait for it.
Ranges come from the library's manifest and defaults from params_keys.h, so the rows can't drift from what the
controller reads. A change is checked against the row it was made on, so a request from before its switch
changed is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:49:32 -05:00
alan-polk 49b651af70 openpilot: BluePilot lateral startup bits, per-frame inputs and settings registry
- params_keys.h: every setting in the library's manifest (python -m opendbc.bluepilot_lateral.params.manifest),
  without BACKUP, which StarPilot's params don't have. disable_BP_lat_UI defaults to "1": BluePilot lateral
  is off until the user turns it on.
- car init (VehicleStartupPreferences.prepare): init_ford_safety_param_starpilot ORs the library's startup
  bits into the Ford param. They stay off without the openpilot toggle, in Safe Mode, or when a startup
  setting can't be read.
- card (configure_controller): the Ford CarController gets a BluePilotInputs, which fills the library's
  LateralInputs from modelV2, vehicleParameters and lateralDelay each frame and re-reads the per-frame
  settings every 3 s.
- test_bluepilot_lateral.py: the init path's bits, the real CarController and libsafety with the same
  param, for a CAN and a CAN FD Ford, off/on/on+pinion/pinion-only, curvature and angle mode: every
  steering and LKA frame passes, and only angle mode with BluePilot on steers through the path angle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:49:32 -05:00
alan-polk 40147f9f74 BluePilot lateral library: Mondeo pinion geometry, platforms without a pinion row
Re-vendored from the library (stamped copy, unedited).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:49:32 -05:00
alan-polk bcb0abe576 Ford: hook the BluePilot lateral library into opendbc
- safety/modes/ford.h: includes the library's safety with StarPilot's lateral permission
  (lateral_controls_allowed(), which includes AOL) as its lateral binding. ford_init hands the library
  bits 9-14 of the Ford param (never on the Transit); with the bit set, LateralMotionControl/2 go through
  the library's 4-signal checks instead of the stock ones, Lane_Assist_Data1 carries the angle-mode state,
  and the pinion source replaces yaw and joins the selected RX list (stock, stock-switch or AOL).
- car/ford/carcontroller.py: one BluePilotLateral per Ford; while it's active it sends the steering and
  LKA messages, otherwise the stock path runs unchanged. StarPilot's openpilot side attaches the per-frame
  inputs and settings as bluepilot_inputs.
- safety tests: test.sh runs the library's safety tests by directory and gates the library headers'
  coverage in a run of their own; test_ford_bluepilot_hooks.py covers where the bits ride, the Transit,
  the pinion RX check on every list and the full-list guard. The qualification and mutation runners
  include the library's safety tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:49:32 -05:00
alan-polk 7b36024f6d Ford safety tests: reset the alternative experience after AOL fixtures
The CAN FD display fixtures and the stock-switch class left alternative_experience at 32. Now that the
stock words are AOL words, a later Ford test could run with AOL configured; they reset it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:49:32 -05:00
alan-polk c5ce014573 BluePilot lateral library (stamped copy)
opendbc_repo/opendbc/bluepilot_lateral is BluePilotDev/bluepilot-lateral as released, made by the
library's tools/vendor.sh and checked by its tools/check_vendored.sh (VERSION names the release and
commit). Nothing inside the folder is edited here: changes go to the library, get released, and are
vendored again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:49:32 -05:00
alan-polk 8da0c9d916 Ford: remove the interim BluePilot port; AOL on the stock profiles
StarPilot's angle-only bluepilot_lateral adaptation and the BluePilot-derived curvature strategies (Mach-E,
classic, Explorer, generic CAN FD, new-port curvature, manual-turn latch, curvature preview, pinion
measurement) are removed, with their extended safety profiles 16/32/64 and the interim angle word 128. Ford
lateral is upstream's stock curvature path until the BluePilot lateral library is mounted.

StarPilot's own Ford features stay, re-keyed from the extended words to the stock ones:
- AOL: classic 32 -> 0, Mach-E 18 and the CAN FD trucks 66 -> 2 (+1 with openpilot long); the CAN FD
  retained-display rules apply to word 2. Edge/Mondeo/Transit and the manual bit (256) are unchanged.
- release CAN FD long: word 3 (was 19/67); 19 and 67 are now retired and denied.
- stock cruise switch, CAN FD camera-lead radar handling, hands-free cluster: keyed on the Ford family.
- classic stock ACC (0) keeps the no-ACCDATA TX list the extended classic profile had.

Bits 9-14 of the Ford param are reserved for the BluePilot lateral library's startup bits
(safety/modes/ford_param.h); AOL and pandad mask them out of the profile word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:49:32 -05:00
firestarsdog 2fd0741f56 fix(slc): prevent confirmation prompts when longitudinal control is disengaged 2026-10-30 23:31:59 -04:00
firestar5683 c3d5939ffe Keep Polestar discovery on normal harness wiring 2026-10-30 22:09:43 -05:00
firestar5683 7f8aa3dceb Restore stable effective gain across StarPilot torque controllers 2026-10-30 22:07:21 -05:00
firestarsdog a1fccf70b4 Draw unset SET dash to avoid font fallback 2026-10-30 23:01:32 -04:00
firestarsdog aac227a103 Bind SET engagement to the selected speed limit 2026-10-30 22:53:13 -04:00
firestar5683 0d8c81e294 Renew an owned FLM trial before draining queued evidence 2026-10-30 21:49:47 -05:00
firestarsdog b9744f1cab Cycle shared personality widget on tap 2026-10-30 22:30:42 -04:00
firestarsdog 70b705782c Unify Onroad Long Indicator 2026-10-30 22:28:58 -04:00
firestar5683 efc8527820 Restore measured FLM receiver after queue scheduling regressions 2026-10-30 21:27:10 -05:00
firestar5683 d421abeee1 Yield FLM queues only when actual motion needs service 2026-10-30 21:05:45 -05:00
firestar5683 7da9cea0f6 Yield FLM evidence queues before fresh pose and trial delivery 2026-10-30 20:41:23 -05:00
firestar5683 24b3d17c58 Load live FLM trial validation before the driving loop 2026-10-30 19:51:36 -05:00
firestar5683 64eba05e62 Capture genuine FLM checkpoints before the reconstruction age ceiling 2026-10-30 19:27:50 -05:00
Dom 87736cf206 Use the established sound-pack mock in audio callback test 2026-10-30 19:10:31 -05:00
firestar5683 fb20651274 Retain native-visible FLM experiments through missing-evidence pauses 2026-10-30 19:03:46 -05:00
Dom 84bc481dd0 Align Galaxy test fixtures with current developer controls 2026-10-30 18:58:02 -05:00
firestar5683 e438a1a374 Play one temporary steering warning per AOL fault episode 2026-10-30 18:01:31 -05:00
firestar5683 f7c38a24a8 Show vehicle battery voltage on the Galaxy dashboard 2026-10-30 17:56:44 -05:00
Dom d56266b63b Restore selfdrived executable permission 2026-10-30 17:53:32 -05:00
firestar5683 6984f1da29 Add calibration reset beside driver monitoring in Galaxy 2026-10-30 17:43:17 -05:00
firestar5683 ce6545467b Keep AOL steering active with doors open 2026-10-30 17:36:45 -05:00
firestar5683 1a89d5577a Cover HKG torque steering independence from Alpha Long 2026-10-30 17:26:45 -05:00
firestar5683 39298d97be Remove optional Volt longitudinal tune 2026-10-30 17:21:28 -05:00
firestar5683 d84abc611d Keep door-open AOL pauses free of takeover alerts 2026-10-30 17:19:22 -05:00
firestar5683 60b0f1e826 Reuse exact native primitive validation during FLM input packing 2026-10-30 17:04:36 -05:00
firestar5683 2487154a1e Restore flashed Volt LKAS button mapping 2026-10-30 16:53:57 -05:00
firestar5683 5bedae0794 Refresh FLM producer clock pin for current modeld 2026-10-30 16:44:27 -05:00
Dom 1ab130e4a5 Align updater test fixtures with metadata checks 2026-10-30 16:41:09 -05:00
firestar5683 320e399f98 Keep alternate HKG CAN-FD discovery on normal wiring 2026-10-30 16:29:48 -05:00
firestar5683 1d7e01f9f1 Preserve Mach-E AOL across angle and pinion handovers 2026-10-30 16:26:07 -05:00
firestar5683 37bbd2711d Add toggle defaults reset to Software 2026-10-30 16:12:04 -05:00
Dom d513137550 Repair CI test collection and fixtures 2026-10-30 16:07:17 -05:00
firestar5683 0d32c47b56 Preserve FLM discovery against preselection backlog 2026-10-30 16:05:31 -05:00
firestar5683 6bc374c7d4 Refresh the release inventory after updater source changes 2026-10-30 16:04:39 -05:00
mtawata 867ed373d6 fix fast updater hang; improve version selection list; schedule update install 2026-10-30 13:58:52 -07:00
firestar5683 0fd2353c55 Publish the intended common archive as an ordinary Git blob 2026-10-30 15:37:32 -05:00
firestar5683 21f675eae0 Validate each FLM control graph once during probe preparation 2026-10-30 15:32:49 -05:00
firestar5683 f4dde57839 Keep FLM input reception responsive and numerical work off Controls 2026-10-30 15:09:04 -05:00
firestar5683 b2604f4b8a Ship the executable Params library 2026-10-30 13:23:44 -05:00
firestar5683 ebe7f28aae Update from the live installed Git revision 2026-10-30 13:18:48 -05:00
firestar5683 bf0243f41b Build matching Outback MAIN lateral firmware 2026-10-30 13:15:36 -05:00
firestar5683 da0d0d204b Restore Toyota stop-and-go assistance setting 2026-10-30 13:09:55 -05:00
firestar5683 e9e7481416 Offer both controllers on every torque-tuned vehicle 2026-10-30 13:08:26 -05:00
firestar5683 0fcf127704 Arm Outback lateral on physical cruise MAIN 2026-10-30 13:07:30 -05:00
Dom f7b85976a5 Align lane-centering test fixtures 2026-10-30 13:00:19 -05:00
James Vecellio-Grant 2b3e186822 controls: Blendful lateral policy (alpha) (#2073) 2026-10-30 12:40:57 -05:00
firestar5683 8daabf71f9 Keep live plots refresh cadence and layout steady 2026-10-30 12:02:00 -05:00
firestar5683 1fcfefc977 Show classic HKG AOL icons before cruise engagement 2026-10-30 11:59:48 -05:00
firestar5683 01529d935d Keep FLM numerical preparation within its input budget 2026-10-30 11:27:24 -05:00
firestar5683 ba0e051293 Fix language font loading on device 2026-10-30 11:10:30 -05:00
firestar5683 bfca5476e6 Preserve manager executable permission 2026-10-30 11:07:21 -05:00
firestar5683 bfa9427dbd Fix typed lane centering default enrollment 2026-10-30 11:06:09 -05:00
Dom 02588a19a2 Use typed localization test resources and fixtures 2026-10-30 10:52:25 -05:00
firestar5683 f4ec1c187e Share corroborated CEM lead departure across vehicle configurations 2026-10-30 10:48:59 -05:00
Dom bc494bd7d5 Restore manager executable mode 2026-10-30 10:43:58 -05:00
firestar5683 0b94e10fd9 Preserve Toyota stop engagement while the brake is held 2026-10-30 10:39:14 -05:00
firestar5683 f09bf1fc28 Reuse validated immutable FLM input metadata 2026-10-30 10:34:03 -05:00
firestar5683 de00bb2f11 Preserve missing lane centering preferences on upgrades 2026-10-30 10:28:21 -05:00
firestar5683 7acb954a6d Translate Galaxy and native UI through the shared language setting 2026-10-30 10:27:37 -05:00
firestar5683 5e057b9848 Share display translations across Galaxy and native UI 2026-10-30 10:27:37 -05:00
firestar5683 4fcf11f07a Enable lane centering by default on new installs 2026-10-30 10:22:47 -05:00
Dom 6120b36217 Register existing blindspot setting descriptions 2026-10-30 09:59:21 -05:00
Dom 5c662d9e43 Keep sound selection tests stable with blindspot settings 2026-10-30 09:53:20 -05:00
Dom b64d7cf9e9 Share banked Hyundai CAN-FD RX workspace to recover Panda RAM 2026-10-30 09:07:01 -05:00
firestar5683 18432adb3d Build blindspot alert 2026-10-30 08:41:03 -05:00
firestar5683 fae3f5ccfc Blindspot alert 2026-10-30 08:37:21 -05:00
firestar5683 8fdee1d44e Remove redundant wheel control default buttons 2026-10-30 08:19:47 -05:00
firestar5683 b3b96adecc Preserve Palisade AOL through camera echo races and braking 2026-10-30 07:48:14 -05:00
firestar5683 df9898673e Stabilize GM startup test collection across CI shards 2026-10-30 03:34:54 -05:00
firestar5683 66beca6de7 Avoid overlapping subscriptions for the flashed Volt parser 2026-10-30 02:40:34 -05:00
Dom 717a82245f Account for Galaxy-only accelerator preference in page parity test 2026-10-30 02:23:15 -05:00
firestar5683 d955ebd7a2 Keep schema and caller checks aligned with reviewed source contracts 2026-10-30 02:22:25 -05:00
firestar5683 2cca20624c Finalize the admitted Sportage long AOL startup profile 2026-10-30 02:12:43 -05:00
firestar5683 7db42dd5d6 Distinguish native-rejected Ford UI from transmitted display frames 2026-10-30 01:49:30 -05:00
firestarsdog eff809d839 Add DisengageOnAccelerator to Galaxy 2026-10-30 02:41:22 -04:00
Dom b3a4b964c2 Use typed Quick Select test fixtures
Retain real composition and input-routing methods with typed drawing boundaries.
Preserve existing assertions and validate optional settings requests explicitly.
2026-10-30 01:40:41 -05:00
firestarsdog 0114eb04bb Add compact ui DisengageOnAccelerator 2026-10-30 02:17:36 -04:00
firestarsdog 890c30c3cb Rebuild Params and cereal for SLC lookahead 2026-10-30 02:13:07 -04:00
firestar5683 7e00ee80c4 Align regression and settings coverage with current AOL contracts 2026-10-30 01:05:49 -05:00
firestarsdog e00fb66bc8 Firefox Arabesque Updater 2026-10-30 01:49:51 -04:00
firestarsdog 0d4422552b Large UI: replace radial Quick Select with a stable overlay 2026-10-30 01:43:43 -04:00
firestar5683 c7f3de2416 Clarify speed-limit type validation and settings test contracts 2026-10-30 00:28:07 -05:00
firestar5683 4ea9adbdb9 Order Ford standby display after inactive steering proof 2026-10-30 00:21:06 -05:00
firestar5683 9e7e4dde52 Keep factory wheel roles explicit and restore CI source hygiene 2026-10-30 00:16:33 -05:00
firestarsdog a8bc9d1f24 Merge remote-tracking branch 'origin/Dom' into Dom 2026-10-30 01:10:22 -04:00
firestarsdog 63395a56f1 SLC: add timed adoption of upcoming limits 2026-10-30 01:03:30 -04:00
firestar5683 0a786d37e3 Show factory AOL roles and fix wheel controls safety qualification 2026-10-30 00:01:17 -05:00
firestarsdog 6fe76b728b Mapd: add lookahead for early speed-limit adoption 2026-10-30 00:41:31 -04:00
Dom c65296f6df Initialize native settings localization test fixture
Share isolated real Params with the localization owner and initialize the RHD row.
Preserve existing saved-state and parked-state assertions.
2026-10-29 23:05:03 -05:00
firestar5683 008687eb87 Build Sportage AOL and shared wheel controls fixes 2026-10-29 23:03:49 -05:00
firestar5683 dc7ff90070 Restore Sportage AOL and show effective wheel controls 2026-10-29 22:46:29 -05:00
firestar5683 c6ef6b138a Avoid duplicate native packet validation in FLM 2026-10-29 22:39:28 -05:00
Dom 56c997a284 Restore controlsd executable mode
Preserve the source blob while restoring the script's executable bit.
Refresh the source inventory receipt for the mode-only correction.
2026-10-29 22:22:17 -05:00
firestar5683 f1f8f5696e Use Metric 2026-10-29 22:14:25 -05:00
firestar5683 16f31abd75 RHD Fix 2026-10-29 22:13:23 -05:00
firestar5683 77babc4c85 Release an existing Force Stop hold with RES 2026-10-29 22:10:01 -05:00
firestar5683 d1c2bc14a4 Localize steering command publication stalls 2026-10-29 21:57:08 -05:00
firestar5683 86315e76cb Restore flashed Volt OBD alpha longitudinal profile 2026-10-29 21:55:21 -05:00
firestar5683 52347a3593 Preserve AOL intent through temporary steering overrides 2026-10-29 21:40:46 -05:00
firestar5683 0933e58afc Keep AOL border lit while its latch is armed 2026-10-29 21:30:07 -05:00
firestar5683 cc125cf1eb Preserve Toyota cruise during accelerator override 2026-10-29 21:15:56 -05:00
firestar5683 c073497d44 Recognize short deliberate bookmark swipes 2026-10-29 21:14:56 -05:00
Dom b817c3c26e Fix Subaru init parameter MISRA compliance
Normalize a same-type local copy instead of modifying the input parameter.
Existing safety logic and all 34 paired firmware artifacts remain byte-identical.
Validated 67 debug and 67 release native cases; refresh source inventory receipt.
2026-10-29 20:40:23 -05:00
Dom 075d5c0ffe Cover Impreza MAIN words in the exhaustive AOL protocol contract 2026-10-29 19:41:11 -05:00
Dom 1f1b1d5db9 Match persisted language and bounded proof wait test fixtures 2026-10-29 19:24:19 -05:00
firestar5683 4dd24beabc Separate Volt CC steering minimum from cruise engagement 2026-10-29 19:19:20 -05:00
firestar5683 ad7bfa4899 Build matching 2020 Impreza MAIN lateral artifacts 2026-10-29 19:11:18 -05:00
firestar5683 5910ddb754 Arm 2020 Impreza lateral on physical cruise MAIN 2026-10-29 19:09:50 -05:00
firestar5683 21a3921b16 Keep GM steering active through axis proof delivery races 2026-10-29 19:07:31 -05:00
firestar5683 33e87cea5a Recognize standard HDA2 wiring before diagnostic queries 2026-10-29 18:59:39 -05:00
firestar5683 e3fbbdddb9 Add language selection to Galaxy localization 2026-10-29 18:42:16 -05:00
Dom 76d33aaa81 Keep native test fixtures aligned with current lifecycle contracts 2026-10-29 18:26:08 -05:00
Dom ff62737ac4 Align GM interface fixtures with registered identities and Gen2 Drive 2026-10-29 17:43:51 -05:00
Dom 87b8b2ada5 Cover Polestar receiver counter wraps and fail-closed faults 2026-10-29 17:19:31 -05:00
Dom b43db836a5 Label the non-pedal Bolt camera profile as ACC 2026-10-29 17:17:33 -05:00
firestar5683 1b9bb0cd51 Keep FLM snapshot preparation below live capture priority 2026-10-29 17:03:56 -05:00
Dom c3de3defc3 Keep parked power tests in their own collected module 2026-10-29 17:03:45 -05:00
Dom 268370640d Type Jetlink test parameters for model selections 2026-10-29 17:00:01 -05:00
firestar5683 0d795930ff Keep the FLM live receiver at normal CPU priority 2026-10-29 16:58:34 -05:00
firestar5683 ec5739441e Expose parked shutdown settings in Galaxy 2026-10-29 16:58:07 -05:00
Dom e94198f98e Clarify Subaru MAIN observer for MISRA without changing output 2026-10-29 16:41:26 -05:00
Zeph Leggett 5f8638e894 Jetlink: Active Big chooses Jetlink's model by its ONNX 2026-10-29 16:38:54 -05:00
firestar5683 98d2865a29 Publish the Controls scheduling repair for FLM 2026-10-29 16:28:51 -05:00
firestar5683 0e55c02b28 Prioritize Controls CPU time during FLM learning 2026-10-29 16:28:50 -05:00
Dom 3d7df63099 Normalize continuation indentation within source size limits 2026-10-29 16:26:33 -05:00
firestar5683 47e4855580 Build Polestar counter correction firmware 2026-10-29 16:18:37 -05:00
firestar5683 b33e4a071b Correct Polestar LCA counters at modulo-15 wraps 2026-10-29 16:17:07 -05:00
firestar5683 bc3dce2c0c Keep manager shutdown nonblocking and preserve paused AOL intent 2026-10-29 16:12:56 -05:00
Dom ed5e9e56f2 Assert registered Trax layout without changing stock control contracts 2026-10-29 16:07:54 -05:00
dirwin31 30625319b3 Improve Android Auto reconnection and report screen resolution to Bugsink 2026-10-29 16:06:11 -05:00
Zeph Leggett 51e866a038 Jetlink: Active Big chooses Jetlink's model by its ONNX
With Jetlink running the big model (on, supported, no Chestnut), Active Big
in Galaxy and on the device is Jetlink's choice: the model manager marks a
big model selectable when its catalog entry names the ONNX it was built from
(source_sha256), downloaded or not, since Jetlink's host fetches the ONNX
itself. The choice is the new JetlinkModel param, {sha256, displayName}, the
adapter's big-model key; Chestnut's own Active Big is left as it was. None
leaves the model to the Jetlink app, and the manager words it.

A newer choice made in the Jetlink app is written back into JetlinkModel by
jetlink, so Active Big shows the model that drives; one StarPilot does not
list is named as the app's.

JetlinkModel is a new key in params_keys.h: the native params libraries need
their usual rebuild.
2026-10-29 16:03:03 -05:00
Zeph Leggett 21c34c8f4d Jetlink v0.8.12 2026-10-29 16:03:03 -05:00
firestar5683 2800e5b452 Keep unarmed startup steering restrictions from displaying takeover warnings 2026-10-29 15:49:53 -05:00
firestar5683 85997f719f Quiet incomplete drive history and recover full logs 2026-10-29 15:42:32 -05:00
firestar5683 138da851ee Guard two-line centering against conflicting corrections 2026-10-29 15:37:16 -05:00
dirwin31 556f90458e Merge branch 'Dom' into AA-AutoConnectFix-Dom 2026-10-29 13:11:06 -07:00
firestar5683 e2fdc2a4dc Remember unchanged model verification across restarts 2026-10-29 14:59:31 -05:00
firestar5683 312eb9e94d Recover model verification after a worker failure 2026-10-29 14:51:14 -05:00
firestar5683 37fc53c48a Explain community Polaris models in Galaxy 2026-10-29 14:48:32 -05:00
firestar5683 efbe7a776f Materialize matching Panda host object files 2026-10-29 14:48:03 -05:00
firestar5683 7c5e70fd13 Build matching Ford standby-handover firmware 2026-10-29 14:37:09 -05:00
firestar5683 06a74465c0 Keep Ford standby display through the final steering packet 2026-10-29 14:34:35 -05:00
firestar5683 42057a3f8f Limit low-speed steering advisories to engaged or armed steering 2026-10-29 14:33:29 -05:00
firestar5683 d85372232f Animate Polaris highlights and preserve emoji colors 2026-10-29 14:30:06 -05:00
firestar5683 a952a8f8a8 Keep Mach-E native LONG withdrawal separate from manual steering 2026-10-29 14:27:37 -05:00
firestar5683 0826f3b22d Highlight custom Polaris models 2026-10-29 14:25:17 -05:00
firestar5683 58fb8e820b Identify the 2025 Trax from its CAN layout and VIN 2026-10-29 14:21:21 -05:00
firestar5683 38e14008b9 Build Impreza physical MAIN lateral firmware 2026-10-29 13:41:17 -05:00
firestar5683 4c015f6f49 Arm Impreza lateral on physical MAIN and show stock ACC engagement 2026-10-29 13:39:31 -05:00
firestar5683 256628e50b Keep Ford AOL through Cancel during accelerator override 2026-10-29 13:07:02 -05:00
firestar5683 fa25ea0567 Publish native permission for the bypassed-camera Volt configuration 2026-10-29 12:51:00 -05:00
Dom 99f52a7048 Align Bolt fixtures with Drive feeds and explicit ACC faults 2026-10-29 12:44:53 -05:00
firestar5683 eb2c90b80e Refresh queued GM permission during combined control 2026-10-29 12:37:07 -05:00
firestar5683 53b82a1726 Put Cruise Intervals In Wheel Controls 2026-10-29 12:31:54 -05:00
firestar5683 3b04ff3cc4 Keep downloaded models selectable offline 2026-10-29 12:27:56 -05:00
firestar5683 6e11c50dfc Build jacobw Subaru angle adapter firmware 2026-10-29 12:08:10 -05:00
firestar5683 34ae63cbf6 Adapt jacobw Subaru angle control to StarPilot 2026-10-29 12:06:38 -05:00
firestar5683 1f79ca865f Recognize Outback Wilderness camera firmware and credit jacobw Subaru support 2026-10-29 11:54:05 -05:00
Dom 87cb8f9a63 Assert exact four-byte Toyota button capability in variant parity 2026-10-29 11:52:04 -05:00
firestar5683 21b9fd8136 Build Gen2 Bolt pedal firmware 2026-10-29 11:49:58 -05:00
firestar5683 d317185c00 Allow Drive for Gen2 Bolt pedal 2026-10-29 11:48:24 -05:00
firestar5683 f47452c4b1 Restore radar-filter Toyota distance buttons and wheel mapping 2026-10-29 11:23:58 -05:00
firestar5683 6e124d1e45 Keep inactive ACC traffic flowing for every qualified GM owner 2026-10-29 11:17:06 -05:00
firestar5683 50b4da94ba Maintain inactive ACC streams during ordinary SDGM startup 2026-10-29 11:00:17 -05:00
firestar5683 66bf42ac1e Keep Bolt pedal control available after secondary brake loss 2026-10-29 10:55:11 -05:00
firestar5683 8aa35ed00f Report verified models in usage statistics 2026-10-29 10:51:59 -05:00
firestar5683 6639a95904 Keep lane centering responsive with fresh inputs and continuous tracking 2026-10-29 10:22:45 -05:00
dirwin31 2b069cffc2 Build 2026-10-29 06:43:30 -07:00
dirwin31 ac97f5f447 Add supported Message 2026-10-29 06:31:46 -07:00
dirwin31 e7b53f3099 Bugsink Screen Resolutions 2026-10-29 06:21:31 -07:00
dirwin31 6418bfd5b7 Let the car connect first and clear stuck Android Auto Bluetooth links
At ignition the head unit pages the comma for hands-free at the same moment
the supervisor paged the car. The crossed connections can leave the
controller holding a link the 4.9 kernel no longer knows ("ACL packet for
unknown connection handle 7"), after which every SDP/RFCOMM connect to the
car fails with EALREADY and the session retries the same sequence until the
car gives up.

- Ignition-triggered sessions wait up to 8 s for the car's own hands-free
  link before paging it.
- EALREADY on SDP or the cached RFCOMM channel fails the attempt at once,
  keeps the cached channel, drops the stray handle with a raw HCI Disconnect
  (only when BlueZ reports the car disconnected and the kernel does not list
  that handle), and lets the car connect first on the retry.
2026-10-29 06:21:10 -07:00
Dom 6d87ba090c Assert retired SLC fallback stays inactive after source loss 2026-10-29 03:12:15 -05:00
Dom 3fb884b5ba Follow renamed conditional planner integration fixture 2026-10-29 02:27:25 -05:00
firestarsdog aa99e3b6ca Build for SLC Refinement 2026-10-29 03:04:02 -04:00
firestarsdog ad397f89cc Retire SLC fallback to unify behavior 2026-10-29 02:57:30 -04:00
Dom 4e3775fa06 Refresh source inventory after speed-limit UI cleanup 2026-10-29 01:36:13 -05:00
firestarsdog 01416612a1 Remove "Use X Speed" 2026-10-29 02:16:51 -04:00
firestar5683 8fcd77c953 Recover FLM learning windows and deliver current trial evidence 2026-10-29 00:44:04 -05:00
firestar5683 9e002886f9 Build matching Ford cluster-handover firmware 2026-10-29 00:15:33 -05:00
firestar5683 1f9825e594 Keep Ford cluster standby through driver handover 2026-10-29 00:11:34 -05:00
firestar5683 4a82e92c73 Avoid repeated single-line lane-centering acquisition stalls 2026-10-29 00:09:26 -05:00
firestarsdog 507e464c59 Arabesque Firefox Character Fix 2026-10-29 00:32:05 -04:00
firestar5683 b6b548fc9a Admit fresh Toyota lateral input with cruise already off 2026-10-28 23:17:50 -05:00
firestar5683 434c89ce71 Normalize positive model-origin roundoff for stopped release 2026-10-28 22:57:27 -05:00
firestar5683 50781a9736 Fit StarPort torque widgets to square head-unit layouts 2026-10-28 22:37:17 -05:00
firestar5683 31b4abe4c6 Keep camera ACC messages flowing throughout GM startup 2026-10-28 22:28:52 -05:00
firestar5683 cdc97b58df Recognize HKG HDA1 wiring before diagnostic queries 2026-10-28 22:10:42 -05:00
Dom 4a3a989b3c Publish exact Panda bootstub bytes as ordinary Git blobs 2026-10-28 21:48:37 -05:00
firestar5683 b75d9f8baf Build repaired Panda CAN power-save firmware 2026-10-28 21:37:45 -05:00
firestar5683 b12ed577c0 Preserve stock Hyundai AOL across fresh input transitions 2026-10-28 21:34:28 -05:00
firestar5683 2567a32f70 Preserve Panda power-save state across CAN reinitialization 2026-10-28 21:29:24 -05:00
firestar5683 639866e6f7 Keep Hyundai brake withdrawal guard within source budget 2026-10-28 21:08:08 -05:00
firestar5683 ccdddea522 Preserve classic Hyundai AOL through brake withdrawal 2026-10-28 21:02:30 -05:00
Dom b5f1b8a8e3 Complete ready-state fixture for CAN clock contract 2026-10-28 20:45:58 -05:00
firestar5683 14835e1b42 Ignore logging-only Honda EPS diagnostic responses 2026-10-28 20:21:19 -05:00
firestar5683 f1bc3a8c5b Restore legacy USB Panda bootstub identification 2026-10-28 20:20:40 -05:00
Dom cbeaffba9a Refresh audited GPU capability fixture fingerprints 2026-10-28 20:11:42 -05:00
firestar5683 6537a58bd6 Avoid repeated Toyota parent admission projections 2026-10-28 19:52:55 -05:00
firestar5683 5a12f032ed Reuse exact GM steering profile qualification 2026-10-28 19:48:36 -05:00
firestar5683 094c9ae84e Reuse MEB static eligibility within each longitudinal update 2026-10-28 19:47:36 -05:00
firestar5683 83d4bf30a8 Reuse constant Chrysler AOL qualification masks 2026-10-28 19:46:32 -05:00
firestar5683 fdaaae86b0 Share exact static configuration cache across vehicle makes 2026-10-28 19:44:05 -05:00
firestar5683 8995ddb0df Build Toyota configuration overhead fix 2026-10-28 19:27:04 -05:00
firestar5683 390438432e Reduce Toyota pedal runtime configuration overhead 2026-10-28 19:25:58 -05:00
Dom 26ab9745af Align startup fixtures with GM neutral continuity contract 2026-10-28 19:03:46 -05:00
firestar5683 d8ccb7fd68 Honor StarPort head unit display insets 2026-10-28 18:59:25 -05:00
Dom 03feefed84 Preserve Toyota behavior with single-exit safety helpers 2026-10-28 18:20:31 -05:00
firestar5683 1fa29f6c33 Reverse Proxy 2026-10-28 18:07:26 -05:00
firestar5683 34dfc2e1b5 Build Toyota and Lexus pedal camera-copy parity 2026-10-28 18:04:12 -05:00
firestar5683 5309a0d6bc Preserve Toyota and Lexus primary pedal ownership with camera copies 2026-10-28 18:03:06 -05:00
firestar5683 3c770dc283 Build legacy Prius DSU and pedal receiver port 2026-10-28 17:52:38 -05:00
firestar5683 265ca6c17d Merge current Dom checks for legacy Prius receiver 2026-10-28 17:51:29 -05:00
firestar5683 04b5dd0ad5 Port legacy Prius retrofit DSU and pedal receiver from StarPilot 2026-10-28 17:51:23 -05:00
firestar5683 cdef286dbf Cover HKG stop permissions across native policy families 2026-10-28 17:37:03 -05:00
firestar5683 41692084c9 Build Prius retrofit native DSU mirror fix 2026-10-28 17:31:22 -05:00
firestar5683 dbba95d7fb Keep Prius retrofit stock control when native DSU traffic is mirrored 2026-10-28 17:30:07 -05:00
Dom fee87a4576 Keep transport pause comments within source size budget 2026-10-28 17:22:40 -05:00
firestar5683 df8e234ff6 Preserve CCNC AOL intent through full-engagement stop pauses 2026-10-28 17:05:42 -05:00
firestar5683 ba2275363f Maintain neutral steering throughout GM startup 2026-10-28 16:42:50 -05:00
Dom a4e552c7a3 Classify the compressed Ford regression fixture as binary 2026-10-28 15:36:55 -05:00
firestar5683 65ac3bccf6 Restore Dom predictive stopping across HKG 2026-10-28 15:35:36 -05:00
firestar5683 3e7a3dded8 Release corroborated Mach-E lead departure from CEM standstill hold 2026-10-28 15:25:31 -05:00
Dom 62dd77d6bb Keep transport intent documentation within the text size limit 2026-10-28 15:02:57 -05:00
firestar5683 7a7b6d2208 Identify blocking work inside Controls overruns 2026-10-28 14:58:41 -05:00
firestar5683 b8aa3b9eca Arm Ford Alpha AOL on the first physical MAIN edge 2026-10-28 14:41:17 -05:00
firestar5683 b0e93e304f Retain Ford AOL across first gas-held native grant 2026-10-28 14:29:26 -05:00
firestar5683 3baf4f7c82 Skip unrelated GM steering checks on other vehicles 2026-10-28 14:23:29 -05:00
firestar5683 621c8d31e3 Restore Stinger forecast stop intent with the smooth planner 2026-10-28 14:20:00 -05:00
firestar5683 e095ab6b71 Retain real FLM source packets for bounded frequency accounting 2026-10-28 14:01:27 -05:00
firestar5683 e0fc923875 Keep audio callbacks off protected driving cores 2026-10-28 13:56:22 -05:00
firestar5683 4848960966 Finish GM discovery after an early Ford signature rejection 2026-10-28 13:54:55 -05:00
firestar5683 2e70c76990 Patch native audio fixture attributes without type conflicts 2026-10-28 13:49:31 -05:00
firestar5683 b6bfd182dd Run shared GM discovery regressions in CI 2026-10-28 13:45:13 -05:00
firestar5683 c0ed5f309a Prioritize native audio playback below driving control loops 2026-10-28 13:42:32 -05:00
firestar5683 f2294f575e Keep shared GM discovery on normal CAN wiring 2026-10-28 13:19:53 -05:00
firestar5683 0fcc393380 Pace optional FLM receiver on motion without relaxing evidence guards 2026-10-28 12:33:01 -05:00
Dom 2af7ef756b Refresh audited graphics fixture identities after StarPort rename 2026-10-28 12:01:29 -05:00
firestar5683 db651809df Cover device Params startup state shared with native readers 2026-10-28 11:38:17 -05:00
Dom 39392c37a6 Preserve typed radar projection test overrides 2026-10-28 11:21:11 -05:00
firestar5683 d594c6772a Keep device settings in persistent Params storage 2026-10-28 11:18:25 -05:00
firestar5683 1fcd8b3353 Reduce Controls and Telemetry Parsing Work 2026-10-28 11:14:43 -05:00
Dom 7d9cb9b37b Align discovery and independent button fixtures with current contracts 2026-10-28 11:04:52 -05:00
Peter Nguyen 2d28dc4870 2026-10-28 Honda Bosch-A: current radar parser on Dom, with the fixes found since PR 229
The Civic Bosch / CR-V 5G radar parser on Dom still reads range about 9 % short, reads closing
speed at the wrong scale, and can delete a real lead when the radar coasts it. This brings in the
decoder that runs on Peter's Civic today (night-star7, the 7.0 rebase), plus two fixes found since
PR 229:

- Raw U11 0 is the closing-speed low rail (-12 m/s), not a measurement. The point is still
  published (never deleted), but unmeasured, at the trailing range fit; a rail sweep no longer
  seeds the last trusted vRel. Route 00000008 track 17 published -12 m/s for 2.5 s before this.
- The decoder keeps each point's F0 STATUS nibble (RadarInterface.point_statuses) so a consumer
  can tell an unconfirmed track (STATUS 9) from a confirmed one (7). Nothing on Dom reads it yet.

card.py hands vEgo to the radar interface so a coasting point can't imply a reversing lead.

Static: test_bosch_a_radar.py and test_bosch_a_decoder.py 163 passed against Dom's Honda files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 15:43:12 +00:00
Dom c55ef78274 Keep settings test documentation within the text size limit 2026-10-28 10:32:21 -05:00
firestar5683 e9b29f139c Reduce Onroad Torque Drawing Overhead 2026-10-28 10:28:03 -05:00
firestar5683 7d3ba7adf9 Avoid Unused Radar Signal Decoding 2026-10-28 10:19:32 -05:00
firestar5683 d2199ddc20 Speed Up Native CAN Signal Extraction 2026-10-28 10:10:39 -05:00
firestar5683 afd33370f6 Measure smaller FLM source experiments within the existing slew limit 2026-10-28 09:59:49 -05:00
firestar5683 b0417bbf61 Keep classic HKG LKAS and MAIN mappings independent 2026-10-28 09:47:49 -05:00
Dom 6617a1675d Refresh settings fixtures and audited StarPort capability identity 2026-10-28 09:38:58 -05:00
firestar5683 9f4fb7dbb4 Preserve FLM evidence during overload and remove unused wakeups 2026-10-28 09:11:23 -05:00
ervteng 316ed6b8b2 kia/stinger: decode 2022+ radar tracks 2026-10-28 09:06:57 -05:00
firestar5683 dbd72abae6 Add Experimental Speed Nudge and Group Driving Personalities 2026-10-28 08:57:26 -05:00
firestar5683 9ade200473 Build Camry filter radar admission fix 2026-10-28 08:56:35 -05:00
firestar5683 c1a00e3ef5 Merge current Dom checks for Camry filter fix 2026-10-28 08:55:20 -05:00
firestar5683 c03f84cf61 Recognize Camry filter with independent cluster radar traffic 2026-10-28 08:54:56 -05:00
Dom 5ce3f02b99 Align Bolt lifecycle fixtures with raw camera payload contract 2026-10-28 08:54:18 -05:00
firestar5683 63243d7e2d Preserve Encouragement Through Acceleration Noise 2026-10-28 08:39:55 -05:00
Dom 7b6d9cb64b Fix StarPort and Firefox static checks 2026-10-28 08:27:36 -05:00
firestar5683 d61cfcb04f Enable stopped-lead CEM by default 2026-10-28 08:23:23 -05:00
firestar5683 c3c7ee985a Identify Bolt variants from VIN and live cruise capability 2026-10-28 08:21:29 -05:00
Dom 51af702b2c Run CI on the Dom development branch 2026-10-28 08:19:35 -05:00
firestar5683 3621ccf9c2 Add Localization Settings and Repair Global Unit Switching 2026-10-28 08:10:00 -05:00
firestarsdog af48674fae Arabesque Firefox v1 2026-10-28 05:08:17 -04:00
Prabhaav Pillai 08fa2bfde2 Build 2026-10-28 02:56:01 -04:00
Prabhaav Pillai 5b2e2dae0f Refactor Android Auto references to StarPort across the codebase 2026-10-28 01:46:55 -04:00
firestarsdog cc184af2b5 Explain braking preset differences 2026-10-28 01:40:54 -04:00
firestarsdog 13a76dfb8e Keep SLC state and confirmations current 2026-10-28 01:09:47 -04:00
ervteng 9736d887b3 kia/stinger: decode 2022+ radar tracks
The 2022+ Kia Stinger has no radar DBC: the radar's object list is sent on
bus 1 as 10 slots x 3 frames (0x238..0x255, 8 bytes, 50 Hz). Decode it by
hand and publish the objects as radar tracks, gated to KIA_STINGER_2022.

- Stinger2022ObjectDecoder pairs the three frames of a slot (same cycle
  counter and object id in all three, completed within 20 ms, the last
  frame consumed so it cannot be reused) and decode_stinger_2022_triplet
  extracts distance, lateral offset, absolute speed and type.
- Ego speed is the WHL_SPD11 4-wheel average on bus 0 times
  wheelSpeedFactor; relative speed is the radar's absolute speed minus it.
- yRel = -lateral_raw (left positive in the car frame). Tracks not seen in
  a cycle are dropped. canError is reported while the parser is invalid or
  no wheel speed has been seen, and objects decoded in such a cycle are
  discarded. The cycle is emitted on the last address, 0x255.
- interface.py: radarUnavailable is False only when all 30 addresses are
  present in the bus 1 fingerprint with length 8.

Two measured corrections to the raw speed:
- A lead braking to a stop is reported at about -0.3 to -0.6 m/s for 1-3 s
  before settling at 0, while the stock SCC11 lead stays near -0.1 (median
  -0.13 over 13 stock-ACC stops, versus -0.45 from the object frames).
  radard's KF turns the recovery into a positive aLeadK for a parked car,
  which the MPC extrapolates as the lead pulling away. Negative speeds
  above -0.7 m/s are reported as 0 for objects within 2 m of centre;
  faster reversals, adjacent-lane and oncoming traffic stay as measured.
- Absolute speed minus the wheel-speed average reads ~0.14 m/s more closing
  than the stock SCC11 lead (ACC_ObjRelSpd) whenever the car is moving, and
  matches it at standstill: the radar's own ego speed runs below the wheel
  speeds. The 0.14 m/s is subtracted from the ego speed, ramped in over the
  first 1 m/s so standstill is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 21:41:04 -07:00
Dom efe875ffd6 Retire completed GM cold-MAIN recovery before a new lateral request
Clear prior recovery wait state only after the existing healthy unlatched baseline is accepted. Preserve native acknowledgment, fault, identity and expiry gates; cover actual Card and native permission transitions.
2026-10-27 22:49:52 -05:00
Dom e53ec2605f Refresh measured custom pytest workload estimates
Preserve every node, grouping rule, shard count and timeout. Calibrate material module estimates from complete hosted outcomes with conservative scheduling margin.
2026-10-27 22:48:33 -05:00
Dom 65660a4d5c Restore selfdrived executable mode
Keep source bytes unchanged and refresh the canonical prebuilt inventory receipt.
2026-10-27 21:56:44 -05:00
Dom c64e7a8852 Bound Mach-E path assistance by the native speed sample window
Keep exact Mach-E19 independent-lateral profile within the existing six-sample native path limit. Preserve ordinary curvature limits, other modes, fault checks and firmware.
2026-10-27 21:37:48 -05:00
Dom f11f2357d8 Preserve bounded Mach-E lateral proof across held-brake source gaps
Reuse the existing original proof deadline for qualified Mach-E safety19 only. Require fresh independent authority for successors and retain fault, cancel, identity and expiry checks.
2026-10-27 21:28:40 -05:00
Dom b57687cda8 Keep ordinary Mach-E pedal withdrawal with its existing mismatch owner
Withdraw native-denied LONG immediately while retaining only an already proven LAT grant. Preserve fault checks, original proof deadlines and ordinary mismatch counter.
2026-10-27 21:24:22 -05:00
Dom 65d02d27a1 Restore qualified stock-SCC Elantra IRQ diagnostic parity
Classify only the recorded firmware-identified Elantra2021 CAN1 IRQ
bit as diagnostic. Preserve raw reports and native permission, request,
receive health, relay, heartbeat and freshness checks. Alpha-long and
all other configurations remain excluded.

Retain expanded caller/mixed-fault/configuration regression coverage.
Validated 257 focused Elantra and GM/Bolt tests; Ruff clean.
2026-10-27 20:56:10 -05:00
Dom 2dfa4b6fe1 Restore qualified Bolt IRQ diagnostic compatibility
Revert the Bolt-specific admission change from 4b754298 while retaining
native authority, receive-state, relay, heartbeat and actuator checks.
Keep raw diagnostic reports and all other profile policies unchanged.

Add actual Card coverage and restore exact diagnostic policy regressions.
2026-10-27 20:36:13 -05:00
firestarsdog d436c06f99 slc 2026-10-27 21:19:38 -04:00
Dom 05d14fc86e Complete Ford test identities and pinion setting description 2026-10-27 18:50:26 -05:00
Dom e4ad4faf9f Rebuild Panda firmware for qualified Ford CI source 5f0bda11
Refresh source-stamped debug artifacts and canonical prebuilt inventory.
2026-10-27 18:47:34 -05:00
Dom 5f0bda110a Fix Ford qualification coverage, MISRA declarations and test fixtures
Preserve geometry, steering limits, defaults and fault checks.
2026-10-27 18:30:15 -05:00
Dom a1d8204b25 CI: align FLM nested wire typing and paired drain fixtures 2026-10-27 18:06:31 -05:00
Dom 3e0a3e3d7a Ford: ship source-stamped pinion measurement firmware
Rebuild all distributed Panda variants and bootstubs from 4cbffe53 with verified Arm GNU12.3.Rel1; preserve development signing convention. Native debug and release builds passed. Refresh canonical protected source/binary inventory receipt. Default-off Ford option is init-only; no vehicle or road execution claimed.
2026-10-27 17:29:42 -05:00
Dom 4cbffe53b3 Ford: add opt-in pinion curvature measurement
Adapt BluePilot PR #145 by jrneulight (fe5b019568c8c13fb894dc6d8d779d60985051a8) to the existing exact native profile protocol. Default off; qualified parked setting applies at next startup. Preserve existing larger Mach-E envelope, all yaw/heartbeat/relay health, command limits and shadow freshness checks.

Cloud qualification: 171 host tests and 170 subtests; 80 new native/geometry tests; 153 existing native tests and 9131 subtests; release native tests, pandad protocol inventory and full ARM debug/release builds passed. Rebuilt source-stamped firmware follows before branch publication.
2026-10-27 17:14:17 -05:00
Dom 4b94f415ad FLM: construct evidence fields without recursive dict conversion
Build nested typed evidence rows directly while retaining every original field and validation. Complete serialized bytes match the prior writer on recorded d8 evidence and regression fixtures.

Fresh-head combined qualification: 459 tests passed. Cloud performance measurements do not claim device loop-rate recovery or a successful learning trial.
2026-10-27 17:01:45 -05:00
Dom 487dfc4bf4 FLM: preserve fresh evidence across paired queue drains
Merge bounded control/output FIFO heads using original publisher headers. Preserve original age, native, source, overflow and malformed-input checks; retain producer order after joins.

Validated with actual pinned cloud dependencies and fresh-head regression tests.
2026-10-27 17:01:24 -05:00
Dom baddf7a59d Align GM fast-path test oracle with restored Bolt fault veto 2026-10-27 16:42:56 -05:00
Dom a2160580a4 Signal test worker readiness after installing termination handler 2026-10-27 16:08:27 -05:00
Dom 4b754298e7 Reject Bolt CAN interrupt faults in AOL admission 2026-10-27 16:05:51 -05:00
Dom cc5b8b672c Hyundai: keep qualified Elantra AOL steering icons visible
Restore the existing Dom lateral-active dashboard icon behavior only for
qualified Elantra 2021 classic-long AOL profiles. Preserve stock-profile
handling, disengagement blinking, warning fields and all actuator/SCC/FCA
packets. Add native-permission and packet-equivalence regression coverage.

Refresh the canonical protected-source receipt.
2026-10-27 15:36:54 -05:00
Dom 9e5bc45ff7 Fix Ford angle shadow publication and bounded restart 2026-10-27 15:35:46 -05:00
Dom 44dfd7493f Handle absent AOL latch in Subaru test diagnostics 2026-10-27 15:27:42 -05:00
Dom 0422970f2d Compress Ford radar fixture without changing decoded samples 2026-10-27 15:05:25 -05:00
prabhaavp 3b67457f9a Revise privacy policy for Galaxy: StarPilot apps
Updated privacy policy to clarify data handling for Galaxy: StarPilot Companion and Galaxy: StarPilot Auto.
2026-10-27 15:52:21 -04:00
Dom 16d118c4a3 Keep automatic mirrored GM pedal discovery on normal CAN wiring
Scope live VIN and firmware queries to bus0 only when the passive pedal
layout and configured/effective GM query topology agree. Preserve normal
CAN fingerprinting, control configuration, and all Panda fault vetoes.

Regression covers recorded Bolt startup layout, real ISO-TP discovery,
negative topology cases, and unchanged pedal safety configuration.
2026-10-27 14:41:11 -05:00
firestar5683 b5807a459d Restore Mach-E stopped-lead braking on rolling approaches 2026-10-27 13:45:34 -05:00
firestar5683 43c5c1538a Rebind Unchanged Map Graphics Capability Guards 2026-10-27 13:41:13 -05:00
firestar5683 6294915b59 Compress Ford Stop Fixture Without Changing Samples 2026-10-27 13:33:58 -05:00
firestar5683 1454919bfe Preserve Subaru AOL intent across native-first hard stops 2026-10-27 13:23:12 -05:00
firestar5683 c1df455977 Retain established Ford model stops through stationary noise 2026-10-27 13:10:51 -05:00
firestar5683 ac9cb41002 Use Strictly Expired Ford Proof in Deadline Refusal Test 2026-10-27 12:57:32 -05:00
firestar5683 c9734821f9 Resynchronize Ford angle only after steering rejections 2026-10-27 12:51:32 -05:00
firestar5683 e1e02b3949 Preserve Ford lateral intent when cancelling cruise 2026-10-27 12:41:47 -05:00
firestar5683 6a029b3faa Avoid Device Artifacts in Documentation CI Checkout 2026-10-27 12:32:56 -05:00
firestar5683 a30733cf64 Retain Ford AOL through native-first brake withdrawal 2026-10-27 12:29:51 -05:00
firestar5683 ff161633bf Complete Galaxy Description and Recovery Coverage 2026-10-27 12:13:27 -05:00
Zeph Leggett cf4301b16e Jetlink: take over on native02e with the small model's warp 2026-10-27 12:10:26 -05:00
firestar5683 4cc02a4a8f Validate Extracted GPU Loader Fixture Callable 2026-10-27 11:12:20 -05:00
firestar5683 8f86a97616 Expose driver monitoring reset in Galaxy 2026-10-27 11:00:04 -05:00
firestar5683 6bad7eb908 Qualify Held Override Source Handoff Through Original Expiry 2026-10-27 10:56:43 -05:00
firestar5683 6effaaa356 Accelerate Chestnut model loading 2026-10-27 10:55:08 -05:00
firestar5683 81f9630470 Align FLM Test Indentation 2026-10-27 10:41:15 -05:00
firestar5683 ec56bb1f3e Align Ford Curvature Oracle with Qualified Mode Handoff 2026-10-27 10:32:42 -05:00
firestar5683 0ae41eacb6 Refresh GM lateral proof at authority selection 2026-10-27 10:13:15 -05:00
firestar5683 dd37cc81e9 Preserve HKG held-brake lateral proof until its original expiry 2026-10-27 10:08:25 -05:00
firestar5683 eec5cde2c5 Restore Dom low-speed vision stop buffer for HKG longitudinal 2026-10-27 10:07:20 -05:00
firestar5683 a6654bf867 Harden Galaxy drive analysis recovery 2026-10-27 10:05:44 -05:00
firestar5683 42c0d6f24a Qualify Toyota Replay Profile and Braking Expectations 2026-10-27 10:02:02 -05:00
firestar5683 860d2559c5 Require native effect in the selected FLM trial direction
Symmetric native probes could qualify a coordinate even when only the opposite direction changed its encoded command. Carry each direction’s measured visibility and physical effect into selection and interrupted-study recovery so a quantized direction cannot borrow the other direction’s evidence.

Keep existing trial bounds, slew, deadlines and independent acceptance criteria. Validate the previous selector failure, full FLM suite and recorded d5 producer/learner replay. Real-drive improvement requires post-update recorded evidence.
2026-10-27 09:53:24 -05:00
firestar5683 1184e06221 Align Ford startup test with stock idle handoff 2026-10-27 09:31:54 -05:00
firestar5683 5fc5709e4d Block Elantra Steering on Panda CAN Interrupt Faults 2026-10-27 09:28:22 -05:00
firestar5683 f63c935029 Build Toyota source deadline continuity fix 2026-10-27 09:24:33 -05:00
firestar5683 c8ae020038 Merge current changes for Toyota source cutoff fix 2026-10-27 09:23:03 -05:00
firestar5683 887401fc58 Preserve unexpired Toyota command proofs across source cutoffs 2026-10-27 09:22:55 -05:00
firestar5683 d60f2d7ada Synchronize Ford curvature mode handoff with active commands 2026-10-27 09:17:24 -05:00
firestar5683 7a2a88c40c Match Ford BluePilot acknowledgements to emitted packets 2026-10-27 08:55:40 -05:00
Dom 3f251eb5ee Account for measured Ford AOL module workload 2026-10-27 04:42:22 -05:00
firestarsdog 5f84b6c763 Unify speed typography for clearer hierarchy 2026-10-27 04:54:30 -04:00
Dom 5b486edff4 Declare exact pandad build outputs for CI provenance 2026-10-27 03:22:05 -05:00
Dom 7dc37f190f Repair Galaxy lint and qualification fixtures after app split 2026-10-27 02:01:37 -05:00
prabhaavp 2571b8d5c4 Merge pull request #257 from dirwin31:AppSplit
Galaxy: Beta group install, app key import and Sentry app alerts
2026-10-27 02:48:02 -04:00
Prabhaav Pillai d0badbe715 Update app IDs and notification handling for Galaxy app 2026-10-27 02:46:51 -04:00
Danny 0c5f83e690 Galaxy: Remove the APK QR code and hide phone internet sharing
The QR code only linked to the removed APK download, so /api/companion/qr.svg is gone and /api/galaxy/qr.svg answers only when Galaxy is paired. Hide the Enable phone internet button, its restart checkbox and the sharing blurb on the Galaxy page.
2026-10-27 02:46:51 -04:00
Danny 7d81b58d52 Companion: Stop shipping the Direct APK
Android users join the Play beta group from Galaxy, so remove the bundled installer, its version file and the workflow that verified them. The comma now reports no shipped app version, so it no longer offers an offline update.
2026-10-27 02:46:51 -04:00
Danny 8f6d643936 Galaxy: Send Android users to the beta group instead of the APK download 2026-10-27 02:46:51 -04:00
Danny d08cd1b08b Galaxy: Add remote keys and app Sentry notifications
Serve the Galaxy app key and its QR code from /api/galaxy/session to direct local connections so the Android app can import the tunnel key on its own. Let the app and the iOS app register for Sentry push alerts.
2026-10-27 02:46:50 -04:00
Prabhaav Pillai 50e60ef156 Add car control sections and update projections in settings for AA support 2026-10-27 02:36:31 -04:00
Dom cb16d27d3d Qualify SLC receipt retention and aligned SET behavior 2026-10-27 01:20:39 -05:00
Dom 6f3e156abd Refresh protected inventory receipt after SLC source update 2026-10-27 00:47:02 -05:00
firestarsdog 6221a89f4b SLC Cleanup 2026-10-27 01:39:37 -04:00
Dom c79315f8d4 Refresh measured Ford custom test workload estimates 2026-10-27 00:14:15 -05:00
Dom 12dab8c31d Calibrate lifecycle workloads and align Honda cruise fixture 2026-10-26 23:24:41 -05:00
firestar5683 03f9a9576e Restore generic Ford curvature cluster ownership 2026-10-26 23:17:19 -05:00
firestar5683 1320712ab4 Pace Ford BluePilot commands from accepted CAN returns 2026-10-26 22:34:06 -05:00
Dom 3758148f83 Mark published Panda ELF objects as binary resources 2026-10-26 22:32:20 -05:00
Dom 6ebdb1b748 Align qualification fixtures and typing with established contracts 2026-10-26 22:13:51 -05:00
firestar5683 7d218d0a4b Restore recorded Elantra diagnostic admission and Panda fault logging 2026-10-26 22:05:26 -05:00
firestar5683 bbbed56e54 Build final Toyota transmit receipt identity fix 2026-10-26 21:59:05 -05:00
firestar5683 34dc3be528 Merge latest steering learning changes for Toyota publication 2026-10-26 21:57:22 -05:00
firestar5683 080d1d3a04 Build Toyota transmit receipt identity fix 2026-10-26 21:57:04 -05:00
firestar5683 6103e0395b Preserve FLM learning windows across unchanged steering repeats
The d5 Ioniq 6 logs repeatedly reset source tracking when Card repeats a command that already arrived on time. Discard only a recent unchanged repeat after the existing native CAN verifier succeeds; add no sample, application time or permission.

Use independently admitted pending CarState brackets to complete original poses without waiting for that command to reach Card. Classify stale control source clocks as transient stale evidence, preserving the original bounded study deadline. Replace Python character loops with equivalent strict text predicates.

Validation: focused regression suite and paced d5 replay with original Card command references; actual controller/CAN trial application and worsening-trial rollback. No timing/acceptance threshold changes or claimed road improvement.
2026-10-26 21:55:26 -05:00
firestar5683 be522b4ccf Merge branch 'SecretGoodStarPilot' of https://github.com/StarPilotHQ/StarPilot into HEAD 2026-10-26 21:54:12 -05:00
firestar5683 9c0cbcd5f4 Ignore Toyota transmit receipts when checking adapter identity 2026-10-26 21:54:11 -05:00
firestarsdog ed2abcc4b9 Torque Bar Optimization + Gradient 2026-10-26 21:55:36 -04:00
firestar5683 eebd74e745 Use an independent target for single-line tracking 2026-10-26 20:13:26 -05:00
firestarsdog 8e4710a4e6 Merge remote-tracking branch 'origin/SecretGoodStarPilot' into SecretGoodStarPilot 2026-10-26 21:00:28 -04:00
firestar5683 0d01b3d818 Restore Subaru AOL steering angle and speed envelope 2026-10-26 19:46:38 -05:00
firestarsdog 1e90f2da72 Speed Limit Confirmations UI Work 2026-10-26 20:38:11 -04:00
firestarsdog 6a07f58ea6 Remove unnecessary 3-second wait from automatic SLC adoption 2026-10-26 20:38:11 -04:00
firestarsdog 632fa39562 Handle Toyota SLC targets within native cruise limits 2026-10-26 20:38:11 -04:00
firestarsdog 2e395aa714 Align shared SLC actions and simplify common flow 2026-10-26 20:38:11 -04:00
Zeph Leggett 8b4902209c Jetlink: move the warp output when the small model loads
The output used to move after the small model's warmup had linked the
warp to its address, which needed the warp to link again by dropping a
private tinygrad cached property. Had that ever stopped working, the
small model's own warp would have kept writing the freed memory.

modeld now asks the adapter's coherent_warp() (Jetlink's make_coherent
with Jetlink on, off legacy9d) and load_verified_model moves the small
model's warp output before warmup(), as Jetlink's own warp moves its
output before its first call. CatalogWarp only reads the answer
(warp_copied): sent from where it is, or copied out, chosen once.
2026-10-26 19:32:00 -05:00
Zeph Leggett 0701c25b14 Jetlink bf4dc94
make_coherent's contract is one rule: move a buffer before the first call of the JIT that writes it. CREDITS.md and JETLINK.md name the new revision.
2026-10-26 19:31:43 -05:00
firestar5683 f6b2c132fb Fix Ford CAN-FD cluster ownership and parked startup warnings 2026-10-26 19:20:54 -05:00
Zeph Leggett f36b39a68b Jetlink: send the warp from coherent memory on a comma
tinygrad maps the warp's QCOM output write-combined, which the CPU reads
uncached: CatalogWarp spent ~2.9 ms a frame copying the frame out, out
of the 46 ms a host has to answer in. It now moves the output to
IO-coherent write-back memory with Jetlink's warp.make_coherent, as
Jetlink's own warp does, and the link sends straight from it (0.22 ms
measured for Jetlink's warp). The warp has run by then, and tinygrad
bakes a held buffer's address in at link time, so its program links
again on the next call. If the kernel refuses the memory, the frame is
copied out as before, and the adapter's log says which.

TinyJit's per-call input checks are left alone: 0.045 ms a call on a
Mac under this tinygrad, not the ~1 ms they cost under Jetlink's.
2026-10-26 19:04:34 -05:00
Zeph Leggett bf09b8eea4 Jetlink e0257f4
warp.make_coherent is public, for an adapter's own warp: it moves a QCOM
output to memory the CPU reads cached, as Jetlink's warp does.
CREDITS.md and JETLINK.md name the new revision.
2026-10-26 19:04:05 -05:00
Zeph Leggett 6e430242e3 Jetlink: the link's warp goes through the runner's warp_frames
CatalogModelState.warp_frames is the warp branch of run(), which run()
and CatalogWarp now both call, so the link enqueues exactly what the JIT
was captured with and reads npy and input_queues live rather than as
they were when it was built. CatalogWarp binds the output once (the
captured JIT returns the same buffer every call), reuses one pair of
warm-up frames for the probe and frees them, and drops their blob
cache entries. model_warp lets a failure raise without logging it
too: Jetlink logs it as it keeps the small model.
2026-10-26 18:50:12 -05:00
dirwin31 6c9ae11f63 Jetlink: send the small model's warp off legacy9d
Jetlink's stock driving warp is a legacy9d pickle, which a native02e
modeld cannot load, so the link never took over there. The adapter's
model_warp (Jetlink's optional hook since 0605e34) now hands Jetlink
the small model's own camera warp (CatalogWarp) on any other runtime:
the same JIT, inputs and blob cache, read into host memory after each
frame, with a probe at load that refuses an output not read live.
Under legacy9d it returns None and Jetlink loads the stock pickle.

From #253, without its edit to jetlink_repo or the hold tolerance
override.
2026-10-26 18:43:20 -05:00
Zeph Leggett db94a2be1a Jetlink 0605e34
The adapter may now supply the warp the link sends (ModelSide.model_warp,
optional; what it returns is checked against interface.FrameWarp before
the frame loop). Without one, or when it returns None, Jetlink loads the
stock driving warp pickle as before. API stays 3.

CREDITS.md and JETLINK.md name the new revision.
2026-10-26 18:41:10 -05:00
firestar5683 c417e793c5 Add Heatdeath Controls Benchmark 2026-10-26 18:28:20 -05:00
firestar5683 718a2c3ddd Keep SpacePilot open across cold setup and interrupted clock reads
Discard a preempted clock pair and try up to three fresh pairs while
retaining the 1 ms accepted span and all existing freshness/resume gates.
Yield after receive-only decoder construction so normal UI collection
refreshes before full physical admission, Offroad request or input.

Recorded d5 clock failure; reproduced timing regressions; 250 focused
native cases, lint/type checks and independent source/evidence review.
No vehicle commands, device deployment or physical cure claim.
2026-10-26 18:17:20 -05:00
firestar5683 76b5f7e512 Avoid rebuilding the favorites catalog on each tap 2026-10-26 17:36:13 -05:00
firestar5683 5e5fa8d9c1 Preserve EV6 AOL on unassigned cruise CANCEL 2026-10-26 17:21:22 -05:00
firestar5683 36111dfdb6 Preserve Subaru AOL intent through stops 2026-10-26 16:52:11 -05:00
prabhaavp 8ead1ab0f9 Merge pull request #252 from dirwin31:AA-Wireless-Setup
Android Auto: improve wireless adapter setup and pairing
2026-10-26 17:44:33 -04:00
Prabhaav Pillai 6ba879ca3b Preserve the full discovery deadline for slow adapters, clear stale receiver selection when switching setup types, reuse the existing UI spinner, and tighten comments and regression tests. 2026-10-26 17:44:18 -04:00
firestar5683 a9af491104 Preserve HKG AOL authorization across button counter rollover 2026-10-26 16:36:50 -05:00
firestar5683 42a918acc2 Keep Encouragement and Gas Override From Stacking 2026-10-26 16:29:29 -05:00
firestar5683 c604521745 Build final Toyota and Lexus configuration port 2026-10-26 16:26:58 -05:00
firestar5683 09d7e2873e Merge current changes for Toyota publication 2026-10-26 16:25:08 -05:00
firestar5683 5189f468d2 Build Toyota and Lexus configuration parity 2026-10-26 16:25:06 -05:00
Dom 40a23df6be Align damping qualification fixtures and preserve MISRA parameter immutability 2026-10-26 16:23:24 -05:00
prabhaavp 7a38780739 Merge pull request #250 from dirwin31:SGSP-Better-Phone-GPS
Preserve usable phone GPS fixes and enforce measurement freshness
2026-10-26 17:22:14 -04:00
firestar5683 5c78ec40d7 Merge current changes for Toyota configuration parity 2026-10-26 16:19:46 -05:00
firestar5683 c6f00f7a4d Complete Toyota and Lexus configuration parity with Dom 2026-10-26 16:19:46 -05:00
firestar5683 a119dfbae0 Encourage Persistent Clear-Road Hesitation 2026-10-26 16:16:35 -05:00
prabhaavp fc6501364b Improve README.md badges and links
Updated badge links in README.md for better visibility.
2026-10-26 16:57:06 -04:00
firestar5683 1fa5818bb3 Refresh StarPilotHQ Project Homepage 2026-10-26 15:47:38 -05:00
firestar5683 ebfea6b3b7 Build SecOC Yaris stock and alpha support 2026-10-26 15:35:00 -05:00
firestar5683 e672bd30c1 Support SecOC Yaris AOL with stock and alpha longitudinal 2026-10-26 15:33:22 -05:00
Danny 4c37c009b7 Better Bugsink Reporting 2026-10-26 13:25:49 -07:00
firestar5683 ba87dd4c70 Build Subaru angle routing fix 2026-10-26 15:23:09 -05:00
Danny a581b01d84 Revert "Android Auto: restore optional car pairing row for wireless adapters"
This reverts commit 44d9c868b2.
2026-10-26 13:20:57 -07:00
firestar5683 63888e0fd8 Restore Subaru angle steering routing and collision warning checks 2026-10-26 15:20:15 -05:00
dirwin31 44d9c868b2 Android Auto: restore optional car pairing row for wireless adapters 2026-10-26 13:06:37 -07:00
firestar5683 e2a5d6ca66 Build RAV4 Prime AOL and sequential gear fix 2026-10-26 15:06:20 -05:00
firestar5683 8f3be8f6fb Enable key-ready RAV4 Prime AOL in sequential gear 2026-10-26 15:05:09 -05:00
dirwin31 b7fcbfee64 Unify Android Auto setup layouts and add themed pairing progress indicators.
Clarify connection stages across wireless, adapter, USB, and tablet options with regression coverage for progress states and responsive layouts.

(cherry picked from commit 489dad0e7733127c7a9654c9a7491d1ab8a554a4)
2026-10-26 13:00:54 -07:00
dirwin31 a420ff55ed AA: Layout Again 2026-10-26 13:00:52 -07:00
dirwin31 54b2f060e7 AA: Put Messages in Pairing Box, Hide Banner 2026-10-26 13:00:51 -07:00
dirwin31 8822e26d5b Android Auto: Wait Longer for Adapters 2026-10-26 13:00:49 -07:00
dirwin31 1d38987d61 AA: Layout Unification 2026-10-26 13:00:48 -07:00
dirwin31 f7fed1776d AA BT: Fix Pairing Window Request from Galaxy 2026-10-26 13:00:47 -07:00
dirwin31 8d2872bed4 Android Auto: Unify Pages 2026-10-26 13:00:45 -07:00
dirwin31 2141786f05 Android Auto: Unblock Pairing Circumstances 2026-10-26 13:00:43 -07:00
dirwin31 2f7d990597 BT: Show Device List Again 2026-10-26 13:00:42 -07:00
dirwin31 49660054f9 Android Auto: Add support for forgetting selected car during auto-connect retries 2026-10-26 13:00:40 -07:00
dirwin31 4c07adab7d UI: Selector Fixes, Less Duplicate for AA Wireless. 2026-10-26 13:00:39 -07:00
dirwin31 6b09da8676 Android Auto: apply workflow fixes
Split Android Auto changes from 08fb4c3001fe95dbbe784af54e09ecc33043a8bd.
2026-10-26 13:00:38 -07:00
dirwin31 8d9115f9e7 Android Auto: Allow choosing wired AA with Jetlink on 2026-10-26 13:00:36 -07:00
dirwin31 2c80f161a2 Android Auto: Retry Bluetooth connects that report unimplemented 2026-10-26 13:00:34 -07:00
dirwin31 2635773393 Android Auto: Send failed session traces to Bugsink 2026-10-26 13:00:33 -07:00
dirwin31 7fea4f939d Android Auto: AAWireless v1 adapter option
Co-authored-by: Peter Nguyen <trung791997@gmail.com>
2026-10-26 13:00:31 -07:00
dirwin31 55a41e9026 AA UI: Fix Blocked Wired 2026-10-26 13:00:30 -07:00
dirwin31 06fefc6768 Android Auto UI: Integrate wired and app settings directly into step 2 2026-10-26 13:00:28 -07:00
dirwin31 dbc8e0ea39 Add car type and profile configuration options for Android Auto setup 2026-10-26 13:00:26 -07:00
firestar5683 0037bdd836 Allow Fast Return to StarPilot 6.x 2026-10-26 14:40:01 -05:00
firestar5683 02ae25b975 Make SpacePilot entry reliable at natural tapping speeds
Count distinct touch releases by their original timestamps, retain taps
during valid Park dwell, and let preparation earn its own admission.
Cancel only the pending C4 startup camera redirect for a freshly parked
open game. All session, physical, alert, control, noOutput, ignition and
input authority checks remain unchanged.

231 focused native cases, original before regressions, current successor
entry/decoder qualification, canonical lint/type checks and independent
review. Host functional evidence; no device changes or headroom claim.
2026-10-26 14:35:25 -05:00
firestar5683 b976cd2e7c Stop Paid Permanent Address Lookups 2026-10-26 14:23:42 -05:00
firestar5683 6c58d58a7a Bind CAN-FD mirror damping to the selected calibration 2026-10-26 14:15:34 -05:00
firestar5683 8098eb454c Limit Steering Counter Repair to Bolt Pedal Profiles 2026-10-26 14:00:50 -05:00
firestar5683 6e88336f3a Trim Repeated AOL Guard Commentary 2026-10-26 13:39:40 -05:00
firestar5683 76c2aba14e Keep Lane Width Calculation Out of NumPy Cold Imports 2026-10-26 13:36:59 -05:00
firestar5683 261e2ca45d Preserve completed FLM windows during inline probe input gaps 2026-10-26 13:31:42 -05:00
firestar5683 d96f6af078 Track GM Steering Acknowledgement Counters 2026-10-26 13:21:55 -05:00
firestar5683 e1818affa2 Preserve Ford AOL through gas-held engagement and steering release 2026-10-26 12:46:43 -05:00
firestar5683 a71a67fd1f Allow Onroad Wi-Fi Settings 2026-10-26 12:37:26 -05:00
firestar5683 4d0246997b Restore lane centering with fresh polled state 2026-10-26 12:36:20 -05:00
firestar5683 d41159e65b Preserve Dom CAN-FD torque damping across longitudinal modes 2026-10-26 12:32:32 -05:00
dirwin31 306afa06a8 AOL: Skip the temporary steering warning while the driver steers 2026-10-26 17:32:23 +00:00
firestar5683 ec25e2330a Consume pending native evidence before FLM collection 2026-10-26 11:41:40 -05:00
Dom 2551c9ce5f lint: make Rebecca shield zip default explicit 2026-10-26 11:26:52 -05:00
firestarsdog cabc7da5b9 Add Rebecca power-ups, Bizarro mode, and scaling difficulty (contributed by Mary) 2026-10-26 12:05:20 -04:00
Dom df021f4e14 test: initialize lane inactivity reason in shared longitudinal fixture 2026-10-26 10:52:03 -05:00
dirwin31 be8cf95de8 AOL: Skip the temporary steering warning while the driver steers
A hard override on the Civic puts the EPS in NO_TORQUE_ALERT_1, which
reads as a temporary steering fault. The armed-AOL warning added
steerTempUnavailableSilent for it every time, even though the driver was
holding the wheel. CarSpecificEvents already stays quiet in that case.
Route 00000060: all 23 status-2 windows cleared before the driver let go.
The warning still shows if the fault is present while the wheel is free.

(cherry picked from commit f9167e2a24007c0822b4eae8870a24100a709325)
2026-10-26 08:25:28 -07:00
firestar5683 7f5d30c30d Reset lane centering for lane changes and identify input refusals 2026-10-26 10:13:21 -05:00
dirwin31 41543cd593 Preserve usable phone GPS fixes and enforce measurement freshness 2026-10-26 08:02:48 -07:00
firestar5683 0f00621c98 Coalesce refreshed FLM receipts with scheduled tracking 2026-10-26 09:34:09 -05:00
firestar5683 099cbd2809 Keep SpacePilot awake and release game mode on verified key-off
Renew the existing activity timer only during active offroad game ticks.
Observe only the exact game-owned Offroad request and restore Auto after
continuous fresh all-Panda ignition-off, closed game, stopped driving
services and healthy noOutput through the existing owner transaction.
Ordinary exit, stale data, reconnect and external mode changes never
restore Auto. UI restart does not adopt a previous game request.

142 source-bound focused cases, original timeout regression, lint/type
checks and independent source/evidence review. Synthetic host lifecycle
qualification only; no device changes or new physical/headroom claim.
2026-10-26 09:17:19 -05:00
firestar5683 0e5e5574c4 Publish refreshed FLM collection receipts on tracking 2026-10-26 09:09:55 -05:00
firestar5683 347397ad38 Add exclusive parked SpacePilot mode and native Big UI
Use the supported Offroad lifecycle with fresh Park, receive-only CAN,
stopped-process and noOutput checks. Add offroad touch/controller play
and the native Big UI five-version-tap entry. Exiting never restores
driving mode automatically within the existing manager session.

Qualified by210 unique focused passing cases, lint/type checks, native
host rendering/input/resource checks and independent lifecycle review.
Actual vehicle lifecycle, hardware inputs and device headroom remain
unqualified; no deployment is part of this change.
2026-10-26 00:01:36 -05:00
firestar5683 35f62c3c5a Bound sampled lane clearance with corroborated body geometry 2026-10-25 23:39:42 -05:00
firestar5683 3da487cd19 Mark NumPy sinc as an intentional API name 2026-10-25 23:11:00 -05:00
firestar5683 d914cf86ba Register automatic Ford discovery regressions in vehicle CI 2026-10-25 23:02:34 -05:00
firestar5683 6413fef0f9 Refine C3 Disengage Sound 2026-10-25 23:00:35 -05:00
firestar5683 87b42f9127 Use combined HKG lateral permission for steering TX and forwarding 2026-10-25 22:59:49 -05:00
firestar5683 822dbe692f Keep automatic Ford discovery on the normal CAN harness 2026-10-25 22:55:54 -05:00
firestar5683 eb2b6c2d23 Preserve Local Changes During Fast Updates 2026-10-25 22:18:41 -05:00
firestar5683 0009df9084 Require fresh Ioniq 6 parser receipts after ECU handoff 2026-10-25 22:06:07 -05:00
firestar5683 f3bbd38e81 Wake Auto Learn on fresh motion and native evidence 2026-10-25 21:05:53 -05:00
firestar5683 a3811ef5dd Keep Auto Learn collection alive during slow metadata delivery 2026-10-25 20:50:06 -05:00
firestar5683 8807d791f1 Require qualified body bounds before added lane correction 2026-10-25 20:04:27 -05:00
Dom a168542200 Fix shared lane test feed cadence without hidden historical batches 2026-10-25 19:49:28 -05:00
firestar5683 aa17fb6f0e Add native parked SpacePilot Easter egg on comma four 2026-10-25 19:43:58 -05:00
firestar5683 d59a37d37f Track single lane lines with smooth transitions and predicted clearance 2026-10-25 19:17:20 -05:00
Dom fff069c0e3 tests: qualify GM factory clocks and FLM physical-effect fixtures 2026-10-25 19:13:41 -05:00
firestar5683 f2b235bc7b Defer EV6 ECU takeover until the inactive control producer is ready 2026-10-25 19:07:34 -05:00
firestar5683 318c440b2b Allow measurable Auto Learn trials without increasing slew 2026-10-25 18:32:04 -05:00
firestar5683 567c190d5d Restore Galaxy settings when returning from tools 2026-10-25 18:23:30 -05:00
Dom ef6354430a ci: refresh protected inventory receipt for privacy policy update 2026-10-25 18:16:42 -05:00
prabhaavp da972263c3 Revise privacy policy for Galaxy: StarPilot Companion 2026-10-25 19:13:17 -04:00
Dom 1cd3c7f179 test: qualify Bolt ACC factory brake clock in native and AOL fixtures 2026-10-25 18:04:20 -05:00
Prabhaav Pillai 19d4b21f6b README and privacy policy for Android App 2026-10-25 19:02:39 -04:00
firestar5683 0ddf2cb8de Reduce comma 3 speaker resonance 2026-10-25 17:53:57 -05:00
firestar5683 eb7afba097 Show Jetlink model status in GPU feedback 2026-10-25 17:41:51 -05:00
firestar5683 27b552cbd8 Reset Jetlink fallback history without GPU compilation 2026-10-25 17:39:43 -05:00
firestar5683 13e1875d20 Synchronize Bolt ACC pedal brake frames with factory counters 2026-10-25 17:33:45 -05:00
Dom 5ccbcc5752 ci: recognize the NumPy sinc identifier in speaker filtering 2026-10-25 17:11:03 -05:00
firestar5683 b5c90af1cf Fix Galaxy Jetlink setup guide link 2026-10-25 16:58:36 -05:00
firestar5683 33fc8be564 Adapt StarPilot sounds for the comma 3 speaker 2026-10-25 16:57:26 -05:00
Dom 2084622bec ci: calibrate material workload estimates from both hosted runs 2026-10-25 16:54:37 -05:00
Dom d3193635a2 ci: rebalance custom pytest using current hosted workload measurements 2026-10-25 16:21:40 -05:00
Dom 3b3960a5b8 Align EV9 pedal contract test with independent lateral authority 2026-10-25 15:37:59 -05:00
firestar5683 de97a6eff3 Resume Auto Learn discovery when the road regime changes 2026-10-25 15:09:51 -05:00
firestar5683 9fc77a256b Try feasible Auto Learn directions at coordinate bounds 2026-10-25 14:59:31 -05:00
firestar5683 447373d78b Verify PE AOL steering continuity through pedal overrides 2026-10-25 14:40:56 -05:00
firestar5683 8a5fbf0be8 Preserve bounded clearance with one visible lane line 2026-10-25 14:31:40 -05:00
firestar5683 1a5ee718c9 Keep HKG AOL armed through full engagement and pedal overrides 2026-10-25 14:28:55 -05:00
Dom 5e83cb218f Condense transport intent comments within source size limit 2026-10-25 14:16:20 -05:00
firestar5683 fc5875831c Arm Ford AOL when cruise engages before the automatic MAIN pulse 2026-10-25 14:10:02 -05:00
firestar5683 24174ec6a6 Build Toyota pedal source continuity fix 2026-10-25 14:02:52 -05:00
firestar5683 ef03c7ba36 Merge current changes for Toyota pedal continuity 2026-10-25 13:58:28 -05:00
firestar5683 59c6935f3c Preserve Toyota AOL intent through held accelerator gaps 2026-10-25 13:57:49 -05:00
firestar5683 3c740d2050 Allow conflated car state snapshots in Auto Learn 2026-10-25 13:55:50 -05:00
firestar5683 3b67ac199e Refresh GM lateral evidence after control preparation 2026-10-25 13:54:50 -05:00
firestar5683 90916a5ff2 Cover recorded RAV4 configuration in brake regression 2026-10-25 13:51:35 -05:00
Dom 71632a6b48 Refresh prebuilt receipt for validated Arabesque assets 2026-10-25 13:50:12 -05:00
firestar5683 baae36fc3a Preserve Toyota AOL intent through held-brake source gaps 2026-10-25 13:47:45 -05:00
firestarsdog 0c842da32e Arabesque: Rebecca, Adrift 2026-10-25 14:33:26 -04:00
Dom d6fe10f60b Fix file manager type contracts and refresh documentation receipt 2026-10-25 13:01:13 -05:00
firestarsdog faa61d48fc Arabesque Files 2026-10-25 13:50:43 -04:00
firestar5683 d33f5b550c Preserve AOL intent during temporary EPS event joins 2026-10-25 12:25:17 -05:00
Dom e404020aca Assert UI test bounds before indexing optional values 2026-10-25 12:22:06 -05:00
firestar5683 0421b31bb1 Remove duplicate Ioniq 6 blind-spot sound alias 2026-10-25 12:14:32 -05:00
firestarsdog 32360730ba Build Panda firmware with tici stall recovery 2026-10-25 05:08:08 -04:00
firestarsdog 4a84cf290d Unify speed-limit signs across UIs for consistent sizing and clarity 2026-10-25 05:05:36 -04:00
firestarsdog 2248773fcc Restore tici fan retries after stalls 2026-10-25 04:58:10 -04:00
Dom 286641c1fe Declare logger metadata test build output 2026-10-25 02:06:43 -05:00
Dom 4b30638588 Isolate FLM native binding fixtures from preloaded extensions 2026-10-25 01:24:48 -05:00
firestar5683 4cd78e7366 Log bounded GM lateral withdrawals after command publication 2026-10-25 01:06:32 -05:00
firestar5683 d17623d930 Preserve Ford AOL intent across EPS gas-release receipt joins 2026-10-25 00:43:59 -05:00
firestar5683 9ca75ddefd Report interrupted pending trials to the learner 2026-10-25 00:42:22 -05:00
Dom cafb6df8c2 Balance custom pytest pedal caller workload 2026-10-25 00:29:21 -05:00
firestar5683 b6e7e63d87 Detect unresponsive steering on stock ASCM Volts 2026-10-24 23:48:28 -05:00
firestar5683 82abd03443 Retain pending learning study across consumed-source timing gaps 2026-10-24 23:36:17 -05:00
firestar5683 5674f11442 Avoid loading model runtime in Controls 2026-10-24 23:26:26 -05:00
firestar5683 49ab8cf392 Record model identity in qlog opening metadata 2026-10-24 23:20:11 -05:00
firestar5683 202a52c353 Match BluePilot angle delay and missing-model input behavior 2026-10-24 22:09:51 -05:00
firestar5683 766f4ceabb Use an explicit failure for unapproved capture in source tests 2026-10-24 22:07:06 -05:00
firestarsdog baab9caf43 Fix false GPU fallback icons 2026-10-24 23:02:19 -04:00
firestar5683 4c250a6a06 Restore Auto Learn source admission after GPU startup fix 2026-10-24 21:55:54 -05:00
firestar5683 809681dc24 Reduce repeated EV9 configuration copies 2026-10-24 21:54:37 -05:00
firestar5683 c12afe13e7 Capture native audio callback timing 2026-10-24 21:46:43 -05:00
firestar5683 d6b8ade37f Defer torque EV ECU disable until inactive controls are ready 2026-10-24 21:34:54 -05:00
Dom 0427ba9fbf Isolate Bolt saved-owner test Params lock 2026-10-24 21:30:33 -05:00
firestar5683 3d8f901f1c Exit failed GPU startup before isolated Small recovery 2026-10-24 21:25:48 -05:00
firestar5683 58bb172bda Reduce repeated startup configuration serialization 2026-10-24 21:02:51 -05:00
firestar5683 e3872c4760 Retain Auto Learn source rejection evidence in route logs 2026-10-24 20:27:33 -05:00
firestar5683 b83bddccf3 Keep sign parity tests independent of a graphics context 2026-10-24 20:25:47 -05:00
firestar5683 d5dcbd1891 Restore original small UI sign proportions 2026-10-24 20:08:38 -05:00
firestar5683 192b64e407 Match compact sign tests to the shorter outline 2026-10-24 18:47:48 -05:00
firestar5683 b1b48eaaf3 Keep UI modules within the source size limit 2026-10-24 18:21:24 -05:00
prabhaavp 3530f447c1 Merge pull request #246 from natehuby76/fix/c4-menu-start
reset c4 menu on reopen
2026-10-24 19:08:19 -04:00
whoisdomi e97e07e1b3 Model runtime fix
Select the model runtime before validating device artifacts
2026-10-24 18:02:09 -05:00
firestar5683 2251e13068 Compact small UI speed limit signs 2026-10-24 17:51:54 -05:00
Nathan 69b0d7c600 reset c4 menu on reopen 2026-10-24 17:42:05 -05:00
firestar5683 1c332c67f8 Reduce digest size-selection overhead 2026-10-24 17:11:24 -05:00
firestar5683 eb97258ed1 Optimize scalar PID clipping 2026-10-24 16:23:06 -05:00
firestar5683 4fe5cca267 Preserve model source renderer API and static contracts 2026-10-24 15:54:45 -05:00
firestarsdog d656e9f422 Large UI Model Loading 2026-10-24 16:49:56 -04:00
Dom 44ad6f5342 Balance lifecycle shards using measured pedal caller cost 2026-10-24 15:43:48 -05:00
firestar5683 a6779a8aa0 Reduce feedback observation copying 2026-10-24 15:41:39 -05:00
firestar5683 d43477ec41 Refresh release receipt after Vienna sign polish 2026-10-24 15:12:30 -05:00
firestarsdog 0f981ad88f Vienna Sign Polish 2026-10-24 16:09:36 -04:00
Dom dbd28f84c4 Narrow Node executable before projection contract subprocess 2026-10-24 14:52:09 -05:00
firestar5683 f95f5a88cf Apply shared host warning policy to inactive AOL source pauses 2026-10-24 14:50:30 -05:00
firestar5683 5bef40f51c Cover shared AOL source pauses across all makes and Volt owners 2026-10-24 14:42:42 -05:00
firestarsdog 6b9b8a4dfb Unify SLC signs for clarity and fix Android Auto layout saving 2026-10-24 15:38:38 -04:00
firestar5683 823f6923c8 Retain AOL intent through fully withdrawn source pauses 2026-10-24 14:28:39 -05:00
firestar5683 9e6dabb149 Schedule slow Toyota caller modules from measured CI timings 2026-10-24 13:26:26 -05:00
firestar5683 9712480382 Retain Ford AOL intent through temporary EPS recovery with gas held 2026-10-24 12:42:09 -05:00
firestar5683 e5265f88b9 Preserve the local test runner discovery interface 2026-10-24 12:28:58 -05:00
firestar5683 4a9881ff5b Prevent synchronized crash-session uploads during driving 2026-10-24 12:25:09 -05:00
firestar5683 b00ca4c52e Retain armed reverse intent through an inactive source gap 2026-10-24 12:24:46 -05:00
firestar5683 25cbb14cbd Balance vehicle caller CI workloads from hosted timings 2026-10-24 11:38:52 -05:00
firestar5683 1ebbff5cd9 Isolate Android Auto rendering from driving cores 2026-10-24 11:29:24 -05:00
firestar5683 163751cb7e Keep wheel actions bound across equivalent CarParams layouts 2026-10-24 11:01:12 -05:00
Dom 91b378cc5b test: keep capture recovery publication on the synthetic clock 2026-10-24 10:58:33 -05:00
firestar5683 3f693e1735 Keep Ford angle AOL within native steering limits through turns and pedals 2026-10-24 10:40:09 -05:00
firestar5683 d646a5dea8 Format source study regression tests 2026-10-24 10:29:09 -05:00
firestar5683 0b54917f90 Keep bounded source trials progressing across road variation 2026-10-24 10:17:07 -05:00
firestar5683 e15bd6bf3d Keep Android Auto below controls priority 2026-10-24 10:11:30 -05:00
firestar5683 baf9a3fff6 Prevent Android Auto renderer CPU starvation 2026-10-24 10:08:26 -05:00
firestar5683 3b081b2fc2 Format source recovery regression tests 2026-10-24 09:55:07 -05:00
firestar5683 24126eafdc Keep source learning progressing after interrupted trials 2026-10-24 09:45:44 -05:00
firestar5683 44efc8d935 Allow Android Auto renderer cold startup to finish 2026-10-24 09:45:31 -05:00
firestar5683 5dddf9ae1d Stabilize native registry and asynchronous source fixtures 2026-10-24 00:10:31 -05:00
firestar5683 b863214df8 Preserve original RELEASE skip accounting across shards 2026-10-23 23:41:28 -05:00
firestar5683 6efe2e5379 Keep CI fixtures current and partition complete RELEASE contracts 2026-10-23 23:24:10 -05:00
firestar5683 04c590f7c4 Exercise composite MAIN freshness through native steering transmission 2026-10-23 22:52:46 -05:00
firestar5683 39d30d89c1 Correct pose interval fixture typing 2026-10-23 22:48:49 -05:00
firestar5683 567bde2b4e Balance independent Toyota caller tests across custom jobs 2026-10-23 22:44:02 -05:00
firestar5683 4f4cb4e7d9 Align source fixtures and cover composite MAIN freshness 2026-10-23 22:43:56 -05:00
firestar5683 15dc2cb26c Distribute the growing lifecycle catalog across more jobs 2026-10-23 22:35:57 -05:00
firestar5683 317f08d15a Separate eager startup fixtures from deferred takeover 2026-10-23 22:32:50 -05:00
firestar5683 c0ae7127ef Keep vehicle refusal fixtures aligned with qualified configurations 2026-10-23 22:31:54 -05:00
firestar5683 b50b5cc1a3 Allow slow source tracking experiments from measured native sensitivity 2026-10-23 22:29:52 -05:00
firestar5683 e9d39b4f5e Repair learner receipt test fixtures 2026-10-23 22:27:02 -05:00
firestar5683 d5700b6910 Account for combined clock resolution in motion admission 2026-10-23 21:54:31 -05:00
firestar5683 b0c054d881 Reacquire SDGM Volt steering after inactive brake feedback 2026-10-23 21:39:15 -05:00
firestar5683 d4dbb83a55 Build matching Toyota pedal and hold firmware 2026-10-23 21:29:59 -05:00
firestar5683 b6b820a275 Support shared Toyota pedal and brake hold paths 2026-10-23 21:26:01 -05:00
firestar5683 d8a218b807 Restore GM AOL arming from persistent cruise main 2026-10-23 21:02:48 -05:00
firestar5683 0a2ee300e7 Build matching BluePilot angle and Ford AOL firmware 2026-10-23 20:58:48 -05:00
firestar5683 1996510d7a Enable BluePilot angle steering with retained Ford AOL 2026-10-23 20:52:06 -05:00
firestar5683 a8e10e4e52 Restore compatible model runtime 2026-10-23 20:48:09 -05:00
Dom a5f43c1d4b Use typed boolean values in Ford preference cleanup regression 2026-10-23 20:41:03 -05:00
firestar5683 a25dcb535a Align model publication regression with repository lint rules 2026-10-23 20:38:01 -05:00
firestar5683 0172b49987 Restore Dom model publication guard after dropped camera frames 2026-10-23 20:34:08 -05:00
firestar5683 c5ae97f216 Dispatch shared AOL validation only to the current vehicle owner 2026-10-23 20:13:42 -05:00
firestar5683 d2f3acc248 Keep calibrated configuration across learner receipt gaps 2026-10-23 20:10:59 -05:00
firestar5683 976d2a2222 Reject unrelated deadline and F1 owners before qualification 2026-10-23 20:06:11 -05:00
firestar5683 a67202cfb4 Build matching Toyota DSU bypass firmware 2026-10-23 20:01:28 -05:00
firestar5683 4194390dc1 Support Toyota DSU bypass on camera bus 2026-10-23 19:59:49 -05:00
firestar5683 276f3561ce Preserve Ford hands-free display preference across ignition 2026-10-23 19:58:59 -05:00
Dom 7afcf3a8ac Align Prius CI fixtures with qualified hardware profiles 2026-10-23 19:53:04 -05:00
firestar5683 7403185bd8 Keep Ford steering selection visible with AOL enabled 2026-10-23 19:46:20 -05:00
firestar5683 df22d36413 Balance lifecycle CI jobs using measured runtimes 2026-10-23 19:14:21 -05:00
firestar5683 656ba431e9 Update model runtime test contracts 2026-10-23 19:07:47 -05:00
firestar5683 50fc142dd7 Handle unavailable Python Bluetooth socket connections 2026-10-23 19:04:37 -05:00
firestar5683 2a7ebf190c Build matching RAV4 Hybrid pedal and CAN filter firmware 2026-10-23 19:04:07 -05:00
firestar5683 c276b589c7 Support RAV4 Hybrid pedal and CAN filter together 2026-10-23 19:02:36 -05:00
Dom 04b8eb0cd3 Correct manual Matrix four-byte test fixtures 2026-10-23 18:29:58 -05:00
firestar5683 806783c148 Keep receipt callback checks after the output drain 2026-10-23 18:22:41 -05:00
firestar5683 c7e6c27eda Use explicit manual Matrix test fixtures 2026-10-23 18:19:33 -05:00
firestar5683 1a7c20ab6c Compile native RDF Chestnut model 2026-10-23 18:13:43 -05:00
firestar5683 d2d2399609 Build matching Toyota radar and LTA pedal firmware 2026-10-23 18:13:27 -05:00
firestar5683 0cc30a9b30 Support Toyota radar and LTA pedals 2026-10-23 18:11:57 -05:00
firestar5683 1e7d9c311f Preserve FLM capture with native model startup 2026-10-23 18:10:40 -05:00
firestar5683 0eec2e2a55 Bound native model loading memory 2026-10-23 18:09:38 -05:00
firestar5683 748e7b13fc Fix model runtime test fixtures 2026-10-23 18:08:05 -05:00
firestar5683 1f17185669 Keep F1 Volt pedal retention bound to physical receipts 2026-10-23 18:07:54 -05:00
firestar5683 6fae1942e4 Load optional learning capture before the controls loop 2026-10-23 18:06:10 -05:00
firestar5683 094332da2c Build matching EPS73 Prius CAN filter firmware 2026-10-23 17:51:41 -05:00
firestar5683 16eaf005fe Support EPS73 Prius four-byte CAN filters 2026-10-23 17:48:29 -05:00
firestar5683 12601d1fac Pin model runtime source imports before ambient hooks 2026-10-23 17:38:06 -05:00
firestar5683 0022fde1cb Fix Auto Learn collection recovery after evidence gaps 2026-10-23 17:36:10 -05:00
firestar5683 332540a931 Preserve GM cold-start wait provenance 2026-10-23 17:24:35 -05:00
firestar5683 d28aa489ca Compile older Chestnut models 2026-10-23 17:13:33 -05:00
firestar5683 a5eda8a63a Fix Auto Learn authorization and tracking delivery timing 2026-10-23 17:13:21 -05:00
firestar5683 6e5879e035 Preserve stock angle lateral recovery within original source deadline 2026-10-23 17:12:44 -05:00
firestar5683 d377f5efd7 Keep GM lateral intent armed through startup and pedal withdrawal 2026-10-23 17:01:06 -05:00
firestar5683 db297a341b Reuse exact Hyundai deadline admission during control cycles 2026-10-23 16:55:56 -05:00
firestar5683 091682eb06 Fix native model static checks 2026-10-23 16:39:50 -05:00
firestar5683 c779fc4672 Keep Hyundai factory cruise alive until controls are ready 2026-10-23 16:30:25 -05:00
firestar5683 26bc78b69d Compile native Chestnut models 2026-10-23 16:17:25 -05:00
Dom 3a1d0bc615 Restore selfdrived executable mode 2026-10-23 16:13:30 -05:00
firestar5683 7897829d9b Preserve observed worker exit evidence 2026-10-23 16:09:42 -05:00
firestar5683 1353dc4943 Support manual Matrix CAN filter configurations 2026-10-23 16:09:21 -05:00
firestar5683 f50aaa1d6d Handle Hyundai longitudinal withdrawal before brake receipt 2026-10-23 16:03:05 -05:00
firestar5683 076cda2d6c Support stock Prius retrofit AOL 2026-10-23 15:54:01 -05:00
firestar5683 37dc1533ef Reuse exact native qualification across all vehicle makes 2026-10-23 15:42:44 -05:00
firestar5683 f9bf710396 Fix audio integration static checks 2026-10-23 15:33:38 -05:00
firestar5683 04030a447e Use a typed failure callback in HKG admission regression 2026-10-23 15:31:32 -05:00
firestar5683 eb955e391c Reduce repeated HKG source deadline qualification 2026-10-23 15:29:10 -05:00
firestar5683 95d87910f9 Reuse exact native configuration admission for EV6 and EV9 2026-10-23 15:25:08 -05:00
prabhaavp 4b54f61deb Merge pull request #245 from dirwin31:Stardust-Spotify-Companion
Improve Spotify Connect recovery and Bluetooth phone audio
2026-10-23 16:16:54 -04:00
Prabhaav Pillai c14afb153e Merge branch 'SecretGoodStarPilot' into pr/dirwin31/245 2026-10-23 16:16:34 -04:00
Prabhaav Pillai 5755042c96 - First-time pairing interrupted by the new login timeout.
- IPv6-only startup blocked indefinitely.
- Saved initial volume overridden with 100%.
- Unbounded diagnostic logging in the audio loop.
- Hidden speaker-disconnection status while paused.
- Duplicate slider handlers, redundant CSS, verbose documentation, and test lint issues.
2026-10-23 16:15:21 -04:00
firestar5683 e1c73f2359 Keep superseded CI runs cancelled 2026-10-23 14:56:13 -05:00
firestar5683 0c03e1b1b8 Reduce Hyundai longitudinal configuration copy overhead 2026-10-23 14:52:29 -05:00
firestar5683 63fffaa27b Build matching Toyota Matrix stock-control firmware 2026-10-23 14:48:41 -05:00
firestar5683 eac8cea6ee Support Toyota Matrix stock-control AOL 2026-10-23 14:40:44 -05:00
firestar5683 4b5a99e66d Restore independent AOL arming on non-SCC Hyundai vehicles 2026-10-23 14:37:40 -05:00
firestar5683 0a7529919f Balance current AOL lifecycle workloads 2026-10-23 14:14:05 -05:00
Dom 77f54a22f0 CI: balance lifecycle shards using measured native caller cost 2026-10-23 14:09:22 -05:00
firestar5683 1887a45a68 Refresh Galaxy build receipt 2026-10-23 13:34:13 -05:00
Prabhaav Pillai d45c1f2b1b Group Galaxy audio settings under Android Auto and standardize banners 2026-10-23 14:25:42 -04:00
firestar5683 2f68bdedca Build matching Ford hands-free display firmware 2026-10-23 13:12:45 -05:00
firestar5683 dcb7d5de82 Keep Ford hands-free display active through driver turns 2026-10-23 13:10:24 -05:00
firestar5683 657a9462ce Preserve SDGM Volt MAIN intent through startup and braking 2026-10-23 12:59:58 -05:00
firestar5683 8da7e4f493 Link local Galaxy access from app installation 2026-10-23 12:41:57 -05:00
firestar5683 db24c48edc Report bounded learner source observation refusals 2026-10-23 12:41:37 -05:00
firestar5683 01a31c1f2f Build matching original Prius four-byte filter artifacts 2026-10-23 12:25:50 -05:00
firestar5683 9d2d8f3a31 Support original Prius four-byte CAN filters 2026-10-23 12:17:52 -05:00
firestar5683 7df9af125d Keep confirmed vision signs current during cooldown 2026-10-23 12:08:22 -05:00
firestar5683 dc9a5743ee Avoid repeated work for retained learning poses 2026-10-23 12:00:57 -05:00
Dom 165651b096 Register complete HKG module in lifecycle CI 2026-10-23 11:55:24 -05:00
firestar5683 a75d3fd787 Include camera conversion in vision CPU budget 2026-10-23 11:45:33 -05:00
firestar5683 b00a235274 Fix alert preview test startup 2026-10-23 11:43:54 -05:00
firestar5683 b0c6319a1a Restore GV70 two-Panda AOL ownership and stopping parity 2026-10-23 11:37:31 -05:00
firestar5683 2993c8fb07 Restore vision candidate follow-up cadence 2026-10-23 11:20:42 -05:00
firestar5683 c7e47a0289 Reorder lateral settings 2026-10-23 11:18:11 -05:00
firestar5683 733253c7c5 Preserve ASCM Volt intent across complete Card source gaps 2026-10-23 10:18:57 -05:00
dirwin31 f487123e4c Merge SecretGoodStarPilot into Stardust-Spotify-Companion 2026-10-23 07:47:13 -07:00
firestar5683 131739bda6 Format audio backend diagnostics and fixture assertions 2026-10-23 09:44:46 -05:00
firestar5683 90ca300382 Avoid duplicate native history queue in recovery fixtures 2026-10-23 09:34:16 -05:00
firestar5683 9d50b3734c Report active audio playback backend 2026-10-23 09:25:22 -05:00
firestar5683 7fe4b5b550 Bound learner history before tracking initialization 2026-10-23 09:14:39 -05:00
Dom 5961cbd675 Use real alert manager in lane change tests 2026-10-23 09:11:12 -05:00
firestar5683 f19c719d76 Align learner recovery and pilot refusal fixtures 2026-10-23 09:02:15 -05:00
firestar5683 6e72874e55 Strengthen numerical learner regression checks 2026-10-23 08:40:39 -05:00
firestar5683 dc2b45ef1e Reduce vision proposal decoding overhead 2026-10-23 08:34:37 -05:00
firestar5683 9b1ebf0635 Show steering pause warning only for acknowledged lateral requests 2026-10-23 08:32:01 -05:00
firestar5683 4d203961da Align learner protocol and lifecycle fixtures 2026-10-23 08:29:20 -05:00
firestar5683 7c25601821 Track actual poll deliveries in learner fixtures 2026-10-23 08:05:49 -05:00
firestar5683 09dbb29d5a Queue original CAN evidence in decoder fixtures 2026-10-23 08:00:07 -05:00
firestar5683 dc86e03e60 Build matching original Prius smartDSU artifacts 2026-10-23 07:40:24 -05:00
firestar5683 da51312a6f Support original Prius smartDSU configurations 2026-10-23 07:27:12 -05:00
firestar5683 b98d9a1e6e Balance measured Toyota caller workloads 2026-10-23 07:12:39 -05:00
Dom 18b6a4a458 Align event frame archive fixture 2026-10-23 07:07:26 -05:00
firestar5683 6d201df86a Align UI fixtures and complete Galaxy setting descriptions 2026-10-23 06:36:08 -05:00
firestar5683 43007a6318 Build documentation with the standard library 2026-10-23 06:35:32 -05:00
firestar5683 80ca622ea6 Align Toyota caller fixtures with qualified AOL and native acknowledgments 2026-10-23 06:27:12 -05:00
firestar5683 266ee4ce07 Model suppressed ADRV diagnostic replies in startup regressions 2026-10-23 06:25:05 -05:00
firestar5683 b46431793b Align drive and session fixtures with current contracts 2026-10-23 06:23:00 -05:00
firestar5683 c06d1dfe16 Verify Ford event-first SOFT retention through its current owner 2026-10-23 06:07:05 -05:00
firestar5683 2d2f662bdf Balance independent Toyota cases and audit existing map GPU guards 2026-10-23 06:06:24 -05:00
firestar5683 ed3f88ef52 Scope HKG startup fixture preparation to Hyundai interfaces 2026-10-23 06:02:47 -05:00
firestar5683 29ab44fc4d Align model compiler and steering-delay test fixtures 2026-10-23 05:56:55 -05:00
firestar5683 b42499038d Load native safety in fresh Volkswagen caller tests 2026-10-23 05:52:43 -05:00
Dom 5dea258223 Align custom pytest discovery contract with complete shard gate 2026-10-23 05:37:12 -05:00
firestar5683 7d2c0aafea Distribute custom pytest workloads without dropping cases 2026-10-23 05:10:16 -05:00
Dom 92f0c26228 Cover Toyota camera identity contradiction latch 2026-10-23 04:47:13 -05:00
firestar5683 3b22e29c20 Prepare classic HKG startup owners in family regression callers 2026-10-23 04:44:38 -05:00
firestar5683 206907f651 Preserve armed intent through split SOFT recovery 2026-10-23 04:42:58 -05:00
Dom e0bea55fa9 Align uploader and torque layout test fixtures 2026-10-23 04:39:20 -05:00
Dom 7c795af543 Compact Toyota camera test fixture without changing data 2026-10-23 04:25:15 -05:00
firestar5683 8b9338a0a6 Preserve Chrysler physical cancel in location fault tests 2026-10-23 04:09:50 -05:00
firestar5683 9a2d62445d Align Toyota SecOC tests with qualified RAV4 angle support 2026-10-23 04:04:20 -05:00
firestar5683 314c92e51f Build matching Toyota camera filter artifacts 2026-10-23 04:00:12 -05:00
firestar5683 af84074472 Support camera Toyota radar filter configurations 2026-10-23 03:55:56 -05:00
Dom 4a38356a5f Apply onroad graphics fixtures to unittest runner 2026-10-23 03:53:13 -05:00
firestar5683 ecc1db481b Balance independent lifecycle workloads within existing deadlines 2026-10-23 03:51:56 -05:00
firestar5683 6eb9df9642 Align Tesla screen settings fixture with Alpha availability 2026-10-23 03:14:37 -05:00
firestar5683 8c814777f6 Align HKG unit callers with shared intent and startup contracts 2026-10-23 03:12:42 -05:00
firestar5683 9e6a49742e Isolate synthetic state machine event rules from CAN faults 2026-10-23 03:11:33 -05:00
firestar5683 359549db26 Align generic wheel policy fixture with current capabilities 2026-10-23 03:04:50 -05:00
firestar5683 468770cabd Retain host test crash and timeout evidence 2026-10-23 03:03:56 -05:00
firestar5683 1ec8ca7abb Align HKG location regressions with shared armed intent policy 2026-10-23 02:28:18 -05:00
Dom d049218089 Align Toyota legacy filter safety tests 2026-10-23 02:08:27 -05:00
firestarsdog 7a8e17dda5 fix(galaxy): expand timeline for readable history 2026-10-23 02:55:27 -04:00
firestar5683 d48e34a3a0 Build matching Toyota legacy filter artifacts 2026-10-23 01:49:56 -05:00
firestar5683 6f4fdfb851 Support legacy Toyota four-byte CAN filter profiles 2026-10-23 01:42:12 -05:00
firestarsdog 7011142a49 feat(replay): keep seek targets visible while scrubbing 2026-10-23 02:30:11 -04:00
Dom d048a8eb98 Align EV9 stopping marker test contract 2026-10-23 01:29:12 -05:00
Dom 22b2f2a898 Preserve bootstub binary output modes 2026-10-23 01:17:30 -05:00
Dom 4e74d8890d Align interface and confirmation test contracts 2026-10-23 00:59:33 -05:00
firestar5683 7e2cf618e0 Cover HKG native catalog admission and isolate inherited test policy 2026-10-23 00:49:31 -05:00
firestar5683 1f8205231f Scope complete build identity to lifecycle gates 2026-10-23 00:26:57 -05:00
firestarsdog 4bee14a4d7 build(replay): refresh ARM64 prebuilt and receipt 2026-10-23 01:24:45 -04:00
firestarsdog 68629dcb82 Fix compact UI confirmations, text overlap, and one-way Display controls 2026-10-23 01:24:18 -04:00
firestarsdog 29da914430 feat(replay): color timelines to show drive history 2026-10-23 01:24:18 -04:00
Dom c4c5d276d5 Align vehicle CI provenance fixtures 2026-10-23 00:22:53 -05:00
firestar5683 a012e58a99 Align controller and UI fixtures with current contracts 2026-10-23 00:15:50 -05:00
firestar5683 c8d2a8aaf0 Preserve exact ASCM Volt steering receipts across receive ordering 2026-10-23 00:14:03 -05:00
firestar5683 b2296b4844 Pin lifecycle build inputs across independent shards 2026-10-23 00:04:03 -05:00
Dom 403e360551 Synchronize simulated startup readiness fixture 2026-10-22 23:54:46 -05:00
firestar5683 c1d966997d Run Ford legacy long denial with an explicit release fixture 2026-10-22 23:51:04 -05:00
firestar5683 143b9b5d4f Bound Subaru StopStart pulse with integer nanosecond deadline 2026-10-22 23:50:06 -05:00
firestar5683 6053d3e6ff Restore HKG stock angle arming and steering recovery 2026-10-22 23:47:42 -05:00
Dom 9e08f0b1bb Align GM startup tests with retained lateral intent 2026-10-22 23:45:07 -05:00
firestar5683 1e189a1192 Restore legacy Toyota PCM stop latch transitions 2026-10-22 23:42:56 -05:00
firestar5683 84fb671740 Type Ford CAN and developer panel test fixtures 2026-10-22 23:38:16 -05:00
firestar5683 86b752f9d2 Record qualified Subaru smoothing startup metadata in replay reference 2026-10-22 23:37:28 -05:00
Dom 2fe363a1f8 Align Ford CI fixture typing 2026-10-22 23:24:20 -05:00
firestar5683 989beaae3c Shard complete lifecycle qualification by module 2026-10-22 23:21:56 -05:00
firestar5683 d6273c7137 Verify Vision adoption and command identity 2026-10-22 23:18:11 -05:00
firestar5683 1a2cd5e55d Merge current family fixes with qualified Toyota CAN filters 2026-10-22 23:10:14 -05:00
firestar5683 3149512d97 Build qualified Chrysler native guards 2026-10-22 23:09:38 -05:00
firestar5683 edb618e910 Qualify Chrysler native guards without changing safety limits 2026-10-22 23:04:49 -05:00
firestar5683 482e3cd7f2 Restore Dom mode transitions for qualified Volt longitudinal control 2026-10-22 22:57:39 -05:00
firestar5683 687bc6835d Build Ford configuration parity firmware and pandad 2026-10-22 22:54:30 -05:00
firestar5683 aaa2f687ea Complete Ford release long manual and multi-Panda support 2026-10-22 22:49:49 -05:00
firestar5683 c9fbbc0331 Merge gateway MEB support and qualified Toyota replay metadata 2026-10-22 22:48:54 -05:00
firestar5683 e24c677109 Refresh qualified Toyota standstill metadata expectations 2026-10-22 22:47:53 -05:00
firestar5683 996542ffef Build gateway MEB native safety 2026-10-22 22:41:30 -05:00
firestar5683 dbc5af5d55 Merge current native artifacts with Toyota filter configurations 2026-10-22 22:41:18 -05:00
firestar5683 f99d84daa8 Restore Toyota EPS8 four-byte CAN filter configurations 2026-10-22 22:41:05 -05:00
firestar5683 b98f1bfce5 Restore gateway MEB independent lateral and saved speed control 2026-10-22 22:40:45 -05:00
firestar5683 1fdc8b89e8 Preserve HKG AOL arming and original source deadlines 2026-10-22 22:33:16 -05:00
Dom da6e0bd0a9 Align CI formatting and Mici toggle fixture 2026-10-22 22:28:48 -05:00
firestar5683 c642fd9427 Keep classic HKG discovery on observed normal wiring 2026-10-22 22:22:36 -05:00
firestar5683 0147c90469 Build GM safety checks 2026-10-22 22:13:50 -05:00
firestar5683 4e956b46ec Keep GM safety checks explicit and remove unreachable forwarding 2026-10-22 22:12:36 -05:00
firestar5683 107e99a5fc Merge Tesla safety firmware with current qualification fixes 2026-10-22 22:10:23 -05:00
firestar5683 7610f33129 Qualify Subaru RELEASE AVH guard and ordinary engagement 2026-10-22 22:09:05 -05:00
firestar5683 5acadf1d91 Build Tesla Pre-AP safety cleanup firmware 2026-10-22 22:08:34 -05:00
firestar5683 33ca04f895 Resolve Tesla Pre-AP native safety diagnostics 2026-10-22 22:07:42 -05:00
firestarsdog 0171603f6d Fix compact Driving Controls availability so the menu opens its editor 2026-10-22 23:06:18 -04:00
firestar5683 cac674d270 Run Honda native lifecycle tests under both CI runners 2026-10-22 22:05:31 -05:00
firestar5683 faa890e903 Exercise GM interceptor release guards in native coverage 2026-10-22 22:04:47 -05:00
firestar5683 c7fe28fdfd Merge current tests with Toyota smartDSU priority 2026-10-22 21:55:14 -05:00
firestar5683 cc9161776a Preserve Toyota smartDSU priority over camera traffic 2026-10-22 21:55:13 -05:00
firestar5683 8e1bb6995c Repair Bluetooth and HTTP caller qualification 2026-10-22 21:51:18 -05:00
firestar5683 1ad498846f Type Rivian native test payloads explicitly 2026-10-22 21:49:07 -05:00
firestar5683 fe5b2c66da Merge current qualification tests with Toyota smartDSU artifacts 2026-10-22 21:46:10 -05:00
firestar5683 f7ca352105 Build legacy Toyota smartDSU artifacts 2026-10-22 21:46:00 -05:00
firestar5683 8a3e80cddd Restore executable modes for daemon entrypoints 2026-10-22 21:44:22 -05:00
firestar5683 d429cc3c90 Verify Toyota angle factory and independent LTA health 2026-10-22 21:44:16 -05:00
firestar5683 6095ea559c Accept current native layout documents 2026-10-22 21:42:06 -05:00
firestar5683 cdb7e7a5d4 Reject missing Auto Learn withdrawal receipts 2026-10-22 21:39:39 -05:00
firestar5683 95155234e8 Publish explicit Auto Learn source withdrawals 2026-10-22 21:37:28 -05:00
firestar5683 de94ce4ad8 Qualify native variants and current caller fixtures 2026-10-22 21:36:56 -05:00
firestar5683 ab2baa98ea Cover Rivian unsupported profiles and permanent EPS retirement 2026-10-22 21:35:57 -05:00
prabhaavp 4e46321160 Merge pull request #238 from dirwin31:PR-Smaller-4
App and web: Companion apps, Galaxy pages, Spotify, Bluetooth and Android Auto screens
2026-10-22 22:31:29 -04:00
firestar5683 15a78b9b33 Maintain Auto Learn source delivery cadence 2026-10-22 21:29:34 -05:00
Prabhaav Pillai a57cd3d54a Merge SecretGoodStarPilot into PR-Smaller-4, preserving both Galaxy feature sets 2026-10-22 22:29:25 -04:00
firestar5683 82f3baaebb Merge qualified Nissan coverage and lateral lifecycle fixes 2026-10-22 21:29:16 -05:00
firestar5683 6dff9ba47f Test unsupported Nissan AOL safety words 2026-10-22 21:28:13 -05:00
firestar5683 9e191161d7 Merge current vehicle fixes with legacy Toyota smartDSU support 2026-10-22 21:24:55 -05:00
firestar5683 011e46b8ed Preserve armed lateral intent through temporary warnings 2026-10-22 21:22:55 -05:00
firestar5683 9ce2893646 Build qualified Outback and Subaru smoothing artifacts 2026-10-22 21:14:26 -05:00
firestar5683 4d8467ce37 Restore legacy Toyota smartDSU control paths 2026-10-22 21:14:16 -05:00
firestar5683 c6a366b013 Restore Outback angle and frozen Subaru model smoothing 2026-10-22 21:13:43 -05:00
Prabhaav Pillai d921cf6559 Refactor Galaxy tools into a searchable nested catalog
Render tool menus from the catalog and update navigation, guides, and tests
2026-10-22 22:03:31 -04:00
firestar5683 15578da372 Preserve HKG angle AOL intent through healthy stops 2026-10-22 20:59:02 -05:00
firestar5683 6148a86dc1 Preserve Tesla schema and radar fixture contracts 2026-10-22 20:49:31 -05:00
firestar5683 a0fd5ea025 Include native pytest cases in safety coverage 2026-10-22 20:47:05 -05:00
firestar5683 16509c3803 Expose Alpha Longitudinal in Vehicle Controls 2026-10-22 20:46:13 -05:00
firestar5683 0f1cce2285 Refresh stock longitudinal planner expectations 2026-10-22 20:45:40 -05:00
firestar5683 83a90e89b4 Merge qualified HKG and MQB source 2026-10-22 20:15:07 -05:00
firestar5683 82367fd413 Build MQB direct-drive native safety 2026-10-22 20:14:23 -05:00
firestar5683 ca2373a9a0 Refresh Auto Learn inputs after queued decoding 2026-10-22 20:14:03 -05:00
firestar5683 d4027487c0 Repair HKG startup and native qualification fixtures 2026-10-22 20:12:30 -05:00
firestar5683 9cf41c7b38 Restore MQB direct-drive lateral and longitudinal ownership 2026-10-22 20:08:25 -05:00
firestar5683 f9a06b7d1a Merge qualified Forester and shared build artifacts 2026-10-22 20:05:30 -05:00
firestar5683 dc1e248d03 Build qualified Forester angle artifacts 2026-10-22 20:02:48 -05:00
firestar5683 2d58df950b Share Subaru angle receive storage across exact profiles 2026-10-22 20:02:08 -05:00
firestar5683 9983d3a4cb Merge preview and CI fixes with Toyota filter support 2026-10-22 20:00:23 -05:00
firestar5683 08c0efb01d Merge qualified shared source 2026-10-22 19:59:30 -05:00
firestar5683 8adbeddcbb Accept forwarded Toyota radar-filter advertisements 2026-10-22 19:59:30 -05:00
firestar5683 2c352b90b4 Keep offset sign previews within the visible canvas 2026-10-22 19:57:34 -05:00
firestar5683 0852af76e3 Preserve validated CI import provenance 2026-10-22 19:57:15 -05:00
firestar5683 d747e5ca08 Restore Forester first generation angle control 2026-10-22 19:52:53 -05:00
firestar5683 6633870fb3 Merge CI contracts and recording artifacts with Toyota filter support 2026-10-22 19:52:02 -05:00
firestar5683 a9edd2ca3b Accept forwarded Toyota smartDSU status copies 2026-10-22 19:50:42 -05:00
firestar5683 4840e9e1d9 Build Auto Learn recording and replay 2026-10-22 19:49:51 -05:00
firestar5683 94f88b41a9 Repair CI contracts and preview rendering 2026-10-22 19:44:47 -05:00
firestar5683 2077b98d76 Merge Subaru qualification tests with Toyota parity 2026-10-22 19:41:55 -05:00
firestar5683 8bd7ac53c7 Build EPS8 Toyota smartDSU artifacts 2026-10-22 19:41:23 -05:00
firestar5683 332d235693 Qualify Subaru native discovery and receiver guards 2026-10-22 19:39:12 -05:00
firestar5683 7aea14397c Merge Rivian static corrections with Toyota parity 2026-10-22 19:39:01 -05:00
firestar5683 951947cef2 Merge CI schema and Rivian static qualification 2026-10-22 19:35:52 -05:00
firestar5683 3f06976373 Merge current CI and GM source fixes with Toyota parity 2026-10-22 19:34:46 -05:00
firestar5683 26025d80dd Build EPS8 Toyota smartDSU artifacts 2026-10-22 19:33:38 -05:00
firestar5683 e18bf451d0 Fix SDGM Volt Alpha lateral startup and withdrawal 2026-10-22 19:32:53 -05:00
firestar5683 84087746d7 Align PE protocol checks with supported Alpha profile 2026-10-22 19:32:52 -05:00
firestar5683 6a8c1cf8cf Build Rivian native static corrections 2026-10-22 19:32:20 -05:00
firestar5683 ec957d6430 Fix Rivian native static diagnostics 2026-10-22 19:31:45 -05:00
firestar5683 27c7ba7827 Preserve CI schema and replay contracts 2026-10-22 19:31:25 -05:00
firestar5683 194d6fc106 Merge current safety and Auto Learn fixes for Toyota qualification 2026-10-22 19:29:03 -05:00
firestar5683 23ca75140a Build EPS8 Toyota smartDSU artifacts 2026-10-22 19:28:08 -05:00
firestar5683 d0a90d10ef Share Toyota safety RX workspace 2026-10-22 19:25:32 -05:00
firestar5683 778eed3a60 Make Honda atomic state and fixtures statically verifiable 2026-10-22 19:24:28 -05:00
firestar5683 62dc081f70 Keep Auto Learn source publication responsive 2026-10-22 19:10:12 -05:00
firestar5683 204a6f8534 Restore EPS8 Toyota smartDSU ownership 2026-10-22 19:09:43 -05:00
firestar5683 4413c29923 Restore MQB fixed and second-Panda lateral ownership 2026-10-22 19:04:28 -05:00
Dom 43360170dd Align PE marker and Subaru build variant tests 2026-10-22 18:42:16 -05:00
firestar5683 281f5b6b3a Strengthen PE release and pedal regression coverage 2026-10-22 18:32:02 -05:00
firestar5683 9ec0303f93 Preserve PE independent lateral intent alongside Alpha longitudinal 2026-10-22 18:13:36 -05:00
firestar5683 bb51c66589 Build qualified Subaru angle and startup changes 2026-10-22 18:04:07 -05:00
firestar5683 8c5f4bae13 Restore Ascent angle target shaping 2026-10-22 18:03:21 -05:00
firestar5683 9c5da263cc Merge qualified shared source 2026-10-22 18:02:10 -05:00
firestar5683 8025957925 Merge current shared source for HKG qualification 2026-10-22 17:50:11 -05:00
firestar5683 d4a49cb8c1 Allow tuning preparation to be turned off 2026-10-22 17:50:08 -05:00
firestar5683 bb39b9f388 Build guarded Legacy AVH startup request 2026-10-22 17:49:21 -05:00
firestar5683 7926a909e1 Restore guarded Legacy AVH startup request 2026-10-22 17:48:36 -05:00
Danny b4acca0798 Spotify: Preserve final volume behavior on the newer base 2026-10-22 15:47:15 -07:00
dirwin31 c7cc700e4e BlueALSA: Bump to v5.0.0 2026-10-22 15:47:15 -07:00
dirwin31 89509ba3c7 BT: Dont try and re connect to established audio Stream 2026-10-22 15:47:15 -07:00
Danny 843c364494 Test 2026-10-22 15:47:15 -07:00
Danny b5a58c741f BT: Track Skipping Mute Toggles 2026-10-22 15:47:15 -07:00
Danny f702c707e5 Use Colored Bar 2026-10-22 15:47:15 -07:00
Danny ce980ed98f Spotify: Account for network starting later 2026-10-22 15:47:15 -07:00
Danny 5814e26a53 Spotify: Advertise across different networks better, Swap Devices More Seemlessly 2026-10-22 15:47:15 -07:00
firestar5683 2cc8849544 Restore four-byte Toyota radar filter variants 2026-10-22 17:46:06 -05:00
Dom fb6b75a81d Align vehicle contract tests with intended safety ownership 2026-10-22 17:44:38 -05:00
firestar5683 7f584d7e58 Deliver Ford MAIN rearm after prior feedback clears 2026-10-22 17:43:06 -05:00
Danny c777a9ec8a iOS: Add the Galaxy companion with live device pages and CarPlay
Add LAN and Bluetooth connections, secure pairing, device-matched Galaxy page
caching, phone location and CarPlay navigation. Include connection recovery,
diagnostics, regression tests and a simulator CI build. Add shared companion
docs and host tests, and remove obsolete bundled-web lint exceptions.
2026-10-22 15:37:20 -07:00
Danny f63e715d2d Android: Add the StarPilot companion and signed release workflow
Connect over LAN or Bluetooth with network discovery, build-matched Galaxy
pages, phone GPS and a background uplink. Guide pairing with readiness retries,
cancellable progress and bond cleanup. Include app updates, regression tests,
the current APK, and a workflow to test, build and sign releases.
2026-10-22 15:37:20 -07:00
Danny e11ce3071d Galaxy: Add companion, Spotify and phone-aware web controls
Add companion installation and updates, Spotify setup and playback, destination
sharing, and Android Auto controls. Adapt Galaxy pages to phone transports and
device type, improve Bluetooth pairing feedback, and cover the new web flows.
2026-10-22 15:37:20 -07:00
Danny a531afd02a Bluetooth: Coordinate companion pairing and Android Auto ownership
Expose pairing readiness and coordinate adapter hand-offs with Android Auto.
Show app pairings separately, support individual removal, and improve pairing
controls on both comma screens. Add Galaxy companion endpoints and web asset
manifests, preserve the plain camera look, and fix headless speed-limit shapes.
2026-10-22 15:37:20 -07:00
firestar5683 a57a08843a Maintain Auto Learn history through pauses 2026-10-22 17:35:15 -05:00
firestar5683 3c592b58b0 Recover Auto Learn capture after interruptions 2026-10-22 17:34:49 -05:00
firestar5683 b781fa90d7 Recognize four-byte RAV4 radar filter advertisement 2026-10-22 17:32:58 -05:00
firestar5683 59c29e6e9c Build Ford lateral session handoff firmware 2026-10-22 17:13:31 -05:00
firestar5683 ba906bb038 Start fresh Ford lateral sessions on driver activation 2026-10-22 17:13:02 -05:00
firestar5683 ab1aeda540 Restore Avalon smartDSU ownership 2026-10-22 17:10:18 -05:00
firestar5683 46051ce2b4 Restore legacy Toyota smartDSU ownership 2026-10-22 17:00:52 -05:00
firestar5683 5ac0bbab48 Enable Turn Signal Guidance by default 2026-10-22 16:57:10 -05:00
firestar5683 236fd3942f Build guarded Legacy Stop Start startup request 2026-10-22 16:56:39 -05:00
firestar5683 c6db508304 Restore guarded Legacy Stop Start startup request 2026-10-22 16:55:56 -05:00
firestar5683 3305afdf98 Enable torque tuning for every torque controller 2026-10-22 16:52:31 -05:00
firestar5683 08d38e9bdf Increase clear-road encouragement 2026-10-22 16:51:45 -05:00
firestar5683 c8bbe72a2a Correct Palisade AOL status relay ownership 2026-10-22 16:45:09 -05:00
Dom 57bfa98906 Fix Rivian and Sentry test static checks 2026-10-22 16:37:30 -05:00
firestar5683 38bee61910 Authorize EV9 lateral intent from physical cruise SET release 2026-10-22 16:30:49 -05:00
firestar5683 9748e4a449 Pulse newly displayed speed limits 2026-10-22 16:24:13 -05:00
firestar5683 ea61d3002c Restore Camry cluster radar parser 2026-10-22 16:21:46 -05:00
firestar5683 3f8f1c69e4 Restore Toyota camera pedal configurations 2026-10-22 16:17:12 -05:00
firestar5683 7ac512caf2 Build Subaru angle and LKAS display repair 2026-10-22 16:17:02 -05:00
firestar5683 e3070b7b42 Preserve Subaru angle bounds and current LKAS display 2026-10-22 16:16:26 -05:00
firestar5683 de28764611 Merge qualified Toyota angle and Small UI updates 2026-10-22 16:15:10 -05:00
firestar5683 3366652afa Build independent RAV4 angle lateral control 2026-10-22 16:14:16 -05:00
firestar5683 928aeb8fe2 Restore original Small UI speed limit sign 2026-10-22 16:07:32 -05:00
firestar5683 40afc1bad2 Restore independent RAV4 angle lateral control 2026-10-22 16:05:39 -05:00
firestar5683 ecc570756a Build guarded Subaru stop and go 2026-10-22 15:55:14 -05:00
firestar5683 a7c78e97b0 Restore guarded Dom Subaru stop and go 2026-10-22 15:54:33 -05:00
firestar5683 9b1bbf7d21 Turn Signal Guidance 2026-10-22 15:47:13 -05:00
firestar5683 e70f7ea88b Preserve the original EV6 output proof across an input timeout 2026-10-22 15:43:58 -05:00
firestar5683 e72e3a875b Restore classic Honda alpha lateral ownership 2026-10-22 15:40:40 -05:00
firestar5683 db741fd789 Cover unbelted lateral recovery fault-marker vetoes 2026-10-22 15:36:09 -05:00
firestar5683 2325f052f0 Fix Subaru software cruise parked settings import 2026-10-22 15:33:32 -05:00
firestar5683 b41fdc6545 Restore selected Honda and CAN-FD Panda ownership 2026-10-22 15:33:11 -05:00
firestar5683 c03714aab2 Merge qualified Mazda startup with planner test typing 2026-10-22 15:31:48 -05:00
firestar5683 b79ea58759 Build Mazda MAIN-on lateral startup 2026-10-22 15:28:42 -05:00
firestar5683 66f0ec1371 Restore Mazda MAIN-on lateral startup 2026-10-22 15:28:09 -05:00
Dom 40e84d4a54 Type encouragement planner test options 2026-10-22 15:25:44 -05:00
firestar5683 057b881da8 Build guarded Subaru software cruise 2026-10-22 15:21:12 -05:00
firestar5683 7924313af9 Restore Dom Subaru software cruise with guarded stock buttons 2026-10-22 15:20:37 -05:00
firestar5683 7ebd1b46a7 Fit compact speed limit sign to visible offset 2026-10-22 15:18:04 -05:00
firestar5683 6a9df653ab Build Rivian GEN1 always-on lateral 2026-10-22 15:17:58 -05:00
firestar5683 036d2f0fee Place Rivian H7 receive workspace in AXI SRAM 2026-10-22 15:17:26 -05:00
firestar5683 d0a252d34b Merge shared vehicle qualification updates 2026-10-22 15:17:11 -05:00
Dom 11b26d3511 Align Hyundai startup fixtures with staged handoff 2026-10-22 15:07:02 -05:00
firestar5683 17f3920a55 Restore Rivian GEN1 always-on lateral 2026-10-22 15:05:24 -05:00
firestar5683 456c1955a1 Restore Honda Nidec pedal lateral ownership 2026-10-22 14:59:39 -05:00
firestar5683 744032b961 Encouragement 2026-10-22 14:58:27 -05:00
firestar5683 6a773e7d2d Restore Camry and C-HR radar CAN filter ownership 2026-10-22 14:51:22 -05:00
Dom f87e6e4093 Audit concrete parameterized vehicle test classes 2026-10-22 14:46:12 -05:00
firestar5683 4c7854dea8 Preserve armed lateral intent during unbelted pause recovery 2026-10-22 14:38:52 -05:00
firestar5683 45a73a439b Restore Honda CAN-FD and alternate radar lateral ownership 2026-10-22 14:25:55 -05:00
firestar5683 8462a39b65 Build Volkswagen cold MAIN lateral startup 2026-10-22 14:13:32 -05:00
firestar5683 29546c710a Restore MQB cold MAIN lateral startup 2026-10-22 14:12:53 -05:00
firestar5683 d8d39d1b35 Restore Auto Learn producer admission 2026-10-22 14:08:07 -05:00
firestar5683 178c8694f2 Restore Mazda camera stop-sign observations 2026-10-22 14:00:06 -05:00
firestar5683 2985ed9f6d Restore independent EV9 lateral control with Alpha longitudinal 2026-10-22 13:56:27 -05:00
firestar5683 bd764bbf2e Reduce Chestnut model startup overhead 2026-10-22 13:52:19 -05:00
firestar5683 8e27decb08 Restore 2022 RAV4 radar CAN filter and lateral ownership 2026-10-22 13:43:31 -05:00
firestar5683 1382b62b00 Retain armed lateral intent through inactive control receipts 2026-10-22 13:41:06 -05:00
firestar5683 ffaa466852 Build RAV4 angle-control radar CAN filter ownership 2026-10-22 13:28:11 -05:00
firestar5683 0c0d4bc8cb Restore RAV4 angle-control radar CAN filter ownership 2026-10-22 13:26:13 -05:00
Dom c78aeed361 Align classic CI with safety build modes and fix test typing 2026-10-22 13:05:30 -05:00
firestar5683 c145bf602f Fix RAV4 Continental radar setting authorization 2026-10-22 13:00:15 -05:00
firestar5683 7e19d85b8b Build Subaru stock-cruise always-on lateral 2026-10-22 12:57:47 -05:00
firestar5683 4523d17ecd Restore supported Subaru stock-cruise always-on lateral 2026-10-22 12:57:05 -05:00
firestar5683 9306f865e8 Add Ioniq left paddle Bookmark assignment 2026-10-22 12:51:07 -05:00
Peter Nguyen 3464d40526 2026-10-22 Sentry Discord and webhook alerts attach the saved wide and cabin images again
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 12:34:39 -05:00
firestar5683 b51b8dafd6 Handle Galaxy update tunnel disconnects 2026-10-22 12:34:31 -05:00
firestar5683 46c752caea Build Volkswagen gateway OP-long lateral independence 2026-10-22 12:28:56 -05:00
firestar5683 01479b56b9 Restore gateway MQB OP-long lateral independence 2026-10-22 12:27:51 -05:00
firestar5683 a64dd65025 Fix replay torque bar freshness 2026-10-22 12:04:37 -05:00
firestar5683 838e93b934 Test Honda EPS recovery and Reverse native lifecycle 2026-10-22 11:59:59 -05:00
firestar5683 b88e2eccb9 Gate stock MQB AOL lifecycles in vehicle CI 2026-10-22 11:57:28 -05:00
firestar5683 86db7a63ba Build Volkswagen stock always-on lateral 2026-10-22 11:55:19 -05:00
firestar5683 6120da2d54 Restore stock MQB always-on lateral 2026-10-22 11:54:11 -05:00
firestar5683 5277fc139f Retain lateral intent while a newer native FULL grant is acknowledged 2026-10-22 11:45:13 -05:00
firestar5683 cef4eec062 Restore Galaxy update reconnect screen 2026-10-22 11:44:05 -05:00
firestar5683 2d10707628 Gate shared AOL lifecycles in vehicle CI 2026-10-22 11:37:43 -05:00
firestar5683 d0400456cf Keep neutral classic SCC replacement running during initialization 2026-10-22 11:26:01 -05:00
firestar5683 872de3b085 Warn when a soft fault withdraws independent lateral control 2026-10-22 11:23:45 -05:00
firestar5683 e6f7d9c473 Fix GM control-loop load and lateral recovery after lag 2026-10-22 11:22:03 -05:00
firestar5683 e57c9a5989 Retain stock Ford intent when braking overlaps temporary EPS loss 2026-10-22 11:19:01 -05:00
firestar5683 deefc26c85 Retain armed lateral intent when an axis publication expires 2026-10-22 11:15:57 -05:00
firestar5683 1f66903899 Recover Auto Learn after calibration delivery gaps 2026-10-22 11:11:11 -05:00
firestar5683 98a6ca21f3 Build Ford accelerator-override lateral safety firmware 2026-10-22 11:08:22 -05:00
firestar5683 a3b270cbfc Retain Ford lateral intent when cruise engages under accelerator override 2026-10-22 11:06:50 -05:00
firestar5683 3ce8e82c73 Retain Mazda lateral intent at standstill 2026-10-22 11:03:51 -05:00
firestar5683 0970a7b685 Retain Mazda lateral intent through Reverse 2026-10-22 10:59:50 -05:00
firestar5683 36ecda9f25 Exercise EV6 Alpha startup in release regression coverage 2026-10-22 10:55:07 -05:00
firestar5683 0cdc3287b5 Preserve Mazda lateral intent for mapped Cancel actions 2026-10-22 10:53:47 -05:00
firestar5683 d69a9f4db5 Restore Small UI sign and parked Galaxy offroad 2026-10-22 10:52:58 -05:00
firestar5683 9ab83d8d59 Refresh prebuilt inventory after Nissan test typing 2026-10-22 10:52:11 -05:00
Dom f8c91e6c62 Fix Nissan test CAN values typing 2026-10-22 10:46:20 -05:00
firestar5683 86be96c44c Withdraw Toyota pedal steering when MAIN expires 2026-10-22 10:17:30 -05:00
firestar5683 82f9995887 Build Nissan always-on lateral 2026-10-22 10:13:01 -05:00
firestar5683 9af5e64787 Reuse Nissan safety RX workspace 2026-10-22 10:10:36 -05:00
firestar5683 075b73e940 Restore Nissan stock-cruise always-on lateral 2026-10-22 10:05:08 -05:00
firestar5683 e914d761b1 Improve Auto Learn feedback 2026-10-22 08:44:35 -05:00
firestar5683 f33c8605da Preserve stock lateral intent after temporary steering faults 2026-10-22 08:37:24 -05:00
firestar5683 155b105a44 Restore mapped classic Hyundai MAIN and LKAS AOL controls 2026-10-22 08:23:03 -05:00
firestar5683 ce66b2ed7d Test Ford AOL retention across temporary location loss 2026-10-22 08:21:35 -05:00
firestar5683 d36a4b8888 Cover Chrysler stock ACC location recovery 2026-10-22 08:12:00 -05:00
firestar5683 fb943dd85a Retain qualified lateral intent across temporary withdrawals 2026-10-22 08:09:06 -05:00
firestar5683 371000a848 Preserve Ford AOL intent with the initial integrity epoch 2026-10-22 08:06:00 -05:00
firestar5683 33952c42b9 Build Tesla screen AOL safety firmware 2026-10-22 07:58:35 -05:00
firestar5683 7731bee396 Preserve Tesla screen AOL intent through temporary inhibition 2026-10-22 07:55:42 -05:00
firestar5683 74d2ef9698 Initialize classic AOL dash icons after profile finalization 2026-10-22 07:49:23 -05:00
firestar5683 ccdd137671 Build Lexus IS DSU MAIN AOL 2026-10-22 07:27:57 -05:00
firestar5683 5480ae3caa Restore Lexus IS DSU MAIN lateral ownership 2026-10-22 07:24:49 -05:00
firestar5683 2b42135302 Validate published prebuilt receipts before device updates 2026-10-22 07:04:46 -05:00
Prabhaav Pillai 8f2e33dead (Another eight) round of Galaxy UI bug fixes
Made card headers, icons, spacing, and controls more consistent across Galaxy pages.
Improved vehicle selection and Bluetooth device layouts.
Refined Model Manager filters and moved running model status into its four-item summary.
Moved Jetlink above Controls.
Updated UI tests to match the revised layouts.
2026-10-22 04:12:20 -04:00
Prabhaav Pillai 91e1ce8466 Improve error handling and UI elements for software status 2026-10-22 03:49:43 -04:00
Prabhaav Pillai ee83b3010a (Another seventh) round of Galaxy UI bug fixes
Improved consistency across Galaxy pages
Reworked the Model Manager layout, filters, downloads, randomizer, and Jetlink controls.
Improved vehicle selection and the Galaxy pairing and installation flow.
Fixed settings-row rendering, Android Auto upload timeouts, and Sentry event ID validation.
Updated tests for current UI behavior - all 102 JavaScript and 797 Python Galaxy tests pass.
2026-10-22 03:39:05 -04:00
firestarsdog d773f87897 ui: refine speed-limit signs and speed display hierarchy 2026-10-22 03:22:11 -04:00
firestarsdog d2dbeddcf1 ui: unify speed-limit signs for clearer confirmation cues 2026-10-22 02:49:00 -04:00
Dom aab66cd015 Fix device artifact test fixture for FLM native binding 2026-10-21 23:43:36 -05:00
firestar5683 b151ca11cb Global FLM Auto Learn 2026-10-21 23:28:39 -05:00
firestar5683 21c74f72ef Honor Panda fault policy before ECU takeover 2026-10-21 22:50:55 -05:00
firestar5683 4b9de265bf Handle Ioniq 6 native brake withdrawal before host sampling 2026-10-21 22:48:16 -05:00
firestar5683 70799d5bc3 Fix GM steering companion receive ordering 2026-10-21 22:45:01 -05:00
firestarsdog a5f18d35cd Restore C4 MAX fade; contain SLC offsets for readability 2026-10-21 23:12:12 -04:00
prabhaavp 9ab16c0838 Merge pull request #240 from dirwin31:3X-Widgets
Allow Full Widget Editing and Arrangement on 3X
2026-10-21 22:39:15 -04:00
Prabhaav Pillai 51dd8d48ce Removed duplicate font opacity handling 2026-10-21 22:38:59 -04:00
firestar5683 55a40280fb Merge latest tests with vehicle regression coverage 2026-10-21 21:18:38 -05:00
Danny f964651e60 No Bounds 2026-10-21 21:37:24 -04:00
Danny 4366e6ac7a Allow Full Widget Editing and Arrangement on 3X, add AA only widgets to 3X screen 2026-10-21 21:37:24 -04:00
firestar5683 55bbf6b98a Require emitted EV9 steering and select native test variants 2026-10-21 19:59:07 -05:00
Dom 77347170f8 Clarify SLC UI test preconditions and method mocks 2026-10-21 19:58:59 -05:00
firestar5683 d77bea5972 Pair GV60 longitudinal startup with exact native heartbeat safety 2026-10-21 19:56:15 -05:00
firestar5683 1973ad6439 Defer EV9 ECU takeover until replacement controls are ready 2026-10-21 19:37:46 -05:00
firestar5683 44beeb7606 Preserve HKG READY evidence across batched CAN frames 2026-10-21 18:51:48 -05:00
firestar5683 4854bc74b6 Preserve Mazda lateral control on unassigned Cancel 2026-10-21 18:38:17 -05:00
firestarsdog 3d2d094c8b SLC Fixes 2026-10-21 19:25:05 -04:00
firestarsdog 0972fec4ef SLC Styling 2026-10-21 19:25:05 -04:00
firestarsdog ab8368f287 Big SLC Overhaul 2026-10-21 19:22:59 -04:00
Dom 0299391cf8 Use pinned capnproto dependency in host heartbeat tests 2026-10-21 17:53:46 -05:00
firestar5683 db73e3bdbb Verify HKG AOL fault recovery against emitted steering commands 2026-10-21 16:49:14 -05:00
Dom 7edb10e149 Fix vision typing and projection HTTP test fixtures 2026-10-21 15:47:55 -05:00
firestar5683 4f3110af3a Preserve classic HKG AOL intent through location input faults 2026-10-21 15:41:17 -05:00
firestar5683 c7c3dbd699 Preserve HKG stock CAN-FD AOL intent during location input loss 2026-10-21 14:59:29 -05:00
firestar5683 58a4514321 Prepare ordinary HKG HDA-II takeover before publishing longitudinal control 2026-10-21 14:24:11 -05:00
firestar5683 4b3017a7fc Keep registered Ford CAN-FD discovery on normal bus 0 2026-10-21 13:59:11 -05:00
firestar5683 8e6cd917e4 Cover Ioniq 5 PE READY stock fallback with captured startup CAN 2026-10-21 12:56:37 -05:00
Dom ab9b2d7624 Make CI fixture preconditions and AST body types explicit 2026-10-21 12:49:11 -05:00
firestar5683 5ffbe27aaa Keep Ioniq 5 PE READY startup stock until ECU takeover is proven 2026-10-21 12:47:27 -05:00
firestar5683 66a573747d Prepare Ioniq 5 PE longitudinal takeover from a proven parked READY state 2026-10-21 12:45:05 -05:00
firestar5683 0c1f0b3d8d Retain Confirmed Vision Speed Limits 2026-10-21 12:43:45 -05:00
firestar5683 b3c26b5824 Match Dom hands-free cluster scope across Ford CAN-FD 2026-10-21 12:36:48 -05:00
firestar5683 43eea2e977 Restore Vision Speed Limits 2026-10-21 12:30:55 -05:00
firestar5683 3c687b55f7 Fix GM startup and steering receipt timing faults 2026-10-21 12:16:00 -05:00
prabhaavp 3372a71b4a Merge pull request #237 from dirwin31:PR-Smaller-3
Android Auto: Car screen widgets, navigation overlay, now playing and diagnostics
2026-10-21 13:11:34 -04:00
Prabhaav Pillai 9632656c59 Trim trivial verbose comments 2026-10-21 13:10:49 -04:00
Prabhaav Pillai 5a2e9d2606 AA documentation update and improve network recovery logic 2026-10-21 13:07:44 -04:00
firestar5683 1477a59fcd Prepare radar HDA-II takeover before publishing longitudinal control 2026-10-21 11:59:37 -05:00
firestar5683 8090e48441 Preserve HKG stock AOL intent through temporary location input loss 2026-10-21 11:44:58 -05:00
firestar5683 297f56f29a Match Dom Mach-E cluster messages with stock idle ownership 2026-10-21 11:32:09 -05:00
Dom 4fff2bba47 Assert captured messages before GM successor test mutations 2026-10-21 11:20:54 -05:00
firestar5683 4f1b668aea Keep Mach-E stock display ownership before lateral engagement 2026-10-21 11:10:14 -05:00
firestar5683 1319c60fda Preserve fresh GM lateral authority while braking 2026-10-21 10:54:26 -05:00
firestar5683 223c4f1322 Enforce current Hyundai startup evidence before controller output 2026-10-21 10:51:38 -05:00
Dom d3c0e9df8b Use typed CAN packets in Volt lifecycle fixture 2026-10-21 10:41:28 -05:00
firestar5683 e9abadd2f4 Capture F1 Volt withdrawal receipts in Card 2026-10-21 10:18:27 -05:00
firestar5683 9de201d18d Prepare radar HDA-I takeover before publishing longitudinal control 2026-10-21 09:54:27 -05:00
firestar5683 b300093058 Build conventional-cruise F1 Volt lateral startup 2026-10-21 09:52:58 -05:00
firestar5683 97a50dead6 Restore conventional-cruise F1 Volt lateral startup 2026-10-21 09:52:19 -05:00
Dom 210e6504fe Align updater test mocks with offroad status keyword 2026-10-21 09:39:51 -05:00
firestar5683 31d888ba79 Build RAV4 TSS2 pedal pairing 2026-10-21 09:35:25 -05:00
firestar5683 5ee8d662a7 Restore RAV4 TSS2 pedal interceptor pairing 2026-10-21 09:33:25 -05:00
firestar5683 c569a798ba Build Corolla TSS2 pedal pairing 2026-10-21 09:08:33 -05:00
firestar5683 f334ac0693 Restore Corolla TSS2 pedal interceptor pairing 2026-10-21 09:06:29 -05:00
firestar5683 defaf64c0e Allow Forced Offroad Updates 2026-10-21 08:31:44 -05:00
firestar5683 ba6eac264e Fix Big Model Cold Startup 2026-10-21 08:23:17 -05:00
firestar5683 4ed9546240 Test Subaru automatic stock startup ownership 2026-10-21 05:35:53 -05:00
firestar5683 1cbf3b927e Test Honda automatic stock startup and native handoff 2026-10-21 05:26:08 -05:00
firestar5683 a4e1631228 Keep Hyundai startup testers until controller publication succeeds 2026-10-21 04:12:13 -05:00
firestar5683 21ee77ea30 Prepare classic Hyundai ECU takeover before publishing longitudinal control 2026-10-21 03:41:28 -05:00
Dom fc6d6604aa Make bounded route inventory test limits explicit 2026-10-21 03:34:52 -05:00
firestar5683 cb85a84e30 Preserve AOL intent across native updates and classic cruise cancellation 2026-10-21 02:03:14 -05:00
firestar5683 708a68adeb Preserve Hyundai diagnostic settle time during stock restoration 2026-10-21 00:52:55 -05:00
firestar5683 67c1fb6a64 Preserve independent Bolt lateral below cruise engagement speed 2026-10-21 00:10:13 -05:00
firestar5683 fc2a89b988 Preserve GM MAIN intent through parked startup 2026-10-20 23:57:45 -05:00
firestar5683 f1434fe34d Retain Sonata Hybrid lateral intent when cruise is canceled 2026-10-20 23:51:40 -05:00
firestar5683 da628907d0 Preserve Hyundai diagnostic continuity across startup owners 2026-10-20 23:43:42 -05:00
firestar5683 5748148e7c Arm classic stock AOL after successful full engagement 2026-10-20 23:27:39 -05:00
firestar5683 8824bea044 Optimize FLM job encoding 2026-10-20 23:19:02 -05:00
firestar5683 2fb333f279 Build RAV4 Hybrid smartDSU ownership 2026-10-20 23:13:16 -05:00
firestar5683 4000b44866 Verify Toyota RX workspace reconfiguration 2026-10-20 23:13:14 -05:00
firestar5683 10be50fd7c Share Toyota RX checks across exact filter profiles 2026-10-20 23:08:42 -05:00
firestar5683 ad84d01235 Restore RAV4 Hybrid smartDSU ownership 2026-10-20 23:00:30 -05:00
firestar5683 ad3fa91b09 Restore recorded Sonata Hybrid diagnostic admission 2026-10-20 22:21:40 -05:00
firestar5683 01b06dcc71 Keep lateral renewal across stock cruise disengagement 2026-10-20 22:17:53 -05:00
Prabhaav Pillai 409601216b Build 2026-10-20 23:05:29 -04:00
Prabhaav Pillai d7db526f8c Revert "Add bundled Ion headers to device include path (WSL Fix)"
This reverts commit b209e6a655.
2026-10-20 23:05:04 -04:00
Prabhaav Pillai 4b1466f5eb Revert "Fix WSL device build headers and FFmpeg linkage"
Reverts the source changes from commit 470ab5cc70. The generated prebuilt manifest remains with the rebuilt artifacts.
2026-10-20 23:05:04 -04:00
firestar5683 51646bf4cb Receive fresh lateral inputs before withdrawing AOL 2026-10-20 22:04:30 -05:00
Dom 6ca072af44 Narrow test fixture types before mutation 2026-10-20 21:56:51 -05:00
firestar5683 ea916e50bd Restore classic Hyundai AOL steering dashboard icons 2026-10-20 21:43:04 -05:00
firestar5683 5cf5637d65 Detect refused steering on qualified SDGM Volts 2026-10-20 21:42:46 -05:00
firestar5683 2abc15c222 Preserve stock ASCM Volt lateral intent below cruise speed 2026-10-20 21:33:52 -05:00
firestarsdog 42d0beabee test: avoid build env cap'n proto links 2026-10-20 22:32:31 -04:00
firestar5683 f5f8a331f1 Preserve G90 diagnostic continuity through controller startup 2026-10-20 21:32:06 -05:00
firestar5683 a278aa8fba Preserve GPS daemon executable mode 2026-10-20 21:23:22 -05:00
firestar5683 ec856f38e6 Retain stock Ford AOL intent across short command gaps 2026-10-20 21:21:56 -05:00
firestar5683 f0f9b43bef Restore car GPS fixes on the standard logging channel 2026-10-20 21:21:52 -05:00
firestar5683 0b01007a9b Bound FLM replay memory 2026-10-20 21:20:01 -05:00
firestar5683 b9a8a41784 Build Jeep Grand Cherokee brake hold 2026-10-20 21:16:58 -05:00
firestar5683 2ad95d4176 Restore Jeep Grand Cherokee stock ACC brake hold 2026-10-20 21:12:26 -05:00
Danny e26202eae2 Bluetooth and Spotify: Phone audio, pairing bridge and Spotify player 2026-10-20 21:05:02 -05:00
firestar5683 4da8dd6c3f Build Panda authority-based siren warning 2026-10-20 21:02:58 -05:00
firestar5683 c0b16fe8cc Separate armed AOL heartbeat from Panda siren activity 2026-10-20 21:00:57 -05:00
Danny 7775d42443 FAQ update 2026-10-20 20:09:00 -04:00
Danny ab34e5d8a5 Trailing TLS OpenHeadUnit Fix 2026-10-20 20:09:00 -04:00
Danny 12b6dadf17 Android Auto: Car screen widgets, navigation overlay, now playing and diagnostics 2026-10-20 20:09:00 -04:00
prabhaavp 7ea822bbb1 Merge pull request #236 from dirwin31:PR-Smaller-2
Bluetooth and Spotify: Phone audio, pairing bridge and Spotify player
2026-10-20 20:06:28 -04:00
Prabhaav Pillai 86aa912748 Fix Tests for AA 2026-10-20 20:04:53 -04:00
Prabhaav Pillai 3c7898921b Safe app key removal after Bluetooth forget succeeds only 2026-10-20 20:03:38 -04:00
firestar5683 f6a03dce08 Build Ford AOL safety firmware 2026-10-20 18:52:57 -05:00
firestar5683 31c5010e11 Preserve Ford AOL intent across qualified physical pauses 2026-10-20 18:51:56 -05:00
Danny 7ea5058365 Bluetooth and Spotify: Phone audio, pairing bridge and Spotify player 2026-10-20 19:42:21 -04:00
firestar5683 7c9b45bb5b Build Tesla Pre-AP startup and safety artifacts 2026-10-20 18:39:50 -05:00
firestar5683 f4b8982ee0 Restore calibrated Tesla Pre-AP pedal control 2026-10-20 18:35:44 -05:00
Prabhaav Pillai 470ab5cc70 Fix WSL device build headers and FFmpeg linkage 2026-10-20 19:23:48 -04:00
Prabhaav Pillai cdcf6a0dd1 Build verified device artifacts 2026-10-20 19:22:40 -04:00
firestar5683 28a017e12e Reject stale and malformed Tesla HW1 radar observations 2026-10-20 18:03:22 -05:00
firestar5683 2a73dc50ff Restore Hyundai ECU response handling before longitudinal takeover 2026-10-20 18:02:47 -05:00
firestar5683 bd490d2ee3 Keep Transit steering angle encoding inside native limits 2026-10-20 18:01:32 -05:00
firestar5683 edb2be5716 Build Prius ZSS support 2026-10-20 17:59:09 -05:00
James f5c56bc631 ZSS support
Co-Authored-By: Erich Moraga <33645296+erichmoraga@users.noreply.github.com>
2026-10-20 17:56:01 -05:00
firestar5683 fc753b3900 Build Chrysler lateral intent 2026-10-20 17:48:18 -05:00
Dom b801a9ff42 Merge published navigation and device build updates 2026-10-20 17:44:27 -05:00
firestar5683 764b94f2ab Restore Chrysler stock ACC lateral intent 2026-10-20 17:41:20 -05:00
Dom de0092349d Fix navigation GPS carrier subscriptions
Use GPS transport services in navtilesd and MapFeed, preserving phone GPS through starpilotNavigation. Add startup subscription regressions.

Source-only correction; no prebuilt receipt or native artifacts changed.
2026-10-20 17:39:33 -05:00
Prabhaav Pillai b209e6a655 Add bundled Ion headers to device include path (WSL Fix) 2026-10-20 18:21:15 -04:00
prabhaavp d2db94e177 Merge pull request #235 from dirwin31:PR-Smaller-1
Core: Companion phone uplink, phone GPS, cellular off switch and usage stats
2026-10-20 18:16:33 -04:00
Prabhaav Pillai cfaf5b05b2 Refactor cellular data toggle descriptions for clarity and update GPS validation logic 2026-10-20 18:13:47 -04:00
Jeffrey Wong fdcf1db290 Build: keep the hash-pinned model guard libraries instead of recompiling them 2026-10-20 17:00:04 -05:00
firestar5683 68f0dde601 Build Volt conventional-cruise F1 firmware 2026-10-20 16:12:24 -05:00
firestar5683 19e0619ae9 Support no-camera Volt conventional cruise with F1 brakes 2026-10-20 16:09:48 -05:00
firestar5683 12d77dd2d6 Fix Ioniq reverse latch and left-paddle support 2026-10-20 15:49:56 -05:00
firestar5683 7d14e28c4d Build removed-camera Volt cruise-fault safety firmware 2026-10-20 15:43:46 -05:00
firestar5683 749dba88f5 Reject faulted cruise engagement on removed-camera Volts 2026-10-20 15:41:56 -05:00
firestarsdog 6bc930a07b Color border cleanup 2026-10-20 16:14:25 -04:00
firestarsdog 219dc02f11 Keep AOL cyan on gas without longitudinal control 2026-10-20 14:21:03 -04:00
firestar5683 37bd6981ad Build removed-camera Volt CAN isolation firmware 2026-10-20 13:03:25 -05:00
firestar5683 ded5368547 Keep removed-camera Volt traffic off the absent camera bus 2026-10-20 12:58:05 -05:00
firestar5683 aeb33f3ae7 Build Toyota stationary AOL continuity fix 2026-10-20 12:44:58 -05:00
firestar5683 9f2830b94b Merge current vehicle fixes for Toyota continuity 2026-10-20 12:41:08 -05:00
firestar5683 b07d3f94e2 Keep Toyota AOL armed through stationary output gaps 2026-10-20 12:41:07 -05:00
firestar5683 afd4cde972 Fix Volt source handoffs and transient clock sampling 2026-10-20 12:14:47 -05:00
firestarsdog d2cc8e282e + Gray Border Override for All Engagement
Update
2026-10-20 12:52:54 -04:00
Prabhaav Pillai 18505b6af7 Update updater status message for clarity 2026-10-20 12:09:10 -04:00
Prabhaav Pillai 223f1869eb Fix "This scan was incomplete. More local segments may exist." 2026-10-20 12:06:19 -04:00
firestar5683 c871086830 Build Bolt pedal AOL recovery firmware 2026-10-20 11:04:30 -05:00
Prabhaav Pillai 662e152627 Add DualShock 4 profile to joystick controller configurations Part 2 2026-10-20 12:02:59 -04:00
firestar5683 b432b14a3b Fix Bolt pedal startup, resume, and AOL override recovery 2026-10-20 10:58:04 -05:00
Prabhaav Pillai 1f733a74ef Add DualShock 4 profile to joystick controller configurations 2026-10-20 11:47:59 -04:00
Danny 2919499c61 Build qualified Honda AOL recovery firmware 2026-10-20 10:43:45 -05:00
Danny 9deea7d855 Honda: Keep longitudinal through temporary EPS faults and ignore camera CAN interrupt-rate faults 2026-10-20 10:41:03 -05:00
firestar5683 73c3ddd45c Keep HKG angle AOL armed through temporary stop restrictions 2026-10-20 09:59:17 -05:00
firestar5683 e96ba4205f Preserve stock HKG lateral ownership through delayed brake status 2026-10-20 09:29:55 -05:00
Danny 40abb31b4d Honda: Keep longitudinal through temporary EPS faults and ignore camera CAN interrupt-rate faults 2026-10-20 07:27:23 -07:00
Danny a8d121bf45 Core: Update developer panel tests for the cellular off switch 2026-10-20 06:08:45 -07:00
Danny 786a1981b6 Mapd: Ship the binary built with phone GPS support 2026-10-20 06:03:40 -07:00
Danny 8f628ba48b Core: Companion phone uplink, phone GPS, cellular off switch and usage stats 2026-10-20 06:03:37 -07:00
firestar5683 5c27cc667b Fix HKG brake continuity and duplicate PE startup receipts 2026-10-20 06:04:21 -05:00
firestar5683 9685faaed1 Build qualified HKG MAIN and angle AOL firmware 2026-10-20 03:09:13 -05:00
firestar5683 11a3272049 Preserve HKG MAIN rearm and mapped angle AOL cancellation 2026-10-20 03:08:45 -05:00
firestarsdog d9bd0a06a9 Galaxy Routes Gate Update 2026-10-20 03:34:53 -04:00
firestarsdog 651fc56ae6 Local Routes Explain 2026-10-20 03:27:17 -04:00
firestarsdog 63f6655dce Update camera colors 2026-10-20 03:04:39 -04:00
firestarsdog 2cb5b05746 Tweak disengaged muted effect 2026-10-20 02:45:39 -04:00
firestarsdog cda3693dd8 Unify Technicolor camera grading to distinguish engagement states 2026-10-20 02:20:29 -04:00
Prabhaav Pillai f23e0449ff Pause stars on slow scrolling in Firefox Mobile 2026-10-20 02:11:22 -04:00
Prabhaav Pillai 722ce72d33 Use restart background for Galaxy loading screen 2026-10-20 01:55:27 -04:00
Prabhaav Pillai 7f1196d00e Fix Galaxy update handoff and reuse boot screen 2026-10-20 01:49:49 -04:00
firestar5683 5b9713a042 Preserve qualified Sonata AOL through cruise CANCEL 2026-10-20 00:21:03 -05:00
Prabhaav Pillai 0e7503448c Fix Broken Updates via Galaxy (whoops!) 2026-10-20 01:11:35 -04:00
firestar5683 f9d57ea7a4 Build Toyota gas override continuity fix 2026-10-20 00:07:20 -05:00
firestar5683 b821f1961d Preserve Toyota lateral control during gas override 2026-10-20 00:05:10 -05:00
firestar5683 922376a15f Build qualified HKG angle AOL brake firmware 2026-10-20 00:02:12 -05:00
firestar5683 06150d413a Preserve HKG angle AOL through braking and fresh input renewal 2026-10-20 00:01:14 -05:00
firestar5683 930b803054 Build Toyota cruise and standstill fixes 2026-10-19 23:45:26 -05:00
firestar5683 e14afc699c Integrate current HKG qualification updates 2026-10-19 23:38:07 -05:00
firestar5683 4e27abda7d Restore Toyota PCM speed overrides and standstill steering 2026-10-19 23:38:06 -05:00
firestar5683 ba75592a63 Qualify restored HKG firmware identities 2026-10-19 23:30:36 -05:00
firestar5683 4b8a0ecc13 aussie 2026-10-20 04:30:32 +00:00
firestar5683 62273b970e Jalisco's 2026-10-20 04:30:32 +00:00
firestar5683 94adf3c9e8 CCNC 2026-10-20 04:30:32 +00:00
firestar5683 06c0eb600b kia forte 2026-10-20 04:30:31 +00:00
raadiphone0-sketch 9c2e2ca33c Hyundai: add Korean Sonata DN8 fingerprints 2026-10-20 04:30:31 +00:00
firestar5683 382190c618 Restore every Dom HKG radar vehicle binding 2026-10-19 23:24:17 -05:00
firestar5683 43c0034641 Require current EV9 Ready evidence before ECU takeover 2026-10-19 23:19:46 -05:00
firestar5683 130776a608 Verify Hyundai default session recovery before stock fallback 2026-10-19 23:17:07 -05:00
firestar5683 076a7312ed Build qualified Ioniq 5 PE longitudinal firmware 2026-10-19 23:11:37 -05:00
firestar5683 b79799f10d Verify separate PE and EV9 startup ownership 2026-10-19 23:10:18 -05:00
firestar5683 2cbd16d4d3 Cover saved PE startup preferences and accelerator boundaries 2026-10-19 23:09:26 -05:00
firestar5683 4a6f567c73 Restore Ioniq 5 PE longitudinal startup and controller 2026-10-19 23:09:26 -05:00
firestar5683 6b691113a3 Keep qualified HKG angle AOL active during accelerator override 2026-10-19 23:09:02 -05:00
firestar5683 a432da3265 Build Tinygrad Runtime Compatibility 2026-10-19 23:01:28 -05:00
firestar5683 58cf992fe4 Preserve StarPilot Model Runtime Compatibility 2026-10-20 03:55:47 +00:00
Adeeb Shihadeh 66c350c9ab modeld: fix macOS build (#39112) 2026-10-20 03:55:46 +00:00
Daniel Koepping 68984ff07b bump tinygrad (#39085) 2026-10-20 03:55:45 +00:00
firestar5683 926ba1b700 Keep recorded PE firmware discovery on normal CAN wiring 2026-10-19 22:39:25 -05:00
firestar5683 393e06209e Restore FLM Results Navigation 2026-10-19 22:30:33 -05:00
firestar5683 72de373447 Build Upstream Integration 2026-10-19 22:25:46 -05:00
firestar5683 0ef9458408 Merge Current StarPilot Changes 2026-10-19 22:19:41 -05:00
firestar5683 34147fc258 Match Serialized Planner Feedback 2026-10-19 22:17:12 -05:00
firestar5683 9ebbe9b4a6 Recognize camera-bypassed Volt CAN layout 2026-10-19 22:10:05 -05:00
Prabhaav Pillai c532223fa0 Restore V-Adj Spot Monitoring warnings and polish Galaxy settings, cameras, and updates
Bundle the verified VASM model, enable it at startup, and split VASM and vision speed-sign inference across little cores when both are active.
Restore VASM warnings in PiP activation, red outlines, and onroad blind-spot borders, including expanded Android Auto views.
Improve cabin snapshots with longer warm-up, adjusted capture timeouts, a fresh preview frame, and clearer capture buttons and save prompts.
Polish Galaxy settings with dimmed gated controls and icons, clearer vehicle fingerprinting and steering availability descriptions, rounded speed-offset ranges, and immediate refresh after saving.
Improve updater startup messages and preserve update/reconnect screens across service interruptions and restarts.
Add regression tests for the updated behavior.
2026-10-19 23:07:19 -04:00
firestar5683 f57ffcf364 Build Global AOL Defaults 2026-10-19 22:03:31 -05:00
firestar5683 ae686e1062 Default AOL On Globally 2026-10-19 22:00:34 -05:00
firestar5683 082053627e Qualify 2027 Ioniq 5 PE route and model year 2026-10-19 21:43:54 -05:00
firestar5683 6896325150 Build Upstream Artifacts 2026-10-19 21:41:01 -05:00
firestar5683 974f2b3d71 Add 2027 Ioniq 5 PE firmware identification 2026-10-19 21:37:00 -05:00
firestar5683 b62dbaf303 Align Planner Test Feedback 2026-10-19 21:32:11 -05:00
firestar5683 fefbe01cf9 Update Upstream Compatibility Checks 2026-10-19 21:30:58 -05:00
firestar5683 cea9caba0d Update Ioniq firmware device build 2026-10-19 21:24:54 -05:00
firestar5683 5747919dab Adapt Upstream Compatibility 2026-10-19 21:23:03 -05:00
Harald Schäfer a8c5d08686 cruise planner: remove delay when lowering set speed (#39127) 2026-10-20 02:19:24 +00:00
Adeeb Shihadeh 7f70c11414 speedup unit tests (#39122) 2026-10-20 02:19:24 +00:00
Adeeb Shihadeh d1d6ee59d8 we support all the linuxes! (#39121) 2026-10-20 02:19:24 +00:00
Adeeb Shihadeh c488fbdfb9 msgq: rm logger (#39118) 2026-10-20 02:19:24 +00:00
Adeeb Shihadeh 81bd999ced bump msgq (#39117) 2026-10-20 02:19:24 +00:00
Adeeb Shihadeh af620ae6d5 show offroad alert for ignored uploads (#39104) 2026-10-20 02:19:24 +00:00
Harald Schäfer 843dd22f40 Remove obsolete Chill mode code (#39097)
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2026-10-20 02:19:24 +00:00
Shane Smiskol 6304911b10 releases tweaks 2026-10-20 02:19:24 +00:00
Shane Smiskol 08f1585c30 Initial cruise set speed scroller ui (#39098) 2026-10-20 02:19:24 +00:00
Harald Schäfer 426b9a9f40 Fix typo in Autospeed feature name 2026-10-20 02:19:24 +00:00
Harald Schäfer 14c7980041 Update RELEASES.md for version 0.11.3 changes 2026-10-20 02:19:24 +00:00
Shane Smiskol fc7b26c39e update translations (#39101) 2026-10-20 02:19:24 +00:00
Shane Smiskol d69c052bb8 Minor initial set speed fixes (#39099) 2026-10-20 02:19:24 +00:00
Adeeb Shihadeh c103cb5722 Ratekeeper: resync after a stall instead of running catch-up frames (#39095) 2026-10-20 02:19:24 +00:00
Harald Schäfer 4c7375c6bf Add configurable initial max speed (#39081)
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2026-10-20 02:19:24 +00:00
Harald Schäfer 2d7e7de428 pigeond: set minimum satellite elevation to 0 degrees (#39083)
Co-authored-by: haraschax <6804392+haraschax@users.noreply.github.com>
2026-10-20 02:19:24 +00:00
Shane Smiskol 5f9ddcd7b7 ui: check raylib version for keyboard gradient (#39036) 2026-10-20 02:19:24 +00:00
Daniel Koepping ae0442cb1e bump to 0.11.3 (#39093) 2026-10-20 02:19:24 +00:00
Daniel Koepping f542e9add1 bump panda (#39092) 2026-10-20 02:19:24 +00:00
Harald Schäfer 7594738868 modeld: seed previous curvature when lateral control is inactive (#39091) 2026-10-20 02:19:24 +00:00
Adeeb Shihadeh ad244114e7 nav alpha (#39066) 2026-10-20 02:19:24 +00:00
firestar5683 b95da836d4 Recognize recorded Ioniq 5 PE firmware exactly 2026-10-19 21:18:36 -05:00
firestar5683 5c6121e691 Restore Ioniq 6 Reboot Lateral Control 2026-10-19 21:16:21 -05:00
firestar5683 8ebda2b25a Update Device Build 2026-10-19 20:59:34 -05:00
firestar5683 100b077dc7 Isolate Chestnut Startup Fallback 2026-10-19 20:57:30 -05:00
firestar5683 7cc4472f6c Fix Volt lateral intent and lag takeover alerts 2026-10-19 20:39:49 -05:00
firestarsdog fdc8b5469a Large UI Selectors 2026-10-19 21:28:27 -04:00
whoisdomi f6e833f8df Joystick Mode Refresh
Allows driving with AOL or full engagement.
Adds joystick_probe.py to put in new controllers.
Added stock, Xbox, and Stadia controller support.
2026-10-19 18:42:48 -05:00
firestar5683 3e5f95f6fe Update Device Build 2026-10-19 17:26:05 -05:00
firestar5683 6b39253b4c Refresh Steering Replay References 2026-10-19 17:24:06 -05:00
firestar5683 5521e6aafe Restore CI Fixtures 2026-10-19 17:24:05 -05:00
Dom f0c0e79611 test: qualify Galaxy lane fixtures and narrow UI request 2026-10-19 17:04:05 -05:00
firestar5683 3a815cfdd4 Update Device Build 2026-10-19 16:19:19 -05:00
firestar5683 2070075016 Legacy Recording Cleanup 2026-10-19 16:16:22 -05:00
firestar5683 bea3b340c9 Global Feature Availability 2026-10-19 16:16:22 -05:00
firestarsdog fdd6627985 fix(slc): prevent MAX decreases from releasing the speed-limit cap 2026-10-19 15:51:11 -04:00
Prabhaav Pillai a8efc82ede Update touch-action property for gx-slider to enable vertical panning 2026-10-19 15:26:22 -04:00
firestar5683 4197abe0bb Update shipped artifacts 2026-10-19 13:05:13 -05:00
firestar5683 6a7b57c7b4 Use Model Lead Trajectories 2026-10-19 13:01:45 -05:00
firestar5683 f18f051208 Update shipped artifacts 2026-10-19 12:19:58 -05:00
firestar5683 ce91cd69f3 Restore Radar Scheduling 2026-10-19 12:18:47 -05:00
Prabhaav Pillai 1dbc70b8bc Fix iPhone focus zoom on Galaxy text inputs 2026-10-19 13:15:19 -04:00
firestar5683 337bb07540 Update shipped artifacts 2026-10-19 12:00:20 -05:00
firestar5683 47e1e72ad2 Preserve feature configuration contracts 2026-10-19 11:58:55 -05:00
tsk-go 79fdeb4915 toyota: AOL for SecOC Sienna 2026-10-19 11:58:55 -05:00
firestar5683 134152d736 Update shipped artifacts 2026-10-19 11:38:34 -05:00
firestar5683 69908c78f2 Merge Jetlink shared integration 2026-10-19 11:37:20 -05:00
firestar5683 5b62c299d3 Update shipped artifacts 2026-10-19 11:09:59 -05:00
firestar5683 72b01a0ff1 Qualify GM Cancel Safety 2026-10-19 11:08:30 -05:00
firestar5683 6dbb2a8cc4 Update shipped artifacts 2026-10-19 10:44:18 -05:00
firestar5683 7d145ee952 Enable Global Driving Features 2026-10-19 10:42:53 -05:00
firestar5683 90dde04655 Update shipped artifacts 2026-10-19 10:15:38 -05:00
firestar5683 2106e717da Restore GM Cancel Remapping 2026-10-19 10:14:04 -05:00
firestar5683 13d7b725b9 lane centering release 2026-10-19 09:24:04 -05:00
firestar5683 6bc6a51493 Update shipped artifacts 2026-10-19 09:13:56 -05:00
firestar5683 e0499536f1 Handle GM native longitudinal withdrawal 2026-10-19 09:13:01 -05:00
firestar5683 29b4900511 Update shipped artifacts 2026-10-19 08:51:47 -05:00
firestar5683 675059464f Follow GM Cruise Main for AOL 2026-10-19 08:50:43 -05:00
firestar5683 c5d38f5e90 Update shipped artifacts 2026-10-19 02:22:35 -05:00
firestar5683 1751f88386 Allow Full Module Test Completion 2026-10-19 02:21:36 -05:00
firestar5683 1e26174465 Update shipped artifacts 2026-10-19 01:51:58 -05:00
firestar5683 9f58a09e0c Correct Replay Reference Spelling 2026-10-19 01:50:54 -05:00
firestar5683 0c2918d8be Merge SLC Regression Tests 2026-10-19 01:44:19 -05:00
firestar5683 21ea2142b1 Update shipped artifacts 2026-10-19 01:42:47 -05:00
firestar5683 448b6872fb Refresh Rivian Replay Reference 2026-10-19 01:39:48 -05:00
firestarsdog 584751c5cf test(slc): Guard C4 rejection and timeout dismissal 2026-10-19 02:32:17 -04:00
firestar5683 b0bcc06d3e Update shipped artifacts 2026-10-19 01:13:41 -05:00
firestar5683 6eebb5c753 Reject Mixed Subaru Firmware 2026-10-19 01:12:46 -05:00
firestar5683 05534dc748 Merge remote-tracking branch 'origin/SecretGoodStarPilot' into SecretGoodStarPilot 2026-10-19 00:56:07 -05:00
firestar5683 c879896cb3 Update shipped artifacts 2026-10-19 00:55:30 -05:00
Dom 03117097dc test: align Galaxy offset range with band-safe minimum 2026-10-19 00:54:53 -05:00
firestar5683 e852b445ed Merge remote-tracking branch 'origin/SecretGoodStarPilot' into SecretGoodStarPilot 2026-10-19 00:53:31 -05:00
firestar5683 8cdf14b1b7 Update shipped artifacts 2026-10-19 00:53:04 -05:00
firestar5683 23ba84eab4 Repair Volvo Safety Qualification 2026-10-19 00:47:35 -05:00
firestar5683 5968a0620e Restore Subaru Firmware Recognition 2026-10-19 00:47:35 -05:00
firestar5683 3a8dbe75f1 Repair CI Contracts 2026-10-19 00:47:35 -05:00
firestar5683 73003793a0 Preserve Cereal Fork Compatibility 2026-10-19 00:47:34 -05:00
firestarsdog 81a330c55b SLC: Fix offset safety, retention, and UI 2026-10-19 01:28:28 -04:00
firestarsdog 6fba491e77 SLC: Preserve set-speed override through accelerator use 2026-10-19 00:35:46 -04:00
firestar5683 503e15c9c0 Update shipped artifacts 2026-10-18 23:24:10 -05:00
firestar5683 54f17d67de Update shipped artifacts 2026-10-18 23:23:25 -05:00
firestar5683 7a395da55e Show Auto Learn Results 2026-10-18 23:23:25 -05:00
firestarsdog ecfda508ef SLC: Unify Vision confirmation behavior 2026-10-19 00:19:05 -04:00
firestarsdog 1ef8cafbdf SLC Confirmations Fixes 2026-10-18 23:43:12 -04:00
firestarsdog c2f46fd534 Center Reverse Gear Text 2026-10-18 22:56:34 -04:00
firestarsdog c68fa22202 Replay Compact UI Cleanup 2026-10-18 22:14:44 -04:00
firestarsdog 8d3b10cb60 SLC : Accept/Reject All Sources Fix 2026-10-18 21:28:02 -04:00
firestar5683 a9f202ebe6 Update shipped artifacts 2026-10-18 20:26:34 -05:00
firestar5683 fa0b381766 Report FLM fitting readiness 2026-10-18 20:25:18 -05:00
firestar5683 5c5b96efc4 Update shipped artifacts 2026-10-18 20:17:21 -05:00
firestar5683 3d2fa5f7c0 Validate FLM directional evidence 2026-10-18 20:17:20 -05:00
Dom 87fa4f76fa Repair FLM evidence fixture and atomic test port publication 2026-10-18 20:06:18 -05:00
firestar5683 a87e0bbcf3 Update shipped artifacts 2026-10-18 20:00:00 -05:00
firestar5683 5b57fbc2e2 Align FLM request targets 2026-10-18 20:00:00 -05:00
Dom aecb9076a4 Type Galaxy updater test setup receiver 2026-10-18 19:52:25 -05:00
firestar5683 65bfdcbb1b Update shipped artifacts 2026-10-18 19:08:18 -05:00
firestar5683 2313062052 Reset interrupted Galaxy updates 2026-10-18 19:07:13 -05:00
Dom 14b39b2f2b Align new FLM and startup test fixture types 2026-10-18 19:06:28 -05:00
firestar5683 ea51848a1f Update shipped artifacts 2026-10-18 18:52:34 -05:00
firestar5683 5e1056c103 Fix Palisade takeover startup 2026-10-18 18:44:03 -05:00
firestar5683 7e1e99025d Update shipped artifacts 2026-10-18 18:31:46 -05:00
firestar5683 6ce281bf5f Fix FLM evidence and proposal lifecycle 2026-10-18 18:30:31 -05:00
firestarsdog dc266eea96 Simplify replay UI for easier route selection and playback 2026-10-18 19:25:14 -04:00
Zeph Leggett 4f7ff0a4d3 Jetlink adapter checks and guide
jetlink's own kit checks the adapter module and modeld's hook order. Tests cover in_control with AOL armed and paused, the driving warp jetlink runs, and the catalog runner's history reset on tinygrad keeping its buffers. JETLINK.md describes the stay-engaged hand-back and the cable rule.
2026-10-18 16:18:43 -05:00
Zeph Leggett acde83a0a8 Galaxy Jetlink status from jetlink
The Jetlink card's state, activity and running model come from jetlink's Status (phase, active, running, running_sha256, running_checkpoint), so StarPilot no longer derives them. A build in progress reads preparing, with its line below.
2026-10-18 16:18:38 -05:00
Zeph Leggett ce766c0668 Stay engaged when Jetlink hands back
A Jetlink hand-back while engaged soft-disabled with Big Model Failed and
"Restart the car to retry", although the small model drives on and Jetlink
retries in seconds. Now nothing disengages: a Big Model Lost warning shows
for 5 s. A native chestnut's loss still raises Big Model Failed.

jetlink's swap events also refuse engaging for the second after a swap
(bigModelLoading) and hold the comm and localizer errors the swap's dropped
frame raises, as a chestnut load does. In control is the rule the swap
itself waits on (openpilot, or AOL armed or paused), and a gap in modeld's
runtime record holds the last state instead of reading as a switch.

The warning is a selfdrived alert, like aolAvailability: no new
OnroadEvent, so cereal and schema-policy.json are unchanged.
2026-10-18 16:18:37 -05:00
Zeph Leggett 9a7f3d4174 Jetlink offroad alert and optional owner
- jetlinkd is ancillary: a dead owner sends the drive back to the small
  model and no longer blocks engaging
- a crashed owner now restarts, as porting.md asks
- Offroad_JetlinkUnavailable says why a Jetlink the user turned on cannot
  run (jetlink's reason())
- JetlinkBigModel, JetlinkCatalog and JetlinkRuntime are no longer used

params_keys.h changed: libparams_c.so, libcommon.a and the prebuilt
manifest need regenerating with the prebuilt build. Until then the
tracked params library does not know Offroad_JetlinkUnavailable, so
hardwared skips that alert (logged once) and it stays inert.
2026-10-18 16:18:37 -05:00
Zeph Leggett af96e527d7 Jetlink runs modeld's driving warp
jetlink runs the driving_warp pickles modeld already ships, so its own warp build, the four jetlink_warp pickles and their QCOM import and validation go.
2026-10-18 16:18:37 -05:00
Zeph Leggett 4c1f9a0205 Jetlink host is not a chestnut
cable_connected() is true for any host on the USB-C port. With a Chestnut pick downloaded and Jetlink on, every drive waited 10 s for a chestnut, raised Big Model Failed and left Jetlink unattached. The cable now counts only with Jetlink off.
2026-10-18 16:18:37 -05:00
Zeph Leggett ca183df497 Jetlink API 3 adapter
StarPilotAdapter subclasses jetlink's Stock: StarPilot's param names, the
AOL engagement rule, the model root and a CatalogModelState history reset
that keeps its JIT buffers. jetlinkd runs jetlink's owner as it is, modeld
calls the hooks, and Galaxy and analytics read jetlink's runtime record in
place of JetlinkRuntime.

- no big-model slot or catalog keys: jetlink provisions its default model
- jetlink restores the owner's tuning itself; the port draw stays cut with
  a host plugged in
- the Jetson is asked to power off on DoShutdown only, capped at 30 s
2026-10-18 16:18:37 -05:00
Zeph Leggett de40ad2ff1 Jetlink d24328d
Vendor only the comma payload jetlink commits to (jetlink/, LICENSE,
pyproject.toml, README.md) with an include list, so the exclude list goes
and upstream's README stays as published; StarPilot's notes live in
JETLINK.md. The root helper now ships inside the package.

The adapter moves to API 3 in the next commit; until then Jetlink stays
off.

d24328d stands in for the jetlink release tag commit: re-run
tools/vendor/sync.py jetlink_repo <tag commit> --apply before merging and
update the revision in CREDITS.md and JETLINK.md with it.
2026-10-18 16:18:37 -05:00
Zeph Leggett 31840b07d7 Vendor include lists 2026-10-18 16:16:19 -05:00
firestarsdog 4f45d7995a Rebuild replay 2026-10-18 16:23:43 -04:00
firestarsdog ece0db0788 Overlap replay seek preparation and release old log buffers early 2026-10-18 15:47:34 -04:00
Dom fe2cc2aa9f Type synthetic FLM storage fixture tokens precisely 2026-10-18 14:44:11 -05:00
firestar5683 b04bbb55cb Update shipped artifacts 2026-10-18 14:13:17 -05:00
firestar5683 ab30a5992a Fix FLM training collection 2026-10-18 14:11:45 -05:00
firestarsdog 3f838298fb Rebuild replay runtime assets 2026-10-18 11:35:46 -04:00
firestarsdog 4b582f53d5 Index replay logs from owned buffers 2026-10-18 11:30:39 -04:00
firestar5683 604cf77110 Update shipped artifacts 2026-10-18 10:14:51 -05:00
firestar5683 0d1b42c306 Correct Palisade stock status relay ownership 2026-10-18 10:14:02 -05:00
firestar5683 b236266235 Update shipped artifacts 2026-10-18 10:12:29 -05:00
firestar5683 697c41b33c Restore GM native health compatibility 2026-10-18 10:11:04 -05:00
Dom 03a1bc5823 Detect loaded native variant in Hyundai join tests 2026-10-18 03:45:06 -05:00
Dom dabd6fe8bf Fix Hyundai cancellation test fixture typing 2026-10-18 03:11:04 -05:00
firestar5683 a37e6b3008 Update shipped artifacts 2026-10-18 02:57:06 -05:00
firestar5683 60e973fff8 Preserve Hyundai lateral intent on cruise cancel 2026-10-18 02:56:07 -05:00
Dom c09f4ba8ff Use RAM media layout in HTTP server test fixture 2026-10-18 01:34:10 -05:00
firestar5683 8efab94dab Update shipped artifacts 2026-10-18 01:30:59 -05:00
firestar5683 94f9c4c68d Keep inactive Prius longitudinal commands neutral 2026-10-18 01:29:32 -05:00
TonyJOM 69b71dcad8 Restore Rivian torque handshake 2026-10-18 01:29:31 -05:00
firestar5683 cebaaaba05 Update shipped artifacts 2026-10-18 01:01:00 -05:00
firestar5683 d25d9bdfe3 Reject incomplete replay route scans 2026-10-18 01:00:03 -05:00
firestar5683 e94a9b8e2f Merge current performance updates 2026-10-18 00:49:16 -05:00
firestar5683 3aa6349a95 Update shipped artifacts 2026-10-18 00:47:52 -05:00
firestar5683 aa5591e840 Fix Ascent cancel cadence and dash state 2026-10-18 00:43:59 -05:00
prabhaavp 5ed2019e4c Merge pull request #227 from dirwin31:Stardust-PR-11
Download More Ram (And Other Fixes)
2026-10-18 01:41:35 -04:00
firestar5683 a1402646b4 Restore MQB vehicle settings 2026-10-18 00:41:06 -05:00
Prabhaav Pillai 8f34f5fb18 AA projection and SLC action handling with improved state management and viewport adjustments 2026-10-18 01:40:04 -04:00
Danny 71a11f8396 Update Tests for New Optimizations 2026-10-18 01:40:04 -04:00
Danny 3a770b3ab2 Download More Ram
(cherry picked from commit f3df89cc99ea9b28ca83c717f4ceee822ab7854f)
2026-10-18 01:40:04 -04:00
Danny 260ce7e7f1 SLC: Keep source readings while no limit is known
(cherry picked from commit 70eb9232a705f516a2281ae2d0d14a061989de52)
2026-10-18 01:40:04 -04:00
Danny 29e594d3d4 Android Auto: Toggle experimental mode from the car screen whatever the comma screen shows
(cherry picked from commit 918d7385ab6e9fd680af7bd1ab111de479b920e4)
2026-10-18 01:40:04 -04:00
dirwin31 50e27971e1 SLC: Hide Use limit after applying rounded set speed
(cherry picked from commit 6efa78bf74184cf85ff3f0a2705fc5b2e3c87ee0)
2026-10-18 01:40:04 -04:00
Danny 182552b3f4 Android Auto: Fix steering wheel tap target on car screen
(cherry picked from commit e5e44179132aa1ff83dcd22b8a8b6345ee674d6d)
2026-10-18 01:40:04 -04:00
Danny bc06785c36 Mapd: Keep loaded tile when GPS fix expires
(cherry picked from commit dce32f4698e31194162657124b23fd18131626be)
2026-10-18 01:39:54 -04:00
Danny 7fc51eeb16 Mapd: Limit CPU usage
(cherry picked from commit 78e083b2afe460b17cb82ad9d21d9d83103b62e3)
2026-10-18 01:39:54 -04:00
Danny 669001e842 Mapd: Speed up road matching
(cherry picked from commit dda07c64af3c6f027125f25f09e26c61bd445519)
2026-10-18 01:39:54 -04:00
dirwin31 a3844c8378 Android Auto: Pin renderer and daemon threads to core 6
(cherry picked from commit f1ab156b331788ff64ac6408d547b74b54741262)
2026-10-18 01:39:54 -04:00
dirwin31 f998483d1a Selfdrived: Throttle Chestnut status parameter reads to 10 Hz
(cherry picked from commit e2168a5fb9ff2beee8631de4f5705b6900d6c797)
2026-10-18 01:39:54 -04:00
Danny f2fccf054a Android Auto: Fix experimental mode taps 2026-10-18 01:39:54 -04:00
dirwin31 d1beeffbc2 SLC: Keep nav directions and sources up, hide redundant Use limit 2026-10-18 01:39:54 -04:00
dirwin31 f413e0f089 SLC: Show limits in other modes 2026-10-18 01:39:54 -04:00
firestarsdog 6616df50e5 Rebuild replay runtime assets 2026-10-18 01:35:36 -04:00
firestarsdog b827d2317a Decode Zstd replay logs directly in C++ and store Galaxy media in RAM 2026-10-18 01:35:12 -04:00
firestar5683 358da422b9 Update shipped artifacts 2026-10-18 00:32:22 -05:00
firestar5683 4a07f81a0c Merge current Galaxy updates 2026-10-18 00:30:12 -05:00
firestar5683 cb3c6d756c Update shipped artifacts 2026-10-18 00:29:41 -05:00
firestar5683 8c437bc11b Retain Mazda AOL after cruise engagement 2026-10-18 00:28:34 -05:00
firestar5683 5e73e8c76b Restore Honda AOL lane indicators 2026-10-18 00:28:28 -05:00
Prabhaav Pillai f4a4d86cf3 Galaxy update reconnect flow, restart-only blurred background, mathematically centered squircle Galaxy logo, and SVG-derived browser icons. 2026-10-18 01:28:13 -04:00
Prabhaav Pillai 44755c7cf7 Refactor ambient stars logic and improve CSS for stability and performance 2026-10-18 01:28:13 -04:00
Dom 60d02accce Type GPS binary fixture numeric fields 2026-10-18 00:12:40 -05:00
firestar5683 d6f66df19d Update shipped artifacts 2026-10-18 00:05:55 -05:00
firestar5683 ac6c27d1ed Merge qualified Volt test correction 2026-10-18 00:01:10 -05:00
firestar5683 15ac04a8ea Update shipped artifacts 2026-10-17 23:59:28 -05:00
firestar5683 5ab25a2d52 Publish QCOM GPS horizontal accuracy 2026-10-17 23:58:04 -05:00
Dom e039fe2d25 Align Volt test with qualified CC source signature 2026-10-17 23:55:46 -05:00
firestar5683 4d7e22dec7 Update shipped artifacts 2026-10-17 23:49:29 -05:00
firestar5683 d34b63efde Merge current CI fixture corrections 2026-10-17 23:47:38 -05:00
firestar5683 818ee972a9 Update shipped artifacts 2026-10-17 23:46:58 -05:00
firestar5683 e4ec6c1a14 Guard Volt CC pedal discovery against partial camera layouts 2026-10-17 23:45:58 -05:00
Dom 2d7f394b23 Type new FLM replay test fixtures precisely 2026-10-17 23:44:58 -05:00
firestar5683 9a7ed2007e Update shipped artifacts 2026-10-17 23:34:50 -05:00
firestar5683 2c5c0902ad Restore qualified Volt CC discovery 2026-10-17 23:33:39 -05:00
firestar5683 59c19c6727 Match Bolt pedal gear freshness to Panda 2026-10-17 23:30:41 -05:00
firestar5683 7139f08a9c Update shipped artifacts 2026-10-17 23:27:42 -05:00
firestar5683 07adfe819e Complete FLM learning pipeline 2026-10-17 23:26:55 -05:00
Dom be35d9b557 Test canonical CEM gauge rendering after shared UI cleanup 2026-10-17 22:15:38 -05:00
firestar5683 e127fd9803 Update shipped artifacts 2026-10-17 21:43:45 -05:00
firestar5683 ac0527c443 Handle native longitudinal withdrawal 2026-10-17 21:42:58 -05:00
firestar5683 628efa6f2d Update shipped artifacts 2026-10-17 21:26:30 -05:00
firestar5683 da24e32836 Reduce learner memory retention 2026-10-17 21:23:30 -05:00
firestar5683 15140e8563 Update shipped artifacts 2026-10-17 20:46:31 -05:00
firestar5683 5b12042b88 Fix lateral learning intake 2026-10-17 20:02:38 -05:00
firestar5683 52c31d0c47 Fix shared CEM and camera selection 2026-10-17 20:02:38 -05:00
Dom 49d15fc31e Clarify pytest failure callable in Volvo lifecycle test 2026-10-17 19:41:37 -05:00
Dom d2b821e66c Supply native receipt metadata in lateral test fixtures 2026-10-17 19:23:49 -05:00
Dom ec84548e85 Restore Volvo safety coverage and correct new test fixtures 2026-10-17 19:20:08 -05:00
firestar5683 7357d6a54c Update shipped artifacts 2026-10-17 18:41:37 -05:00
firestar5683 2cd7728be2 FLM Auto-Weave 2026-10-17 18:38:27 -05:00
firestar5683 f7cfc08a8c Galaxy ignition option 2026-10-17 18:33:42 -05:00
firestar5683 51ceedd551 Volvo and Polestar parity 2026-10-17 18:33:41 -05:00
firestarsdog 96eef9c2af Feather Pagination Edges 2026-10-17 18:09:49 -04:00
Dom 0d02b9d213 Fix training report test context types 2026-10-17 11:50:34 -05:00
firestar5683 9015091839 Preserve FLM maneuvers and camera selection 2026-10-17 11:12:51 -05:00
firestar5683 198a9fca63 FLM Training Results 2026-10-17 10:53:16 -05:00
firestarsdog 1edc24f3ed On Device Replay : Butternova 2026-10-17 06:34:08 -04:00
firestarsdog 537a14eed7 Speed up on-device replay seeking and reduce memory use 2026-10-17 03:58:07 -04:00
firestarsdog 0fad40f5fc Replay in ram to avoid disk i/o hangs 2026-10-17 00:58:34 -04:00
firestarsdog a97c1a5779 Dynamic Wheel Icons (Both UI) 2026-10-16 23:42:56 -04:00
firestarsdog a5044afa16 Large UI Temp Offroad 2026-10-16 22:46:22 -04:00
firestarsdog cd75895ffc Numerical temp with dynamic unit 2026-10-16 22:31:12 -04:00
firestarsdog a8d307f3da Smooth wheel colors 2026-10-16 22:31:12 -04:00
firestarsdog e4e30e14fc Fix Build 2026-10-16 20:15:13 -04:00
firestarsdog 192729eb8d Freeze Galaxy stars during routes playback 2026-10-16 19:48:08 -04:00
firestarsdog 8803a39d69 Routes + Replay Cleanup 2026-10-16 19:21:21 -04:00
Dom 571099b369 Correct fit-reporting physical-context test fixtures
Use the existing four-field context shape while preserving the calibration-change scenario and all assertions. Refresh the canonical source receipt.
2026-10-16 18:11:08 -05:00
firestar5683 771b118b81 Volt Regret 2026-10-16 17:30:18 -05:00
firestar5683 53309097e9 Fix Auto Learn collection renewal 2026-10-16 17:21:48 -05:00
whoisdomi 9910159990 Takeoff standstill tweak 2026-10-16 15:59:05 -05:00
Dom a8addf3f32 Repair wired Android Auto CI prerequisites
Install the pinned H.264 test encoder in the unit-test environment and align the UI contract test with existing wired support. Preserve runtime code, timeouts, and ownership gates.
2026-10-16 15:44:16 -05:00
Dom 397ab7ae9d Fix Android Auto and lane-strength CI typing
Preserve existing USB behavior while typing test doubles and the diagnostic log proxy. Correct prose spelling and the existing CLI executable mode. Add proxy forwarding coverage and refresh the canonical source receipt.
2026-10-16 15:36:34 -05:00
whoisdomi 85e3222810 Improve profile-limited takeoffs
Adapt PR #226 stationary lead release and breakaway to the global Faster Takeoffs toggle. Preserve strict freshness, committed-stop clearance, selected acceleration profiles and planner bounds. PR #218 launch admission is already implemented through the same optional path.
2026-10-16 15:12:22 -05:00
firestar5683 65b349b24d Align lane centering strength displays 2026-10-16 15:08:28 -05:00
prabhaavp dce1fa4222 Merge pull request #223 from dirwin31/RemoveVerifyHeadUnit
Remove Verify Head Unit
2026-10-16 15:57:00 -04:00
prabhaavp f303ad56ce Merge pull request #222 from dirwin31:SGSP-Wired
Revive Wired AA
2026-10-16 15:44:52 -04:00
Prabhaav Pillai 356bf46d83 AA connection handling and improve UI messaging for wired connections 2026-10-16 15:44:38 -04:00
Dom c7b6c25d3c Include carParams in shared device-state test fixture 2026-10-16 13:36:37 -05:00
Dom 2d4eaba8f6 Clarify startup interface and EV6 test types 2026-10-16 13:29:17 -05:00
Danny be42c0a610 Test That Verufy Stays off 2026-10-16 11:21:55 -07:00
firestar5683 e62a51821d Auto Print Population 2026-10-16 13:09:27 -05:00
firestar5683 4fa668d81a EV6 mismatch 2026-10-16 12:56:52 -05:00
Danny 33e8f54c7f Change default head unit verification to false and bump config version to 5 2026-10-16 10:53:18 -07:00
firestar5683 89430a70da Fix GM AOL main rearm 2026-10-16 12:03:17 -05:00
Dom 9de940e9c8 Fix spelling in lateral delay comment 2026-10-16 10:31:37 -05:00
firestar5683 3778552160 FLM Auto-Weave
Interpolate the measured Ioniq 6 steering delay instead of rounding delayed model requests to whole frames. Bound unsaturated friction growth without exceeding the current requested component or retaining its old direction; preserve full breakaway response, saved tunes and native limits. Cover actual Controls, replay state and controller timing.
2026-10-16 10:27:11 -05:00
dirwin31 bb514b6f0b Add wired android auto back in, gate behind no jetlink and no chestnut 2026-10-16 07:51:20 -07:00
firestar5683 abb9646499 FLM Calibration Lifecycle
Keep bounded automatic learning collection through valid live calibration refinements. Retire generations on resets or invalid calibration, preserve live physical transforms and existing controller tunes, and validate fitted coefficient bounds before publication. Exercise the current controller and historical wire paths.
2026-10-16 09:47:39 -05:00
firestar5683 7e63c553a4 FLM Auto-Weave 2026-10-16 08:46:39 -05:00
firestar5683 63008e9480 Resume AOL Latch Upon Exit 2026-10-16 08:37:07 -05:00
Dom 1e1120316f Clarify radar projection types without changing behavior 2026-10-16 08:31:08 -05:00
firestar5683 fab8b79c8c AOL Latch Publication 2026-10-16 08:27:54 -05:00
Dom eb151c76b1 Handle process exit race in replay parent-death test 2026-10-16 08:23:02 -05:00
firestar5683 40e0f1f2a9 Controls Loop Optimizations 2026-10-16 08:13:10 -05:00
firestarsdog e982987197 Arabesque 2026-10-16 08:40:20 -04:00
firestarsdog 9db921b585 Replay Decoder Optimization 2026-10-16 04:51:00 -04:00
firestarsdog f09a61bd34 Freeze Galaxy stars on dialog open 2026-10-16 02:47:08 -04:00
firestar5683 01fd37fa75 Prebuilt runtime artifacts
Ship generated artifacts matching the source tree.
Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: Ian <ianpang126@gmail.com>
Co-authored-by: Intelli <contact@intelli.software>
Co-authored-by: pharmacomaniac <blittle65@gmail.com>

Co-authored-by: prabhaavp <prabhaav@msu.edu>
Co-authored-by: whoisdomi <dcantu83@gmail.com>
2026-10-14 20:02:39 -05:00
firestar5683 200632aabd StarPilot Auto Learn
Learn bounded feed-forward corrections on eligible torque controllers behind Use StarPilot Auto Learn, preserving installed tunes and native safety limits.
Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: Intelli <contact@intelli.software>
Co-authored-by: haraschax <6804392+haraschax@users.noreply.github.com>
Co-authored-by: pharmacomaniac <blittle65@gmail.com>

Co-authored-by: whoisdomi <dcantu83@gmail.com>
2026-10-14 20:02:39 -05:00
firestar5683 80fbb4f6db Feature registration
Register vehicle controls, planner modes, UI actions and Galaxy services after their providers exist. Wire the shared runtime entrypoints and cover their combined behavior.

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: DimitriChrysafis <Dimitri.chrysafis@gmail.com>
Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com>
Co-authored-by: Kacper Rączy <gfw.kra@gmail.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
Co-authored-by: stef <19478336+stefpi@users.noreply.github.com>
Co-authored-by: whoisdomi <dcantu83@gmail.com>

Co-authored-by: Intelli <contact@intelli.software>
Co-authored-by: haraschax <6804392+haraschax@users.noreply.github.com>
Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 20:02:39 -05:00
firestar5683 8cea672429 Drive Statistics
Implement background drive analysis and statistics with explicit worker and persistence ownership.

Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
2026-10-14 20:02:39 -05:00
firestar5683 1a67eedd00 Learning UI
Expose fleet-learning operations through Galaxy presentation endpoints.

Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
2026-10-14 20:02:39 -05:00
firestar5683 5deb059c54 Learning Workers
Process drive evidence and fit bounded steering profiles off the controls loop.
2026-10-14 20:02:39 -05:00
firestar5683 28b8974301 Drive History
Expose drive history summaries and plot data through Galaxy.

Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
2026-10-14 20:02:39 -05:00
firestar5683 a82935f326 User interfaces and Android Auto
Integrate onroad views, configurable widgets, local settings, steering-profile contracts, Bluetooth and Android Auto with their device and runtime services.

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: DimitriChrysafis <Dimitri.chrysafis@gmail.com>
Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
Co-authored-by: stef <19478336+stefpi@users.noreply.github.com>
Co-authored-by: whoisdomi <dcantu83@gmail.com>

Co-authored-by: Intelli <contact@intelli.software>
Co-authored-by: pharmacomaniac <blittle65@gmail.com>

Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 20:02:39 -05:00
firestar5683 9d298304c3 Vision
Implement vision annotation observations, inference and preferences through a dedicated runtime owner.
2026-10-14 20:02:39 -05:00
firestar5683 8b254da432 Runtime Dependencies
Extend vendored runtime helpers and diagnostics while preserving the existing compiler and model ABI.
2026-10-14 20:02:39 -05:00
firestar5683 9e94f56921 Native protocol adapters
Connect native axis transport and acknowledgments, with regression coverage for the joined protocol paths.

Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
2026-10-14 20:02:39 -05:00
firestar5683 fc73a3383e Planner Wiring
Wire longitudinal feature selection and inputs into planner hosts after their owners are available.

Co-authored-by: Danny <dannyirwin31@yahoo.com>

Co-authored-by: whoisdomi <dcantu83@gmail.com>
2026-10-14 20:02:39 -05:00
firestar5683 fd4ca85d61 Audio
Provide alert playback and volume control with a native audio callback that does not depend on the Python GIL.

Co-authored-by: Daniel Koepping <elkoled@gmail.com>
2026-10-14 20:02:39 -05:00
firestar5683 8571e16f68 Runtime AOL
Register vehicle AOL adapters and runtime dispatch after the vehicle factories and native contracts exist.

Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>

Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 20:02:39 -05:00
firestar5683 f71daaf60f Volvo
Add the Volvo C1 port with matching Python registration and exact native parameter admission.

Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
2026-10-14 20:02:39 -05:00
firestar5683 fb465d8f24 Volkswagen
Update Volkswagen vehicle identification and parameter coverage.

Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: Ian <ianpang126@gmail.com>
2026-10-14 20:02:39 -05:00
firestar5683 6c32c9fff2 Vehicle Preferences
Resolve startup preferences and controller extensions through capability-aware vehicle owners.
2026-10-14 20:02:39 -05:00
firestar5683 7f3b68f0a8 Toyota
Update Toyota ADAS messages and control interfaces with platform-specific safety tests.

Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>

Co-authored-by: pharmacomaniac <blittle65@gmail.com>
2026-10-14 20:02:39 -05:00
firestar5683 d5b0c26f91 Tesla
Add Tesla HW1 and supported namespace handling with explicit native admission and unknown-bit rejection.
2026-10-14 20:02:39 -05:00
firestar5683 718dffaf3d Subaru
Update Subaru vehicle messages and controller/native safety integration.
2026-10-14 20:02:39 -05:00
firestar5683 e4f3d6661c Longitudinal
Implement acceleration profiles, FollowJerk, force-stop and lead-departure owners. Keep selected acceleration limits and hazard arbitration explicit at their shared boundaries.

Co-authored-by: whoisdomi <dcantu83@gmail.com>
2026-10-14 20:02:39 -05:00
firestar5683 999665ca1c Vehicle Policy
Select longitudinal policy through the shared vehicle dispatch contract.
2026-10-14 20:02:39 -05:00
firestar5683 5ef0a37fb8 Mazda
Update Mazda vehicle interface behavior with focused stock-control tests.
2026-10-14 20:02:39 -05:00
firestar5683 79c8945a41 Lateral
Integrate torque feedback, lane-change smoothing and low-speed Turn Assist through dedicated lateral owners.

Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>

Co-authored-by: pharmacomaniac <blittle65@gmail.com>
2026-10-14 20:02:39 -05:00
firestar5683 8f132013d2 Navigation UI
Expose map operations and status through Galaxy presentation endpoints.

Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
2026-10-14 20:02:39 -05:00
firestar5683 3e9f070c70 Curve Speed
Resolve curve speed and smoothing through a dedicated learning and preference owner.

Co-authored-by: whoisdomi <dcantu83@gmail.com>
2026-10-14 20:02:39 -05:00
firestar5683 fda22037d7 Wheel Controls
Route controller input and cruise actions through shared transport and mode-action owners.

Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
2026-10-14 20:02:39 -05:00
firestar5683 d8708b65c7 CEM
Implement conditional driving modes with explicit scene, button and traffic state ownership.

Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com>
Co-authored-by: whoisdomi <dcantu83@gmail.com>
2026-10-14 20:02:39 -05:00
firestar5683 58427d61d9 SLC
Select qualified speed-limit sources, preserve acceptance and override decisions, and publish distinct control and display coordinates. Carry accepted and pending source identity with each displayed decision.

Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
2026-10-14 20:02:39 -05:00
firestar5683 9a16e8e922 Nostalgia
Add the optional nostalgia behavior as an isolated feature owner.
2026-10-14 20:02:39 -05:00
firestar5683 2b1152adf7 Hyundai
Integrate vehicle-specific steering, longitudinal control, startup, and handoff policies, including Ioniq, EV9, GV70, and non-SCC configurations. Preserve the corresponding native safety and CAN routing contracts.

Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: Intelli <contact@intelli.software>
2026-10-14 20:02:39 -05:00
firestar5683 cf21c9729f Honda
Integrate Honda steering and AOL adapters with platform-specific native safety coverage.

Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
2026-10-14 20:02:39 -05:00
firestar5683 7da43d01e8 GM AOL
Apply the GM host AOL policy after its control families and capabilities are available.
2026-10-14 20:02:39 -05:00
firestar5683 34334f26d2 Ford
Provide curvature and optional BluePilot angle controllers for supported Ford configurations, with per-Panda transport and native safety hooks.
2026-10-14 20:02:39 -05:00
firestar5683 d705dffb1f Chrysler
Update Chrysler vehicle parameters and controller behavior with focused platform tests.
2026-10-14 20:02:39 -05:00
firestar5683 694b460f80 Developer Tools
Provide laptop and device build entry points, cache compatibility checks and developer tooling. Keep distribution assets and model packaging available before runtime consumers.

Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 20:02:39 -05:00
firestar5683 a9caa495b7 Replay Helpers
Provide UI replay and startup helpers for inspecting onroad rendering without a live drive.

Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
2026-10-14 20:02:39 -05:00
firestar5683 e9dd458699 Replay
Provide route replay, log migration and recorded vehicle fixtures for regression checks.

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: Kacper Rączy <gfw.kra@gmail.com>
Co-authored-by: YassineYousfi <yyousfi1@binghamton.edu>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
2026-10-14 20:02:39 -05:00
firestar5683 0db0d2f589 Software and AGNOS
Manage software updates and AGNOS retained state through explicit manifests and update preferences.

Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
2026-10-14 20:02:39 -05:00
firestar5683 14e42178df Sentry UI
Expose Sentry events and notification presentation through Galaxy.

Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
2026-10-14 19:56:17 -05:00
firestar5683 e52e1a6a86 Sentry
Implement Sentry scanning, notification state and worker cancellation through explicit policies and preferences.
2026-10-14 19:56:17 -05:00
firestar5683 978105ad9b Project identity and attribution
Document StarPilot setup and third-party attribution. Keep cloud authentication scoped to the selected provider.

Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2026-10-14 19:56:17 -05:00
firestar5683 c1aeddbfea Power
Manage device power, parked services and vehicle-specific Panda wake behavior.

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
2026-10-14 19:56:17 -05:00
firestar5683 ab81464bd1 Maps
Add navigation and map matching providers with the vendored map service sources.

Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
2026-10-14 19:56:17 -05:00
firestar5683 49d5b8eaff Models
Own model discovery, compilation and registry selection through explicit model metadata and geometry contracts.

Co-authored-by: whoisdomi <dcantu83@gmail.com>
2026-10-14 19:56:17 -05:00
firestar5683 fab3ec9aeb Galaxy UI
Add Galaxy web assets and client settings interfaces with their bundled vendor notices.

Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 19:56:17 -05:00
firestar5683 00364fd645 Galaxy Access
Separate Galaxy authentication and local access policy from web presentation.

Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
2026-10-14 19:56:17 -05:00
firestar5683 ef11470b30 GM
Register GM controllers, car state, distance-button actions and feature capabilities against the shared platform groups.
2026-10-14 19:56:17 -05:00
firestar5683 a5944213e4 Bolt Pedal
Implement Bolt Pedal command generation and mode selection with dedicated native safety coverage. Keep pedal actuation separate from the factory cruise families.
2026-10-14 19:56:17 -05:00
firestar5683 4ee03f74d7 Volt
Add distinct Volt, Silverado, Suburban and factory ACC control owners rather than sharing pedal assumptions across platforms.
2026-10-14 19:56:17 -05:00
firestar5683 157a93a03e Bolt Cruise
Implement Bolt cruise control with its own host and native admission gates.
2026-10-14 19:56:17 -05:00
firestar5683 438b0c2f98 GM Longitudinal
Provide shared GM longitudinal policy helpers for the vehicle-specific controllers.
2026-10-14 19:56:17 -05:00
firestar5683 5dc6ea7068 GM Contracts
Define GM platform groups, startup preferences and CAN messages before their control families are registered.

Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
2026-10-14 19:56:17 -05:00
firestar5683 751d2369c5 Drive Lifecycle
Track drive identity and evidence lifecycle so consumers reset state at the same drive boundaries.
2026-10-14 19:56:17 -05:00
firestar5683 b6c81875b0 Connect
Own Connect credentials, registration and upload preferences through shared access providers.

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
2026-10-14 19:56:17 -05:00
firestar5683 264bb5a8a8 Camera UI
Serve fresh camera snapshots with explicit image responses and expose live crop controls without placing file or camera startup work on the UI thread.

Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
2026-10-14 19:56:17 -05:00
firestar5683 1d13b9d88b Camera
Coordinate finite camera leases with manager-owned processes and reject frames that predate a request. Preserve the native frame timestamp contract across camera variants.
2026-10-14 19:56:17 -05:00
firestar5683 6d742eb343 CI
Add control trace and platform qualification tools that exercise explicit safety modes and vehicle coverage.

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: Kacper Rączy <gfw.kra@gmail.com>
Co-authored-by: YassineYousfi <yyousfi1@binghamton.edu>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>

Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 19:56:17 -05:00
firestar5683 72ef8a0dc7 Vehicle Contracts
Centralize vehicle lookup, firmware identification and dashboard limits while retaining the stock vehicle registry.

Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 19:56:17 -05:00
firestar5683 f45cc97134 AOL
Define host-to-Panda AOL intent, policy and wire contracts with neutral defaults before vehicle adapters register capabilities.

Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
2026-10-14 19:56:17 -05:00
firestar5683 ce6c209d38 Cruise Speed
Resolve cruise speed increments through a shared interval owner for consistent button behavior.

Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com>
2026-10-14 19:56:17 -05:00
firestar5683 d874c9258c Native Safety
Extend native safety and health contracts with explicit AOL state and bounded message handling. Keep vehicle-specific admissions outside the generic layer.

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2026-10-14 19:56:17 -05:00
firestar5683 5a01c2bacb Shared UI Data
Introduce shared feature settings and presentation state so both UI layouts can consume the same resolved values.

Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>
2026-10-14 19:56:17 -05:00
firestar5683 ec8d7eb98b Contracts
Define persistent settings, typed schema fields and storage migrations before feature owners consume them. Keep calibration and parameter readers aligned with the shared data contracts.

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: haraschax <6804392+haraschax@users.noreply.github.com>

Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com>
Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 19:56:17 -05:00
6404 changed files with 1261244 additions and 108362 deletions
+24 -1
View File
@@ -5,13 +5,23 @@
openpilot/selfdrive/modeld/models/big_*_tinygrad.pkl -text
*.svg -text
*.png -text
openpilot/selfdrive/assets/emoji.npz -text
*.gif -text
*.ttf -text
*.otf -text
*.woff -text
*.woff2 -text
*.wav -text
openpilot/common/timezone_grid.bin -text
openpilot/starpilot/galaxy/web/vendor/vue/vue.esm-browser.js -text
*.apk -text
openpilot/starpilot/galaxy/bin/hev-socks5-tunnel_linux_arm64 -text
openpilot/starpilot/galaxy/bin/hostapd_linux_arm64 -text
openpilot/starpilot/galaxy/bin/hostapd_cli_linux_arm64 -text
openpilot/starpilot/soloist/pulseaudio/bin/pulseaudio -text
openpilot/starpilot/soloist/pulseaudio/bin/pactl -text
openpilot/starpilot/soloist/bluealsa/bin/bluealsa-aplay -text
openpilot/starpilot/soloist/bluealsa/bin/bluealsad -text
openpilot/selfdrive/car/tests/test_models_segs.txt -text
openpilot/common/hardware/comma/updater -text
@@ -23,6 +33,7 @@ panda/** !filter !diff !merge -text
rednose_repo/** !filter !diff !merge -text
teleoprtc_repo/** !filter !diff !merge -text
tinygrad_repo/** !filter !diff !merge -text
tinygrad_model_runtime/** !filter !diff !merge -text
# Compiled model parts must retain exact binary bytes.
*.pkl.chunk* -text
@@ -32,7 +43,6 @@ tinygrad_repo/** !filter !diff !merge -text
*.a -text
*.so -text
*.so.* -text
openpilot/cereal/messaging/bridge -text
openpilot/selfdrive/pandad/pandad -text
openpilot/tools/replay/replay -text
openpilot/system/camerad/camerad -text
@@ -41,4 +51,17 @@ openpilot/system/loggerd/encoderd -text
openpilot/system/loggerd/loggerd -text
openpilot/starpilot/galaxy/bin/frpc_linux_arm64 -text
openpilot/starpilot/maps/provider/mapd -text
openpilot/tools/arabesque_firefox/offline/*.deb -text
openpilot/tools/arabesque_firefox/offline/*.tar.xz -text
openpilot/selfdrive/test/process_replay/refs/starpilot/*.zst -text
# Published Panda object files are AArch64 ELF, not text.
openpilot/selfdrive/pandad/main.o -text
openpilot/selfdrive/pandad/panda.o -text
openpilot/selfdrive/pandad/panda_safety.o -text
openpilot/selfdrive/pandad/panda_usb.o -text
openpilot/selfdrive/pandad/pandad.o -text
openpilot/selfdrive/pandad/spi.o -text
# Compressed recorded regression fixture; retain exact binary bytes.
openpilot/starpilot/tests/testdata/ford_mache_lead_departure.json.gz -text
+6
View File
@@ -0,0 +1,6 @@
github: firestar5683
patreon: firestar4430
custom:
- "https://cash.app/$domkthompson"
- "https://account.venmo.com/u/firestar4430"
- "https://www.paypal.com/paypalme/firestar4430"
+11
View File
@@ -11,6 +11,17 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Close pull requests targeting testing
if: github.repository == 'StarPilotHQ/StarPilot' && github.event.pull_request.base.ref == 'testing'
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
current=$(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json baseRefName,state --jq '.baseRefName + ":" + .state')
if [ "$current" = testing:OPEN ]; then
gh pr close "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --comment 'Please retarget this pull request to `stable` and reopen it. Maintainers publish qualified changes to `testing`.'
fi
- uses: actions/checkout@v7
# Label PRs
+25 -5
View File
@@ -5,8 +5,15 @@ on:
branches:
- master
- Domathon
- SecretGoodStarPilot
- Dom
- StarPilot
- stable
- testing
- testingupstreamsync
- dev
pull_request:
types: [opened, synchronize, reopened, edited]
workflow_dispatch:
workflow_call:
inputs:
run_number:
@@ -20,20 +27,33 @@ concurrency:
jobs:
docs:
name: build docs
permissions:
contents: read
runs-on: ${{
(github.repository == 'commaai/openpilot') &&
(github.repository == 'StarPilotHQ/StarPilot' && github.event_name == 'push' && github.ref == 'refs/heads/testing')
&& fromJSON('["self-hosted","Linux","X64","truenas","starpilot-build"]')
|| ((github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))
&& fromJSON('["namespace-profile-amd64-8x16"]')
&& fromJSON('["namespace-profile-amd64-8x16"]'))
|| fromJSON('["ubuntu-24.04"]') }}
steps:
- uses: commaai/timeout@v1
- uses: actions/checkout@v7
- run: ./tools/op.sh setup
with:
sparse-checkout: |
/docs/
/openpilot/selfdrive/assets/icons_mici/settings/comma_icon.png
sparse-checkout-cone-mode: false
- uses: actions/setup-python@v6
if: github.repository == 'StarPilotHQ/StarPilot' && github.event_name == 'push' && github.ref == 'refs/heads/testing'
with:
python-version: '3.12.13'
# Build
- name: Build docs
run: ./tools/op.sh docs --build
run: python3 docs/serve.py --build
# Push to docs.comma.ai
- uses: actions/checkout@v7
+124
View File
@@ -0,0 +1,124 @@
name: FLM offroad contracts
on:
push:
branches: [Dom, StarPilot, stable, testing, dev]
paths:
- 'openpilot/starpilot/flm/**'
- 'openpilot/starpilot/lateral/**'
- 'openpilot/starpilot/aol/**'
- 'openpilot/starpilot/galaxy/web/js/flm*.js'
- 'openpilot/starpilot/galaxy/tests/test_flm*.mjs'
- 'openpilot/starpilot/galaxy/drive_history.py'
- 'openpilot/selfdrive/controls/lib/latcontrol*'
- 'openpilot/selfdrive/controls/controlsd.py'
- 'openpilot/system/manager/process_config.py'
- 'openpilot/selfdrive/modeld/**'
- 'openpilot/system/camerad/cameras/**'
- 'openpilot/system/sensord/**'
- 'openpilot/selfdrive/locationd/**'
- 'msgq_repo/msgq/visionipc/**'
- 'rednose_repo/rednose/helpers/**'
- 'openpilot/starpilot/models/laboratory_runner.py'
- 'openpilot/starpilot/models/tests/test_laboratory_runner.py'
- '.github/workflows/flm-offroad.yaml'
- 'pyproject.toml'
- 'uv.lock'
pull_request:
branches: [stable]
types: [opened, synchronize, reopened, edited]
workflow_dispatch:
inputs:
source_sha:
description: Full candidate commit SHA to qualify without creating a branch
type: string
required: false
permissions:
contents: read
concurrency:
group: flm-offroad-${{ inputs.source_sha || github.ref }}
cancel-in-progress: true
env:
CI: 1
PYTHONPATH: ${{ github.workspace }}
RAYLIB_BACKEND: headless
jobs:
contracts:
name: offroad backend contracts
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.source_sha || github.sha }}
- name: Verify exact source under test
env:
SOURCE_SHA: ${{ inputs.source_sha }}
run: |
git rev-parse HEAD
test -z "$SOURCE_SHA" || test "$(git rev-parse HEAD)" = "$SOURCE_SHA"
- run: ./tools/op.sh setup
- name: Check all FLM and integrated controller source
timeout-minutes: 1
run: |
ruff check openpilot/starpilot/flm openpilot/selfdrive/controls/controlsd.py openpilot/selfdrive/controls/lib/latcontrol_pid.py openpilot/selfdrive/controls/lib/latcontrol_torque.py openpilot/system/manager/process_config.py
uv run --isolated --frozen --only-group typecheck ty check --python "$(command -v python3)" openpilot/starpilot/flm openpilot/selfdrive/controls/controlsd.py openpilot/selfdrive/controls/lib/latcontrol_pid.py openpilot/selfdrive/controls/lib/latcontrol_torque.py openpilot/system/manager/process_config.py
- name: Build native dependencies
timeout-minutes: 10
run: scons
- name: Test producer capture, clocks, offroad recommendations, startup and rollback
timeout-minutes: 3
run: |
tools/op.sh test \
openpilot/starpilot/flm/tests/test_offroad_backend.py \
openpilot/starpilot/flm/tests/test_offroad_report.py \
openpilot/starpilot/flm/tests/test_offroad_coordinate_policy.py \
openpilot/starpilot/flm/tests/test_offroad_retained_trials.py \
openpilot/starpilot/flm/tests/test_offroad_process_lifecycle.py \
openpilot/starpilot/flm/tests/test_offroad_analysis_progress.py \
openpilot/starpilot/flm/tests/test_route_recording_clocks.py \
openpilot/starpilot/flm/tests/test_configured_route_recording.py \
openpilot/starpilot/flm/tests/test_observed_maneuvers.py \
openpilot/starpilot/flm/tests/test_pid_coordinate_proposals.py \
openpilot/starpilot/flm/tests/test_offroad_equal_native_output.py \
openpilot/starpilot/flm/tests/test_offroad_fault_isolation.py \
openpilot/starpilot/flm/tests/test_device_vehicle_identity.py \
openpilot/starpilot/galaxy/tests/test_drive_history.py \
openpilot/starpilot/galaxy/tests/test_flm_acceptance.py \
--json-output ci-results/flm-offroad.json
.venv/bin/python -m pytest -q --import-mode=importlib \
openpilot/starpilot/flm/tests/test_steering_compatibility.py \
openpilot/starpilot/flm/tests/test_offroad_nonemitted_controls.py \
openpilot/starpilot/flm/tests/test_pending_review.py \
openpilot/starpilot/flm/tests/test_observed_maneuvers.py \
openpilot/starpilot/flm/tests/test_upstream_producer_transport.py \
openpilot/starpilot/flm/tests/test_clock_resolution_budget.py \
openpilot/starpilot/flm/tests/test_consumption_join_clocks.py \
openpilot/starpilot/flm/tests/test_control_source_clock_recovery.py \
openpilot/starpilot/flm/tests/test_drain_receipt_clock.py \
openpilot/starpilot/flm/tests/test_event_admission_clock.py \
openpilot/starpilot/models/tests/test_laboratory_runner.py \
openpilot/starpilot/aol/tests/test_source_expiry_native_off.py \
--junitxml=ci-results/flm-producer.xml
- name: Test completed-drive and steering-result presentation
timeout-minutes: 1
run: |
node openpilot/starpilot/galaxy/tests/test_flm_training_results.mjs
node openpilot/starpilot/galaxy/tests/test_flm_tracking_results.mjs
node openpilot/starpilot/galaxy/tests/test_flm.mjs
node openpilot/starpilot/galaxy/tests/test_tuning_editor.mjs
node openpilot/starpilot/galaxy/tests/test_settings_defaults.mjs
node openpilot/starpilot/galaxy/tests/test_flm_ux_browser.mjs
- name: Retain offroad contract results
if: always()
uses: actions/upload-artifact@v4
with:
name: flm-offroad-contracts
path: |
ci-results/flm-offroad.json
ci-results/flm-producer.xml
if-no-files-found: warn
@@ -0,0 +1,41 @@
name: Galaxy phone bridge
on:
push:
branches: [Dom, StarPilot, stable, testing, dev, secretgood-ios-integration]
paths:
- 'openpilot/starpilot/galaxy_bluetooth/**'
- '.github/workflows/galaxy-phone-bridge.yaml'
pull_request:
branches-ignore: [stable]
paths:
- 'openpilot/starpilot/galaxy_bluetooth/**'
- '.github/workflows/galaxy-phone-bridge.yaml'
workflow_dispatch:
workflow_call:
permissions:
contents: read
concurrency:
group: galaxy-phone-bridge-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
bridge:
name: Comma Bluetooth bridge tests
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: false
lfs: false
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install bridge test dependencies
run: python -m pip install pycryptodome
- name: Run bridge regressions
run: python -m unittest discover -s openpilot/starpilot/galaxy_bluetooth/tests -v
+111
View File
@@ -0,0 +1,111 @@
name: PR Discord reminder
# Only trusted workflow code runs. Never check out or execute PR contents here.
on:
pull_request_target:
types: [opened]
push:
branches: [stable, testing]
paths: [.github/workflows/pr_discord_reminder.yaml]
workflow_dispatch:
permissions: {}
concurrency:
group: pr-discord-reminder-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: false
jobs:
remind:
if: github.repository == 'StarPilotHQ/StarPilot'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
issues: read
pull-requests: write
steps:
- name: Validate and send one reminder for a newly opened PR
env:
GH_TOKEN: ${{ github.token }}
shell: python
run: |
import json
import os
import urllib.request
REPO = "StarPilotHQ/StarPilot"
MARKER = "<!-- starpilot-pr-discord-reminder-v1 -->"
BODY = ("Thank you for your PR! Once CI passes on your PR against `stable`, "
"please open a report describing it in the StarPilot Discord at "
"[https://firestar.link/discord](https://firestar.link/discord)\n\n" + MARKER)
def remind(event, request):
if event.get("action") != "opened" or "pull_request" not in event:
return "not a newly opened PR"
if event.get("repository", {}).get("full_name") != REPO:
raise ValueError("Unexpected repository")
number = event["pull_request"].get("number")
if type(number) is not int or number <= 0:
raise ValueError("Invalid PR number")
path = f"/repos/{REPO}/issues/{number}/comments"
page = 1
while True:
comments = request("GET", f"{path}?per_page=100&page={page}")
if any(c.get("user", {}).get("login") == "github-actions[bot]"
and MARKER in (c.get("body") or "") for c in comments):
return "reminder already present"
if len(comments) < 100:
break
page += 1
request("POST", path, {"body": BODY})
return "reminder posted"
def self_test():
event = {"action": "opened", "repository": {"full_name": REPO},
"pull_request": {"number": 123, "head": {"repo": {"fork": True}}}}
def check(payload, pages, expected, posts):
calls = []
def request(method, path, body=None):
calls.append((method, path, body))
return pages.pop(0) if method == "GET" else {}
assert remind(payload, request) == expected
assert sum(c[0] == "POST" for c in calls) == posts
for method, path, body in calls:
if method == "POST":
assert body == {"body": BODY}
check(event, [[]], "reminder posted", 1)
bot = {"user": {"login": "github-actions[bot]"}, "body": MARKER}
check(event, [[bot]], "reminder already present", 0)
check(event, [[{}] * 100, [bot]], "reminder already present", 0)
check(event, [[{"user": {"login": "someone"}, "body": MARKER}]],
"reminder posted", 1)
for action in ("reopened", "synchronize", "closed", "edited"):
check(dict(event, action=action), [], "not a newly opened PR", 0)
check({}, [], "not a newly opened PR", 0)
for bad in ("123; echo unsafe", 0, -1, True):
try:
remind(dict(event, pull_request={"number": bad}), None)
except ValueError:
pass
else:
raise AssertionError("Invalid PR number accepted")
print("Self-tests passed: fork PR, rerun deduplication, pagination, spoofed marker, event guards, invalid input")
self_test()
if os.environ["GITHUB_EVENT_NAME"] == "pull_request_target":
with open(os.environ["GITHUB_EVENT_PATH"]) as stream:
event = json.load(stream)
def request(method, path, body=None):
req = urllib.request.Request(
"https://api.github.com" + path,
data=json.dumps(body).encode() if body is not None else None,
method=method,
headers={"Authorization": "Bearer " + os.environ["GH_TOKEN"],
"Accept": "application/vnd.github+json",
"Content-Type": "application/json",
"X-GitHub-Api-Version": "2022-11-28"})
with urllib.request.urlopen(req, timeout=30) as response:
return json.load(response)
print(remind(event, request))
else:
print("Validation only; no PR comments sent")
+2 -1
View File
@@ -2,8 +2,9 @@ name: safety qualification
on:
push:
branches: [master, Domathon, SecretGoodStarPilot]
branches: [master, Domathon, Dom, StarPilot, stable, testing, testingupstreamsync, dev]
pull_request:
types: [opened, synchronize, reopened, edited]
workflow_dispatch:
permissions:
+318 -10
View File
@@ -5,8 +5,14 @@ on:
branches:
- master
- Domathon
- SecretGoodStarPilot
- Dom
- StarPilot
- stable
- testing
- testingupstreamsync
- dev
pull_request:
types: [opened, synchronize, reopened, edited]
workflow_dispatch:
workflow_call:
inputs:
@@ -27,6 +33,12 @@ env:
PYTHONPATH: ${{ github.workspace }}
jobs:
stable_pr_phone_bridge:
if: github.event_name == 'pull_request' && github.base_ref == 'stable'
permissions:
contents: read
uses: ./.github/workflows/galaxy-phone-bridge.yaml
source_integrity:
name: source integrity
runs-on: ubuntu-24.04
@@ -34,13 +46,23 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v7
- name: Validate published device build receipt
if: github.event_name == 'push' && (github.ref == 'refs/heads/Dom' || github.ref == 'refs/heads/StarPilot' || github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/testing' || github.ref == 'refs/heads/dev')
run: python3 tools/ci/check_prebuilt_receipt.py --revision HEAD
- name: Check shipped device runtime dependencies
run: |
python3 -m unittest tools.laptop_device_build.tests.test_runtime_dependencies -v
python3 -c 'from pathlib import Path; assert b"starting pandad (comma hardware)" in Path("openpilot/selfdrive/pandad/pandad").read_bytes(), "Shipped pandad must use the comma hardware build profile"'
python3 -c 'from pathlib import Path; paths = ("openpilot/system/camerad/camerad", "msgq_repo/msgq/visionipc/_visionipc.so", "openpilot/system/loggerd/encoderd", "openpilot/tools/replay/replay"); assert all(b"/dev/ion\0" in Path(p).read_bytes() for p in paths), "Shipped camera buffers must use ION"'
- name: Test one-shot branch migration
run: python3 -m unittest discover -s scripts/tests -v
- name: Validate tracked dependencies
run: python3 tools/vendor/check.py --revision HEAD
- run: ./tools/op.sh setup
id: setup
- name: Build native dependencies for packaging tests
id: build
run: scons -j2 openpilot/common/libparams_c.so msgq_repo/msgq/ipc_pyx.so
run: scons -j2 openpilot/common/libparams_c.so msgq_repo/msgq/_ipc.so
- name: Test dependency tools
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: python3 -m unittest discover -s tools/vendor/tests -v
@@ -50,6 +72,9 @@ jobs:
- name: Test CI tools
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: python3 -m unittest discover -s tools/ci/tests -v
- name: Test authenticated monitoring release artifacts
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: python3 -m pytest -q tools/ci/tests/test_stock_monitoring_release.py
- name: Test updater
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: python3 -m unittest discover -s openpilot/system/updated/tests -v
@@ -156,8 +181,31 @@ jobs:
timeout-minutes: 1
run: scripts/lint/lint.sh
build_host:
name: build host
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- run: ./tools/op.sh setup
- name: Restore the latest native build cache
uses: actions/cache/restore@v4
with:
path: /tmp/scons_cache
key: scons-host-x64-${{ github.sha }}
restore-keys: scons-host-x64-
- name: Build openpilot once for every host test job
run: scons
- name: Share the native build cache with host test jobs
uses: actions/cache/save@v4
with:
path: /tmp/scons_cache
key: scons-host-x64-${{ github.sha }}
unit_tests:
name: unit tests
needs: build_host
runs-on: ${{
(github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') ||
@@ -183,25 +231,44 @@ jobs:
run: go mod download
- run: ./tools/op.sh setup
id: setup
- name: Restore the shared native build
uses: actions/cache/restore@v4
with:
path: /tmp/scons_cache
key: scons-host-x64-${{ github.sha }}
- name: Build openpilot
id: build
run: scons
- name: Provide H.264 encoder for Android Auto integration tests
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
uv pip install --python .venv/bin/python --only-binary av av==19.0.1
.venv/bin/python -c "import av; assert 'libx264' in av.codecs_available"
- name: Provide pinned OpenCV DNN for vision contract tests
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
uv pip install --python .venv/bin/python --no-deps --only-binary :all: opencv-python-headless==4.11.0.86
.venv/bin/python -c "import cv2; assert cv2.__version__ == '4.11.0'; assert callable(cv2.dnn.readNetFromONNX); assert callable(cv2.dnn.NMSBoxes)"
- name: Run unit tests
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
timeout-minutes: ${{ contains(runner.name, 'nsc') && 2 || 20 }}
env:
RAYLIB_BACKEND: headless
STARPILOT_TEST_DIAGNOSTICS: ci-results/host-test-diagnostics/unittest
run: tools/op.sh test --json-output unit-test-results.json
- name: Test custom module-level pytest cases
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
timeout-minutes: 10
env:
RAYLIB_BACKEND: headless
run: python3 tools/ci/run_host_tests.py --pytest
- name: Test GM vehicle configurations and CAN behavior
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
timeout-minutes: 5
run: tools/op.sh test opendbc_repo/opendbc/car/gm/tests --json-output gm-test-results.json
- name: Test shared GM discovery, routing, and manual overrides
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
timeout-minutes: 2
run: >-
.venv/bin/python -m pytest -q --import-mode=importlib
opendbc_repo/opendbc/car/gm/tests/test_shared_discovery.py
opendbc_repo/opendbc/car/gm/tests/test_automatic_discovery.py
opendbc_repo/opendbc/car/gm/tests/test_bolt_vin_discovery.py
--junitxml=gm-discovery-results.xml
- name: Test native independent-axis protocol
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
@@ -209,6 +276,7 @@ jobs:
openpilot/selfdrive/pandad/tests/test_pandad_canprotocol
openpilot/selfdrive/pandad/tests/test_aol_protocol
openpilot/selfdrive/pandad/tests/test_aol_wire
openpilot/selfdrive/pandad/tests/test_panda_faults
openpilot/selfdrive/pandad/tests/test_producer_timing
openpilot/selfdrive/pandad/tests/test_producer_sink
- name: Test map provider to host messaging
@@ -222,13 +290,165 @@ jobs:
STARPILOT_PYTHON: ${{ github.workspace }}/.venv/bin/python
run: go test -mod=readonly -race -run '^Test(MsgqNativeLayout|Shadow(GoPythonIPC|ExecutableHostGpsIPC))$' -count=1 -v
- name: Save complete unit test results
if: ${{ always() && (hashFiles('unit-test-results.json') != '' || hashFiles('gm-test-results.json') != '') }}
if: ${{ always() && (hashFiles('unit-test-results.json') != '' || hashFiles('gm-test-results.json') != '' || hashFiles('gm-discovery-results.xml') != '' || hashFiles('ci-results/host-test-diagnostics/**') != '') }}
uses: actions/upload-artifact@v4
with:
name: unit-test-results
path: |
unit-test-results.json
gm-test-results.json
gm-discovery-results.xml
ci-results/host-test-diagnostics/
if-no-files-found: error
custom_pytest:
name: custom pytest (${{ matrix.group }})
needs: build_host
runs-on: ubuntu-24.04
timeout-minutes: 45
permissions:
contents: read
strategy:
fail-fast: false
matrix:
group: [0, 1, 2, 3, 4, 5, 6, 7, 8]
steps:
- uses: actions/checkout@v7
- name: Provide JavaScript runtime for Galaxy contract tests
uses: actions/setup-node@v7
with:
node-version: '24'
package-manager-cache: false
- name: Provide pinned map provider toolchain
uses: actions/setup-go@v7
with:
go-version: '1.25.1'
cache-dependency-path: mapd_repo/go.sum
- name: Fetch pinned map provider dependencies
working-directory: mapd_repo
env:
GOTOOLCHAIN: local
run: go mod download
- run: ./tools/op.sh setup
id: setup
- name: Restore the shared native build
uses: actions/cache/restore@v4
with:
path: /tmp/scons_cache
key: scons-host-x64-${{ github.sha }}
- name: Build openpilot
id: build
run: scons
- name: Provide H.264 encoder for Android Auto integration tests
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
uv pip install --python .venv/bin/python --only-binary av av==19.0.1
.venv/bin/python -c "import av; assert 'libx264' in av.codecs_available"
- name: Provide pinned OpenCV DNN for vision contract tests
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
uv pip install --python .venv/bin/python --no-deps --only-binary :all: opencv-python-headless==4.11.0.86
.venv/bin/python -c "import cv2; assert cv2.__version__ == '4.11.0'; assert callable(cv2.dnn.readNetFromONNX); assert callable(cv2.dnn.NMSBoxes)"
- name: Provide Mesa software graphics for pixel-level tests
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: sudo apt-get update && sudo apt-get install -y libegl1 libgles-dev libgl1-mesa-dri
- name: Test every assigned custom pytest node serially
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
timeout-minutes: 30
env:
RAYLIB_BACKEND: headless
STARPILOT_AUTO_GL_TEST: "1"
STARPILOT_TEST_SOFTWARE_EGL: "1"
LIBGL_ALWAYS_SOFTWARE: "1"
run: .venv/bin/python -m tools.ci.custom_pytest_shards run --group "${{ matrix.group }}" --groups 9 --count 32 --output "ci-results/custom-pytest-group-${{ matrix.group }}"
- name: Save collection, every outcome, JUnit and durable worker diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: custom-pytest-group-${{ matrix.group }}
path: ci-results/custom-pytest-group-${{ matrix.group }}/
if-no-files-found: error
custom_pytest_complete:
name: complete custom pytest catalog
needs: custom_pytest
if: ${{ always() && !cancelled() }}
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v4
with:
pattern: custom-pytest-*
path: ci-results/custom-pytest-shards
- name: Require every case passed or audited capability-unavailable
run: python3 -m tools.ci.custom_pytest_shards aggregate --directory ci-results/custom-pytest-shards --count 32 --output ci-results/custom-pytest-complete.json
- name: Save complete custom catalog verdict
if: always()
uses: actions/upload-artifact@v4
with:
name: custom-pytest-complete
path: ci-results/custom-pytest-complete.json
if-no-files-found: error
aol_lifecycles:
name: AOL lifecycles (${{ matrix.group }})
needs: build_host
runs-on: ubuntu-24.04
timeout-minutes: 45
permissions:
contents: read
strategy:
fail-fast: false
matrix:
group: [0, 1, 2, 3]
env:
FUZZ_SEED: '0'
steps:
- uses: actions/checkout@v7
- run: ./tools/op.sh setup
- name: Restore the shared native build
uses: actions/cache/restore@v4
with:
path: /tmp/scons_cache
key: scons-host-x64-${{ github.sha }}
- name: Build native host dependencies
run: scons
- name: Gate every assigned lifecycle module serially
timeout-minutes: 30
env:
RAYLIB_BACKEND: headless
run: python3 tools/ci/run_vehicle_tests.py --suite aol-lifecycle --shard-group "${{ matrix.group }}" --shard-groups 4 --shard-count 16 --output "ci-results/aol-lifecycle-group-${{ matrix.group }}"
- name: Save every lifecycle outcome and native build
if: always()
uses: actions/upload-artifact@v4
with:
name: aol-lifecycle-group-${{ matrix.group }}
path: ci-results/aol-lifecycle-group-${{ matrix.group }}/
if-no-files-found: error
aol_lifecycle_complete:
name: complete AOL lifecycle catalog
needs: aol_lifecycles
if: ${{ always() && !cancelled() }}
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v4
with:
pattern: aol-lifecycle-*
path: ci-results/aol-lifecycles
- name: Require every full-catalog case exactly once and passed
run: python3 tools/ci/lifecycle_shards.py ci-results/aol-lifecycles --count 16 --output ci-results/aol-lifecycle-complete.json
- name: Save complete catalog verdict
if: always()
uses: actions/upload-artifact@v4
with:
name: aol-lifecycle-complete
path: ci-results/aol-lifecycle-complete.json
if-no-files-found: error
map_provider:
@@ -257,6 +477,7 @@ jobs:
vehicle_contracts:
name: vehicle contracts (${{ matrix.suite }})
needs: build_host
runs-on: ubuntu-24.04
timeout-minutes: 35
permissions:
@@ -264,16 +485,23 @@ jobs:
strategy:
fail-fast: false
matrix:
suite: [interfaces, safety-debug, safety-release]
suite: [interfaces, safety-debug]
env:
FUZZ_SEED: '0'
steps:
- uses: actions/checkout@v7
- run: ./tools/op.sh setup
- name: Restore the shared native build
uses: actions/cache/restore@v4
with:
path: /tmp/scons_cache
key: scons-host-x64-${{ github.sha }}
- name: Build native host dependencies
run: scons
- name: Run explicit vehicle suite and record every result
timeout-minutes: 20
env:
STARPILOT_VEHICLE_WORKERS: ${{ matrix.suite == 'interfaces' && '4' || '1' }}
run: python3 tools/ci/run_vehicle_tests.py --suite "${{ matrix.suite }}" --output "ci-results/${{ matrix.suite }}"
- name: Require current complete interface regression coverage
if: ${{ always() && matrix.suite == 'interfaces' }}
@@ -290,6 +518,65 @@ jobs:
path: ci-results/${{ matrix.suite }}/
if-no-files-found: error
safety_release_contracts:
name: RELEASE vehicle contracts (${{ matrix.group }})
needs: build_host
runs-on: ubuntu-24.04
timeout-minutes: 45
permissions:
contents: read
strategy:
fail-fast: false
matrix:
group: [0, 1, 2, 3]
env:
FUZZ_SEED: '0'
steps:
- uses: actions/checkout@v7
- run: ./tools/op.sh setup
- name: Restore the shared native build
uses: actions/cache/restore@v4
with:
path: /tmp/scons_cache
key: scons-host-x64-${{ github.sha }}
- name: Build native host dependencies
run: scons
- name: Run every assigned RELEASE target serially
timeout-minutes: 30
env:
RAYLIB_BACKEND: headless
run: python3 tools/ci/run_vehicle_tests.py --suite safety-release --shard-group "${{ matrix.group }}" --shard-groups 4 --shard-count 16 --output "ci-results/safety-release-group-${{ matrix.group }}"
- name: Save every RELEASE outcome and native build
if: always()
uses: actions/upload-artifact@v4
with:
name: safety-release-group-${{ matrix.group }}
path: ci-results/safety-release-group-${{ matrix.group }}/
if-no-files-found: error
safety_release_complete:
name: complete RELEASE vehicle catalog
needs: safety_release_contracts
if: ${{ always() && !cancelled() }}
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v4
with:
pattern: safety-release-*
path: ci-results/safety-release-shards
- name: Require every RELEASE case exactly once and passed
run: python3 tools/ci/lifecycle_shards.py ci-results/safety-release-shards --suite safety-release --count 16 --output ci-results/safety-release-complete.json
- name: Save complete RELEASE verdict
if: always()
uses: actions/upload-artifact@v4
with:
name: safety-release-complete
path: ci-results/safety-release-complete.json
if-no-files-found: error
recorded_vehicles:
name: recorded vehicles (${{ matrix.variant }})
runs-on: ubuntu-24.04
@@ -359,6 +646,7 @@ jobs:
process_replay:
name: process replay
needs: build_host
runs-on: ${{
(github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') ||
@@ -368,6 +656,11 @@ jobs:
steps:
- uses: actions/checkout@v7
- run: ./tools/op.sh setup
- name: Restore the shared native build
uses: actions/cache/restore@v4
with:
path: /tmp/scons_cache
key: scons-host-x64-${{ github.sha }}
- name: Build openpilot
run: scons
- name: Run replay
@@ -393,6 +686,15 @@ jobs:
with:
name: process_replay_diff.txt
path: openpilot/selfdrive/test/process_replay/diff.txt
- name: Save complete replay outputs for review
uses: actions/upload-artifact@v7
if: always()
with:
name: process-replay-outputs
path: |
openpilot/selfdrive/test/process_replay/fakedata/*.zst
openpilot/selfdrive/test/process_replay/coverage.json
if-no-files-found: error
- name: Upload diff report
uses: actions/upload-artifact@v7
if: always() && github.event_name == 'pull_request'
@@ -429,6 +731,7 @@ jobs:
create_ui_report:
name: Create UI Report
needs: build_host
runs-on: ${{
(github.repository == 'commaai/openpilot') &&
((github.event_name != 'pull_request') ||
@@ -438,6 +741,11 @@ jobs:
steps:
- uses: actions/checkout@v7
- run: ./tools/op.sh setup
- name: Restore the shared native build
uses: actions/cache/restore@v4
with:
path: /tmp/scons_cache
key: scons-host-x64-${{ github.sha }}
- name: Build openpilot
run: scons
- name: Create UI Report
+18 -12
View File
@@ -18,6 +18,7 @@ a.out
.venv-linux-arm64/
bin/
!openpilot/starpilot/galaxy/bin/
!openpilot/starpilot/soloist/pulseaudio/bin/
# created at launch for comma hardware PYTHONPATH (PC uses editable installs via pyproject.toml)
/msgq
@@ -44,8 +45,12 @@ bin/
*.os-*
*.so
!openpilot/tools/replay/libmedia_mux.so
!openpilot/starpilot/soloist/pulseaudio/lib/*.so
!openpilot/starpilot/soloist/pulseaudio/modules/*.so
*.a
st[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]
!/openpilot/starpilot/system/starport/
!/openpilot/tools/starport/
*.unchunked
*.clb
*.class
@@ -69,7 +74,6 @@ openpilot/selfdrive/pandad/tests/test_aol_wire
openpilot/selfdrive/pandad/tests/test_panda_usb
openpilot/cereal/services.h
openpilot/cereal/gen
openpilot/cereal/messaging/bridge
openpilot/selfdrive/ui/translations/tmp
openpilot/selfdrive/car/tests/cars_dump
openpilot/system/camerad/camerad
@@ -122,19 +126,21 @@ openpilot/selfdrive/modeld/models/*.unchunked
!openpilot/selfdrive/modeld/models/dmonitoring_model_tinygrad.pkl.chunk[0-9][0-9][0-9][0-9]of[0-9][0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/dmonitoring_model_tinygrad.pkl.chunkmanifest
!openpilot/selfdrive/modeld/models/dmonitoring_model_tinygrad.pkl.chunksha256
!openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk[0-9][0-9]of[0-9][0-9]
!openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk[0-9][0-9]of[0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk[0-9][0-9]of[0-9][0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk[0-9][0-9][0-9]of[0-9][0-9]
!openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk[0-9][0-9][0-9]of[0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk[0-9][0-9][0-9]of[0-9][0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk[0-9][0-9][0-9][0-9]of[0-9][0-9]
!openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk[0-9][0-9][0-9][0-9]of[0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk[0-9][0-9][0-9][0-9]of[0-9][0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunkmanifest
!openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunksha256
!openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl.chunk[0-9][0-9]of[0-9][0-9]
!openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl.chunk[0-9][0-9]of[0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl.chunk[0-9][0-9]of[0-9][0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl.chunk[0-9][0-9][0-9]of[0-9][0-9]
!openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl.chunk[0-9][0-9][0-9]of[0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl.chunk[0-9][0-9][0-9]of[0-9][0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl.chunk[0-9][0-9][0-9][0-9]of[0-9][0-9]
!openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl.chunk[0-9][0-9][0-9][0-9]of[0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl.chunk[0-9][0-9][0-9][0-9]of[0-9][0-9][0-9][0-9]
!openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl.chunkmanifest
!openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl.chunksha256
# Jetlink editable-install metadata.
/jetlink_repo/jetlink.egg-info/
# Local Google Play resolver build output (source and lockfile are versioned).
openpilot/starpilot/flm/_primitive_walk.cpp
+37 -9
View File
@@ -1,8 +1,12 @@
# Source provenance
## Phone companions and Galaxy contributions
[dirwin31](https://github.com/dirwin31/StarPilotAndroid) developed the Android companion and contributed StarPort setup, wireless adapter compatibility, connectivity fixes and diagnostics ([PR #273](https://github.com/StarPilotHQ/StarPilot/pull/273)). [natehuby76](https://github.com/natehuby76/StarPilotBT) developed the iOS companion and contributed Galaxy Bluetooth pairing, local Wi-Fi discovery and UI fixes, including the C4 menu reset ([PR #246](https://github.com/StarPilotHQ/StarPilot/pull/246)). Their work helped make phone integration and everyday use more reliable. The apps are maintained separately under their respective licenses.
## Jetlink external inference
The comma-side Jetlink client and USB transport in `jetlink_repo` are by Zeph Leggett and the [Jetlink contributors](https://github.com/zoompilot/jetlink). They are vendored from revision `c17cd5c52be0ee83b9a6265b7da69d24ad6c5d02` under the MIT license, retained in [jetlink_repo/LICENSE](jetlink_repo/LICENSE). StarPilot owns the adapter to its model runner, settings and process lifecycle. Companion applications and inference servers remain distributed by Jetlink.
The comma-side Jetlink client and USB transport in `jetlink_repo` are by Zeph Leggett and the [Jetlink contributors](https://github.com/zoompilot/jetlink). They are vendored from revision `9cfde98eec1d7cc714d800504944cf1a3944513d` under the MIT license, retained in [jetlink_repo/LICENSE](jetlink_repo/LICENSE). StarPilot's adapter (`openpilot/starpilot/models/jetlink_adapter.py`) builds on Jetlink's openpilot layer and owns its param names, Always On Lateral rule, model runner reset, settings and alerts. Companion applications and inference servers remain distributed by Jetlink.
## MRR35 Hyundai angle and radar
@@ -12,16 +16,40 @@ The copied MRR35 generator source and DBC definition are at `opendbc_repo/opendb
## Ford support adapted from BluePilot
The Ford lateral strategies, extended CAN constructors, camera-radar filtering and native checks are adapted from StarPilot `2efe6017bfe14cee4807833e05f9a7f6ba255cdb`. Their lineage includes BluePilot's `bp-7.0` Ford work, principally by Alan Polk, with contributions from John Christman, Jacob Neulight, tonesto7, Haibin Wen and other sunnypilot and BluePilot contributors. The reference snapshot is [`e1d051d7ba270261b4455068bd68f1a58db15a4a`](https://github.com/BluePilotDev/bluepilot/commit/e1d051d7ba270261b4455068bd68f1a58db15a4a); the exact checkout used for the earlier StarPilot import was not recorded.
Ford lateral control vendors [BluePilot lateral](https://github.com/BluePilotDev/bluepilot-lateral) v0.2.1 (`2b9dc6cc784faac47a1885d0bda0561f7b76f74d`), developed by Alan Polk (`alan-polk`) and the BluePilot contributors. Alan provided the [StarPilot integration in PR #269](https://github.com/StarPilotHQ/StarPilot/pull/269); his commits and authorship are retained. BluePilot maintains the library and its integration; StarPilot keeps its settings, AOL policy, packaging and integration tests separate. Complete contributor and license notices remain in [the library credits](opendbc_repo/opendbc/bluepilot_lateral/CREDITS.md) and [license](opendbc_repo/opendbc/bluepilot_lateral/LICENSE).
Relevant lineage includes the controller and integration work in [`db2bdff05`](https://github.com/BluePilotDev/bluepilot/commit/db2bdff05df103d71df62f45c2a3cb5211aba6e6) and [`d0aac605f`](https://github.com/BluePilotDev/bluepilot/commit/d0aac605f99d37e9da205e419f7989c1e9eaa386), extended CAN and safety work in [`8f8d6d15f`](https://github.com/BluePilotDev/bluepilot/commit/8f8d6d15f0a590f42b78de964ffb0d0af7f5d63d), and manual-turn detection in [`97867c1eb`](https://github.com/BluePilotDev/bluepilot/commit/97867c1eb57b7472f6fc3de62f0fef576e5a5497).
The Ford CAN FD camera-lead radar filtering is adapted from StarPilot `2efe6017bfe14cee4807833e05f9a7f6ba255cdb`. Its lineage includes BluePilot's `bp-7.0` Ford work, principally by Alan Polk, with contributions from John Christman, Jacob Neulight, tonesto7, Haibin Wen and other sunnypilot and BluePilot contributors. The reference snapshot is [`e1d051d7ba270261b4455068bd68f1a58db15a4a`](https://github.com/BluePilotDev/bluepilot/commit/e1d051d7ba270261b4455068bd68f1a58db15a4a); the exact checkout used for the earlier StarPilot import was not recorded.
The vehicle strategy and CAN/native owners preserve that attribution while adapting to the current controller interfaces and shared safety limits. Upstream contributors do not maintain or endorse this adaptation. Applicable notices are retained in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
## Optional Ford angle controller
The vendored `opendbc_repo/opendbc/bluepilot_lateral` angle core, codecs and Ford-only safety hooks are adapted directly from [BluePilot bp-7.0 e1d051d7ba270261b4455068bd68f1a58db15a4a](https://github.com/BluePilotDev/bluepilot/commit/e1d051d7ba270261b4455068bd68f1a58db15a4a), principally by Alan Polk, with John Christman, Jacob Neulight, Nathan Ingraham, Praeuner and other BluePilot, sunnypilot and comma contributors. Exact source paths and intentionally stricter safety checks are recorded in that folder. Both upstream `LICENSE` and `LICENSE.md` notices are retained. Its layout follows Alan Polk's September 2026 library proposal; this is a StarPilot adapter, not a published BluePilot library release.
The radar interface preserves that attribution while adapting to the current interfaces. Upstream contributors do not maintain or endorse this adaptation. Applicable notices are retained in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
## RAV4 Continental ARS510 receiver
The optional ACC-target and fused-track receivers and DBC preserve firestar5683's Dom integration from `b220a37f4bd119e402225a7aa16a7cd84878d0af` (Sea Turtles, 2026-10-13) and its ARS510 source attribution to ds-sebastian/ars510-radar `fb5b29c2b5999f34afeb6f7ac494a73949d66c67`, copyright 2026 ARS510 radar contributors. The complete MIT permission and warranty notice is retained in THIRD_PARTY_NOTICES.md. Startup/settings ownership is adapted to the current StarPilot architecture; no original firmware binaries or safety permissions are copied.
The ACC-target receiver and DBC preserve firestar5683's Dom integration from `b220a37f4bd119e402225a7aa16a7cd84878d0af` (Sea Turtles, 2026-10-13) and its ARS510 source attribution to ds-sebastian/ars510-radar `fb5b29c2b5999f34afeb6f7ac494a73949d66c67`, copyright 2026 ARS510 radar contributors. The DBC is the one in commaai/opendbc#3860 (ds-sebastian/opendbc `ddcc0b07d1759c96a1d208ae1db13ad91ce23435`). The complete MIT permission and warranty notice is retained in THIRD_PARTY_NOTICES.md. Startup/settings ownership is adapted to the current StarPilot architecture; no original firmware binaries or safety permissions are copied.
## Spotify Bluetooth output
Spotify's Bluetooth output binds the comma's BlueALSA A2DP source to the selected speaker through a process-local ALSA configuration, leaving the system ALSA default, soundd and the warning speaker untouched. That approach is adapted from firestar5683's RoadScore Bluetooth output (`roadscore/prototype/bluetooth_output.py`, firestar5683/StarPilot `RoadScore` at `249eb88b3a397db847e4a595d7e23b7e85d329e5`). The Soloist player itself is never included: each user downloads it from Spotify, and the PulseAudio server that carries its audio is vendored unmodified from Ubuntu (see THIRD_PARTY_NOTICES.md).
## Tesla Pre-AP pedal control
The Pre-AP configuration, pedal codec/feedback, VirtualDAS feedforward table, grade compensation, torque-zero estimator and vehicle-specific gains preserve firestar5683's intentional Dom work, including `7837a3c1aab`, `aed0b7fdb9e9` and pinned `b220a37f4bd119e402225a7aa16a7cd84878d0af`. Original author attribution: firestar5683 <168790843+firestar5683@users.noreply.github.com>. Startup/calibration ownership, current upstream button/PID interfaces and native command bounds are adapted to the current StarPilot architecture; the old permissive native gateway is not transplanted. Existing source/license notices remain intact.
## Subaru angle steering from Jacob Waller's fork
Subaru angle support includes implementation maintained and integrated by **Jacob Waller (jacobw)** in [jacobwaller/openpilot, jul-angle-based](https://github.com/jacobwaller/openpilot/tree/542816196a18dba5f6f0af093c1ece4f415b5a22), with its [opendbc implementation at 8acbeccdab45a47aa7af170d2d17b61f0eb5e4f0](https://github.com/jacobwaller/opendbc/tree/8acbeccdab45a47aa7af170d2d17b61f0eb5e4f0). Jacob authored the VehicleModel angle-limit type correction and integrated the Crosstrek support. The branch also retains the original angle implementation and follow-up work by **lukasloetkolben and elkoled**, alongside comma contributors; their authorship remains theirs.
The inherited source covers Subaru angle platform/firmware definitions, `ES_Status` cruise state, angle controller/CAN integration, vehicle-model limits and native angle enforcement. StarPilot has additional platform-specific limits, driver handoff, discovery and AOL safety guards; this attribution does not claim identical tuning or complete parity with the reference fork. Original source commits, author names, emails and titles are recorded in [the Subaru origin history](opendbc_repo/opendbc/car/subaru/ORIGIN_HISTORY.tsv).
The preferred Crosstrek/2024+ Impreza angle controller is adapted from **Jacob Waller (jacobw)**'s [hackathon-crosstrek branch](https://github.com/jacobwaller/openpilot/tree/118bb0409520433c3e09119ee61c8a57546272e0), pinned to [opendbc 753fdd383a18c3f9e86af801f1e0e9db2a168e72](https://github.com/jacobwaller/opendbc/tree/753fdd383a18c3f9e86af801f1e0e9db2a168e72). Jacob authored its 100 Hz speed-dependent angle filter and 13:1 safety model.
The explicit StarPilot [jacobw Subaru adapter](opendbc_repo/opendbc/car/subaru/JACOBW.md) additionally integrates that branch's low-speed filter, target-first limiting and Crosstrek EPS envelope. Its preserved stricter guards and platform scope are documented alongside the code.
## StarPilot Ford demand tuning
The previous optional StarPilot Controller, formerly in `openpilot/starpilot/car/ford/starpilot_tuning.py`, restored demand tuning from StarPilot `8da0c9d916^`, descended from BluePilot bp-7.0 `e1d051d7ba270261b4455068bd68f1a58db15a4a` through StarPilot `2efe6017bfe14cee4807833e05f9a7f6ba255cdb`. Contributors to that lineage include Alan Polk, John Christman, Jacob Neulight, tonesto7 and Haibin Wen. The current protocol adapter is maintained by StarPilot separately from the pinned BluePilot library; this attribution does not imply BluePilot maintains or endorses the adapted tune.
The current StarPilot Controller replaces that historical curvature-primary tune with a separately maintained adaptation of BluePilot v0.2.1's angle strategy (`2b9dc6cc784faac47a1885d0bda0561f7b76f74d`, `core/lateral_angle_ext.py`). Alan Polk is the principal controller author; John Christman contributed angle-mode anti-stall work, Jacob Neulight the pinion/shadow measurement, Nathan Ingraham and Praeuner high-speed damping, and other contributors are retained in the pinned library's `CREDITS.md`. StarPilot adds bounded small-signal conditioning ahead of the unchanged angle limit chain. This adaptation is not maintained or endorsed by BluePilot; the pinned library and its imported hooks are unchanged.
## Uniden radar detector link
The Uniden detector link builds on **inauner's** earlier Uniden R4/R8/R9 work in [inauner/StarPilot, uniden](https://github.com/inauner/StarPilot/tree/c4b694b2ac8742ddec44123d53f1f84d2990b47e) (`uniden_protocol.py`, `uniden_r4.py`, `uniden_radar_d.py`, the Galaxy Uniden panel and the radar alert banner), which established the detector's BLE alert flow and the Galaxy/UI integration approach. This branch's monitor, transport, widgets and tests are a separate implementation on the current StarPilot Bluetooth owner; the experimental settings and speed-limit slowdown logic are not included. The alert parser and command framing are based on AegisX86/UnidenR8wlink (see THIRD_PARTY_NOTICES.md).
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+70 -11
View File
@@ -1,16 +1,51 @@
# StarPilot
StarPilot is an independent fork of [openpilot](https://github.com/commaai/openpilot), with custom driving controls, vehicle integrations, raylib interfaces for comma 3 and comma four, and the Galaxy companion interface.
**Domathon is the development branch for StarPilot 7.0.** It rebuilds StarPilot on a current openpilot foundation. Feature migration and vehicle qualification are still in progress; this branch is not a completed replacement for the existing Dom release.
[![Ask DeepWiki](https://img.shields.io/badge/Ask-DeepWiki-blue?logo=readthedocs&logoColor=white)](https://deepwiki.com/StarPilotHQ/StarPilot)
[![Discord](https://img.shields.io/discord/1387432184121393333?label=Discord)](https://firestar.link/discord)
[![Last Updated](https://img.shields.io/github/last-commit/StarPilotHQ/StarPilot)](https://github.com/StarPilotHQ/StarPilot)
[![Wiki](https://img.shields.io/badge/Wiki-StarPilot-blue?logo=wiki)](https://wiki.firestar.link)
[![App Store](https://img.shields.io/badge/App_Store-black?logo=apple&logoColor=white)](https://firestar.link/ios)
[![Google Play](https://img.shields.io/badge/Google_Play-green?logo=googleplay&logoColor=white)](https://firestar.link/android)
## Explore the project
StarPilot is an open source driver assistance system for comma 3, 3X, and 4. This branch is where you can try StarPilot 7.0.
- [Developer commands](tools/STARPILOT_DEVELOPMENT.md): host tools, replay, and device builds.
- [Driving interfaces](openpilot/starpilot/ui/README.md) and [Galaxy](openpilot/starpilot/galaxy/README.md): native and companion controls.
- [Driving models](openpilot/starpilot/models/README.md): model management, artifact compatibility, and Model Laboratory status.
- [Builds and developer tools](docs/how-to/laptop-device-build.md): local development and device builds.
- [Dependency maintenance](tools/vendor/README.md): tracked source folders and upstream sync records.
## What's on testing
* **Lane Centering 2.0** can keep the car centered when only one lane line is visible in certain scenarios. When lane markings are unreliable, it falls back to the driving model's path.
* **Enhanced Stops** improves stops at stop signs and traffic lights. Vision Stop Sign Detection uses the road camera to recognize stop signs.
* **Custom Controllers** improve turning behavior on supported vehicles. The Firestar Lateral Method adapts steering to your car, and StarPilot's longitudinal planner manages acceleration and braking on supported radar and vision-only configurations.
* **Custom Models** let you choose from community fine tunes in Galaxy's Model Manager.
* **On-Device UI Replay** lets you review a recorded drive with the driving interface overlaid on the footage.
## StarPort and companion apps
**StarPort** puts the driving display on a compatible Android Auto head unit, with navigation, music controls, and model connection status. Use Mapbox or Google Maps for route guidance, and play audio through compatible car speakers with Spotify Connect or phone audio.
**Galaxy** lets you change settings, download models, update StarPilot, run diagnostics, and manage dashcam footage from your phone. The native apps connect over Wi-Fi, Firestar Link (HTTPS), or Bluetooth. [Download for iOS](https://firestar.link/ios) · [Download for Android](https://firestar.link/android)
## Getting started
Find supported hardware, installation steps, and settings in the [StarPilot wiki](https://wiki.firestar.link). Ask questions in the [community Discord](https://firestar.link/discord) or [open a driving support ticket](https://firestar.link/logs).
## More driving and device features
* Always On Lateral keeps steering assistance available independently of adaptive cruise on supported vehicles.
* Speed Limit Controller uses dashboard, map, or vision data. Curve Speed Controller learns from how you take curves.
* Driving Profiles and Traffic Mode, adjustable alert volume, and vehicle-specific tuning.
* Bluetooth keyboards, controllers, and steering wheel remotes.
* Sentry Mode records motion while parked. V-ASM uses the driver-facing camera to detect vehicles alongside the car.
## GM-only Features
* Increased LKAS fault resiliency
* ASCM_INT and SASCM support
* Custom lateral torque controller, with special tuning for Bolts
* 50% extra torque on 2017 Chevy Bolt
* Improved lateral and longitudinal tuning
* Dashboard cruise control display speed spoofing for vehicles with pedal interceptor
* Extra steering wheel button functionality for vehicles with pedal interceptor
* Optional toggle to boot comma when remote starting your vehicle
## Development
@@ -36,8 +71,32 @@ StarPilot retains upstream vehicle and Panda safety interfaces and adds regressi
Support depends on the vehicle configuration and enabled feature. An existing vehicle identifier or settings page does not by itself establish driving support. Model Laboratory currently exposes management controls, but paired driving inference remains unavailable pending integration and Chestnut validation.
## Upstream and attribution
## Integrations and credits
The current openpilot baseline is [`78dccf0b482ea1298fd1f6fa59b0554187b02ce6`](https://github.com/commaai/openpilot/commit/78dccf0b482ea1298fd1f6fa59b0554187b02ce6). Its history remains intact, followed by the StarPilot foundation and feature commits. Upstream development continues independently; the baseline changes only after an update has been integrated and checked.
StarPilot builds on [comma.ai's openpilot](https://comma.ai/openpilot), which provides automated lane centering, adaptive cruise control, lane change assist, and driver monitoring.
See [LICENSE](LICENSE), [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md), and [CREDITS.md](CREDITS.md) for licensing and source attribution. Component licenses remain with their source folders. StarPilot is maintained independently of comma.
* **JetLink** is an experimental integration with Zeph Leggett / ZoomPilot's host software. Run a larger driving model on a compatible USB-connected laptop, phone, tablet, or Jetson. See the [JetLink setup and hardware guide](openpilot/starpilot/models/JETLINK.md).
* **Chestnut eGPU** is supported on comma 3, 3X, and 4. The 3 and 3X may need additional GPS setup. The model switcher also supports comma's tinygrad driving models.
* Additional vehicle and hardware integrations include the comma pedal interceptor, Toyota SDSU, ZSS and CAN filter configurations, pre-AP Tesla, Ford, and Polestar 2.
Ford-specific lateral-control and vehicle-support work includes substantial adaptations from
[BluePilot](https://github.com/BluePilotDev/bluepilot/tree/bp-7.0), principally developed by
[Alan Polk](https://github.com/alan-polk) with additional BluePilot contributors. StarPilot's
implementation has since diverged, but that does not erase its lineage. See [CREDITS.md](CREDITS.md)
for the code-level provenance and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for applicable
upstream notices and terms. BluePilot and its contributors do not maintain or endorse StarPilot;
please direct support requests for this adaptation to the StarPilot project.
Hyundai, Kia, and Genesis angle steering and related vehicle support include substantial adaptations
from [sunnypilot](https://github.com/sunnypilot/sunnypilot/tree/hkg-angle-steering-2025) and its
[opendbc angle-steering branch](https://github.com/sunnypilot/opendbc/tree/hkg-angle-steering-2025).
StarPilot's implementation has diverged significantly; the upstream contributors do not maintain
this adaptation. Detailed code lineage is recorded in [CREDITS.md](CREDITS.md).
## Third-Party Notices
* Portions of this software include modified versions of the Material Design Icons provided by Google under the Apache License 2.0. A copy of the license is included in the `LICENSE-MDI` file.
* Ford support includes software adapted from BluePilot's `bp-7.0` branch. The source repository contains both a standard MIT notice and a separate custom SUNNYPILOT LLC notice; StarPilot preserves both in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
* Hyundai, Kia, and Genesis support includes software adapted directly from sunnypilot's HKG angle-steering branch and sunnypilot/opendbc. StarPilot preserves the applicable notices in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
> This project uses software from Haibin Wen and SUNNYPILOT LLC and is licensed under a custom license requiring permission for use.
+11 -1
View File
@@ -8,7 +8,17 @@ See the [project overview](README.md) for the current development entry points a
The entries below are retained upstream release notes. They describe openpilot releases, not completed StarPilot 7.0 milestones.
Version 0.11.2 (2026-08-12)
Version 0.11.3 (2026-XX-XX)
========================
* Autospeed
* On supported cars, openpilot will intelligently decide what speed to drive based on the scene, including:
* stopping at red lights, and going at green lights
* slowing down for curves
* adjusting speed based on surrounding traffic
* This behavior was previously available with openpilot's "Experimental mode", but is now out of beta and always enabled
* With openpilot deciding which speed to drive, the car's cruise speed is treated as a maximum speed openpilot will not exceed
Version 0.11.2 (2026-10-14)
=======================
* New driving model
* Big model with 880M parameters
+22 -20
View File
@@ -57,7 +57,7 @@ assert arch in [
"Darwin", # macOS arm64 (x86 not supported)
]
pkg_names = ['acados', 'capnproto', 'ffmpeg', 'json11', 'ncurses', 'zeromq', 'zstd']
pkg_names = ['acados', 'capnproto', 'ffmpeg', 'json11', 'ncurses', 'zstd']
if arch != 'Darwin':
pkg_names.append('libusb')
pkgs = [importlib.import_module(name) for name in pkg_names]
@@ -172,7 +172,7 @@ env = Environment(
COMPILATIONDB_USE_ABSPATH=True,
REDNOSE_ROOT="#rednose_repo",
tools=["default", "cython", "compilation_db", "rednose_filter"],
toolpath=["#msgq_repo/site_scons/site_tools", "#rednose_repo/site_scons/site_tools"],
toolpath=["#rednose_repo/site_scons/site_tools"],
)
# SCons' Darwin linker tool doesn't define the variables used to expand RPATH.
if arch == "Darwin":
@@ -287,17 +287,16 @@ def prune_cache_dir(target=None, source=None, env=None):
# ********** start building stuff **********
SConscript(['opendbc_repo/opendbc/can/SConscript'])
# Build common module
SConscript(['openpilot/common/SConscript'])
Import('_common')
common = [_common, 'json11', 'zmq']
common = [_common, 'json11']
Export('common')
# Build messaging (cereal + msgq + socketmaster + their dependencies)
# Enable swaglog include in dependency sources
env_swaglog = env.Clone()
env_swaglog['CXXFLAGS'].append('-DSWAGLOG="\\"common/swaglog.h\\""')
SConscript(['msgq_repo/SConscript'], exports={'env': env_swaglog})
SConscript(['msgq_repo/SConscript'])
SConscript(['openpilot/cereal/SConscript'])
@@ -319,7 +318,7 @@ SConscript([
if arch == "comma_arm64":
SConscript(['openpilot/system/camerad/SConscript'])
SConscript(['openpilot/starpilot/system/android_auto/SConscript'])
SConscript(['openpilot/starpilot/system/starport/SConscript'])
# Build selfdrive
SConscript([
@@ -329,6 +328,9 @@ SConscript([
'openpilot/selfdrive/modeld/SConscript',
'openpilot/selfdrive/ui/SConscript',
'openpilot/starpilot/audio/native/SConscript',
'openpilot/starpilot/models/runtime_bridge/SConscript',
'openpilot/starpilot/ui/native/SConscript',
'openpilot/starpilot/flm/SConscript',
])
# Replay is also the isolated on-device viewer engine.
@@ -346,7 +348,7 @@ if GetOption('extras') and arch != "comma_arm64":
env.CompilationDatabase('compile_commands.json')
# progress output
def count_scons_nodes(nodes):
def get_scons_nodes(nodes):
seen = set()
stack = list(nodes)
@@ -355,28 +357,28 @@ def count_scons_nodes(nodes):
if node in seen:
continue
seen.add(node)
executor = node.get_executor()
if executor is not None:
stack += executor.get_all_prerequisites() + executor.get_all_children()
# Only scan directories; generated sources are not ready yet.
stack += (node.prerequisites or []) + node.children(scan=isinstance(node, SCons.Node.FS.Dir))
return len(seen)
return seen
progress_interval = 5
progress_count = 0
progress_total = max(1, count_scons_nodes(env.arg2nodes(BUILD_TARGETS or [Dir('.')], env.fs.Entry)))
progress_nodes = get_scons_nodes(env.arg2nodes(BUILD_TARGETS or [Dir('.')], env.fs.Entry))
progress_total = max(1, len(progress_nodes))
def progress_function(node):
global progress_count
if progress_count >= progress_total:
if node not in progress_nodes:
return
progress_count = min(progress_count + progress_interval, progress_total)
progress = round(100. * progress_count / progress_total, 1)
progress_nodes.remove(node)
if len(progress_nodes) % progress_interval:
return
progress = round(100. * (1 - len(progress_nodes) / progress_total), 1)
sys.stderr.write("\rBuilding: %5.1f%%" % progress if sys.stderr.isatty() else "progress: %.1f\n" % progress)
if progress == 100. and sys.stderr.isatty():
sys.stderr.write("\n")
sys.stderr.flush()
Progress(progress_function, interval=progress_interval)
Progress(progress_function)
AddPostAction(BUILD_TARGETS or [Dir('.')], prune_cache_dir)
# Release CI rebuilds tracked device outputs for the host architecture.
+60 -13
View File
@@ -1,9 +1,24 @@
# Third-party notices
## Arabesque Firefox
The offline payload contains original Mozilla and Ubuntu archives. The pinned
versions, upstream download URLs and hashes are listed in
[`runtime.json`](openpilot/tools/arabesque_firefox/runtime.json). Mozilla publishes
the [Firefox 153.6.0esr source](https://archive.mozilla.org/pub/firefox/releases/153.6.0esr/source/)
and [Firefox notices](https://www.mozilla.org/en-US/about/legal/firefox/).
The Ubuntu archives retain their package copyright files. The
[Ubuntu package archive](https://ubuntu.com/project/docs/how-ubuntu-is-made/concepts/package-archive/)
provides source packages alongside the binaries.
## Jetlink
Jetlink's comma client is copyright (c) 2026 Zeph Leggett and distributed under the MIT License. Its complete license and permission notice are retained in [jetlink_repo/LICENSE](jetlink_repo/LICENSE); source and revision are recorded in [CREDITS.md](CREDITS.md#jetlink-external-inference) and `upstream-sync.json`.
## Timezone boundaries
[`openpilot/common/timezone_grid.bin`](openpilot/common/timezone_grid.bin) is a grid derived from [timezone-boundary-builder](https://github.com/evansiroky/timezone-boundary-builder) release 2026f (`timezones.geojson`), which is made available under the [Open Database License](https://opendatacommons.org/licenses/odbl/1-0/) and contains data from © OpenStreetMap contributors. [`openpilot/tools/timezone_grid.py`](openpilot/tools/timezone_grid.py) rebuilds it from that release.
## MRR35 Hyundai angle and radar
The MRR35 radar generator and related Hyundai angle integration derive from the frozen StarPilot snapshot `678af783`, with relevant sunnypilot/opendbc angle-branch ancestry at `cc4b08625a98e94b318cab15e45e05dad58042bd`. Both upstream `LICENSE` and `LICENSE.md` were published for that source. Their scope is not unambiguous, so both applicable notices and the extension-file attribution are retained here without choosing between them. See [CREDITS.md](CREDITS.md) for the narrow source map.
@@ -73,23 +88,14 @@ the exclusion of the other.
## BluePilot Ford support
The Ford lateral strategies, CAN constructors, camera-radar filtering and native checks include work adapted from BluePilot's `bp-7.0` source, through StarPilot `2efe6017bfe14cee4807833e05f9a7f6ba255cdb`. See [CREDITS.md](CREDITS.md#ford-support-adapted-from-bluepilot) for contributors and source revisions. The upstream extension-file and `LICENSE.md` notices reproduced above also apply to the Ford extension sources; they are retained without resolving the difference between their published license descriptions.
## Optional BluePilot angle library adapter
The angle-only adapter in `opendbc_repo/opendbc/bluepilot_lateral` is sourced directly from BluePilot bp-7.0 commit e1d051d7ba270261b4455068bd68f1a58db15a4a. The complete upstream MIT notice is retained in that folder's `LICENSE`, and the simultaneously published Custom MIT notice is retained verbatim in `LICENSE.md`. The applicable SUNNYPILOT acknowledgments reproduced above are also retained in its `CREDITS.md`. This preserves the published terms without resolving their scope or representing the adapted extension as unambiguously plain MIT.
The optional, default-disabled angle lane-centering trim additionally derives from
BluePilot bp-dev e22afa6be9b881fa784c92ebb316db47728a3d81. Its exact source and
contributors are recorded in the library CREDITS.md; the same root/opendbc MIT
and Custom MIT notices coexist unchanged at that revision. This adds attribution,
not a license-scope decision or permission grant.
The Ford CAN FD camera-radar filtering includes work adapted from BluePilot's `bp-7.0` source, through StarPilot `2efe6017bfe14cee4807833e05f9a7f6ba255cdb`. See [CREDITS.md](CREDITS.md#ford-support-adapted-from-bluepilot) for contributors and source revisions. The upstream extension-file and `LICENSE.md` notices reproduced above also apply to that source; they are retained without resolving the difference between their published license descriptions.
## Continental ARS510 radar
The optional RAV4 radar decoders and `toyota_tss2_ars510.dbc` are adapted from
The RAV4 ACC-target radar receiver is adapted from
<https://github.com/ds-sebastian/ars510-radar> at
`fb5b29c2b5999f34afeb6f7ac494a73949d66c67`.
`fb5b29c2b5999f34afeb6f7ac494a73949d66c67`. `toyota_tss2_ars510.dbc` is the DBC
of commaai/opendbc#3860 (ds-sebastian/opendbc `ddcc0b07d1759c96a1d208ae1db13ad91ce23435`).
MIT License
@@ -112,3 +118,44 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## PulseAudio server for Spotify
`openpilot/starpilot/soloist/pulseaudio/` contains unmodified AArch64 binaries from Ubuntu 24.04 packages: PulseAudio 16.1 (LGPL-2.1-or-later), libltdl (LGPL-2.1-or-later), libtdb (LGPL-3.0-or-later), libsoxr (LGPL-2.1-or-later), liborc and speexdsp (BSD-style). The complete copyright and license notices are in that directory's `licenses/`, package hashes in `PACKAGES.sha512`, and the corresponding source is available from Ubuntu's archive for the exact versions listed in its README. The libraries are dynamically linked and may be replaced with `update.sh`.
## Comma-side phone internet tunnel
`openpilot/starpilot/galaxy/bin/hev-socks5-tunnel_linux_arm64` is the upstream
[hev-socks5-tunnel 2.18.0](https://github.com/heiher/hev-socks5-tunnel/releases/tag/2.18.0)
static Linux ARM64 release, under the MIT license. Its notice is retained in
[LICENSE.hev-socks5-tunnel](openpilot/starpilot/galaxy/bin/LICENSE.hev-socks5-tunnel);
the adjacent SHA-256 file pins the downloaded artifact.
## Comma-side Galaxy Bluetooth bridge
The Galaxy Bluetooth phone bridge from [StarPilotHQ/StarPilot](https://github.com/StarPilotHQ/StarPilot)
(natehuby76, PRs #224/#225) is included under `openpilot/starpilot/galaxy_bluetooth/`,
with its license in [UPSTREAM-LICENSE](openpilot/starpilot/galaxy_bluetooth/UPSTREAM-LICENSE).
The bridge runs on openpilot's Python with PyCryptodome 3.23.0 (BSD/public-domain
components, from opendbc). Its other dependencies are vendored unmodified, as
pure-Python sources, in `openpilot/starpilot/galaxy_bluetooth/vendor/`:
dbus-next 0.2.3 (MIT), ifaddr 0.2.0 (MIT) and Zeroconf 0.151.3
(LGPL-2.1-or-later). Their license texts are in `vendor/licenses/`, and
`vendor/VENDOR.json` records each PyPI source file and its SHA-256. Zeroconf is
kept as separate, unmodified source files that can be replaced with another
compatible version, as the LGPL requires.
## Subaru angle support from jacobw
The Subaru angle implementation includes work from Jacob Waller's `jul-angle-based` openpilot/opendbc branches and their upstream contributors. See [CREDITS.md](CREDITS.md#subaru-angle-steering-from-jacob-wallers-fork) and `opendbc_repo/opendbc/car/subaru/ORIGIN_HISTORY.tsv` for pinned sources, original authors and titles. The source repositories publish the comma MIT license; the complete applicable notice remains in the project `LICENSE` and `opendbc_repo/LICENSE`. StarPilot's adaptations preserve additional native and caller safety guards.
## StarPilot Ford demand tuning
The historical tuning formerly in `openpilot/starpilot/car/ford/starpilot_tuning.py` included the BluePilot bp-7.0-derived work identified in [CREDITS.md](CREDITS.md#starpilot-ford-demand-tuning). The published upstream license notices retained above and in the pinned BluePilot library remain applicable to the adapted source. StarPilot's separate protocol adapter does not modify those notices or resolve their scope.
The angle-primary adaptation in `openpilot/starpilot/car/ford/starpilot_controller.py` is derived from BluePilot v0.2.1. It retains the complete MIT copyright and permission notice in `opendbc_repo/opendbc/bluepilot_lateral/LICENSE`, including Comma.ai, BluePilot and StarPilot contributors. See the contributor attribution in `CREDITS.md`.
## Uniden detector protocol
The detector alert parser and command framing in `openpilot/starpilot/uniden/` are based on [AegisX86/UnidenR8wlink](https://github.com/AegisX86/UnidenR8wlink)'s MIT-licensed protocol documentation, copyright (c) 2026 Aegis "P.R Aigis". The complete notice is retained in [UPSTREAM-LICENSE](openpilot/starpilot/uniden/UPSTREAM-LICENSE).
+1 -1
View File
@@ -77,7 +77,7 @@ while [[ $# -gt 0 ]]; do
;;
--cereal|-cereal)
shortcut_targets+=(openpilot/cereal/libcereal.a openpilot/cereal/libsocketmaster.a
openpilot/cereal/messaging/bridge openpilot/cereal/services.h)
openpilot/cereal/services.h)
;;
-j|--jobs)
passthrough_args+=("$1")
File diff suppressed because one or more lines are too long
+26 -1
View File
@@ -5,6 +5,8 @@ openpilot ALC and openpilot LDW do not automatically drive the vehicle or reduce
While changing lanes, openpilot is not capable of looking next to you or checking your blind spot. Only nudge the wheel to initiate a lane change after you have confirmed it's safe to do so.
Unexpected steering may occur. openpilot ALC may not steer to avoid stopped or slow-moving vehicles, cross traffic, construction barriers or cones, motorcycles, children, pedestrians, animals, or other objects on the road.
Many factors can impact the performance of openpilot ALC and openpilot LDW, causing them to be unable to function as intended. These include, but are not limited to:
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation.
@@ -13,6 +15,14 @@ Many factors can impact the performance of openpilot ALC and openpilot LDW, caus
* The device is mounted incorrectly.
* When in sharp curves, like on-off ramps, intersections etc...; openpilot is designed to be limited in the amount of steering torque it can produce.
* In the presence of restricted lanes or construction zones.
* When the lane markings are unclear, worn, missing, or they cross each other.
* Tar marks, shadows, road cracks, temporary or construction lane markings, or other road imperfections.
* When lanes merge or split.
* When entering a highway on-ramp or exiting an off-ramp.
* On roads with intersections or roundabouts.
* On slippery roads.
* When towing a trailer.
* When entering or exiting a tunnel.
* When driving on highly banked roads or in presence of strong cross-wind.
* Extremely hot or cold temperatures.
* Bright light (due to oncoming headlights, direct sunlight, etc.).
@@ -24,6 +34,8 @@ The list above does not represent an exhaustive list of situations that may inte
openpilot ACC and openpilot FCW are not systems that allow careless or inattentive driving. It is still necessary for the driver to pay close attention to the vehicle’s surroundings and to be ready to re-take control of the gas and the brake at all times.
openpilot ACC may not stop your vehicle in time to avoid a collision with a vehicle that quickly stops in front of you. openpilot ACC may occasionally cause your vehicle to brake when not required or when you are not expecting it.
Many factors can impact the performance of openpilot ACC and openpilot FCW, causing them to be unable to function as intended. These include, but are not limited to:
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation.
@@ -35,9 +47,20 @@ Many factors can impact the performance of openpilot ACC and openpilot FCW, caus
* In presence of traffic signs or stop lights, which are not detected by openpilot at this time.
* When the posted speed limit is below the user selected set speed. openpilot does not detect speed limits at this time.
* In presence of vehicles in the same lane that are not moving.
* When a vehicle you are following moves out of your driving path and a stationary or slow-moving vehicle or object is in front of you.
* Narrow vehicles, such as bicycles or motorcycles.
* Vehicles or objects only partially in the driving lane.
* On curves, openpilot ACC may not detect a vehicle in the same lane, and may accelerate to the set speed.
* Cross traffic.
* Oncoming vehicles.
* Animals or objects in the road.
* Rare objects such as trailers, ramps, cargo, open doors, etc. protruding from vehicles.
* When abrupt braking maneuvers are required. openpilot is designed to be limited in the amount of deceleration and acceleration that it can produce.
* When surrounding vehicles perform close cut-ins from neighbor lanes.
* Driving on hills, narrow, or winding roads.
* On slippery roads.
* When towing a trailer.
* When entering or exiting a tunnel.
* Extremely hot or cold temperatures.
* Bright light (due to oncoming headlights, direct sunlight, etc.).
* Interference from other equipment that generates radar waves.
@@ -46,7 +69,9 @@ The list above does not represent an exhaustive list of situations that may inte
## Limitations of openpilot DM
openpilot DM should not be considered an exact measurement of the alertness of the driver.
openpilot DM displays a series of escalating warnings. Disregard of these warnings may result in openpilot being unavailable for a period of time.
openpilot DM should not be considered an exact measurement of the alertness of the driver. openpilot DM cannot always detect if the driver is tired or inattentive.
Many factors can impact the performance of openpilot DM, causing it to be unable to function as intended. These include, but are not limited to:
+6
View File
@@ -4,6 +4,12 @@ openpilot is an Adaptive Cruise Control (ACC) and Automated Lane Centering (ALC)
Like other ACC and ALC systems, openpilot is a failsafe passive system and it requires the
driver to be alert and to pay attention at all times.
openpilot is not an autonomous driving system. It is not a collision avoidance system or a
substitute for safe and attentive driving. The driver is always responsible for the safe
operation of the vehicle and must be ready to take control at any time. The driver can override
openpilot at any time by braking, accelerating, or steering the vehicle. openpilot may
disengage without warning. Read the [limitations](https://github.com/commaai/openpilot/blob/master/docs/LIMITATIONS.md) carefully before using openpilot.
To assist the driver in maintaining alertness, openpilot includes a driver monitoring feature
that alerts when it detects driver distraction.
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PYTHON_BIN="${HEATDEATH_PYTHON:-python3}"
if [[ -z "${HEATDEATH_PYTHON:-}" && -x /usr/local/venv/bin/python3 ]]; then
PYTHON_BIN=/usr/local/venv/bin/python3
fi
exec "$PYTHON_BIN" -B "$ROOT_DIR/tools/heatdeath/heatdeath.py" "$@"
+74 -15
View File
@@ -1,20 +1,79 @@
# Jetlink runtime for StarPilot
<p align="center">
<img src="macos/Resources/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png" width="128" height="128" alt="Jetlink icon">
</p>
This subtree supplies the Jetlink remote-model client used by **StarPilot**.
For installing, connecting, selecting, and running it with StarPilot, follow
[the StarPilot JetLink guide](../openpilot/starpilot/models/JETLINK.md).
<h1 align="center">Jetlink</h1>
The comma runs StarPilot; the connected host runs the upstream Jetlink application.
Host apps, installers, development references, and original history are maintained
in [ZoomPilot / Jetlink](https://github.com/zoompilot/jetlink/tree/c17cd5c).
This runtime subtree does not contain the upstream host applications or docs;
their source attribution does not require installing ZoomPilot on the comma.
<p align="center">
Run openpilot's large driving models on a computer connected to your comma.
</p>
Jetlink is experimental. Use separate power and USB 3, set up parked, and verify
StarPilot's active model status. See the local guide for recovery and limitations.
**Jetlink is experimental.** It requires a comma running an openpilot fork
with Jetlink support: zoompilot's
[`main` release](https://github.com/zoompilot/zoompilot/tree/main), or StarPilot.
If the link drops or lags while engaged, the comma says **TAKE CONTROL** and
stays engaged on the small model. Be ready to take over.
## Attribution
## Quick start
Jetlink was developed by Zeph Leggett / ZoomPilot. Copyright (c) 2026 Zeph Leggett.
The original [MIT license](LICENSE) is preserved without modification.
[Upstream README and credits](https://github.com/zoompilot/jetlink/blob/c17cd5c/README.md).
You need a **comma 3X or comma 4**, a **USB 3 data cable**, and **separate power
for the comma and computer**. Set up offroad with both devices online.
Choose your computer. Each guide covers installation and connecting the comma.
| Computer | Setup guide |
| --- | --- |
| Jetson Orin Nano Super | [Set up a Jetson](docs/jetson.md) |
| Apple silicon Mac | [Set up a Mac](docs/macos-app.md) |
| Linux PC with an NVIDIA GPU | [Set up a Linux PC](docs/linux-pc.md) |
| iPhone or iPad with USB-C | [Install with TestFlight](docs/iphone-app.md) |
| Android phone with USB 3 | [Try the experimental Android app](docs/android-app.md) |
## Demos
### Jetson
<a href="docs/images/install-demo.mp4"><img src="docs/images/install-demo.webp" width="100%" alt="Jetlink installer on a Jetson"></a>
<details>
<summary>Watch the web page</summary>
<a href="docs/images/webui-demo.mp4"><img src="docs/images/webui-demo.webp" width="100%" alt="The Jetson's web page on a phone and a computer, with simulated drive data: sign in, frame timing against the 50 ms budget, a model downloaded and prepared (sped up), the power setting applied, and keep awake"></a>
</details>
### Mac
<a href="docs/images/mac-demo.mp4"><img src="docs/images/mac-demo.webp" width="100%" alt="Jetlink for Mac: Use Model downloads and prepares a model, the comma connects over USB, and Status shows each frame against the 50 ms budget"></a>
### iPhone and iPad (experimental)
Simulator demo.
<a href="docs/images/iphone-demo.mp4"><img src="docs/images/iphone-demo.webp" width="100%" alt="Jetlink for iPhone, recorded in the iOS Simulator: Get downloads and prepares a model, the comma connects over USB, and Status shows each frame against the 50 ms budget, with timings modeled on an iPhone 17 Pro measurement"></a>
<a href="https://testflight.apple.com/join/DAsYk5sP"><img src="docs/images/testflight-badge.svg" alt="Available on TestFlight" height="40"></a>
### Android (experimental)
Emulator demo.
<a href="docs/images/android-demo.mp4"><img src="docs/images/android-demo.webp" width="100%" alt="Jetlink for Android, recorded in the Android emulator: Get downloads a model, the comma connects over USB, and Status shows each frame against the 50 ms budget. The download is sped up, the emulator's CPU preparation cut, and the model's time modeled on an estimate for a Snapdragon 8 Gen 3"></a>
<a id="comma-setup-all-platforms"></a>
<a id="jetson-or-linux-pc"></a>
<a id="linux-pc"></a>
<a id="what-to-expect-when-driving"></a>
<a id="if-something-is-wrong"></a>
<a id="more"></a>
## Help
[Setup guides](docs/README.md#set-up) ·
[Daily use](docs/using-jetlink.md) ·
[Troubleshooting](docs/troubleshooting.md) ·
[Operating limits](docs/status.md)
## License
[MIT](LICENSE).
+1 -1
View File
@@ -10,4 +10,4 @@ jetlink: run openpilot's large driving models on an attached Jetson.
# so does the release check (macos/scripts/check-version.sh). The comma runs
# jetlink from a checkout, not an install, so this is also all it has. The Swift
# reads it from Pinned.swift: run JetlinkKit/Scripts/make_pins.py after a bump.
__version__ = '0.8.3'
__version__ = '0.9.0'
+82 -29
View File
@@ -102,12 +102,16 @@ class JetlinkClient:
# the newest model output read off the link, whichever call read it: what
# a frame whose own reply is late publishes again (JetlinkModelState.end)
self.last_output: np.ndarray | None = None
# frames sent and not yet answered, oldest first. More than one while
# frames go out without being waited for (drain), or after a reply a
# frame gave up on (infer_end with hold)
# frames sent and not yet answered, oldest first. More than one after a
# reply a frame gave up on (infer_end with hold)
self._in_flight: deque[Sent] = deque()
# seqs sent with no reply wanted (leave): an ERROR to one is not this link's
self._no_reply_wanted: set[int] = set()
# frames the server never answered this session, for the log: a lost
# datagram is one, and to the caller a held frame like any late reply
self.frames_lost = 0
# take a server's offer of frame datagrams (_take_datagrams); False keeps frames on the stream, for A/B runs
self.allow_datagrams = True
# -- construction ---------------------------------------------------------
@@ -128,8 +132,8 @@ class JetlinkClient:
"""This end is the USB gadget, over a gadget another process owns.
The owner holds ep0 and the UDC bind for as long as the link is enabled,
so a drive starting or ending is no longer an unplug the host has to
recover from. See FfsTransport.borrowed.
so a drive starting or ending is not an unplug the host has to recover
from. See FfsTransport.borrowed.
"""
from jetlink.transport.ffs import FfsTransport
return cls(FfsTransport.borrowed(mount, udc, bounce=bounce, owner_gadget=owner_gadget), **kw)
@@ -210,8 +214,8 @@ class JetlinkClient:
self._dispatch(msg)
continue
if msg.msg_type == P.Msg.INFER_RESP and any(f.seq == msg.seq for f in self._in_flight):
# the answer to a frame nobody waited for, or one a frame gave up
# waiting for: read like any other, then on to what is wanted
# the answer to a frame that gave up waiting for it (a held frame):
# read like any other, then on to what is wanted
self._take_reply(msg)
continue
# A reply a caller gave up on. Drop it, or every frame reads one behind.
@@ -220,12 +224,17 @@ class JetlinkClient:
# -- handshake ------------------------------------------------------------
def hello(self, timeout: float = 5.0) -> dict:
def hello(self, timeout: float = 5.0, pick: dict | None = None) -> dict:
"""Introduce this client. The server starts its session over on a hello,
so this is also how a new owner of the gadget takes over one the server
never saw end; see Session.greet in JetlinkServer."""
never saw end; see Session.greet in JetlinkServer. `pick` is the comma's
own big-model pick with its age and its date by the comma's clock, {ref,
sha256, nbytes, name, age_s, at}; the answer's `pick` is the newer of it
and the server's (PickStore)."""
seq = self._next_seq()
client = {'nonce': self.nonce, 'name': self.name}
if pick is not None:
client['pick'] = pick
try:
link = self.t.link_info()
except Exception:
@@ -238,8 +247,20 @@ class JetlinkClient:
# its last output is nothing the new model may publish
self._in_flight.clear()
self.last_output = None
self.frames_lost = 0
self.t.send_json(P.Msg.HELLO_REQ, seq, {'client': client})
return json.loads(bytes(self._expect(P.Msg.HELLO_RESP, seq, timeout).payload))
resp = json.loads(bytes(self._expect(P.Msg.HELLO_RESP, seq, timeout).payload))
self._take_datagrams(resp)
return resp
def _take_datagrams(self, hello: dict) -> None:
"""Frames as datagrams when the server offers them (only a phone's server,
over the cable). A session that offers none puts frames back on the link."""
port, token = hello.get('frame_port'), hello.get('frame_token')
if port and token is not None and self.allow_datagrams and self.t.use_datagrams(int(port), int(token)):
log.info("frames go to the server as datagrams (port %d)", int(port))
else:
self.t.stop_datagrams()
def state(self, timeout: float = 2.0) -> dict:
seq = self._next_seq()
@@ -285,7 +306,8 @@ class JetlinkClient:
frame_skip: int = DEFAULT_FRAME_SKIP,
progress: ProgressFn | None = None,
build_timeout: float = 900.0,
should_stop: StopFn | None = None) -> ModelSpec:
should_stop: StopFn | None = None,
fetch: bool = False, ref: str | None = None) -> ModelSpec:
"""Make the server ready to run this model, uploading and building if needed.
Blocks until ready or the build fails, and returns the spec the server
@@ -293,8 +315,12 @@ class JetlinkClient:
parser rejects an export (tinygrad and the org.tinygrad domain) still runs.
`onnx_path` None means the caller cannot upload (modeld) and a missing
engine is EngineMissing. `progress(stage, frac, msg)` has stage in
upload/patch/parse/build/load. `should_stop` is polled during long waits.
engine is EngineMissing. `fetch` asks a server that lacks the model to
download it itself (state downloading, stage download) rather than answer
need_upload; one that cannot, or is too old to, answers need_upload as
before. `ref` is the catalog ref the model is known by.
`progress(stage, frac, msg)` has stage in
download/upload/patch/parse/build/load. `should_stop` is polled during long waits.
"""
self.progress_cb = progress
self._should_stop = should_stop or (lambda: False)
@@ -302,7 +328,12 @@ class JetlinkClient:
self._engine_state = None
seq = self._next_seq()
self.t.send_json(P.Msg.ENGINE_REQ, seq, {'sha256': sha256, 'nbytes': nbytes, 'frame_skip': frame_skip})
request = {'sha256': sha256, 'nbytes': nbytes, 'frame_skip': frame_skip}
if fetch:
request['fetch'] = True
if ref:
request['ref'] = ref
self.t.send_json(P.Msg.ENGINE_REQ, seq, request)
resp = json.loads(bytes(self._expect(P.Msg.ENGINE_RESP, seq, 60.0).payload))
self._engine_state = resp
log.info("server engine state: %s (%s)", resp['state'], resp.get('detail', ''))
@@ -379,36 +410,51 @@ class JetlinkClient:
def infer_begin(self, warped: np.ndarray, packed: np.ndarray, frame_id: int = 0,
reset: bool = False, want_state: bool = False, deadline: float | None = None,
silence: float | None = None) -> int:
skip_if_busy: bool = False) -> int | None:
"""Send a frame and return immediately with its sequence number.
Split from infer_end so the caller can work while the Jetson is busy;
openpilot publishes chestnutState in that window. A frame nobody calls
infer_end for is read by the next drain or infer_end. A host that has
answered none of them for `silence` (the client's deadline by default)
is gone, not slow, and the link is done here, before another frame goes
out to it. `deadline` bounds this frame's send.
openpilot publishes chestnutState in that window. A frame whose reply
infer_end stopped waiting for is read by the next drain or infer_end. A
host that has answered none of them for the client's deadline is gone,
not slow, and the link is done here, before another frame goes out to
it. `deadline` bounds this frame's send.
`skip_if_busy` says the caller can do without this frame's reply: it
holds the last output, as JetlinkModelState.end does. A frame the link
cannot take without waiting for the host to drain earlier ones is then
not sent, and None comes back: the link is as good as it was
(Transport.try_send). Over a phone's cable it goes as datagrams instead,
where a lost one is a frame the server never answers, and the next reply
takes it out of flight (_take_reply).
"""
if self.spec is None:
raise LinkError("ensure_engine() first")
if self.dead:
raise LinkError("link previously failed")
silence = self.deadline if silence is None else silence
if self.waiting_for() > silence:
if self.waiting_for() > self.deadline:
self.dead = True
raise LinkError(f"no answer to {len(self._in_flight)} frames in {silence:.1f}s; link abandoned")
raise LinkError(f"no answer to {len(self._in_flight)} frames in {self.deadline:.1f}s; link abandoned")
warped = _as_bytes(warped, self.spec.warped_nbytes, 'warped')
packed = _as_bytes(packed, self.spec.packed_nbytes, 'packed')
seq = self._next_seq()
flags = ((P.Flag.RESET_QUEUES if reset else 0) | (P.Flag.WANT_STATE if want_state else 0)
| (P.Flag.WANT_HIDDEN if self.want_hidden else 0))
parts = (P.pack_infer_req(frame_id, flags), warped, packed)
sent = Sent(seq, frame_id, flags, time.monotonic())
timeout = self.deadline if deadline is None else deadline
try:
self._in_flight.append(Sent(seq, frame_id, flags, time.monotonic()))
self.t.send(P.Msg.INFER_REQ, seq, (P.pack_infer_req(frame_id, flags), warped, packed),
timeout=self.deadline if deadline is None else deadline)
if skip_if_busy and self.t.datagrams:
self.t.send_datagrams(P.Msg.INFER_REQ, seq, parts)
elif skip_if_busy:
if not self.t.try_send(P.Msg.INFER_REQ, seq, parts, timeout=timeout):
return None # the seq is skipped; replies are matched by seq, not counted
else:
self.t.send(P.Msg.INFER_REQ, seq, parts, timeout=timeout)
except LinkError:
self.dead = True
raise
self._in_flight.append(sent)
return seq
def infer_end(self, seq: int, deadline: float | None = None, hold: float | None = None) -> np.ndarray | None:
@@ -476,12 +522,15 @@ class JetlinkClient:
def _take_reply(self, msg: Message) -> np.ndarray:
"""One INFER_RESP off the stream: checked against the frame it answers,
its timings and telemetry kept, the frame and any older one taken out of
flight. Raises, with the link dead, on anything but a good answer."""
flight. Raises NotFinite on Status.NOT_FINITE, the link kept, and with
the link dead on anything else but a good answer."""
while self._in_flight and self._in_flight[0].seq != msg.seq:
# an older frame the server never answered: it answers in order, and a
# frame that fell out of its session (a hello between) is not coming
# an older frame the server never answered: it answers in order, so a
# frame that fell out of its session (a hello between), or whose
# datagrams did not all arrive, is not coming
skipped = self._in_flight.popleft()
log.warning('frame %d (seq %d) was never answered', skipped.frame_id, skipped.seq)
self.frames_lost += 1
if not self._in_flight:
self.dead = True
raise LinkError(f'inference response seq {msg.seq} answers no frame sent')
@@ -491,6 +540,10 @@ class JetlinkClient:
raise LinkError('inference response is missing its header')
fid, status, gpu_us, queue_us, total_us = P.unpack_infer_resp(msg.payload)
self.last_timings = (gpu_us, queue_us, total_us)
if status == P.Status.NOT_FINITE and fid == frame_id:
# the server's session goes on, keeping nothing of the frame
# (Session.infer), so the link stays and last_output is the one before
raise P.NotFinite(f"inference output is not finite: NOT_FINITE (frame {fid})")
if status != P.Status.OK:
self.dead = True
raise LinkError(f"inference failed: {_name(P.Status, status)} (frame {fid})")
+54 -39
View File
@@ -12,8 +12,8 @@ Holding ep0 needs sysfs and a unix socket; `openpilot.common.swaglog` costs
28 MB because it drags numpy, capnp and zmq in to publish a log line, and
`openpilot.common.params` imports swaglog, so a module that touches either
prices the owner out of being minimal. Measured on the comma: python plus this
plus the FunctionFS transport is 10.4 MB against 47.5 MB for the daemon that
imported the world.
plus the FunctionFS transport is 10.4 MB against 47.5 MB with openpilot's
modules imported.
Nothing in jetlink.comma may import openpilot or knows a param: the settings
come from jetlink.openpilot.settings, over the directory and the keys the
@@ -146,7 +146,7 @@ UDC_PATH = Path(UDC_SYSFS)
# the network function jetlink-root.sh gadget --ios adds after ffs.jetlink. Its
# netdev is not usb0, which the modem holds, but whatever the kernel names it
NET_FUNCTION = 'ncm.usb0'
# written by scripts/comma/jetlink-root.sh gadget, which the owner runs when the
# written by jetlink/comma/jetlink-root.sh gadget, which the owner runs when the
# link is on and there is no gadget: "ok", or "error: <reason>"
GADGET_STATUS = Path("/dev/shm/jetlink-gadget")
# the owner's own: "error: the lender could not listen: <reason>" while nothing
@@ -158,15 +158,17 @@ CC_ORIENTATION = Path('/sys/class/power_supply/usb/typec_cc_orientation')
# sleep. Presence comes from this, not the UDC; a marker whose writer is dead is
# a leftover from a kill
DORMANT = Path("/dev/shm/jetlink-dormant")
# hardwared's request to power the Jetson off; see backend.shutdown
# hardwared's request to power the Jetson off; see request_shutdown
SHUTDOWN_REQUEST = Path("/dev/shm/jetlink-shutdown")
# the owner's status record: everything the readers used to take from the
# files above one by one, rewritten whole every step, which makes it the
# owner's heartbeat too. A clean stop removes it
# the owner's status record: the owner's state in one file, rewritten whole
# every step, which makes it the owner's heartbeat too. A clean stop removes it
STATUS = Path("/dev/shm/jetlink/status.json")
# how old that record may be before a reader takes its owner for gone: six of
# its 0.5 s steps. A wait inside a step renews it (Owner.beat)
HEARTBEAT_TIMEOUT = 3.0
# how the owner's crash-loop backoff starts its record's error, which
# status.Status.reason_code reads it by
BACKING_OFF = "the service keeps stopping"
# the owner's start times, for its crash-loop backoff (see the owner)
STARTS = Path("/dev/shm/jetlink/starts.json")
# held with flock by the owner for its whole life, so there is only ever one
@@ -174,11 +176,15 @@ OWNER_LOCK = Path("/dev/shm/jetlink/owner.lock")
# what the server's last hello said (lending.SERVER_FIELDS), kept apart from
# the status record so a clean stop leaves it for the next owner
SERVER = Path("/dev/shm/jetlink/server.json")
# how long a host that stopped reading configured still counts as there. The
# owner holds the gadget for as long as the link is enabled, so presence no
# longer blinks at every handover; what is left to bridge is a USB3 link
# recovery passing through "addressed", and a bounce made on purpose when a
# host will not enumerate (wait_for_host)
# the joining model's runtime record, rewritten by a thread in modeld once a
# second and on every handover: whether the big model drives, for a reader
# with no modelV2 (status.runtime). modeld's close() leaves it stopping
MODELD = Path("/dev/shm/jetlink/modeld.json")
# how often modeld rewrites that record without a handover
RECORD_PERIOD = 1.0
# how long a host that stopped reading configured still counts as there: long
# enough to bridge a USB3 link recovery passing through "addressed", and a
# bounce made on purpose when a host will not enumerate (wait_for_host)
PRESENCE_HOLD = 5.0
@@ -199,22 +205,31 @@ def write_record(path: Path, record) -> None:
def clear_leftovers(directory: Path) -> None:
"""The temporaries a writer killed between its write and its rename left
in `directory`. For the owner's start, when nothing else writes there."""
in `directory`, for the owner's start. Only a dead writer's (write_record
names them by pid): modeld writes its runtime record there too, and a
live one's is mid-write."""
try:
for leftover in directory.glob('.*.json.*'):
leftover.unlink(missing_ok=True)
pid = leftover.name.rsplit('.', 1)[-1]
if not (pid.isdigit() and pid_alive(int(pid))):
leftover.unlink(missing_ok=True)
except OSError:
pass
def read_record(path: Path) -> dict | None:
"""A JSON record write_record wrote, or None: missing, or not a record."""
try:
record = json.loads(read(path))
except ValueError:
return None
return record if isinstance(record, dict) else None
def owner_status() -> dict | None:
"""The owner's status record, or None without one: no owner has run since
boot, the last one stopped cleanly, or it is one too old to write it."""
try:
record = json.loads(read(STATUS))
except ValueError:
return None
return record if isinstance(record, dict) else None
return read_record(STATUS)
def owner_alive(record: dict) -> bool:
@@ -316,8 +331,8 @@ def wait_for_host(timeout: float, bounce=None, should_stop=None, report=None, mo
"""Wait for the Jetson to enumerate us, bouncing a bus that stalled.
The gadget stays bound throughout. An unbind is an unplug as the far end sees
it, and while one boots it takes ~50 s a cycle: doing that on a timer landed
an unplug on a box that was seconds from enumerating.
it, and while one boots it takes ~50 s a cycle, so an unbind on a timer can
land on a box seconds from enumerating.
The one case that needs an edge is a host that took the bind as a wake, reset
the bus and stopped. The UDC then sits in default or addressed with the CC
@@ -420,9 +435,15 @@ def dormant() -> bool:
pid = int(read(DORMANT))
except ValueError:
return False
return pid_alive(pid)
def pid_alive(pid) -> bool:
if not isinstance(pid, int) or isinstance(pid, bool) or pid <= 0:
return False # 0 and below name process groups, never one process
try:
os.kill(pid, 0)
except ProcessLookupError:
except (ProcessLookupError, OverflowError, ValueError):
return False
except PermissionError:
pass # alive, just not ours to signal
@@ -430,7 +451,15 @@ def dormant() -> bool:
def request_shutdown(reason: str) -> bool:
return _write(SHUTDOWN_REQUEST, json.dumps({'reason': reason}), "write the shutdown request")
"""Hand the owner a power-off request, whole or not at all: a partial one (a
full /dev/shm) is one the owner cannot read, so it never takes it. False,
and logged, when it cannot be written."""
try:
write_record(SHUTDOWN_REQUEST, {'reason': reason})
return True
except OSError:
log.exception("jetlink: could not write the shutdown request")
return False
def pending_shutdown() -> str | None:
@@ -441,22 +470,8 @@ def pending_shutdown() -> str | None:
"""
if not SHUTDOWN_REQUEST.exists():
return None
try:
return str(json.loads(read(SHUTDOWN_REQUEST)).get('reason', ''))
except ValueError:
return None
def await_shutdown(timeout: float, poll: float = 0.25) -> bool:
"""Wait for the owner's run to take a shutdown request. False if nobody did
within `timeout`, and then the request is withdrawn."""
deadline = time.monotonic() + timeout
while time.monotonic() < deadline:
if not SHUTDOWN_REQUEST.exists():
return True
time.sleep(poll)
finish_shutdown()
return False
record = read_record(SHUTDOWN_REQUEST)
return None if record is None else str(record.get('reason', ''))
def finish_shutdown() -> None:
+728
View File
@@ -0,0 +1,728 @@
#!/usr/bin/env bash
#
# Copyright (c) 2026-, Zeph Leggett.
# This file is part of jetlink and is licensed under the MIT License.
#
# Everything jetlink does as root on the comma, in one place. The owner runs it
# through jetlink/comma/root.py, which is sudo -n and a timeout:
#
# sudo jetlink/comma/jetlink-root.sh gadget # the gadget for a Jetson or a Mac
# sudo jetlink/comma/jetlink-root.sh gadget --ios # the gadget for an iPhone
# sudo jetlink/comma/jetlink-root.sh net # after a bind, iOS only: address, DHCP
# sudo jetlink/comma/jetlink-root.sh rps # the cable's receive work onto core 6, read back
# sudo jetlink/comma/jetlink-root.sh check # what is there now
# sudo jetlink/comma/jetlink-root.sh teardown
# sudo jetlink/comma/jetlink-root.sh port hold|off # the USB-C port held as the device, or let go
# sudo jetlink/comma/jetlink-root.sh port device|reset # ask the far end to host over USB PD, or reset PD
# sudo jetlink/comma/jetlink-root.sh port source # ask the far end for the source role: the comma charges it
# sudo jetlink/comma/jetlink-root.sh udc apply|restore # the USB device controller kept a device and its debug log off, or stock
# sudo jetlink/comma/jetlink-root.sh udc start|stop # its device side turned on, or off
# sudo jetlink/comma/jetlink-root.sh vm apply|restore # the link's VM tuning, or the stock values
# sudo jetlink/comma/jetlink-root.sh draw off|on # no current drawn from the port, or the charger's own
# sudo jetlink/comma/jetlink-root.sh boot SETTING # at boot: draw off while the Jetlink setting's file is not 0
#
# For the comma four and the comma 3X only. Both are SDM845 on the same AGNOS
# kernel (4.9, dwc3 at a600000.dwc3), with configfs, FunctionFS and NCM built
# in and no modules to load.
# The 3X is assumed from the kernel it shares with the four; only the four is tested.
#
# gadget: the USB gadget, chosen by the comma's Jetlink setting. The
# comma is the USB device and the host runs the model; docs/transport.md says
# why. For a Jetson or a Mac (USB), the FunctionFS vendor interface alone. For
# an iPhone (iOS, with --ios), a composite: the vendor interface first, so it
# stays interface 0, and a CDC-NCM network interface after it, since an iPhone
# app can only use the network: the phone gets 192.168.60.x by DHCP from the
# dnsmasq this script starts on the gadget's netdev, and dials the comma at
# 192.168.60.1:5599.
#
# It does not bind the UDC: a FunctionFS gadget cannot attach to a controller
# until its descriptors are written, and the owner, which opens ep0, writes
# them and binds. The NCM function rides on that bind, and its netdev exists
# only from the first bind on, so the network is set up by net, which the owner
# runs after each bind.
#
# On failure the reason is left in $STATUS_FILE as well as on stderr, so the
# openpilot side can say why the link is unavailable. net reports in
# $NET_STATUS_FILE; it never fails the gadget.
set -euo pipefail
GADGET=${JETLINK_GADGET:-/sys/kernel/config/usb_gadget/jetlink}
FFS_MOUNT=/dev/ffs-jetlink
FFS_NAME=jetlink
CONFIGFS=/sys/kernel/config
# who openpilot runs as: the owner opens the endpoints and binds the UDC as it
OPENPILOT_USER=comma
# tmpfs on purpose: per-boot state, and the comma's flash is precious
STATUS_FILE=/dev/shm/jetlink-gadget
NET_STATUS_FILE=/dev/shm/jetlink-net
# pid.codes test allocation; get a real PID before distributing this
VID=0x1209
PID=0x0001
NET_IF=usb0 # the function name suffix only; see net_ifname for the netdev
# NCM batches packets, which a 460 KB frame benefits from
NET_FN=ncm.$NET_IF
COMMA_ADDR=192.168.60.1
COMMA_PREFIX=24
# The whole subnet and short leases: the comma's 4.9 kernel gives the host a new
# random MAC every bind, so each bind is a new DHCP client. With 8 addresses and
# an hour's lease, eight rebinds in an hour left the next host without one.
DHCP_RANGE=192.168.60.2,192.168.60.254,10m
DNSMASQ_PID=/dev/shm/jetlink-dnsmasq.pid
DNSMASQ_IF=/dev/shm/jetlink-dnsmasq.if
DNSMASQ_LEASES=/dev/shm/jetlink-usb0.leases
SYS_NET=${JETLINK_SYS_NET:-/sys/class/net}
# The cable's receive work (RPS): core 6, the one big core openpilot runs no
# real-time thread on. It clocks out the rest of each frame and takes the
# phone's reply, and under load 4.9 hands it to ksoftirqd, which waits behind
# any SCHED_FIFO thread on its core. With f0 (cores 4-7) each connection hashed
# to one of them: 4 is card/controlsd/selfdrived, 5 the ui, 87 and 77 % busy on
# a drive. A ui-like FIFO 53 load on the receive core took the link from 7.6 to
# 12.4 ms (p90 36 to 47 ms round trip); on core 6, 7.7.
# The kernel keeps only the cores online at the write, so with the big cores
# parked it reads 00: the owner steers again once a drive starts.
RPS_CPUS=40
# No connection tracking on the cable. AGNOS builds conntrack and the legacy
# tables in, so every packet to and from the phone would be tracked and walk four
# empty tables: NOTRACK in raw for the cable's netdev takes 0.37 ms off a TCP
# frame's send, and covers the TCP that frame
# datagrams fall back to. The rules carry a comment and are replaced as a set:
# the netdev's name moves between binds, and usb0 is the modem's when it has one.
IPTABLES=${JETLINK_IPTABLES:-iptables-legacy}
TRACK_TAG=jetlink
# port: the charger's DISABLE_POWER_ROLE_SWITCH voter on the PMI8998, the one
# role lever that holds across plugs, and the policy engine's own USB PD
# requests; jetlink/comma/port.py says when each is used
POWER_ROLE_VOTER=${JETLINK_POWER_ROLE_VOTER:-/sys/kernel/debug/pmic-votable/DISABLE_POWER_ROLE_SWITCH}
USBPD=${JETLINK_USBPD:-/sys/class/usbpd/usbpd0}
DUAL_ROLE=${JETLINK_DUAL_ROLE:-/sys/class/dual_role_usb/otg_default}
# udc: the dwc3 glue for the port's controller (usb0, ssusb@a600000) and the
# policy engine's parameters. Both have a usb_compliance_mode, and each gates
# one place only: the policy engine's turns the device side on at every sink
# attach, not just when the charger detection read a USB port (SDP, CDP or
# floating lines); the glue's keeps dwc3 from turning it off again when the
# lines read floating and no host enumerated it in 10 s. An Apple port connects
# its data lines only after USB PD, and at boot no gadget is bound for 10 s.
UDC_GLUE=${JETLINK_UDC_GLUE:-/sys/devices/platform/soc/a600000.ssusb}
PE_PARAMS=${JETLINK_PE_PARAMS:-/sys/module/policy_engine/parameters}
# And Qualcomm's FunctionFS logs four lines to an IPC debug ring for every USB
# request, inside io_submit on modeld's frame thread: about 200 a frame, into
# a buffer only debugfs reads. Turned off while recording, the frame's
# io_submit goes from 1.20 to 0.88 ms and frames from 21.14 to 20.86 ms at
# p50. 1 turns it off; stock is 0.
FFS_LOG_OFF=${JETLINK_FFS_LOG_OFF:-/sys/kernel/debug/ipc_logging/f_fs/log_disable}
USB_PSY=${JETLINK_USB_PSY:-/sys/class/power_supply/usb}
# draw: the charger's USB_ICL voter, the input current limit on the port. As
# the sink the charger draws up to 900 mA from whatever powers the port, though
# the comma runs on its own supply. A 3X browns out the moment it draws from a
# laptop (PMIC power-off reason UVLO). An iPhone powers what it plugs into with
# little current; under that draw its supply sags, the charger's weak-charger
# and reverse-boost handlers cut and restore the input in a loop, and the phone
# never sees a device. Forced to 0 the input is suspended: the port still reads
# present and the roles still settle, and those handlers stand down at 25 mA or
# less. As the source the kernel votes the input to 0 itself.
USB_ICL_VOTER=${JETLINK_USB_ICL_VOTER:-/sys/kernel/debug/pmic-votable/USB_ICL}
# vm: loggerd's dirty pages pile up until the kernel reclaims them
# synchronously, right while a FunctionFS transfer allocates its buffer: gadget
# reads stall 200-350 ms and the big model falls back. Capping dirty memory
# keeps that reclaim cheap. System-wide, since the gadget read shares the
# kernel with every writer.
# Not vm.min_free_kbytes: a 128 MB floor takes about three times that out of
# MemAvailable, 360 MB on a 3.6 GB comma, and openpilot's LOW MEMORY alert
# reads MemTotal-MemAvailable against 90 %, so a drive at 80 % would alert. vm.extra_free_kbytes (Android's) instead has kswapd keep that much
# more free ahead of the allocators, leaving the direct-reclaim floor where it
# is: 32 MB took 3 minutes of recording from 49 direct-reclaim stalls (the
# longest 148 ms) to none, for 2.7 points on that gauge, as the kernel takes
# it out of MemAvailable about 2.5 times; 64 MB adds nothing but costs 4.5.
# A drive sits near 71 %.
# And the socket buffer caps, for the iPhone's TCP link: transport/tcp.py asks
# for 4 MB, which turns autotuning off, and the kernel clamps it to these, 224
# KB on AGNOS and so 448 KB of buffer. A 393 KB frame in 1448-byte segments does
# not fit, so the send waits on the phone's ACKs: 6 to 50 ms, following its
# round trip. With 4 MB the frame goes in one write and the send takes ~4 ms. Only a socket that asks gets more; one set up
# before the apply keeps the old cap until the phone reconnects.
VM_SYSCTLS=(vm.dirty_bytes=16777216 vm.dirty_background_bytes=8388608 vm.extra_free_kbytes=32768
net.core.wmem_max=4194304 net.core.rmem_max=4194304)
PROC_SYS=${JETLINK_PROC_SYS:-/proc/sys}
# the stock values to write back, one key=value a line, recorded by the first
# apply and dropped by restore
SYSCTL_PREV=${JETLINK_SYSCTL_PREV:-/dev/shm/jetlink-sysctl-prev}
usage() {
echo "usage: $0 gadget [--ios] | net | rps | check | teardown | port hold|off|device|reset|source|sink | udc apply|restore|start|stop | vm apply|restore | draw off|on | boot SETTING" >&2
exit 2
}
status() {
# best effort: a device with no /dev/shm still gets the stderr line
{ echo "$1" > "$STATUS_FILE" && chmod 0644 "$STATUS_FILE"; } 2>/dev/null || true
}
net_status() {
{ echo "$1" > "$NET_STATUS_FILE" && chmod 0644 "$NET_STATUS_FILE"; } 2>/dev/null || true
}
fail() {
echo "jetlink: $1" >&2
status "error: $1"
exit 1
}
# -- the gadget's network, iOS only -------------------------------------------
net_present() {
[[ -d "$GADGET/functions/$NET_FN" ]]
}
dnsmasq_alive() {
local pid
pid=$(cat "$DNSMASQ_PID" 2>/dev/null || true)
[[ -n "$pid" ]] && kill -0 "$pid" 2>/dev/null
}
# The interface the kernel gave the network function. The function is named
# ncm.usb0 but the netdev is not usb0: the modem already holds that name on a
# comma, so ours comes up as usb1 or later, and the number can change from one
# bind to the next. u_ether records the real name in the function's ifname,
# readable only while the gadget is bound.
net_ifname() {
local name
name=$(cat "$GADGET/functions/$NET_FN/ifname" 2>/dev/null || true)
[[ -n "$name" && -d "$SYS_NET/$name" ]] || return 1
echo "$name"
}
# The cable's receive work onto RPS_CPUS; 0 only when the mask reads it back.
steer() {
local dev=$1 mask got
mask="$SYS_NET/$dev/queues/rx-0/rps_cpus"
[[ -w "$mask" ]] || { echo "jetlink: $dev has no receive steering to set" >&2; return 1; }
put "$RPS_CPUS" "$mask" "could not steer $dev's receive work" || return 1
got=$(cat "$mask" 2>/dev/null || true)
if [[ -z "$got" ]] || (( 16#$got != 16#$RPS_CPUS )); then
echo "jetlink: $dev's receive steering reads ${got:-nothing}, not $RPS_CPUS (core 6 offline?)" >&2
return 1
fi
}
# Every raw-table rule of ours gone, each found by its comment. Never fatal;
# fails only without the tool, which untrack reads as nothing to do.
retrack() {
local rule
command -v "$IPTABLES" >/dev/null 2>&1 || return 1
while read -r rule; do
[[ -n "$rule" ]] || continue
# word splitting is the point: one rule's arguments
# shellcheck disable=SC2086
"$IPTABLES" -w -t raw $rule 2>/dev/null || true
done < <("$IPTABLES" -w -t raw -S 2>/dev/null | sed -n "/--comment $TRACK_TAG /s/^-A /-D /p")
return 0
}
# The cable's traffic, both ways, out of conntrack: ours replaced by these two.
untrack() {
local dev=$1
retrack || return 0
"$IPTABLES" -w -t raw -I PREROUTING -i "$dev" -m comment --comment "$TRACK_TAG" -j CT --notrack 2>/dev/null || true
"$IPTABLES" -w -t raw -I OUTPUT -o "$dev" -m comment --comment "$TRACK_TAG" -j CT --notrack 2>/dev/null || true
}
# The comma's end of the cable network. Idempotent, and never fatal. The owner
# runs it through net once it has bound the UDC and the interface has appeared.
net_up() {
local dev why
if ! dev=$(net_ifname); then
net_status "error: no netdev yet; it appears when the owner binds the UDC (then run net)"
echo "$NET_FN present, its netdev not yet created (appears at bind); run net after binding" >&2
return 0
fi
# NetworkManager manages every device on AGNOS and would DHCP on it itself
nmcli dev set "$dev" managed no >/dev/null 2>&1 || true
if ! ip addr replace "$COMMA_ADDR/$COMMA_PREFIX" dev "$dev" 2>/dev/null; then
why="could not set $COMMA_ADDR/$COMMA_PREFIX on $dev"
net_status "error: $why"; echo "jetlink: $why" >&2
return 0
fi
if ! ip link set "$dev" up 2>/dev/null; then
why="could not bring $dev up"
net_status "error: $why"; echo "jetlink: $why" >&2
return 0
fi
# parked big cores read back 00 here; the owner steers again onroad
steer "$dev" 2>/dev/null || true
untrack "$dev"
# DHCP for the phone, and only that: no router (option 3) and no DNS (option 6),
# so the phone keeps its default route over Wi-Fi. No DNS service (--port=0).
# dnsmasq binds the interface by name, so a netdev that came back under a new
# name after a rebind needs a fresh dnsmasq: the running one is on a ghost.
if dnsmasq_alive && [[ "$(cat "$DNSMASQ_IF" 2>/dev/null || true)" != "$dev" ]]; then
kill "$(cat "$DNSMASQ_PID")" 2>/dev/null || true
sleep 0.2
fi
if ! dnsmasq_alive; then
rm -f "$DNSMASQ_PID" 2>/dev/null || true
if ! dnsmasq --conf-file=/dev/null --bind-interfaces --interface="$dev" \
--except-interface=lo --port=0 --dhcp-range="$DHCP_RANGE" \
--dhcp-option=3 --dhcp-option=6 --dhcp-leasefile="$DNSMASQ_LEASES" \
--pid-file="$DNSMASQ_PID" 2>/dev/null; then
why="dnsmasq would not start on $dev"
net_status "error: $why"; echo "jetlink: $why" >&2
return 0
fi
echo "$dev" > "$DNSMASQ_IF"
fi
net_status "ok $COMMA_ADDR $dev"
echo "$dev (ncm) at $COMMA_ADDR/$COMMA_PREFIX, DHCP $DHCP_RANGE"
return 0
}
net_down() {
local pid
pid=$(cat "$DNSMASQ_PID" 2>/dev/null || true)
if [[ -n "$pid" ]]; then
kill "$pid" 2>/dev/null || true
fi
rm -f "$DNSMASQ_PID" 2>/dev/null || true
retrack || true
}
# The network function and its DHCP server, gone: for teardown, and for a USB
# gadget left with one by an iOS boot. Unlinking it force-unbinds the UDC.
net_remove() {
local f
net_down
for f in "$GADGET"/configs/c.1/*."$NET_IF"; do
if [[ -L "$f" ]]; then rm -f "$f" 2>/dev/null || true; fi
done
for f in "$GADGET"/functions/*."$NET_IF"; do
if [[ -d "$f" ]]; then rmdir "$f" 2>/dev/null || true; fi
done
}
# -- subcommands ----------------------------------------------------------------
cmd_gadget() {
local ios=0 udcs other owner bound serial uid gid
case "${1:-}" in
"") ;;
--ios) ios=1 ;;
*) usage ;;
esac
[[ $EUID -eq 0 ]] || fail "jetlink-root.sh gadget must run as root"
# set -e alone exits without going through fail, leaving last boot's "ok" in
# $STATUS_FILE for the openpilot side to read.
trap 'fail "line $LINENO: $BASH_COMMAND failed"' ERR
mountpoint -q "$CONFIGFS" || mount -t configfs none "$CONFIGFS" 2>/dev/null || true
mountpoint -q "$CONFIGFS" || fail "no configfs at $CONFIGFS; this kernel cannot configure a USB gadget"
# absent means this AGNOS build has no CONFIG_USB_LIBCOMPOSITE, which nothing
# in userspace can fix
[[ -d "$CONFIGFS/usb_gadget" ]] || fail "kernel has no USB gadget support (CONFIG_USB_LIBCOMPOSITE); jetlink needs an AGNOS build that has it"
# No FunctionFS preflight on purpose: the kernel registers the functionfs
# filesystem only while some ffs.* function exists, so /proc/filesystems never
# lists it on a cold boot. The mkdir, mount and ep0 checks below test it in use.
# a gadget needs a device controller
shopt -s nullglob
udcs=("/sys/class/udc"/*)
shopt -u nullglob
[[ ${#udcs[@]} -gt 0 ]] || fail "no USB device controller in /sys/class/udc; this device cannot act as a USB gadget"
# refuse to fight another gadget for the controller rather than unbinding it
for other in "$CONFIGFS"/usb_gadget/*/UDC; do
if [[ -e "$other" ]]; then
owner=$(basename "$(dirname "$other")")
bound=$(cat "$other" 2>/dev/null || true)
if [[ "$owner" != "jetlink" && -n "$bound" ]]; then
fail "USB gadget '$owner' already holds the device controller ($bound); tear it down first"
fi
fi
done
mkdir -p "$GADGET" || fail "could not create the gadget at $GADGET"
cd "$GADGET"
echo "$VID" > idVendor
echo "$PID" > idProduct
echo 0x0320 > bcdUSB # 3.2: advertise SuperSpeed
if [[ $ios -eq 1 ]]; then
# its own bcdDevice, so hosts that cache descriptors by VID/PID/bcdDevice
# (macOS, Windows) fetch the composite ones rather than the plain gadget's
echo 0x0101 > bcdDevice
# Miscellaneous / Common Class / IAD: the composite device class, which tells
# a host to bind a driver per interface association (the vendor interface
# for jetlink, CDC-NCM for the network) rather than one for the whole device
echo 0xEF > bDeviceClass
echo 0x02 > bDeviceSubClass
echo 0x01 > bDeviceProtocol
else
# the plain gadget: class per interface
echo 0x0100 > bcdDevice
echo 0x00 > bDeviceClass
echo 0x00 > bDeviceSubClass
echo 0x00 > bDeviceProtocol
fi
# The device tree carries a serial on some commas and not others; any stable
# string will do.
serial=$({ tr -d '\0' < /proc/device-tree/serial-number; } 2>/dev/null || cat /etc/machine-id 2>/dev/null || echo 0001)
[[ -n "$serial" ]] || serial=0001
mkdir -p strings/0x409
echo "zoompilot" > strings/0x409/manufacturer
echo "jetlink" > strings/0x409/product
echo "$serial" > strings/0x409/serialnumber
mkdir -p configs/c.1/strings/0x409
echo "jetlink inference link" > configs/c.1/strings/0x409/configuration
# self-powered, and as little as the spec allows: the Jetson has its own 12 V feed
echo 0xC0 > configs/c.1/bmAttributes
echo 8 > configs/c.1/MaxPower
# the mkdir instantiates the function and registers functionfs, so a kernel
# genuinely without it fails here
mkdir -p "functions/ffs.$FFS_NAME" ||
fail "kernel has no ffs gadget function (CONFIG_USB_CONFIGFS_F_FS); jetlink cannot present its endpoints"
# Link once: this is re-run on every deploy, and unlinking a function from a bound
# config force-unbinds the UDC, so an unconditional ln -sf drops a live link.
# Linked before the network function so it is interface 0: hosts that open the
# vendor interface by number depend on that.
[[ -L "configs/c.1/ffs.$FFS_NAME" ]] ||
ln -s "$GADGET/functions/ffs.$FFS_NAME" "configs/c.1/ffs.$FFS_NAME" ||
fail "could not link ffs.$FFS_NAME into configs/c.1"
# The network interface, for an iPhone only. A USB gadget left with one from an
# iOS boot loses it here: unlinking it force-unbinds the UDC, which is why the
# owner switches only while parked. The 4.9 kernel picks the interface's MAC
# addresses itself and refuses them from configfs; DHCP makes that harmless.
if [[ $ios -eq 0 ]]; then
if net_present; then net_remove; fi
else
mkdir -p "functions/$NET_FN" || fail "could not create the $NET_FN gadget function"
# after ffs, so it takes the next interface numbers
[[ -L "configs/c.1/$NET_FN" ]] ||
ln -s "$GADGET/functions/$NET_FN" "configs/c.1/$NET_FN" ||
fail "could not link $NET_FN into configs/c.1"
fi
mkdir -p "$FFS_MOUNT"
# Owned by the user openpilot runs as: on a root-only mount the owner and
# modeld cannot open the endpoints, and Path.exists() raises rather than
# returning False.
uid=$(id -u "$OPENPILOT_USER")
gid=$(id -g "$OPENPILOT_USER")
mountpoint -q "$FFS_MOUNT" || mount -t functionfs -o "uid=$uid,gid=$gid" "$FFS_NAME" "$FFS_MOUNT" ||
fail "could not mount functionfs at $FFS_MOUNT"
# the check that proves the chain: ep0 is what the owner opens to write the
# descriptors and bind the controller
[[ -e "$FFS_MOUNT/ep0" ]] || fail "functionfs mounted at $FFS_MOUNT but has no ep0"
# the owner binds the UDC as the openpilot user, so hand it that one attribute
chown "$OPENPILOT_USER" "$GADGET/UDC" 2>/dev/null || true
status ok
echo "gadget ready at $GADGET"
echo "functionfs mounted at $FFS_MOUNT"
if [[ $ios -eq 1 ]]; then
echo "network function: $NET_FN (after ffs.$FFS_NAME in configs/c.1)"
# its netdev appears at the owner's bind, and net sets it up then
rm -f "$NET_STATUS_FILE" 2>/dev/null || true
else
net_status "net: off"
fi
echo "available UDCs: ${udcs[*]##*/}"
echo "the owner writes the descriptors and binds the UDC"
}
cmd_net() {
[[ $EUID -eq 0 ]] || fail "jetlink-root.sh net must run as root"
[[ -d "$GADGET" ]] || { net_status "error: no gadget"; fail "no gadget at $GADGET; run gadget first"; }
net_up
}
# Not fail(): that is the gadget's record.
cmd_rps() {
local dev
dev=$(net_ifname) || { echo "jetlink: no cable network interface to steer" >&2; exit 1; }
steer "$dev" || exit 1
}
cmd_teardown() {
local f linked=0
net_remove
if [[ -d "$GADGET" ]]; then
echo "" > "$GADGET/UDC" 2>/dev/null || true
rm -f "$GADGET/configs/c.1/ffs.$FFS_NAME" 2>/dev/null || true
rmdir "$GADGET/configs/c.1/strings/0x409" 2>/dev/null || true
# a config with a function still linked cannot go, and trying is a
# configfs error worth not making
for f in "$GADGET"/configs/c.1/*; do
if [[ -L "$f" ]]; then linked=1; fi
done
if [[ $linked -eq 0 ]]; then
rmdir "$GADGET/configs/c.1" 2>/dev/null || true
else
echo "jetlink: configs/c.1 still has a function linked; left in place" >&2
fi
rmdir "$GADGET/functions/ffs.$FFS_NAME" 2>/dev/null || true
rmdir "$GADGET/strings/0x409" 2>/dev/null || true
rmdir "$GADGET" 2>/dev/null || true
fi
# A plain umount can block or segfault on a FunctionFS instance whose owner died
# with endpoints open; lazy-detach unhooks it now and lets the kernel finish.
umount -l "$FFS_MOUNT" 2>/dev/null || umount "$FFS_MOUNT" 2>/dev/null || true
rmdir "$FFS_MOUNT" 2>/dev/null || true
status "error: gadget torn down"
net_status "error: gadget torn down"
echo "jetlink gadget torn down"
}
cmd_check() {
local u g dev udcs
[[ $EUID -eq 0 ]] || { echo "run check as root (sudo)" >&2; exit 1; }
echo "kernel: $(uname -r)"
if mountpoint -q "$CONFIGFS" && [[ -d "$CONFIGFS/usb_gadget" ]]; then
echo "configfs USB gadgets: yes"
else
echo "configfs USB gadgets: NO (no $CONFIGFS/usb_gadget)"
fi
shopt -s nullglob
udcs=(/sys/class/udc/*)
shopt -u nullglob
for u in "${udcs[@]}"; do
# current_speed is the negotiated bus speed: super-speed is USB 3, and a
# 460 KB frame is ~1 ms there against ~11 ms at high-speed (USB 2). The
# owner logs it on every configured edge, since nothing in this script
# runs after enumeration.
echo "device controller: $(basename "$u"), state $(cat "$u/state" 2>/dev/null || echo unknown), speed $(cat "$u/current_speed" 2>/dev/null || echo unknown)"
done
[[ ${#udcs[@]} -gt 0 ]] || echo "device controller: NONE"
for g in "$CONFIGFS"/usb_gadget/*/; do
[[ -d "$g" ]] || continue
echo "gadget $(basename "$g"): bound to '$(cat "$g/UDC" 2>/dev/null)'"
done
echo "gadget status: $(cat "$STATUS_FILE" 2>/dev/null || echo none)"
# A phone plugged straight into the comma negotiates power and the comma may
# end up sourcing it, which reboots the comma. Through a hub the comma sinks.
# On a C-to-C cable the comma can come out the host instead; port hold fixes that.
if [[ -d "$USBPD" ]]; then
echo "USB-C port: power role $(cat "$USBPD/current_pr" 2>/dev/null || echo unknown), data role $(cat "$USBPD/current_dr" 2>/dev/null || echo unknown), USB PD contract $(cat "$USBPD/contract" 2>/dev/null || echo unknown), Type-C $(cat "$USB_PSY/typec_mode" 2>/dev/null || echo unknown)"
fi
if [[ "$(cat "$POWER_ROLE_VOTER/force_active" 2>/dev/null || true)" == 1 ]]; then
echo "USB-C port: held as the device (port hold)"
fi
if [[ "$(cat "$USB_ICL_VOTER/force_active" 2>/dev/null || true)" == 1 ]]; then
echo "USB-C port: no current drawn from it (draw off)"
fi
if [[ -d "$UDC_GLUE" ]]; then
echo "USB device controller: $(cat "$UDC_GLUE/mode" 2>/dev/null || echo unknown), charger detection $(cat "$USB_PSY/real_type" 2>/dev/null || echo unknown), kept a device $(cat "$PE_PARAMS/usb_compliance_mode" 2>/dev/null || echo '?')/$(cat "$UDC_GLUE/usb_compliance_mode" 2>/dev/null || echo '?')"
fi
if ! net_present; then
echo "network function: none (the USB gadget, or no gadget)"
return 0
fi
echo "network function: $NET_FN"
if dev=$(net_ifname); then
echo "$dev: $(cat "/sys/class/net/$dev/operstate" 2>/dev/null || echo unknown), $(ip -4 -o addr show dev "$dev" 2>/dev/null | awk '{print $4}' | tr '\n' ' ')"
else
echo "netdev: absent (it appears when the owner binds the UDC)"
fi
echo "network status: $(cat "$NET_STATUS_FILE" 2>/dev/null || echo unknown)"
if dnsmasq_alive; then echo "dnsmasq: running"; else echo "dnsmasq: not running"; fi
}
# The comma's USB-C port, for a link that runs over USB. hold keeps the port at
# sink, which makes the far end the host; off is dual role, as AGNOS boots it.
# device asks the far end over USB PD to take the host role (a DR_Swap): for a
# far end that powers the comma and still came out the device, which hold
# cannot change. reset is a USB PD hard reset, which puts both ends back to
# the roles their power gives them: a sink is the device. source asks a far end
# that powers the comma for the source role (a PR_Swap), which leaves the data
# roles as they are: an iPhone that hosts the comma stays the host and charges
# from it. The voter gates it, so port off comes first. sink is the swap back,
# for a phone whose link went down once it charged.
cmd_port() {
case "${1:-}" in
hold) force_voter "$POWER_ROLE_VOTER" 1 "to hold the port" || exit 1 ;;
# letting go applies the voters' own result, which is dual role
off) release_voter "$POWER_ROLE_VOTER" || exit 1 ;;
# the kernel sends the DR_Swap and waits 100 ms for it; a refusal, or PD not
# ready yet, is a failed write
device) put device "$DUAL_ROLE/data_role" "the far end did not take the host role ($DUAL_ROLE/data_role)" || exit 1 ;;
reset) put 1 "$USBPD/hard_reset" "could not reset USB PD ($USBPD/hard_reset)" || exit 1 ;;
# the kernel sends the PR_Swap and waits up to 2 s for it; only with a USB PD
# contract, so a write before one, or a refusal, fails
source) put source "$DUAL_ROLE/power_role" "the far end did not give up the source role ($DUAL_ROLE/power_role)" || exit 1 ;;
sink) put sink "$DUAL_ROLE/power_role" "the far end did not take the source role back ($DUAL_ROLE/power_role)" || exit 1 ;;
*) usage ;;
esac
}
# The port's USB device controller, while the link is on. apply keeps it a
# device whatever the charger detection made of the far end's data lines, and
# restore puts the stock behaviour back; see UDC_GLUE. start turns the device
# side on now, for a host that powers the port while it is off, and stop turns
# it off again once that host is gone.
cmd_udc() {
case "${1:-}" in
apply) udc_set Y 1 || exit 1 ;;
restore) udc_set N 0 || exit 1 ;;
start) put peripheral "$UDC_GLUE/mode" "could not start the USB device controller ($UDC_GLUE/mode)" || exit 1 ;;
stop) put none "$UDC_GLUE/mode" "could not stop the USB device controller ($UDC_GLUE/mode)" || exit 1 ;;
*) usage ;;
esac
}
# The compliance modes to $1 and FunctionFS's debug log switch to $2, each on
# its own, so one the kernel lacks does not keep the others.
udc_set() {
local failed=0 knob
for knob in "$PE_PARAMS/usb_compliance_mode" "$UDC_GLUE/usb_compliance_mode"; do
put "$1" "$knob" "could not set $knob" || failed=1
done
put "$2" "$FFS_LOG_OFF" "could not set $FFS_LOG_OFF" || failed=1
return $failed
}
# One value into one kernel file; a line on stderr, with the kernel's reason,
# and a failure when the kernel refuses it. Not fail(): that is the gadget's record.
put() {
local err
if ! err=$( { echo "$1" > "$2"; } 2>&1 ); then
echo "jetlink: $3${err:+: ${err##*: }}" >&2
return 1
fi
}
# A charger voter under debugfs forced to a value, and let go: force_val first,
# since forcing applies whatever force_val holds at that moment.
force_voter() {
{ echo "$2" > "$1/force_val" && echo 1 > "$1/force_active"; } 2>/dev/null ||
{ echo "jetlink: could not force $1 $3" >&2; return 1; }
}
release_voter() {
{ echo 0 > "$1/force_active" && echo 0 > "$1/force_val"; } 2>/dev/null ||
{ echo "jetlink: could not release $1" >&2; return 1; }
}
# A key's value, or nothing when it cannot be read.
sysctl_read() {
local value=""
{ read -r value < "$PROC_SYS/${1//.//}"; } 2>/dev/null || true
echo "$value"
}
# One key per write, so a value the kernel rejects does not take the rest with it.
sysctl_write() {
put "$2" "$PROC_SYS/${1//.//}" "could not set $1=$2"
}
# apply records the stock values, once a boot, and writes the link's; restore
# writes the record back and drops it, and without one does nothing. Either
# is safe to repeat. A reboot resets them.
vm_apply() {
local pair key value had="" rec="" failed=0
# A key already in the record keeps its first value: a second apply must
# not record our own. One missing from it (added by a newer jetlink
# since this boot's first apply) is recorded now, while it is stock.
[[ -e "$SYSCTL_PREV" ]] && had=$(cat "$SYSCTL_PREV" 2>/dev/null)
for pair in "${VM_SYSCTLS[@]}"; do
key=${pair%%=*}
if [[ $'\n'"$had" == *$'\n'"$key="* || $'\n'"$had" == *$'\n'"${key%_bytes}_ratio="* ]]; then
continue
fi
value=$(sysctl_read "$key")
if [[ "$value" == 0 && "$key" == *_bytes ]]; then
# Stock AGNOS runs the dirty limits in ratio mode, so the *_bytes keys
# read 0, and the kernel silently drops a 0 written back to one.
# Writing the ratio key is what zeroes the bytes key, so that is the
# one to put back.
key=${key%_bytes}_ratio
value=$(sysctl_read "$key")
fi
if [[ -n "$value" ]]; then
rec+="$key=$value"$'\n'
else
echo "jetlink: could not read $key" >&2
fi
done
if [[ -n "$rec" ]]; then
{ printf '%s' "$rec" >> "$SYSCTL_PREV" && chmod 0644 "$SYSCTL_PREV"; } 2>/dev/null ||
echo "jetlink: could not record the previous sysctls in $SYSCTL_PREV" >&2
fi
for pair in "${VM_SYSCTLS[@]}"; do
sysctl_write "${pair%%=*}" "${pair#*=}" || failed=1
done
return $failed
}
# Writes the record back line by line: a vm or net.core key and a number,
# nothing else.
vm_restore() {
local key value failed=0
[[ -e "$SYSCTL_PREV" ]] || return 0
while IFS='=' read -r key value; do
if [[ "$key" =~ ^(vm|net\.core)\.[a-z_]+$ && "$value" =~ ^[0-9]+$ ]]; then
sysctl_write "$key" "$value" || failed=1
else
echo "jetlink: not restoring '$key=$value' from $SYSCTL_PREV" >&2
failed=1
fi
done < "$SYSCTL_PREV"
rm -f "$SYSCTL_PREV" 2>/dev/null || true
return $failed
}
cmd_vm() {
case "${1:-}" in
apply) vm_apply || exit 1 ;;
restore) vm_restore || exit 1 ;;
*) usage ;;
esac
}
# The port's input current while the link is on; see USB_ICL_VOTER. off forces
# the limit to 0 and on gives the charger its own limit back; either is safe
# to repeat. A reboot clears it.
cmd_draw() {
case "${1:-}" in
off) force_voter "$USB_ICL_VOTER" 0 "to stop drawing from the port" || exit 1 ;;
on) release_voter "$USB_ICL_VOTER" || exit 1 ;;
*) usage ;;
esac
}
# The fork's launch script, before manager: with the link on, draw nothing from
# the port from boot rather than from the owner's first step, ~20 s later. The
# comma runs off its own power port. SETTING is the Jetlink setting's params
# file; anything but 0 is on, a missing file is off.
cmd_boot() {
[[ $# -eq 1 ]] || usage
local mode
mode=$(cat "$1" 2>/dev/null) || return 0
[[ -n "$mode" && "$mode" != 0 ]] || return 0
cmd_draw off
}
cmd=${1:-}
if [[ $# -gt 0 ]]; then shift; fi
case "$cmd" in
gadget) cmd_gadget "$@" ;;
net) cmd_net ;;
rps) cmd_rps ;;
check) cmd_check ;;
teardown) cmd_teardown ;;
port) cmd_port "$@" ;;
udc) cmd_udc "$@" ;;
vm) cmd_vm "$@" ;;
draw) cmd_draw "$@" ;;
boot) cmd_boot "$@" ;;
*) usage ;;
esac
+7 -7
View File
@@ -7,8 +7,8 @@ See the LICENSE file in the root directory for more details.
Who may do endpoint IO on the gadget, while one process owns it throughout.
The owner (owner.py) holds ep0 for as long as the link is on, and nothing else
ever does: when two processes took turns at it, every change of owner was an
unplug, a fresh libusb open and a fresh server session as the Jetson saw it.
ever does: to the Jetson, a change of who holds ep0 is an unplug, a fresh
libusb open and a fresh server session.
What still has to change hands is the right to read the endpoint files.
FunctionFS keeps a queued read queued until something completes it, so a second
@@ -55,7 +55,7 @@ POLL = 0.5
# what a borrower passes on of the server's hello (Loan.note_server): the owner
# never speaks the protocol, and sleep_after is how it knows whether letting
# go of the gadget lets the Jetson sleep. The rest is for its status record
SERVER_FIELDS = ('protocol', 'device', 'backend', 'runtime_version', 'trt_version', 'sleep_after')
SERVER_FIELDS = ('protocol', 'device', 'backend', 'runtime_version', 'trt_version', 'sleep_after', 'pick', 'fetches')
def _send(conn: socket.socket, msg: dict) -> None:
@@ -119,10 +119,10 @@ class Loan:
def bounce(self) -> bool:
"""Ask the owner to take the gadget down and put it back up.
The only thing that dequeues a FunctionFS write nobody is reading is the
unbind, and the unbind belongs to whoever holds ep0. Called from the write
watchdog on a link that is already 15 s stuck, so the re-enumeration it
costs is not the expensive part.
The only thing that completes a FunctionFS write nobody is reading is the
unbind, and the unbind belongs to whoever holds ep0. Called on writes the
host has stopped taking (FfsTransport._abort_write), so the re-enumeration
it costs is not the expensive part.
"""
with self._lock:
if self._closed:
+128 -35
View File
@@ -71,6 +71,8 @@ GADGET_SETUP_BACKOFF = 60.0
GADGET_HELD_RETRY = 2.0
# between attempts to bring the gadget's network interface up after a bind
NET_BACKOFF = 5.0
# jetlink-root.sh rps attempts a bind before the owner stops asking (ensure_steered)
STEER_TRIES = 6
# between attempts to listen for borrowers after one failed
LENDER_BACKOFF = 30.0
# between runs of the worker that found nothing to do. It costs a couple of
@@ -100,8 +102,8 @@ LOG_BYTES = 1 << 20
def logger(path: Path) -> logging.Logger:
"""The owner's log, to stderr and `path`: swaglog costs 28 MB, so the owner
keeps its own. The worker's lines go to the drive; these are for a bench
session, which wants them after the drive."""
keeps its own. The worker's lines go to the drive's log; these stay for
reading afterwards."""
log = logging.getLogger('jetlink.owner')
log.setLevel(logging.INFO)
handlers: list[logging.Handler] = [logging.StreamHandler()]
@@ -174,11 +176,17 @@ class Owner:
self.dormant = False
# the link mode the root tuning was applied for, None while stock
self.tuned: str | None = None
# the tuning put back since the link was last on: None not yet asked,
# False a restore failed (release_tuning)
self.released: bool | None = None
# the draw from the USB-C port: cut by this owner, and whether it was last
# settled for the link on (steer_draw)
self.cut = False
self.draw_for: bool | None = None
# when there was last something to do. The hold runs from here, not from
# process start: this daemon is not restarted at ignition any more, so a
# hold measured from its birth expires once and never applies again, and
# every wake released the gadget a second later with the jetson still
# coming up
# process start: this daemon lives across ignitions, so a hold measured
# from its birth would expire once and then release the gadget on every
# wake with the jetson still coming up
self.idle_since = time.monotonic()
self.next_attempt = 0.0
self.next_gadget_attempt = 0.0
@@ -194,6 +202,9 @@ class Owner:
self._peer: str | None = None # the phone published as dialed in
self.net_ready = False # usb0 configured for this bind
self.next_net_attempt = 0.0
self.steered = False # usb0's receive work read back on core 6, since the drive started
self.next_steer = 0.0
self.steer_tries = 0 # this bind's, up to STEER_TRIES
self.lender_failed = False # said once, until it listens again
self.next_lender = 0.0
self.worker: subprocess.Popen | None = None
@@ -355,6 +366,26 @@ class Owner:
return
self.next_net_attempt = now + NET_BACKOFF
self.net_ready = gadget.net_up()
self.steered, self.next_steer, self.steer_tries = False, 0.0, 0
def ensure_steered(self, offroad: bool) -> None:
"""The cable's receive work onto core 6 (jetlink-root.sh rps), once a
drive has started: net's own steer, at the bind, reads back 00 while
hardwared has the big cores parked, and the kernel never adds them later.
Retried on NET_BACKOFF, STEER_TRIES times a bind: a core 6 that stays
offline is no reason to run sudo every few seconds for a whole drive."""
if offroad or self.steered or not self.net_ready or self.steer_tries >= STEER_TRIES:
return
now = time.monotonic()
if now < self.next_steer:
return
self.next_steer = now + NET_BACKOFF
self.steer_tries += 1
self.steered = root.run('rps')
if self.steered:
gadget.log.warning("jetlink: the cable's receive work is on core 6")
elif self.steer_tries == STEER_TRIES:
gadget.log.warning("jetlink: the cable's receive work stays where the kernel puts it until the next bind")
def settle(self) -> None:
"""Put the gadget back to bound with nothing open on it.
@@ -444,8 +475,8 @@ class Owner:
# the far end may still be waking; give it the hold before letting go
self.idle_since = time.monotonic()
# after the run, not before it: a run writes JetlinkSpec itself, so a mark
# taken at spawn always differs by the time it exits and every successful
# provision started a second one
# taken at spawn would always differ by the time it exits and every
# successful provision would start a second one
self.note_marks()
return False
@@ -602,35 +633,88 @@ class Owner:
self.close_link()
self.stop_worker()
self.wake()
if self.tuned:
root.run('vm', 'restore')
root.run('udc', 'restore')
if self.tuned == 'ios':
root.run('draw', 'on', timeout=root.PORT_TIMEOUT)
self.tuned = None
self.port.off()
self.release_tuning()
return
# before the gadget: a host is never drawn from while the link comes up
self.steer_draw(True)
self.link_step(mode == 'ios')
self.released = None
if self.tuned != mode:
# jetlink-root.sh vm: the recording VM tuning the gadget's reads need;
# udc: the USB device side kept on for a host that powers the port
# (port.py); draw, iOS only: no current drawn from the port, which an
# iPhone cannot supply. While the link is on. After the step, so the
# first gadget does not wait on them. Put back only when the link is
# turned off or leaves iOS, never on exit: manager stops this at
# ignition, just as the contention starts, and a phone plugged in before
# it is back should still come up. A start assumes the draw stock, so a
# cut a dead iOS owner left lasts until the reboot that clears it
# (port.py). While the link is on. After the step, so the first gadget
# does not wait on them. Put back only when the link is not wanted
# (release_tuning)
if self.tuned is None:
root.run('vm', 'apply')
root.run('udc', 'apply')
if mode == 'ios':
if root.run('draw', 'off', timeout=root.PORT_TIMEOUT):
gadget.log.info("jetlink: drawing no current from the USB-C port, for an iPhone")
elif self.tuned == 'ios':
root.run('draw', 'on', timeout=root.PORT_TIMEOUT)
self.tuned = mode
def link_wanted(self) -> bool:
"""Is the link still wanted at a stop: set on, and no chestnut on the
port? Settings.mode() reads an unreadable param as 'off', as manager
does, so that is not wanted. The except only guards a bug: anything
raised in the stop's finally would skip the teardown after it. manager's
own chestnut test is chestnut_present(), cached 2 s, and this walks the
USB ids itself, so a chestnut mid-re-enumeration can read as absent here
and keep the tuning for that drive; accepted."""
try:
return self.settings.mode() != 'off' and not port.chestnut_attached(self.port.chestnut_ids)
except Exception:
gadget.log.exception("jetlink: could not tell whether the link is still wanted; keeping its tuning")
return True
def release_tuning(self, final: bool = False) -> bool:
"""The link is not wanted, turned off or a chestnut on the port: the
port, its draw and the root tuning go back as AGNOS boots them, at a step
and at the stop manager makes of it, which often comes before a step has
seen the setting. Any other stop keeps them for the owner manager starts
next, which applies them again; a reboot clears them.
The draw first, while a hold still keeps the far end on the port: letting
go of one can drop it for a DRP toggle, and an empty port read in that
moment would give the draw back with a host still in. It is given back
only on an empty port, so it stays cut with a chestnut on, which the
comma powers and where the cut does nothing. The tuning is restored
whatever `tuned` says, since an owner before this one may have applied
it: once when the link goes, and again at the stop (final) if that
failed. On the port's short timeout, since at a stop it comes before the
FunctionFS close, inside manager's 5 s. True when the draw is still cut."""
self.steer_draw(False)
self.port.off()
if self.released is None or (final and not self.released):
vm = root.run('vm', 'restore', timeout=root.PORT_TIMEOUT)
self.released = root.run('udc', 'restore', timeout=root.PORT_TIMEOUT) and vm
if self.released:
self.tuned = None
return self.cut
def steer_draw(self, want: bool) -> None:
"""jetlink-root.sh draw: with the link on, no current drawn from the USB-C
port, whatever is on it. The comma runs off its own power port, and drawing
from the host's only costs it: a 3X browns out the instant it draws from a
laptop (PMIC power-off reason UVLO), and an iPhone sags under the draw and
never sees a device. The launch script cuts it at boot (jetlink-root.sh
boot); this keeps it cut. A forced voter, so it holds for every plug after.
Given back only on an empty port, so the link turned off with a host still
in never lets the charger draw from it. Kept on a stop with the link
wanted, like the tuning (release_tuning). A start assumes the draw stock,
so the link off gives it back on an empty port even uncut here: an owner
before this one may have cut it, and letting go is safe to repeat."""
if want == self.draw_for:
return
if want:
self.cut = root.run('draw', 'off', timeout=root.PORT_TIMEOUT)
if self.cut:
gadget.log.info("jetlink: drawing no current from the USB-C port")
else:
if port.power_role() != 'none':
return # a host is still in; looked at again next step
root.run('draw', 'on', timeout=root.PORT_TIMEOUT)
self.cut = False
# settled, or failed, which is not retried every step
self.draw_for = want
def ensure_lender(self) -> None:
"""Listen for borrowers, or say why not and try again later.
@@ -670,6 +754,7 @@ class Owner:
return
self.attached = gadget.host_attached()
self.watch_the_port()
self.ensure_steered(offroad)
# before the worker gate: hardwared waits 25 s for this and a build in
# flight takes minutes, so a shutdown request cannot queue behind one
@@ -677,9 +762,9 @@ class Owner:
if reason is not None and not self.lender.lent:
if self.worker_running():
if self.shutting_down:
# the run asking the jetson. Stopping it here restarted it every
# step, half a second, less than it takes to start: on the bench
# nothing ever asked, and hardwared gave up after its 25 s
# the run asking the jetson. Stopping it here would restart it every
# half-second step, less than it takes to start, so nothing would
# ever ask and hardwared would give up after its 25 s
return
self.stop_worker()
if time.monotonic() < self.next_shutdown_run:
@@ -861,7 +946,7 @@ class Owner:
A power-off request ends it: hardwared waits 25 s for the owner to take
one, and the Jetson on its own supply stays on otherwise."""
self.backing_off = (f"the service keeps stopping ({died} times in {CRASH_WINDOW / 60:.0f} min), "
self.backing_off = (f"{gadget.BACKING_OFF} ({died} times in {CRASH_WINDOW / 60:.0f} min), "
f"waiting {until - time.monotonic():.0f} s before starting it again")
gadget.log.warning("jetlink: %s", self.backing_off)
self.publish_status()
@@ -881,7 +966,7 @@ class Owner:
still holds the gadget) would clear that owner's records, overwrite its
status record and release its port hold. The kernel lets an flock go with
the process however it dies, and the fd is not inherited by a run.
Without a /dev/shm to lock in, the owner runs as it did before."""
Without a /dev/shm to lock in, the owner runs unlocked."""
try:
gadget.OWNER_LOCK.parent.mkdir(parents=True, exist_ok=True)
fd = os.open(gadget.OWNER_LOCK, os.O_RDWR | os.O_CREAT, 0o644)
@@ -937,9 +1022,17 @@ class Owner:
time.sleep(max(0.0, POLL - (time.monotonic() - started)))
finally:
# first, inside manager's 5 s: it stops this when a chestnut turns up,
# and the comma has to host that. The sysctls stay: a stop here is where
# a drive begins
self.port.off()
# and the comma has to host that. The tuning and the draw go with the
# port when the link is not wanted (release_tuning)
if self.link_wanted():
self.port.off()
elif self.release_tuning(final=True):
if port.power_role() == 'source':
gadget.log.info("jetlink: the comma powers what is on the USB-C port; its draw stays cut, "
"which does nothing there, until a reboot")
else:
gadget.log.warning("jetlink: a host is still on the USB-C port; the comma draws nothing from it "
"until a reboot")
self.lender.stop()
# about this process's lender; with no owner there is nothing to borrow
# anyway, and a chestnut may be why it stopped
+2 -2
View File
@@ -11,8 +11,8 @@ host. An A-to-C cable settles which by construction: the A end only pulls CC
up, so the comma can only be the sink and the device. A C-to-C cable does not.
Both ends are dual role, and the comma can come out the source and the host:
facing a Mac, nothing enumerates; facing an iPhone or a Jetson's own USB-C
port, the far end enumerates as a device. Carrot's Jetson on C-to-C read
"Powered cable w/ sink" and enumerated as 0955:7020.
port, the far end enumerates as a device (a Jetson on C-to-C reads
"Powered cable w/ sink" and enumerates as 0955:7020).
While the link is on, a chestnut is the only thing the comma should host on
this port. So once the comma has been the source for a few seconds with no
+4 -4
View File
@@ -4,7 +4,7 @@ Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
Root on the comma: scripts/comma/jetlink-root.sh under sudo -n, and nothing
Root on the comma: jetlink/comma/jetlink-root.sh under sudo -n, and nothing
else. The script leaves its own record of the gadget and its network in
/dev/shm (jetlink-gadget, jetlink-net), so a False here only says the call
failed; the reason is in the log line and, for the gadget, in those files.
@@ -27,9 +27,9 @@ log = logging.getLogger('jetlink.comma')
AGNOS = os.path.isfile('/AGNOS')
# Resolved, so that <openpilot>/jetlink, a symlink into jetlink_repo, still
# leads to the checkout's scripts.
SCRIPT = Path(__file__).resolve().parents[2] / 'scripts' / 'comma' / 'jetlink-root.sh'
# Next to this file, so the package alone is all the comma runs. A path
# through the <openpilot>/jetlink symlink is fine: bash only opens it.
SCRIPT = Path(__file__).with_name('jetlink-root.sh')
# sudo, configfs, and for iOS nmcli and dnsmasq
TIMEOUT = 30.0
+128 -48
View File
@@ -11,35 +11,42 @@ The fork implements Openpilot (interface.py) once, in an adapter module that
holds every openpilot import, binds it here (bind) and calls the methods of
the Jetlink that comes back. That is the whole contract between the two repos:
the names in __all__, the Jetlink methods and Status, which
tests/openpilot/test_api.py and test_interface.py pin. API names its version:
the adapter checks it exactly and treats any other value as jetlink being
absent, an offroad alert and no link rather than a crash. Everything else in
this package is jetlink's own and changes without notice.
tests/openpilot/test_api.py and test_interface.py pin, and the facade the
fork's hook lines call them through (hooks.py) and the kit its CI runs
(testing.py). API names its version: an adapter declares the one it was
written to, hooks.Hooks refuses one it does not accept, and the fork treats
that as jetlink being absent, an offroad alert and no link rather than a
crash. Everything else in this package is internal to jetlink and may change
at any time.
API changes only for a breaking change to the contract. A new Status field, a
new Jetlink method, or a new interface member that jetlink reads with getattr
and a fallback, is additive and keeps it.
API changes only for a breaking change to the contract: removing or renaming
anything in it, changing what one of its members means, or making an optional
member required. A new Status field, a new Jetlink method, or a new interface
member that jetlink reads with getattr and a fallback, is additive and keeps
it. A bump keeps the previous API working for one minor release, so a fork can
move its pin and then its adapter. Each release that changes the contract
says how in its CHANGELOG section (Forks, docs/publishing.md).
Imported by the resident gadget owner, so nothing heavy at module level: the
parts a heavy process uses are imported when it first uses them.
"""
from __future__ import annotations
import threading
import time
from jetlink.comma import gadget
from jetlink.openpilot.events import Flags, SwapEvents
from jetlink.openpilot.interface import MODES, STATES, Keys, ModelFace, Openpilot, OwnerConfig, conformance
from jetlink.openpilot.parts import Parts, for_this_process
from jetlink.openpilot.status import Status
API = 1
API = 4
__all__ = ['API', 'MODES', 'STATES', 'Jetlink', 'Keys', 'ModelFace', 'Openpilot', 'OwnerConfig', 'Status', 'bind',
'conformance']
'conformance', 'SHUTDOWN_TIMEOUT', 'Flags', 'SwapEvents']
# how long a caller waits for the owner's run to shut the Jetson down. Wake
# from suspend is ~8 s to a server
# how long a power-off request waits for the owner's run to shut the Jetson
# down before it is withdrawn. Wake from suspend is ~8 s to a server
SHUTDOWN_TIMEOUT = 25.0
@@ -62,6 +69,11 @@ class Jetlink:
self._failures: dict[str, str] = {}
# when this process asked for the Jetson to power off, until it was taken
self._shutdown_asked: float | None = None
# shutdown_step: has it run in this process, and has it said yes
self._stepped = False
self._may_power_off = False
# the joining model's handovers as handed_over() last saw them
self._handovers = 0
def _read(self, what: str, read, fallback):
"""read(), or fallback(error) when it raises. The readers never raise:
@@ -97,6 +109,21 @@ class Jetlink:
mode = self._mode()
return self._read('the status', lambda: status.read(self._parts, mode), lambda error: status.failed(error, mode))
def runtime(self):
"""What modeld runs (status.Runtime), the part of status() that changes
while driving, for a loop: the setting, the chestnut test and modeld's
record, nothing else. The chestnut test may walk the USB devices in sysfs,
once per parts.CHESTNUT_TTL (2 s), as status() does. None where
status().running is None for want of the link: off, or beside a chestnut."""
from jetlink.openpilot import status
return status.runtime() if self.enabled() else None
def model_state(self, ref: str) -> str | None:
"""One catalog model for the picker's list: 'ready' (built on the Jetson),
'downloaded' (on the comma) or None. Asked when a list opens."""
from jetlink.openpilot import status
return self._read('a model\'s state', lambda: status.model_state(self._parts, ref), lambda error: None)
def reason(self) -> str | None:
"""Why the link the user asked for cannot run: hardwared's offroad alert.
None with the link off. The files the gadget and the build leave, nothing
@@ -137,6 +164,10 @@ class Jetlink:
def attach(self, small, cam_w: int, cam_h: int):
"""Join the link to modeld, once the camera is up and `small` is built:
the joining model, which drives as `small` until the Jetson is there.
Before every run() it asks the adapter's in_control() (is openpilot or
MADS in control? it swaps only while not), and modeld writes onto it
`frame_drop_ratio` (its share of dropped camera frames, which hands a
lagging large model back).
None unless prepare() said yes in this process: without it the GPU's
thread would start on modeld's realtime core. If the joining model cannot
@@ -151,6 +182,23 @@ class Jetlink:
self._log.exception("jetlink load failed")
return small
def handed_over(self, model) -> bool:
"""modeld, after every run(): did it change which model drives? The
joining model counts its swaps and hand-backs (JoinedModel.handovers),
and the stall of one is not lag, nor are the drops of its frame. Any
other model has no count and never hands over. Since the last call in
this process, which runs one modeld loop."""
handovers = getattr(model, 'handovers', 0)
changed, self._handovers = handovers != self._handovers, handovers
return changed
def state(self, model) -> str:
"""What modeld publishes as the big model's state: the model's
big_model_state as it is, one of STATES on a joining model, and 'none' for
a model without one. A fork's capnp enum holds exactly STATES, so a value
outside it would raise on the frame thread."""
return getattr(model, 'big_model_state', 'none')
def request_shutdown(self, reason: str = '') -> bool:
"""The device is powering off for good: ask for the Jetson to go down
with it, and return at once. True when the request now waits for the
@@ -178,9 +226,47 @@ class Jetlink:
the Jetson powered off later, when nobody wants it off, and the log says
the request went unanswered."""
try:
pending = gadget.SHUTDOWN_REQUEST.exists()
return self._pending()
except Exception:
return False
def shutdown_step(self, should_shutdown: bool, reason: str = '') -> bool:
"""hardwared, every loop: may the device power off now? True once it may
(put DoShutdown), and from then on. False while should_shutdown is False
and nothing has been asked. The first True asks once (request_shutdown):
True at once when there was nothing to ask, otherwise once the owner has
taken the request, or SHUTDOWN_TIMEOUT after asking, when it is withdrawn.
Once asked, should_shutdown is not read again, and the caller keeps no
timer. A stat a call. Never raises: a failure once a power-off is wanted
is a yes, since a jetlink bug must not keep a comma on to drain the car's
battery, and one before then is a no."""
if self._may_power_off:
return True
try:
first, self._stepped = not self._stepped, True
# a request this process did not write: a partial one, or one from a
# hardwared that has since restarted. Left, the owner would power the
# Jetson off whenever it next saw one, maybe a drive later
if first and self._shutdown_asked is None:
gadget.finish_shutdown()
if self._shutdown_asked is None and not should_shutdown:
return False
asked = self._shutdown_asked is not None or self.request_shutdown(reason)
self._may_power_off = not asked or not self._pending()
except Exception:
self._log.exception("jetlink: the shutdown step failed")
if self._shutdown_asked is not None:
# nobody follows the request any more, so it must not stay for the owner
try:
gadget.finish_shutdown()
except Exception:
pass
self._may_power_off = should_shutdown or self._shutdown_asked is not None
return self._may_power_off
def _pending(self) -> bool:
"""shutdown_pending(), raising."""
pending = gadget.SHUTDOWN_REQUEST.exists()
asked, now = self._shutdown_asked, time.monotonic()
if asked is None:
return pending
@@ -195,39 +281,12 @@ class Jetlink:
self._shutdown_asked = None
return pending
def shutdown(self, reason: str = '', timeout: float = SHUTDOWN_TIMEOUT) -> None:
"""request_shutdown(), then wait up to `timeout` for the owner to take it,
on a thread abandoned at the deadline: for a caller with nothing to do
meanwhile. hardwared keeps publishing, and uses the two above."""
if not self.enabled():
return
def request():
try:
self._request_shutdown(reason, timeout)
except Exception:
self._log.exception("jetlink: shutdown request failed")
t = threading.Thread(target=request, name='accelerator-shutdown', daemon=True)
t.start()
t.join(timeout)
if t.is_alive():
self._log.warning("jetlink: shutdown request still pending after %.0f s, going on without it", timeout)
def _request_shutdown(self, reason: str, timeout: float) -> None:
if not self._ask_for_power_off(reason):
return
if gadget.await_shutdown(timeout):
self._log.warning("jetlink: shutdown request handed to the jetson")
else:
self._log.warning("jetlink: nobody took the shutdown request within %.0f s", timeout)
def _ask_for_power_off(self, reason: str) -> bool:
"""Hand the request to the owner: nothing else can touch the link, and
the request is a file (gadget.SHUTDOWN_REQUEST) the owner's step looks
for before anything else. Skipped when no Jetson is known to be there
(dormant counts as there). A run busy in a long provision is stopped for
it; the caller's timeout covers a Jetson that never answers."""
it; shutdown_pending()'s deadline covers a Jetson that never answers."""
from jetlink.openpilot.status import Presence
if not self.enabled():
return False
@@ -243,13 +302,34 @@ class Jetlink:
self._shutdown_asked = time.monotonic()
return True
def should_extend_catalog(self) -> bool:
"""Should the model manager's big-model catalog carry the newer catalogs'
models? With no chestnut fitted. Hardware, not the link setting: the model
manager drops a pick its catalog does not list."""
def lists_big_models(self) -> bool:
"""Is the model manager's big-model list jetlink's (big_catalog) rather
than sunnypilot's? With no chestnut fitted. Hardware, not the link
setting: the model manager drops a pick its catalog does not list."""
return not self._parts.chestnut_fitted()
def big_catalog(self, selector: int) -> dict | None:
"""The model index as the model manager's big-model catalog, every bundle
at `selector` (its REQUIRED_JSON_VERSION), fetched again
(Models.big_catalog). None when it cannot be had, offline say, and the
model manager keeps the list it has."""
from jetlink.registry.index import RegistryError
try:
return self._parts.models.big_catalog(selector)
except RegistryError as e:
self._log.warning("jetlink: could not fetch the model index: %s", e)
return None
def listed_ref(self, ref: str) -> str | None:
"""The ref big_catalog() lists a pick's model under, for a pick a new list
no longer names: a recompile is listed once, under its newest ref. None
while the list is not jetlink's (lists_big_models)."""
return self._parts.models.listed_ref(ref) if self.lists_big_models() else None
# API 3's, until the next minor release: the catalog is left as fetched.
# Its picks still drive, since the index knows every ref it ever saw
def should_extend_catalog(self) -> bool:
return False
def extend_catalog(self, catalog: dict) -> dict:
"""The big-model catalog the model manager fetched, with the models newer
catalogs list folded in. Never raises."""
return self._parts.models.big_catalog(catalog)
return catalog
+115
View File
@@ -0,0 +1,115 @@
"""
Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
The onroad events of a big model that joins mid-drive, as flags. A native big
model loads before the first modelV2; this one joins onto a modelV2 the small
model already publishes, and can leave and come back. Each fork's selfdrived
calls SwapEvents.update once a tick and maps the flags onto its own events.
It swaps in only while nothing is in control, so the driver is told once when
it is ready (offer) and re-engages to use it. For a second after a swap nothing
engages (no_entry) while the big model builds its history and proves it keeps
up (the joining model hands back on a held frame in that second), and the chime
at the end of it says the driver can. When it leaves, the small model drives on
and the driver is told (link_lost); nothing disengages.
The fork's own chime on a rising modelV2.big, a native big model's, must not
fire for a joined one, or it says engage now at the start of the no-entry
second: gate it on the state being 'none', or at least drop it on no_entry
(zoompilot drops it on no_entry or chime, then adds it on chime).
Either way the switch costs modeld a frame or two, and a frame the camera
dropped is an invalid pose from the model and a localizer soft disable on the
next tick (TAKE CONTROL IMMEDIATELY). So a switch is `settling` for a second, which selfdrived must
treat as it does a native big model's load: hold the comm and localization
errors that frame raises.
"""
from __future__ import annotations
from typing import NamedTuple
# how long each lasts, in seconds; SwapEvents counts them in the caller's ticks.
# The link-lost warning covers about the time the small model takes to refill
# its history, the no-entry about 20 frames of the big model's. An enable inside
# that second is refused, and pressed again after the chime
OFFER_S = 3.
HANDBACK_S = 5.
SWITCHING_S = 1.
class Flags(NamedTuple):
offer: bool # ready while something is in control: re-engage to switch
link_lost: bool # it fell while in control; the small model drives on
no_entry: bool # the second after a swap: refuse an engagement
chime: bool # the end of that second: the big model drives, engage now
settling: bool # the second after a switch either way: forgive its dropped frame
def _tick(left: int) -> tuple[bool, int]:
return left > 0, max(left - 1, 0)
class SwapEvents:
def __init__(self, tick_s: float):
# checked once here: update() runs in selfdrived's loop and never raises
if not tick_s > 0 or round(SWITCHING_S / tick_s) < 1:
raise ValueError(f"SwapEvents needs the loop period in seconds, short enough to count a {SWITCHING_S:g} s switch: {tick_s}")
self.offer_ticks = round(OFFER_S / tick_s)
self.handback_ticks = round(HANDBACK_S / tick_s)
self.switching_ticks = round(SWITCHING_S / tick_s)
self.offered = False
self.running = False
# the state as last seen fresh: a gap in the fork's status or message holds
# it, never reads as the link going
self._state = 'none'
# ticks left of each event, and of the settling after a switch either way
self._offer = self._handback = self._switching = self._settle = 0
@property
def settling(self) -> bool:
return self._settle > 0
def update(self, fresh: bool, big: bool, in_control: bool, state: str) -> Flags:
"""One tick of the caller's loop, in hooks.SwapTracker.update's order.
`fresh`: modelV2 and the fork's state message are seen, alive and valid
this tick. `big`: modelV2.big, from a modelV2 alive and valid this tick.
`in_control`: the fork's meaning of something steering or able to
(zoompilot: openpilot or MADS, MADS even paused), the same rule the swap
waits on (the adapter's engaged()). `state`: the joining model's
big_model_state, its STATES name (str() of a capnp enum, never its .raw
number, which matches no state)."""
# a stale state neither offers the switch nor rearms the offer
if fresh:
self._state = state
if self._state != 'ready' or big:
# ended by the swap as well as by the link going: an offer still on
# screen after the switch reads as if it had not happened
self.offered = False
self._offer = 0
elif in_control and not self.offered and self._handback == 0:
# with nothing in control it swaps at once and the chime says so. Once
# per readiness, not at every stop, and after the link-lost warning,
# which would hide it
self.offered = True
self._offer = self.offer_ticks
# a chestnut dropping modelV2.big is its own fork's failure event, not this
running = bool(big) and self._state != 'none'
if running != self.running:
self._settle = self.switching_ticks + 1 # counted down below, this tick included
self._switching = self.switching_ticks + 1 if running else 0 # the no-entry, then the chime
if not running and in_control:
self._handback = self.handback_ticks
self.running = running
self._settle = max(self._settle - 1, 0)
if not in_control:
self._handback = 0
offer, self._offer = _tick(self._offer)
link_lost, self._handback = _tick(self._handback)
switching, self._switching = _tick(self._switching)
return Flags(offer, link_lost, switching and self._switching > 0, switching and self._switching == 0, self.settling)
+304
View File
@@ -0,0 +1,304 @@
"""
Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
What a fork's hook lines call: Jetlink's methods, behind a net that never
raises.
manager, hardwared, the UI and the model manager call these on every device,
link on or off, and modeld on every drive: whatever jetlink does wrong turns
the link off and is logged, and never takes one of them down. Each hook has
the answer it gets with the link off, and gives it on any failure. They are
not all False: attach() keeps modeld's model, big_catalog() is None so the
model manager keeps its own list, and shutdown_step() says yes to a power-off
that is wanted, since a broken jetlink must never keep a comma on to drain the
car's battery. selfdrived's
swap events (swap_events()) answer no event at all.
The fork's guard, which builds Hooks or else Off inside a function, and its
own fallback for no jetlink at all: docs/porting.md, "The adapter module".
Off is for a jetlink that imports but cannot be used (another API); link_on()
is the fork's stdlib read of the setting, so the reason a link cannot run is
told only to someone who turned it on.
Imported by every process that imports the fork's hook module, the resident
gadget owner among them: the standard library and jetlink's light half only.
Construction checks the API and nothing more; the adapter is built and bound
on the first hook that needs it, once per process. handed_over() and state()
read the model alone and never bind. With link_on() saying the link is off,
the only hooks that bind are BINDS_WITH_LINK_OFF's; every other one answers
as the link off, modeld's prepare() among them.
"""
from __future__ import annotations
import threading
from collections.abc import Callable
from jetlink.openpilot import API, Flags, Jetlink, SwapEvents, bind
# the APIs a fork's adapter may be written to: today's, and after a bump the
# previous one too, for one minor release (jetlink/openpilot/__init__.py)
COMPATIBLE = frozenset({API, 3})
# the hooks that ask jetlink with link_on() saying off. status(): the UI shows
# the big model's name from the model library. shutdown_step(): hardwared
# clears, from boot, a power-off request it did not write; and the request
# and its wait, for a link turned off while one is pending. The model
# manager's: the catalog is hardware and the library, not the setting
BINDS_WITH_LINK_OFF = frozenset({'status', 'shutdown_step', 'request_shutdown', 'shutdown_pending', 'model_state',
'lists_big_models', 'big_catalog', 'listed_ref', 'should_extend_catalog', 'extend_catalog'})
# what selfdrived is told when the swap events cannot run: none at all
NO_EVENTS = Flags(False, False, False, False, False)
# how often the swap events read modeld's runtime record without a state of the fork's own
RUNTIME_POLL_S = 0.2
def _text(error: BaseException) -> str:
"""An error as a log line says it, from an error whose str() may raise too."""
try:
return f"{type(error).__name__}: {error}"
except Exception:
return type(error).__name__
class _Hooks:
"""The hooks and the answer each gets with the link off. _call(name,
default, *args) is Jetlink.<name>(*args), or default with the link off;
_run() the same without asking link_on()."""
def __init__(self, reason: str = '', link_on: Callable[[], bool] | None = None):
self._why = reason
self._link_on = link_on
# the joining model's handovers as handed_over() last saw them, in this process
self._handovers = 0
self._prepared = False
def _link(self) -> bool | None:
"""link_on()'s answer, or None without one or for one that raises, which
counts as on: the hook asks jetlink, as without link_on()."""
try:
return None if self._link_on is None else bool(self._link_on())
except Exception:
return None
def _call(self, name: str, default, *args):
if name not in BINDS_WITH_LINK_OFF and self._link() is False:
return default
return self._run(name, default, *args)
def _run(self, name: str, default, *args):
return default
def should_run(self, started, params, CP) -> bool:
"""manager's should_run for the gadget owner."""
return self._call('enabled', False)
def status(self):
return self._call('status', None)
def reason(self) -> str | None:
"""Why jetlink cannot run here, told to someone who turned the link on,
else Jetlink.reason's. The call first: a bind that fails sets the why.
Without link_on() the why is told; with one that raises, nobody is."""
on = True if self._link_on is None else self._link()
if on is False:
return None
answer = self._run('reason', None)
return self._why if self._why and on else answer
def prepare(self, chestnut: bool) -> bool:
"""modeld, before config_realtime_process. A chestnut runs the large
model itself and never asks jetlink."""
self._prepared = bool(not chestnut and self._call('prepare', False))
return self._prepared
def attach(self, model, small, cam_w: int, cam_h: int):
"""modeld, once `small` is built: the model to run, `model` unless the link
joined. Binds nothing unless prepare() said yes in this process."""
if not self._prepared:
return model
# past prepare()'s yes: the setting has had its say for this modeld
joined = self._run('attach', None, small, cam_w, cam_h)
return model if joined is None else joined
# Jetlink's own two, which read the model and self._handovers alone: modeld
# asks every frame, so they never bind
def handed_over(self, model) -> bool:
try:
return bool(Jetlink.handed_over(self, model))
except Exception:
return False
def state(self, model) -> str:
try:
return Jetlink.state(self, model)
except Exception:
return 'none'
def runtime(self):
"""What modeld runs, from its runtime record (Jetlink.runtime): a
status.Runtime, or None with the link off or unusable, or a chestnut
fitted. Cheap enough for selfdrived's loop: two small files, and the
chestnut test's USB walk once per parts.CHESTNUT_TTL, as status()."""
return self._call('runtime', None)
def shutdown_step(self, should_shutdown: bool, reason: str = '') -> bool:
return self._call('shutdown_step', should_shutdown, should_shutdown, reason)
def request_shutdown(self, reason: str = '') -> bool:
return self._call('request_shutdown', False, reason)
def shutdown_pending(self) -> bool:
return self._call('shutdown_pending', False)
def model_state(self, ref: str) -> str | None:
return self._call('model_state', None, ref)
def lists_big_models(self) -> bool:
return self._call('lists_big_models', False)
def big_catalog(self, selector: int) -> dict | None:
"""None with the link off or on any failure: the model manager keeps its list."""
return self._call('big_catalog', None, selector)
def listed_ref(self, ref: str) -> str | None:
return self._call('listed_ref', None, ref)
# API 3's, until the next minor release
def should_extend_catalog(self) -> bool:
return self._call('should_extend_catalog', False)
def extend_catalog(self, catalog: dict) -> dict:
return self._call('extend_catalog', catalog, catalog)
def swap_events(self, tick_s: float) -> SwapTracker:
"""selfdrived's swap-event tracker, updated every `tick_s` (events.SwapEvents)."""
return SwapTracker(None, None, tick_s)
class Off(_Hooks):
"""The link off on every hook; reason() says why, when the link is on."""
class Hooks(_Hooks):
"""Jetlink over the fork's adapter, for an adapter written to `api`.
adapter_factory() makes it, on first use. Raises at once for an API this
jetlink does not accept. `log` is a logger, or a function that returns one,
for what fails before the adapter's log is there."""
def __init__(self, api: int, adapter_factory: Callable[[], object], *, link_on: Callable[[], bool] | None = None,
log=None):
if api not in COMPATIBLE:
raise ValueError(f"jetlink package API {API}, this build expects {api}")
super().__init__('', link_on)
self._factory = adapter_factory
# the adapter's once bound; until then the fork's, or the standard library's
self._log = log
self._bound = None
self._binding = threading.Lock()
# hook -> the failure last logged for it, cleared by a call that works
self._failed: dict[str, str] = {}
def _jetlink(self):
"""Bound once, the failure included: one Jetlink per process, so that
prepare() and attach() reach the same one."""
if self._bound is None:
with self._binding:
if self._bound is None:
self._bound = self._bind()
return self._bound or None
def _bind(self):
try:
op = self._factory()
self._log = getattr(op, 'log', None) or self._log
return bind(op)
except Exception as e:
self._why = f"jetlink failed to start: {_text(e)}"
self._report("jetlink: %s", self._why)
return False
def _report(self, msg: str, *args) -> None:
"""A failure to the log, in the except block that caught it. A log that
fails is let go: nothing a hook does may raise."""
try:
if not hasattr(self._log, 'exception'):
try:
log = self._log() # a factory; None or a logger raises here too
except Exception:
log = None
if not hasattr(log, 'exception'):
import logging
log = logging.getLogger('jetlink')
self._log = log
self._log.exception(msg, *args)
except Exception:
pass
def _net(self, name: str, default, fn, *args):
"""fn(*args), or default when it raises. Logged once per distinct error
(the UI would log a failing status five times a second), again after a
call that works."""
try:
result = fn(*args)
except Exception as e:
text = _text(e)
if self._failed.get(name) != text:
self._failed[name] = text
self._report("jetlink: %s() failed: %s", name, text)
return default
self._failed.pop(name, None)
return result
def _run(self, name: str, default, *args):
def call():
jetlink = self._jetlink()
return default if jetlink is None else getattr(jetlink, name)(*args)
return self._net(name, default, call)
def swap_events(self, tick_s: float) -> SwapTracker:
"""Bookkeeping alone, so it binds nothing: selfdrived builds it once,
link on or off."""
return SwapTracker(self._net('swap_events', None, SwapEvents, tick_s), self, tick_s)
class SwapTracker:
"""events.SwapEvents behind the net: update() is no event at all when it
fails, and settling False; the failure is logged as the hooks' are. Inert
without a tracker."""
def __init__(self, events: SwapEvents | None, hooks: Hooks | None, tick_s: float):
self._events = events
self._hooks = hooks
self._ok = events is not None
# runtime() a few times a second: modeld rewrites its record once a second
self._every = max(round(RUNTIME_POLL_S / tick_s), 1) if events is not None else 1
self._ticks = 0
self._runtime = None
@property
def settling(self) -> bool:
try:
return self._ok and bool(self._events.settling)
except Exception:
return False
def update(self, fresh: bool, big: bool, in_control: bool, state: str | None = None) -> Flags:
"""SwapEvents.update. `state` is the fork's own message's, where it has
one (zoompilot: modelDataV2SP.acceleratorState); without it the tracker
reads modeld's runtime record (hooks.runtime()), and a tick without a
live one is not fresh."""
if self._events is None:
return NO_EVENTS
if state is None:
if self._ticks == 0:
self._runtime = self._hooks.runtime()
self._ticks = (self._ticks + 1) % self._every
state = getattr(self._runtime, 'state', None)
fresh = fresh and state is not None
flags = self._hooks._net('swap_events.update', None, self._events.update, fresh, big, in_control, state or 'none')
self._ok = flags is not None
return NO_EVENTS if flags is None else flags
+118 -22
View File
@@ -17,7 +17,7 @@ The interface is split by process. The resident gadget owner gets data only
(OwnerConfig), no callbacks, so it stays at the standard library and about
10 MB. The heavy processes get the adapter object and each uses its side:
StatusSide in manager, the UI, hardwared and the model manager, WorkerSide in
the provisioning run, ModelSide in modeld, BuildSide in the warp build.
the provisioning run, ModelSide in modeld.
The standard library only: the owner imports this module.
"""
@@ -45,15 +45,24 @@ class Keys:
offroad: str # BOOL: is the car parked (manager's IsOffroad)
progress: str # JSON {stage, frac, msg, drops}: provisioning and join progress
spec: str # JSON: the built model's spec and whether its engine is built
pointers: str # JSON: catalog ref -> {oid, size}
# sunnypilot's model manager: the big-model pick, JSON {ref, displayName},
# and the big-model catalog, JSON {bundles}. Without one both are None, and
# jetlink runs its own default big model
# jetlink runs its own default big model, or the one picked on the server.
# A fork with a picker of its own and no catalog (StarPilot) declares only
# big_model, and may name its pick by the ONNX's hash, {sha256,
# displayName}; a newer pick made on the server is written into it
big_model: str | None = None
catalog: str | None = None
# BOOL: an iPhone on a direct cable is asked to charge from the comma
# (comma.port). Off when unset, and without the key
charge_phone: str | None = None
# STRING: where the model manager takes a pick by its ref and stores it in
# big_model (sunnypilot's ModelManager_DownloadRef). A newer pick made on
# the server is written there, so the comma's own list shows it; without
# the key it drives all the same
select: str | None = None
# API 3's kept pointers, unread since the model index: until the next minor release
pointers: str | None = None
@dataclass(frozen=True)
@@ -82,13 +91,13 @@ class ModelFace:
# The sides are typing Protocols so a type checker can hold the adapter to
# them; conformance() is the check both repos run. A parameter jetlink passes
# by keyword is keyword-only here, and only those names must match.
# by keyword is keyword-only here, and only those names must match. The
# members in OPTIONAL are ones jetlink reads with getattr and a fallback.
class StatusSide(Protocol):
"""Every reader: manager, the UI, hardwared, the model manager."""
keys: Keys
log: Any # logging.Logger-like (cloudlog): debug, info, warning, error, exception
catalog_selector: int # the model manager's REQUIRED_JSON_VERSION; 0 without a model manager
def params_dir(self) -> Path:
"""The params store's directory, by params.cc's rule, worked out on every
@@ -103,10 +112,11 @@ class StatusSide(Protocol):
"""Is comma's chestnut fitted? A USB walk; jetlink caches the answer."""
def camera(self) -> tuple[int, int, int, int]:
"""This device's (cam_w, cam_h, model_w, model_h): the warp modeld asks for."""
"""This device's (cam_w, cam_h, model_w, model_h): the warp modeld loads."""
def warp_path(self, cam_w: int, cam_h: int, model_w: int, model_h: int) -> Path:
"""Where the build puts the warp for this geometry."""
"""Where modeld's warp for this geometry is: openpilot's driving warp
pickle, which warp.Warps.load reads."""
class WorkerSide(StatusSide, Protocol):
@@ -127,39 +137,123 @@ class WorkerSide(StatusSide, Protocol):
class ModelSide(WorkerSide, Protocol):
"""modeld: comma's model face, the engagement a swap waits out, and the
structured log line the link's telemetry goes to."""
"""modeld: comma's model face, whether anything is in control, and the
structured log line the link's telemetry goes to. What modeld writes onto
the model every frame is Jetlink.attach's."""
def model_face(self) -> ModelFace:
"""What a ModelState for comma's large model has to carry."""
def engagement(self) -> Callable[[int], bool]:
"""A poller, made on the thread that calls it: (timeout_ms) -> engaged. Waits
up to timeout_ms for news and answers True when controls are engaged, or when
that is not known."""
def in_control(self) -> bool:
"""Is openpilot or MADS in control? The joining model asks on modeld's
frame thread before every frame and swaps the large model in only while
not. True when it cannot tell; never raises."""
def event(self, name: str, **fields: Any) -> None:
"""A structured log line (cloudlog.event)."""
def small_reset(self, small: Any) -> Callable[[], None] | None:
"""Optional (OPTIONAL): the reset of the fork's small model for a hand-back, or None
for jetlink's own (warp.prepare_reset, which knows stock modeld's,
modeld_v2's and a ModelState with GPU queues and numpy inputs). Asked once
on modeld's main thread before the frame loop. The reset runs on the
frame thread at a hand-back, so it zeroes the history in place and
allocates and compiles nothing; warp.reset_queues makes one."""
class BuildSide(Protocol):
"""scons: comma's warp graph."""
def make_warp(self, cam_w: int, cam_h: int, model_w: int, model_h: int) -> tuple[Callable[..., Any], int]:
"""The warp graph for this geometry, and the size of the NV12 frame it
reads. Imports comma's graph module before anything of tinygrad's."""
def model_warp(self, small: Any, cam_w: int, cam_h: int, model_w: int, model_h: int) -> FrameWarp | None:
"""Optional (OPTIONAL): the warp the link sends frames through, warmed,
or None for openpilot's driving warp pickle at warp_path (warp.Warp). For
a fork whose runtime cannot load that pickle, typically with its small
model's own warp. Asked once on modeld's main thread before the frame
loop, after the small model's warmup; raising keeps the drive on the
small model, as a pickle that does not load does. The offroad checks
still look for the pickle (Warps.built): only modeld has a small model
to ask, so warp_path must name a file either way."""
class Openpilot(ModelSide, BuildSide, Protocol):
class Openpilot(ModelSide, Protocol):
"""The whole adapter: one object implements every side."""
# What modeld hands Jetlink.attach and gets back: not the adapter's, pinned so
# a fork knows what its ModelState needs and what it may read off the result.
class SmallModel(Protocol):
"""The fork's own ModelState, whatever its shape. jetlink calls run()
positionally and writes attributes onto it (lat_delay, PLANPLUS_CONTROL);
the rest is optional, read with getattr: the frame's desire key and numpy
inputs (modeld_v2), the lateral delay a joining large model starts on, and
sunnypilot's planplus gain."""
desire_key: str
numpy_inputs: Any
lat_delay: float
PLANPLUS_CONTROL: float
def run(self, bufs: Any, transforms: Any, inputs: Any, after_enqueue: Callable[[], None] | None = None) -> Any:
"""One frame's outputs, as modeld's ModelState.run."""
class JoinedModel(Protocol):
"""What attach returns and modeld reads off and writes onto every frame.
frame_drop_ratio is written, lat_delay read and written. lat_delay and the
face (get_action_from_model through LONG_SMOOTH_SECONDS, modeld_v2's reads)
follow the model that drives, like any name it does not define, so over a
stock modeld's small model they are there only while the large one drives."""
handovers: int # moves on every swap and hand-back; modeld forgives that frame's drops
big_model_state: str # one of STATES
chestnut: bool # modelV2.big
get_action_from_model: Callable[..., Any]
constants: Any
LAT_SMOOTH_SECONDS: float
LONG_SMOOTH_SECONDS: float
frame_drop_ratio: float # modeld's share of dropped camera frames, before every run()
lat_delay: float
def run(self, bufs: Any, transforms: Any, inputs: Any, after_enqueue: Callable[[], None] | None = None) -> Any:
"""One frame's outputs, from whichever model drives."""
def close(self) -> None:
"""Let go of the link at modeld's exit."""
class FrameWarp(Protocol):
"""What an adapter's model_warp returns, warp.Warp's shape, run on modeld's
frame thread. Only one of the small and the large model runs a frame, so a
warp that shares the small model's JIT and buffers is never in use by both.
On a comma, a warp that reads its GPU output back moves it first with
warp.make_coherent, before the warp's JIT first runs."""
output: Any # the warped frame, (2, 6, model_h/2, model_w/2) uint8 as bytes: read after wait(), until the next start()
def start(self, frame: int, big_frame: int, tfm: Any, big_tfm: Any) -> None:
"""Warp the camera buffers at these addresses under their 3x3 transforms."""
def wait(self) -> None:
"""Return once `output` holds what start() warped."""
# The members of each protocol an implementation may lack: jetlink reads them
# with getattr and a fallback. conformance() passes an object without one and
# holds one with it to its signature, and adding one keeps API. Kept out of
# the protocols, where a name would be a member itself; a type checker still
# asks for these, as typing has no optional member
OPTIONAL: dict[type, tuple[str, ...]] = {
ModelSide: ('small_reset', 'model_warp'),
SmallModel: ('desire_key', 'numpy_inputs', 'lat_delay', 'PLANPLUS_CONTROL'),
JoinedModel: ('get_action_from_model', 'constants', 'LAT_SMOOTH_SECONDS', 'LONG_SMOOTH_SECONDS', 'lat_delay'),
}
def optional(protocol: type) -> frozenset[str]:
"""The members of `protocol` an implementation may lack, inherited ones included."""
return frozenset(name for cls in protocol.__mro__ for name in OPTIONAL.get(cls, ()))
def load_adapter(module: str) -> Openpilot:
"""The adapter an adapter module makes. An adapter module is the fork's
module that holds every openpilot import jetlink needs: its top level
imports only the standard library, and it has adapter() -> Openpilot and
owner_config() -> OwnerConfig. The entry points that run as their own
process (the provisioning run, the warp build) are told its name."""
process (the provisioning run) are told its name."""
return importlib.import_module(module).adapter()
@@ -201,9 +295,11 @@ def conformance(obj: object, protocol: type) -> list[str]:
jetlink pins the interface with it, and the fork's tests run it against the
real adapter."""
problems = []
may_lack = optional(protocol)
for name, expected in members(protocol).items():
if not hasattr(obj, name):
problems.append(f"{name}: missing")
if name not in may_lack:
problems.append(f"{name}: missing")
continue
if expected is None:
continue
+309 -283
View File
@@ -15,36 +15,41 @@ So modeld is handed the small model it already loaded, and the Jetson is
swapped in underneath once the link, the engine and the warp are all there.
modeld re-reads `model` every frame, and `modelV2.big` keeps its meaning.
From the join on, every frame goes to the Jetson whether or not it drives:
the small model drives on, and the large model's history and hidden state are
current and warm when the swap comes, so its first driving frame costs what
every frame costs. Those shadow frames are also the proof: the large model
is offered only once the host has answered the last PROVING_FRAMES of them
in time (model_state.keeping_up), so a host cold from a reconnect, or one
that is simply too slow, proves itself with the small model driving and not
at the wheel. The swap itself changes which model's output is published and
nothing else. While it drives, a reply that is not back in time is not
waited for: the previous frame's output is published again (a held frame,
Until the swap the comma runs its own model and nothing else; the link idles
on a keepalive ping. The large model is built on the swap frame and starts
from a reset history, as at every modeld start. The second after the swap is
its proof: the fork holds engagement off for it, and a large model that holds
a frame in it (model_state.PROVING_FRAMES) hands back before anyone can
engage. While it drives, a reply that is not back in time is not waited for:
the previous frame's output is published again (a held frame,
model_state.HOLD_FRAME) and the camera frame is not dropped. Too many holds
hand the drive back to the small model, as a lost link does.
No frames go to the host while the small model drives. Sending them costs
the comma ~9 ms of every frame for as long as the window stays shut (a whole
drive with MADS on), which starves the driver monitoring model under
selfdrived's frequency floor (commIssue).
Two rules the swap keeps:
- tinygrad work happens on modeld's thread. The joining thread does link IO
only; building the JetlinkModelState unpickles a TinyJit, and doing that
next to the small model running frames on the same device is not safe.
- never swap while the plan is steering. The two models disagree by ~195 m of
planned path, and the swap costs a frame or two. Require fresh, fully
disengaged controls; standstill alone is not enough, longitudinal control
may still hold the brake.
planned path, and the swap costs a frame or two. The adapter says before
every frame whether anything is in control (in_control), from openpilot's
own messages; standstill alone is not enough, longitudinal control may still
hold the brake.
"""
from __future__ import annotations
import os
import threading
import time
from jetlink import protocol as P
from jetlink.comma import gadget
from jetlink.openpilot.model_state import JetlinkModelState
from jetlink.transport.priority import background_thread
# after a join fails or the large model dies mid-drive. Long enough not to
@@ -56,39 +61,25 @@ REJOIN_DELAY = 5.0
REJOIN_DELAY_MAX = 60.0
STABLE_SECONDS = 60.0
# after a join that held: a link that ran for minutes and then went is a USB
# drop, and the host re-enumerates a rebound gadget in under a second. The
# rest of the old delay was the driver's time, not the Jetson's
# drop, and the host re-enumerates a rebound gadget in under a second
REJOIN_DELAY_QUICK = 1.0
# failures in a streak retried that quickly before the doubling starts. A
# demote is mostly one late frame, a tail of the link or the host and not a
# dead one: on a phone's cable each one cost 5 to 60 s on the small model,
# five times in nine minutes on an iPad (2026-10-03). A link that fails on
# its heels this many times is backed off as before
# dead one, and a full backoff costs 5 to 60 s on the small model. A link
# that fails on its heels this many times is backed off as usual
QUICK_RETRIES = 3
# after a link lost while it only shadowed: no swap, demote or alert to pay
# for, so no doubling. A phone that dropped its first frames again and again
# pulsed the icon for 1 to 60 s between tries (2026-10-04)
SHADOW_REJOIN_DELAY = 2.0
# how often a link that is ready but has nowhere to land gets checked, and
# how long the check may take; both off the frame loop
KEEPALIVE_PERIOD = 10.0
PING_TIMEOUT = 2.0
# how often a backoff looks at the gadget. A host that configures it again
# after it went away is a replug, which the backoff is not for: one waited 16 s
# for a Jetson that was back in 0.4 (2026-09-29)
# after it went away is a replug, which the backoff is not for: a replugged
# Jetson is back in under half a second
REPLUG_POLL = 0.25
# link drops in one drive before the status names the cable. One is weather;
# the 2026-09-07 evening drive had six in twelve minutes, every one the
# USB-C port losing its host, and nothing the driver could see said so
# link drops in one drive before the status names the cable. One is chance;
# repeated drops are almost always the USB-C port losing its host, and nothing
# else the driver can see says so
DROPS_TO_BLAME_CABLE = 2
ENGAGEMENT_POLL_MS = 100
ENGAGEMENT_MAX_AGE = 0.25
# a large-model frame is ~30 ms and the worst seen on the current stack ~55.
# One that took LATE_FRAME, or a second past SLOW_FRAME within LAG_WINDOW of
# the last, is a fault and is handled as a loss: modeld would otherwise count
# the dropped camera frames into modeldLagging with the slow model still
# steering. With a late reply held rather than waited for (model_state), a
# frame this long is the comma's own stall, a warp or a send, or a frame with
# nothing to hold yet. A frame past link.INFERENCE_TIMEOUT never returns; it fails
LATE_FRAME = 0.1
SLOW_FRAME = 0.075
LAG_WINDOW = 10.0
# A host slower than the camera but never that slow (an iPhone that has warmed
# up: 55 ms a frame drops one camera frame in ten) still has modeld skipping
# frames, and selfdrived soft-disables on modeldLagging once modeld's filtered
@@ -98,54 +89,58 @@ LAG_WINDOW = 10.0
# a second within about 6.5 s is not. modeld forgives the frame of a handover
# too, so the drops that decided it never reach selfdrived
DROP_LIMIT = 0.0075
# the first frames after every swap are never counted as slow: the first after
# a join carries the history reset, and a Mac's is ~100 ms of CoreML warm-up
SETTLING_FRAMES = 3
# the small model drives the first frames of every modeld start, even with the
# large model ready: its first run in a process costs ~1.3 s, which the first
# fallback frame paid (25 dropped frames, commIssue) when the large model had
# driven from frame one. Nothing is in control at a modeld start
# fallback frame would pay (25 dropped frames, commIssue) if the large model
# drove from frame one. Nothing is in control at a modeld start
SMALL_WARMUP_FRAMES = 3
# shadowing this long without keeping up, the panel says the link is too slow
# to drive rather than 'checking' for the drive. The proof goes on: a host
# that warms up late still gets offered
SLOW_LINK_AFTER = 10.0
# the panel's line while the large model shadows: once it is built, once it
# keeps up, and once it has not for SLOW_LINK_AFTER
CHECKING = 'checking the link keeps up'
PROVEN = 're-engage to switch'
SLOW = 'too slow to drive'
# the panel's line while a ready link waits for the window
READY = 're-engage to switch'
# why a demote happened, as the log says it
LOST = 'lost jetlink'
BEHIND = 'jetlink fell behind'
# a NaN or an inf in an output: a host that answers, wrongly. A lag and not a
# drop, the link is kept, and the next swap starts the host from a reset
BAD_OUTPUT = 'jetlink output not finite'
# what modeld_v2 builds the frame's inputs from: the small bundle's desire
# name and optional slots, read off the small model whichever drives
SMALL_READS = ('desire_key', 'numpy_inputs')
# why a built model was let go before it drove
NOT_UP = 'could not bring up the large model'
# and as the leave says it to the server (protocol.Msg.LEAVE)
LEAVING = {LOST: P.LEAVE_LOST, BEHIND: P.LEAVE_BEHIND}
# and as the panel's one line says it while the join tries again
RECONNECTING = {LOST: 'reconnecting', BEHIND: 'fell behind, reconnecting', NOT_UP: 'load failed, reconnecting'}
# the demotes that count as lag, which says nothing about the cable
LAGS = (BEHIND, BAD_OUTPUT)
# and as the panel's one line says it while the join tries again, with the
# `why` of its progress code (status.PROGRESS_CODES 'reconnecting')
RECONNECTING = {LOST: ('reconnecting', 'lost'), BEHIND: ('fell behind, reconnecting', 'behind'),
NOT_UP: ('load failed, reconnecting', 'load_failed'),
BAD_OUTPUT: ('bad output, reconnecting', 'bad_output')}
# how long a model name the comma's index did not have stays the sha's
NAME_RETRY = 30.0
class JoiningModelState:
"""Duck-types openpilot's modeld ModelState, with a second one inside.
`progress` is where the join says what it is waiting on (status.Progress),
`engagement` makes the poller the swap window reads (the adapter's), and
`log` is cloudlog on a comma.
`log` is cloudlog on a comma, and `in_control` the adapter's, asked before
every frame; without one, the in_control last written stands. `name` is
the catalog's name for a model's sha256, for the runtime record.
"""
def __init__(self, small, connect, build, prepare=None, reset_small=None, *, progress, engagement, log):
def __init__(self, small, connect, build, prepare=None, reset_small=None, *, progress, log, in_control=None,
name=None):
self._small = small
self._active = small
self._connect = connect
self._build = build
self._reset_small = reset_small
self._progress = progress
self._engagement = engagement
self._log = log
# whatever the swap would otherwise do on the frame loop, done now on
# modeld's main thread before the frame loop exists; at the swap it cost
# modeld's main thread before the frame loop exists; at the swap it costs
# a 1.5 s frame
if prepare is not None:
try:
@@ -156,14 +151,17 @@ class JoiningModelState:
log.exception("jetlink: could not prepare the large model ahead of the swap")
raise
# handed over by the joining thread, consumed by the next frame, which
# handed over by the joining thread, consumed by the swap frame, which
# builds the large model state from it. Only ever assigned under the lock
self._joined: tuple[object, object] | None = None
# the large model state once built: fed every frame, driving when it is
# _active. Only the frame thread assigns it
# a link is ready and waiting for the window. Kept true while a keepalive
# ping has _joined out for a moment
self._available = False
# the large model state, from the swap until it hands back: always _active.
# Only the frame thread assigns it
self._big = None
# what the frame thread let go of and why (LOST, BEHIND, or a build that
# failed), for the join thread to say goodbye to and close or keep.
# what the frame thread let go of and why (LOST, BEHIND, BAD_OUTPUT, or a
# build that failed), for the join thread to say goodbye to and close or keep.
# Assigned under the lock
self._retired: tuple[object, str] | None = None
self._lock = threading.Lock()
@@ -182,29 +180,24 @@ class JoiningModelState:
# changes of the model that drives, and decisions to change it: modeld
# compares it across run() (handovers)
self._handovers = 0
# set on a frame the large model fell behind on; the next frame demotes.
# _slow_at is when the last slow frame was, for the second strike
# set on a frame the large model fell behind on; the next frame demotes
self._lagging = False
self._slow_at: float | None = None
# modeld's share of dropped camera frames, for the frame about to run
self._frame_drop_ratio = 0.0
# frames each model has run: the small one's since start, the large one's
# since it swapped in
# set by the large model's first frame: the join thread clears the
# progress, which is params IO and not the frame thread's
self._announce = False
# frames the small model has run since start
self._small_frames = 0
self._big_frames = 0
# the panel's last line about the large model shadowing (CHECKING, PROVEN
# or SLOW). A report is a param write on the frame thread, so only a
# change is reported
self._proving = CHECKING
# whether the host had let go of the gadget when the last link was lost,
# and whether this failure streak has already skipped a backoff for a replug
self._host_left = False
self._replugged = False
# assume engaged and moving until a message says otherwise, so a swap can
# never happen on no information
self._engaged = True
self._engagement_updated = 0.0
# in control until the adapter says otherwise, so a swap can never happen
# on no information
self._in_control = True
self._ask_in_control = in_control
self._stop = threading.Event()
# whether the large model has produced a frame; a first inference that
@@ -212,10 +205,20 @@ class JoiningModelState:
# modelDataV2SP, not a param: a chestnut's load is over once, this never is
self._loading = True
self._threads = [threading.Thread(target=self._join_loop, daemon=True),
threading.Thread(target=self._watch_engagement, daemon=True)]
for t in self._threads:
t.start()
# the runtime record's: when the large model's last answer (not a held
# frame) came, and a wake for its writer on a hand-back and the first
# answer. The frame thread assigns them and nothing else; the writer
# thread reads the rest itself. The path is taken now, so a test's stays
# its own
self._output_at = 0.0
self._record = threading.Event()
self._record_path = gadget.MODELD
self._name = name
self._thread = threading.Thread(target=self._join_loop, daemon=True)
self._thread.start()
self._writer = threading.Thread(target=self._write_loop, daemon=True)
self._writer.start()
# -- what modeld reads ------------------------------------------------------
# A read not defined here follows the model that is driving (__getattr__):
@@ -223,21 +226,16 @@ class JoiningModelState:
# function, which sunnypilot keeps on the ModelState so a custom small bundle
# can carry its own. Swaps and demotes happen inside run(), so what is read
# after it belongs to the model whose output it is. What the loop writes
# lands on both. The frame's inputs are built for the small bundle (its
# desire name, its optional slots); the large model reads the desire under
# any name and the loop always supplies what it needs, so a swap can land on
# any frame
# lands on both, but for what only this reads. The frame's inputs are built
# for the small bundle (SMALL_READS, off the small model whichever drives);
# the large model reads the desire under any name and the loop always
# supplies what it needs, so a swap can land on any frame
@property
def big_model_available(self) -> bool:
"""Built, keeping up with the frames it shadows, and waiting to switch:
what big_model_state calls ready, and what the driver is offered."""
return not self._stop.is_set() and self._shadowing and self._big.keeping_up
@property
def _shadowing(self) -> bool:
# a large model built and fed every frame, with the small model driving
return self._big is not None and self._active is self._small
"""Connected and waiting to switch: what big_model_state calls ready, and
what the driver is offered."""
return not self._stop.is_set() and self._available and self._active is self._small
@property
def chestnut(self) -> bool:
@@ -271,14 +269,6 @@ class JoiningModelState:
# read by the status publisher on every send, so the telemetry follows the link
return getattr(self._active, 'client', None)
@property
def desire_key(self) -> str:
return self._small.desire_key
@property
def numpy_inputs(self):
return self._small.numpy_inputs
@property
def lat_delay(self):
return self._active.lat_delay
@@ -308,160 +298,110 @@ class JoiningModelState:
@frame_drop_ratio.setter
def frame_drop_ratio(self, value):
# modeld's frameDropPerc / 100, written before every run(). Read here, by
# the lag rule; it lands on the small model too, as every write does
# the lag rule; no small model reads it
self._frame_drop_ratio = value
self._small.frame_drop_ratio = value
@property
def in_control(self) -> bool:
return self._in_control
@in_control.setter
def in_control(self, value):
# openpilot or MADS in control, by openpilot's own messages, asked before
# every run(): the swap waits for False. Not a thread polling selfdrived:
# that wakes ~300 times a second and takes 6 to 11 % of a core inside modeld
self._in_control = value
def __getattr__(self, name):
# Only for names this class does not define. Without it, a comma or
# sunnypilot sync that adds one read was an AttributeError on the frame
# thread, which modeld re-raises: modeld dead for the drive, on jetlink
# devices only. Reads only; a new write lands here and nowhere else, so
# each one modeld makes has its own setter above
# Only for names this class does not define, so a read that a comma or
# sunnypilot sync adds is not an AttributeError on the frame thread (modeld
# re-raises it and is dead for the drive). Reads only; a write lands on
# this object alone, so each one modeld makes has its own setter above
if name.startswith('_'):
# also what keeps __init__ from recursing before _active exists
raise AttributeError(name)
return getattr(self._active, name)
# a small model without one of SMALL_READS has none, whichever drives
return getattr(self._small if name in SMALL_READS else self._active, name)
# -- the frame path ---------------------------------------------------------
def run(self, bufs, transforms, inputs, after_enqueue=None):
self._adopt()
if self._ask_in_control is not None:
self.in_control = self._ask_in_control()
if self._lagging:
# the last frame was the large model's last, published as it came
self._lagging = False
self._demote(BEHIND)
elif self._active is not self._small and self._frame_drop_ratio > DROP_LIMIT:
# modeld is behind the large model; this frame is the small model's
self._log.warning("jetlink: modeld dropped %.2f %% of camera frames behind the large model, "
self._log.warning("jetlink: modeld dropped %.2f %% of camera frames behind the large model, " +
"the small model drives from this one", self._frame_drop_ratio * 100)
self._demote(BEHIND)
self._note_proving()
self._maybe_swap()
if self._active is self._small:
self._small_frames += 1
return self._run_small(bufs, transforms, inputs, after_enqueue)
return self._small.run(bufs, transforms, inputs, after_enqueue)
return self._run_big(bufs, transforms, inputs, after_enqueue)
def _run_small(self, bufs, transforms, inputs, after_enqueue):
"""The small model's frame, and the large model's too when there is one:
warped now, sent once the small model's own work is on the GPU (its
after_enqueue), so the send overlaps it. A link that fails here is lost
before it drove: let go and reopened, with the small model's frame
unharmed."""
big = self._big
if big is None:
return self._small.run(bufs, transforms, inputs, after_enqueue)
try:
big.prepare(bufs, transforms, inputs)
except Exception:
self._log.exception("jetlink: the large model's link failed with the small model driving, reopening")
self._retire(LOST)
return self._small.run(bufs, transforms, inputs, after_enqueue)
failed: list[BaseException] = []
def enqueued():
try:
big.send()
except Exception as e: # never through the small model's run: modeld would make it fatal
failed.append(e)
if after_enqueue is not None:
after_enqueue()
result = self._small.run(bufs, transforms, inputs, enqueued)
if not failed and not big.sent:
# a small model that did not call back; send now
try:
big.send()
except Exception as e:
failed.append(e)
if not failed:
# the proof: would this frame have been held? (model_state.check_shadow)
try:
big.check_shadow()
except Exception as e:
failed.append(e)
if failed:
self._log.error("jetlink: the large model's link failed with the small model driving, reopening",
exc_info=failed[0])
self._retire(LOST)
return result
def _run_big(self, bufs, transforms, inputs, after_enqueue):
big = self._big
started = time.monotonic()
try:
result = big.run(bufs, transforms, inputs, after_enqueue)
except Exception:
except Exception as e:
failed = time.monotonic()
self._log.exception("jetlink: large model failed mid-drive, back to the small model")
self._demote(LOST)
self._demote(BAD_OUTPUT if isinstance(e, P.NotFinite) else LOST)
demoted = time.monotonic()
# re-run the frame rather than propagate: modeld's fallback is permanent,
# this one is retryable. after_enqueue is dropped, the large model may
# already have called it
result = self._small.run(bufs, transforms, inputs, None)
# all of it is one modeld frame, 42 to 107 ms on the 2026-09-29 drives
# with the small model warm. The dropped camera frames are forgiven
# all of it is one modeld frame, 42 to 107 ms measured with the small
# model warm. The dropped camera frames are forgiven
# (modeld sees the model change), but the log should say which part it was
done = time.monotonic()
self._log.warning("jetlink: fallback frame %.0f ms: link %.0f, demote %.0f, small model %.0f",
(done - started) * 1e3, (failed - started) * 1e3,
(demoted - failed) * 1e3, (done - demoted) * 1e3)
return result
took = time.monotonic() - started
self._big_frames += 1
if not getattr(big, 'held', False):
self._output_at = time.monotonic()
if self._loading:
# a connected engine can still fail its first inference; only announce
# readiness after a frame the caller can publish
self._loading = False
self._progress.clear()
self._announce = True
self._rejoin.set()
self._record.set()
self._log.warning("jetlink: large model joined mid-drive, modelV2.big is now true")
if self._big_frames > SETTLING_FRAMES:
why = getattr(big, 'behind', None) or (f'took {took * 1e3:.0f} ms' if self._fell_behind(took) else None)
if why:
# this frame's output is published as it came; its stall is forgiven now
self._lagging = True
self._handovers += 1
self._log.warning("jetlink: large model %s, the small model drives from the next", why)
if big.behind:
# this frame's output is published as it came; its stall is forgiven now
self._lagging = True
self._handed_over()
self._log.warning("jetlink: large model %s, the small model drives from the next", big.behind)
return result
def _fell_behind(self, took: float) -> bool:
if took > LATE_FRAME:
return True
if took <= SLOW_FRAME:
return False
now = time.monotonic()
second = self._slow_at is not None and now - self._slow_at <= LAG_WINDOW
self._slow_at = now
return second
@property
def _window_open(self) -> bool:
# standstill does not make an active longitudinal controller safe to swap
fresh = 0 <= time.monotonic() - self._engagement_updated < ENGAGEMENT_MAX_AGE
return fresh and not self._engaged
def _adopt(self) -> None:
"""Build the large model state from a join that has landed, on this
thread, which is where everything tinygrad touches must happen. From the
next frame on it is fed every frame (_run_small) and swapped in when the
window opens. A build that fails is backed off like a demote, or one that
fails the same way every time is a connect and a build per second for
the drive."""
if self._joined is None:
def _maybe_swap(self) -> None:
"""Build the large model state from a join that has landed and swap it in,
on this thread, which is where everything tinygrad touches must happen.
Its first frame resets the host's history. A build that fails is backed
off like a demote, or one that fails the same way every time is a connect
and a build per second for the drive."""
if self._joined is None or self._in_control or self._small_frames < SMALL_WARMUP_FRAMES:
return
with self._lock:
joined, self._joined = self._joined, None
if joined is not None:
self._available = False
if joined is None:
return
client, spec = joined
try:
t0 = time.monotonic()
big = self._build(client, spec)
big.lat_delay = self._small.lat_delay
self._log.warning("jetlink: built the large model state in %.0f ms; it runs every frame from here",
(time.monotonic() - t0) * 1000)
big.lat_delay = getattr(self._small, 'lat_delay', big.lat_delay)
self._log.warning("jetlink: built the large model state in %.0f ms", (time.monotonic() - t0) * 1000)
except Exception:
self._log.exception("jetlink: could not bring up the large model, staying small")
with self._lock:
@@ -469,63 +409,33 @@ class JoiningModelState:
self._back_off()
return
self._big = big
self._proving = CHECKING # the join thread said so at link ready
# the link is held from here, shadowing or driving: a shadow that ran for
# minutes and then went starts a new streak, as a drive that did
self._joined_at = time.monotonic()
def _note_proving(self) -> None:
"""The panel's line while the large model shadows, on a change only:
PROVEN once it keeps up, SLOW once it has not for SLOW_LINK_AFTER, and
CHECKING again after a hand-back. The first driven frame clears it."""
if not self._shadowing:
return
if self._big.keeping_up:
line = PROVEN
elif time.monotonic() - self._joined_at > SLOW_LINK_AFTER:
line = SLOW
else:
line = CHECKING
if line != self._proving:
self._proving = line
self._log.warning("jetlink: large model %s", line)
self._report('connect', line)
def _maybe_swap(self) -> None:
if not self._shadowing:
return
if not self._big.keeping_up or not self._window_open or self._small_frames < SMALL_WARMUP_FRAMES:
return
# nothing to build and nothing to reset (the module docstring says why)
self._big_frames = 0
self._slow_at = None
# no wake: the record says the swap with the first answer, which wakes it
self._handovers += 1
self._active = self._big
self._active = big
def _demote(self, why: str) -> None:
"""Back to the small model, from a reset history. On the frame thread, so
nothing here waits: the join thread reads the port, reports and closes
the link, moments later."""
self._retire(why) # while _shadowing still tells a drive from a shadow
self._active = self._small
self._handovers += 1
self._loading = True
if self._reset_small is not None:
self._reset_small()
def _retire(self, why: str) -> None:
"""Let the large model go, driving or not, for the join thread to say
goodbye to and close or keep (_close_retired). Counted as a lost link or
a hand-back for lag, and backed off."""
shadow = self._shadowing
the link, moments later. Counted as a lost link or a hand-back for lag,
and backed off."""
big, self._big = self._big, None
if why == BEHIND:
if why in LAGS:
self._lags += 1
else:
self._drops += 1
with self._lock:
self._retired = (big, why)
self._back_off(shadow)
self._back_off()
self._active = self._small
self._handed_over()
self._loading = True
if self._reset_small is not None:
self._reset_small()
def _handed_over(self) -> None:
self._handovers += 1
self._record.set()
def _close_retired(self, retired, why: str) -> None:
"""Say goodbye over the retired large model's link, then close it if it
@@ -557,14 +467,13 @@ class JoiningModelState:
except Exception:
self._log.exception("jetlink: could not say why the link is left")
def _back_off(self, shadow: bool = False) -> None:
def _back_off(self) -> None:
"""Push the next attempt out, further each time one fails on its heels.
Each failed cycle is a swap frame, a demote frame and the alerts that go
with them. The first QUICK_RETRIES failures of a streak are retried in
REJOIN_DELAY_QUICK; the ones after double from REJOIN_DELAY. A join that
held for STABLE_SECONDS starts a new streak. A link lost while it only
shadowed waits SHADOW_REJOIN_DELAY.
held for STABLE_SECONDS starts a new streak.
"""
held = time.monotonic() - self._joined_at if self._joined_at else 0.0
stable = bool(self._joined_at) and held > STABLE_SECONDS
@@ -572,9 +481,7 @@ class JoiningModelState:
if stable:
self._replugged = False # a new streak may skip a backoff for a replug again
self._joined_at = 0.0
if shadow:
delay = SHADOW_REJOIN_DELAY
elif self._failures <= QUICK_RETRIES:
if self._failures <= QUICK_RETRIES:
delay = REJOIN_DELAY_QUICK
else:
delay = min(REJOIN_DELAY * 2 ** (self._failures - QUICK_RETRIES - 1), REJOIN_DELAY_MAX)
@@ -585,17 +492,18 @@ class JoiningModelState:
# -- background -------------------------------------------------------------
def _report(self, stage: str, msg: str) -> None:
def _report(self, stage: str, msg: str, code: str | None, args: dict | None = None) -> None:
"""Tell the UI what the join is waiting on.
Offroad the record carries a provisioning run's progress; without this, a
Jetson that is not plugged in looked like one six seconds from loading. No
fraction to give, and the panel does not invent one.
Jetson that is not plugged in looks like one about to load. No fraction to
give, and the panel does not invent one.
"""
# the count is the diagnosis. A link that runs for minutes and then goes,
# again and again, is the cable, and the cable is the one thing the
# driver can do something about
self._progress.report(stage, 0.0, msg, drops=self._drops if self._drops >= DROPS_TO_BLAME_CABLE else 0)
self._progress.report(stage, 0.0, msg, drops=self._drops if self._drops >= DROPS_TO_BLAME_CABLE else 0,
code=code, args=args)
def _note_link_loss(self, why: str) -> None:
"""Off the frame thread: what the comma's USB-C port sees now, next to the
@@ -610,7 +518,8 @@ class JoiningModelState:
# has still been replugged
self._host_left = not gadget.host_attached()
self._log.warning("jetlink: %s, %s; drop %d, lag %d this drive", why, port, self._drops, self._lags)
self._report('connect', RECONNECTING[why])
msg, code = RECONNECTING[why]
self._report('connect', msg, 'reconnecting', {'why': code})
def _join_loop(self) -> None:
"""Open the link and get the engine ready. No tinygrad in here."""
@@ -625,6 +534,16 @@ class JoiningModelState:
# a dead link, and close() sets this. An idle wake per second is not
# free on modeld's core
self._rejoin.wait()
if self._announce:
# the large model's first frame is out. Before the retired one below,
# whose reconnecting line is newer; woken for this alone, wait again.
# A demote or close sets its own flag before the event, so clearing
# the event and then looking misses neither
self._announce = False
self._progress.clear()
self._rejoin.clear()
if self._retired is None and not self._stop.is_set():
continue
with self._lock:
retired, self._retired = self._retired, None
if retired is not None:
@@ -641,16 +560,20 @@ class JoiningModelState:
self._rejoin.clear()
if self._wait_out_back_off():
return
self._report('connect', 'waiting for jetlink')
self._report('connect', 'waiting for jetlink', 'waiting_for_host')
try:
# the connect can take minutes when the picked model still has to be
# built, so it is handed the flag close() sets rather than polled
client, spec = self._connect(self._stop.is_set)
except Exception as e:
# expected while the Jetson boots. Not exception(): a stack trace every
# 5 s for the first minute of every drive is noise
self._log.warning("jetlink: not joined yet (%s), retrying in %.0fs", e, REJOIN_DELAY)
if self._stop.wait(REJOIN_DELAY):
# expected while the Jetson boots, so no stack trace. A failure that
# knows when it is worth asking again says so (link.ModelMissing), and
# what the panel should show meanwhile
delay = getattr(e, 'retry_after', REJOIN_DELAY)
if waiting := getattr(e, 'waiting', None):
self._report('connect', waiting, getattr(e, 'code', None))
self._log.warning("jetlink: not joined yet (%s), retrying in %.0fs", e, delay)
if self._stop.wait(delay):
return
self._rejoin.set()
continue
@@ -658,9 +581,11 @@ class JoiningModelState:
if self._stop.is_set():
client.close()
return
self._available = True
self._joined = (client, spec)
self._log.warning("jetlink: link ready, the large model shadows from the next frame")
self._report('connect', CHECKING)
self._log.warning("jetlink: link ready, waiting for a window to swap")
self._report('connect', READY, 'ready_waiting_window')
self._keep_alive()
def _wait_out_back_off(self) -> bool:
"""Until the next attempt is due, or a host configures the gadget again
@@ -679,21 +604,118 @@ class JoiningModelState:
host_left = host_left or not attached
return self._stop.is_set()
def _watch_engagement(self) -> None:
background_thread() # off modeld's realtime core; see _join_loop
# made on this thread: the poller's sockets (a SubMaster) belong to the
# thread that made them
engaged = self._engagement()
def _keep_alive(self) -> None:
"""Ping a link that is waiting for a swap window.
On a drive with no stop and no disengage that is the whole drive, and a
host that reboots in there would otherwise be found at the swap: a build
on a dead link, a demote and the backoff, all on modeld's thread.
The client is taken out of _joined for the ping and put back after, so the
frame loop sees a whole one or none, and never waits on the lock.
"""
while not self._stop.is_set():
# rechecked on every poll, including ones with no news: that is when
# alive turns false. The frame thread expires the answer too
self._engaged = engaged(ENGAGEMENT_POLL_MS)
self._engagement_updated = time.monotonic()
if self._rejoin.wait(KEEPALIVE_PERIOD):
return
with self._lock:
joined, self._joined = self._joined, None
if joined is None:
return # swapped in on a frame, or closed under us
try:
joined[0].ping(timeout=PING_TIMEOUT)
except Exception as e:
self._available = False
self._log.warning("jetlink: the link died before it could be used (%s), reopening", e)
self._note_link_loss(LOST)
try:
joined[0].close()
except Exception:
self._log.exception('jetlink: closing the dead link')
self._back_off()
return
with self._lock:
stopped = self._stop.is_set()
if not stopped:
self._joined = joined
if stopped:
# close() ran during the ping and found nothing to close
self._say_leaving(joined[0], P.LEAVE_STOPPED)
joined[0].close()
return
def _write_loop(self) -> None:
"""The runtime record (gadget.MODELD), once a second, on a hand-back and on
the first answer after a swap: tmpfs IO, the link record and a catalog
read for the name, so never on the frame thread, and off modeld's realtime
core first (_join_loop). The last one, after close(), is stopping.
status.runtime reads pid, at, stopping, state, active and last_output_at;
handovers, held, sha256, name, checkpoint, transport, drops and lags have
no reader in jetlink yet, they are for forks (StarPilot's sha and
checkpoint, a drive's counts)."""
background_thread()
pid, names, kinds = os.getpid(), {}, {}
failing = False
while True:
# before the record is built: a wake from here on is for the next one
self._record.clear()
stopping = self._stop.is_set()
try:
gadget.write_record(self._record_path, self._runtime(pid, names, kinds, stopping))
failing = False
except Exception:
if not failing: # once, not every second
self._log.exception("jetlink: could not write the runtime record")
failing = True
if stopping:
return
self._record.wait(gadget.RECORD_PERIOD)
def _runtime(self, pid: int, names: dict, kinds: dict, stopping: bool) -> dict:
big = self._big
state = self.big_model_state
swapped_at = self._joined_at # after the state: a swap sets it before _active
if state == 'running' and self._output_at < swapped_at:
# swapped in and not answered yet: the swap is still landing, not a
# model that stopped answering
state = 'joining'
spec = getattr(big, 'spec', None)
sha = getattr(spec, 'sha256', None)
if big is not None and swapped_at not in kinds:
# once per swap: the gadget the link runs on does not change under it
kinds.clear()
kinds[swapped_at] = gadget.link_kind()
return {'pid': pid, 'at': time.monotonic(), 'stopping': stopping, 'state': state,
'handovers': self._handovers, 'active': big is not None and self._active is big,
'last_output_at': self._output_at, 'held': bool(getattr(big, 'held', False)),
'sha256': sha, 'name': self._name_of(sha, names) if sha else None,
'checkpoint': getattr(spec, 'checkpoint', None),
'transport': kinds.get(swapped_at) if big is not None else None, 'drops': self._drops,
'lags': self._lags}
def _name_of(self, sha: str, names: dict) -> str:
"""The index's name, kept once it is one. The sha's stand-in (a model the
comma's index does not list yet, or a lookup that failed) is asked again
after NAME_RETRY."""
name, retry_at = names.get(sha, (None, 0.0))
if time.monotonic() >= retry_at:
try:
name = self._name(sha) if self._name is not None else None
except Exception:
name = None
real = bool(name) and name != sha[:16]
name = name if real else sha[:16]
names[sha] = (name, float('inf') if real else time.monotonic() + NAME_RETRY)
return name
def close(self) -> None:
first = not self._stop.is_set() # the leave is said once; cleanups close twice
self._stop.set()
self._available = False
self._rejoin.set()
# after the stop: the writer's next record is its last, and says stopping
self._record.set()
self._writer.join(1.0)
self._progress.clear()
with self._lock:
joined, self._joined = self._joined, None
@@ -718,19 +740,17 @@ def join(parts, cam_w: int, cam_h: int, small) -> JoiningModelState:
what the link will hand back; another geometry is rejected.
"""
from jetlink.openpilot import link as links
# here rather than in build(): the import then costs modeld's main thread
# before the frame loop, not the frame the swap lands on
from jetlink.openpilot.model_state import JetlinkModelState
op = parts.op
face = op.model_face()
ready: dict = {}
link = links.Link(parts.log)
def prepare():
from jetlink.openpilot.warp import prepare_reset, warm
from jetlink.openpilot.interface import FrameWarp, conformance
from jetlink.openpilot.warp import Warp, prepare_reset
# the gadget first, so the Jetson enumerates while the warp loads. Left to
# the join thread the bind landed ~3 s later, behind the small model's
# first frame, and one ignition had a 655 ms frame during the bind
# the join thread the bind lands ~3 s later, behind the small model's
# first frame, and can stall a frame by hundreds of ms
links.present_early(link, background_thread)
cached = parts.spec.load()
if cached is not None:
@@ -739,9 +759,14 @@ def join(parts, cam_w: int, cam_h: int, small) -> JoiningModelState:
else:
geometry = parts.warps.geometry()[2:]
try:
ready['reset_small'] = prepare_reset(small)
warp = parts.warps.load(cam_w, cam_h, *geometry)
warm(warp, face.frame_size(cam_w, cam_h))
# the fork's own reset of its small model, else jetlink's from its shape
ready['reset_small'] = getattr(op, 'small_reset', lambda small: None)(small) or prepare_reset(small)
# the fork's own warp, else openpilot's driving warp pickle
warp = getattr(op, 'model_warp', lambda *args: None)(small, cam_w, cam_h, *geometry)
if warp is None:
warp = Warp(parts.warps.load(cam_w, cam_h, *geometry), face.frame_size(cam_w, cam_h))
elif problems := conformance(warp, FrameWarp):
raise RuntimeError(f"the adapter's model_warp is not a warp: {', '.join(problems)}")
except Exception:
link.close()
raise
@@ -752,10 +777,11 @@ def join(parts, cam_w: int, cam_h: int, small) -> JoiningModelState:
warp = ready.get('warp') if ready.get('geometry') == (img_w * 2, img_h * 2) else None
if warp is None:
raise RuntimeError('no prepared warp for the server model geometry')
return JetlinkModelState(cam_w, cam_h, client, spec, warp, face=face, log=parts.log, event=op.event)
return JetlinkModelState(client, spec, warp, face=face, log=parts.log, event=op.event)
def connect(should_stop=None):
return links.open_link(parts, link, should_stop)
return JoiningModelState(small, connect, build, prepare, reset_small=lambda: ready['reset_small'](),
progress=parts.progress, engagement=op.engagement, log=parts.log)
progress=parts.progress, log=parts.log, in_control=op.in_control,
name=parts.models.name_for)
+106 -33
View File
@@ -31,9 +31,11 @@ CONNECT_TIMEOUT = 45.0
CONNECT_DELAY = 0.5
# four frame periods, and four times the slowest frame seen. A host that goes
# silent with no USB edge (a hung server, a phone's cable) costs one frame this
# long plus the small model's, inside modelV2's 0.5 s alive limit; 0.5 s here
# flashed commIssue on top of the fallback
# long plus the small model's, inside modelV2's 0.5 s alive limit; at 0.5 s
# here commIssue flashes on top of the fallback
INFERENCE_TIMEOUT = 0.2
# between joins while neither end has the picked model and nothing else is built
MODEL_WAIT = 60.0
# how long the load may wait for the early gadget bind; a provisioning run may
# still be letting go of the endpoints
PRESENT_TIMEOUT = 5.0
@@ -41,6 +43,18 @@ PRESENT_TIMEOUT = 5.0
# hardware; the ceiling is only there so a server that has stopped answering
# does not hold the caller for the rest of the day.
BUILD_TIMEOUT = 1800.0
# and on top of that, a server downloading the model itself: 1.75 GB at 1 MB/s
FETCH_TIMEOUT = 1800.0
class ModelMissing(RuntimeError):
"""Neither end has the picked model and nothing else is built: only a
provisioning run's download changes that, so the join asks again after
`retry_after` rather than every few seconds, and the panel says `waiting`
(joining._join_loop)."""
retry_after = MODEL_WAIT
waiting = 'big model not downloaded yet'
code = 'model_missing' # waiting's progress code (status.PROGRESS_CODES)
def _left(deadline: float | None, default: float) -> float:
@@ -93,7 +107,7 @@ class Link:
def open(self, deadline: float | None = None):
"""The client, opening one if we have not got one yet, or if the one held
is dead: a big model retired after a link loss closes its client, and
reusing it failed the next attempt with EBADF, 5 s after every loss."""
reusing it fails the next attempt with EBADF."""
if self.client is not None and self.client.dead:
self.close()
if self.client is None:
@@ -211,15 +225,16 @@ def connect_patiently(link: Link):
# -- making the Jetson ready ------------------------------------------------------
def identity(parts, entry: dict) -> tuple[str, int]:
"""The picked model's sha256 and byte count, from the catalog model's LFS
pointer, so the comma can name the model without holding or hashing the
ONNX. Looked up once per model ever and kept in a param: the one part of
provisioning that needs the internet."""
"""The picked model's sha256 and byte count, from the model index, so the
comma can name the model without holding or hashing the ONNX. A row has
them already where the comma's copy of the index knows the model; one it
does not fetches the index again, the one part of provisioning that may
need the internet."""
sha256, nbytes = entry.get('oid'), entry.get('size')
if sha256 and nbytes:
return sha256, int(nbytes)
parts.progress.report('connect', 0.0, 'finding model')
return parts.models.resolve_pointer(entry['ref'])
parts.progress.report('connect', 0.0, 'finding model', code='finding_model')
return parts.models.resolve(entry.get('ref'), sha256)
# What has already been hashed in this process, keyed on the file as it was
@@ -229,6 +244,16 @@ def identity(parts, entry: dict) -> tuple[str, int]:
_hashed: dict[tuple[str, int, int], str] = {}
def _hash_key(path: Path, st) -> tuple[str, int, int]:
return str(path), st.st_size, st.st_mtime_ns
def remember_hash(path: Path, sha256: str) -> None:
"""A file whose hash is already proven, as a download's is on the way in:
its upload need not read the gigabyte again (verified_upload)."""
_hashed[_hash_key(path, path.stat())] = sha256
def verified_upload(log, model_path: Path | None, sha256: str, nbytes: int) -> Path | None:
"""The file to upload, once its hash is proven to match the registry: under
a sha the bytes do not have, the Jetson's plan would lie about its contents."""
@@ -240,7 +265,7 @@ def verified_upload(log, model_path: Path | None, sha256: str, nbytes: int) -> P
log.error("jetlink: %s is %d bytes, the registry says %d; not uploading it",
model_path.name, st.st_size, nbytes)
return None
key = (str(model_path), st.st_size, st.st_mtime_ns)
key = _hash_key(model_path, st)
have = _hashed.get(key)
if have is None:
from jetlink.spec import sha256_file
@@ -256,32 +281,65 @@ def verified_upload(log, model_path: Path | None, sha256: str, nbytes: int) -> P
def ensure(parts, client, sha256: str, nbytes: int, model_path: Path | None, *,
progress=None, should_stop=None, build_timeout: float = BUILD_TIMEOUT):
progress=None, should_stop=None, build_timeout: float = BUILD_TIMEOUT, ref: str | None = None,
fetch: bool = True):
"""Make the server ready for this model and remember what it answered.
Asks without the file first: the server answers from the sha alone when it
has the model, which is every parked poll and every join. EngineMissing means
the Jetson has neither the plan nor the bytes, and neither has the caller."""
has the model, which is every parked poll and every join. Without the file
here either, the server is asked to download the model itself, which only
the Jetson needs. EngineMissing means the Jetson has neither the plan nor
the bytes and could not get them, and neither has the caller. `fetch` False
never asks for the download: a stand-in is a model the server has. `ref`,
the catalog's name for the model, goes with a download."""
from jetlink.client import EngineMissing
ask = functools.partial(client.ensure_engine, sha256, nbytes, progress=progress,
build_timeout=build_timeout, should_stop=should_stop)
fetch = fetch and model_path is None
ask = functools.partial(client.ensure_engine, sha256, nbytes, progress=progress, should_stop=should_stop)
try:
spec = ask(onnx_path=None)
spec = ask(onnx_path=None, fetch=fetch, ref=ref if fetch else None,
build_timeout=build_timeout + (FETCH_TIMEOUT if fetch else 0.0))
except EngineMissing:
upload = verified_upload(parts.log, model_path, sha256, nbytes)
if upload is None:
raise
spec = ask(onnx_path=upload)
spec = ask(onnx_path=upload, build_timeout=build_timeout)
parts.spec.store(spec)
return spec
def stand_in(parts, hello: dict, pick: str, built) -> tuple[str, int] | None:
"""The model to ask for in place of the pick, as (sha256, nbytes), or None
for the pick itself. `built` is the spec record's ready spec, or None.
The server's hello says what it has: the model it has loaded and the ones it
has built. The pick wins whenever the server has it. Otherwise the model it
has loaded drives, so a phone set to its own model serves that rather than
whatever the comma last built on some other server; then the comma's own
record of the last model built, if this server has it too. A server that lists nothing has only the record
to go on."""
cached = hello.get('cached_models')
have = None
if isinstance(cached, list):
loaded = hello.get('loaded')
have = set(cached) | ({loaded} if loaded else set())
if pick in have:
return None
if loaded:
# its size names it to the server: the record's, else the index's
nbytes = built.nbytes if built is not None and built.sha256 == loaded else parts.models.size_for(loaded)
if nbytes:
return loaded, nbytes
if built is not None and built.sha256 != pick and (have is None or built.sha256 in have):
return built.sha256, built.nbytes
return None
def open_link(parts, link: Link, should_stop=None):
"""Get a client and a spec. Link IO only, so it is safe off modeld's thread;
everything that touches tinygrad stays in the joining state's build.
The picked model is built here if the Jetson has not got it, minutes with
the small model driving: a provisioning run works offroad only, so a model
picked in the driveway cost the whole drive otherwise. Only reached with
picked in the driveway would otherwise cost the whole drive. Only reached with
the small model driving (the join loop stops asking once joined), so a build
here never unloads an engine that is steering. Whatever this attempt cannot
use stays on `link`, still open, for the next one.
@@ -296,29 +354,44 @@ def open_link(parts, link: Link, should_stop=None):
# booting; both resolve on their own
client = connect_patiently(link)
try:
hello = client.hello(timeout=10.0)
sent = parts.models.hello_pick()
hello = parts.models.heard(client.hello(timeout=10.0, pick=sent), sent)
parts.log.warning("jetlink: %s trt %s, engine %s, loaded %s",
hello.get('device'), hello.get('trt_version'),
hello.get('engine_state'), str(hello.get('loaded'))[:16])
link.note_server(hello)
# a newer pick on the server drives, and is ours from now on
parts.models.adopt()
selected = parts.models.selected_model() or selected
sha256, nbytes = identity(parts, selected)
if not parts.spec.engine_ready_for(sha256):
path = parts.models.shipped_model_path()
built = parts.spec.ready_spec()
standin = stand_in(parts, hello, sha256, built)
if standin is not None:
# by design, a model already built drives until the
# pick is fetched and built, which a provisioning run does parked, rather
# than the small model. Building here would unload it, and uploading
# would share the link with its frames
parts.log.warning("jetlink: %s is not ready yet, %s drives until it is", selected.get('name', sha256[:16]),
parts.models.name_for(standin[0]))
(sha256, nbytes), path = standin, None
elif built is None or built.sha256 != sha256:
parts.log.warning("jetlink: %s is not built yet, building it with the small model driving",
selected.get('name', sha256[:16]))
try:
# normally one round trip, since the provisioning run left the engine loaded. A
# server that restarted reloads from the plan cache, 13 to 25 s; one
# that has never seen this model builds it, 102 to 294 s
spec = ensure(parts, client, sha256, nbytes, parts.models.shipped_model_path(),
progress=parts.progress.report_with_eta, should_stop=should_stop)
except EngineMissing:
# neither end has the bytes. Fetching them needs the internet and a
# gigabyte of it, which is a parked job; clear the record so the next
# parked period provisions again
parts.spec.clear_ready()
raise
selected.get('name', sha256[:16]))
# normally one round trip, since the provisioning run left the engine loaded. A
# server that restarted reloads from the plan cache, 13 to 25 s; one
# that has never seen this model builds it, 102 to 294 s
spec = ensure(parts, client, sha256, nbytes, path, progress=parts.progress.report_with_eta,
should_stop=should_stop, ref=selected.get('ref'), fetch=standin is None)
client.deadline = INFERENCE_TIMEOUT
return client, spec
except EngineMissing as e:
# neither end has the bytes. Fetching them is a provisioning run's job;
# clear the record if it named this model, so the next one does. The link
# is fine and stays on `link`: closing it leaves a read queued that the
# next attempt's open has to bounce the gadget for
parts.spec.clear_ready(sha256)
raise ModelMissing(str(e)) from e
except BaseException:
link.close()
raise
+113 -147
View File
@@ -13,8 +13,8 @@ frames and context in, 18452 floats out, and holds no control state.
The split is at `run_policy`. The warp stays on the comma's GPU: its input is a
2 MB camera buffer already there and its output the 393 KB the link carries
anyway. The history queues live on the Jetson, shipping them would cost ~10 MB
a frame instead of ~0.5 MB. Upstream fused warp and policy into one JIT, so
the fork's build compiles a standalone warp; see warp.
a frame instead of ~0.5 MB. modeld runs its warp as a JIT of its own, and
the link runs the same one; see warp.
A model that keeps its own history (openpilot #38916, Cinque Terre V3 on)
takes the same warped frame and the same scalars; its hidden state never
@@ -22,8 +22,7 @@ leaves the Jetson, so there is no prev_feat to send back. The spec says which.
What openpilot's modeld reads off a ModelState comes from the fork's adapter
(ModelFace): comma's constants, parser, smoothing and action function.
tinygrad is imported when a model is built, never at module level: only
modeld and the build have it.
tinygrad is warp.Warp's to import: only modeld has it.
"""
from __future__ import annotations
@@ -35,7 +34,7 @@ from dataclasses import dataclass
import numpy as np
from jetlink.openpilot.warp import call_warp
from jetlink.protocol import NotFinite
SEND_RAW_PRED = os.getenv('SEND_RAW_PRED')
SLOW_FRAME = 0.05 # the full 20 Hz budget, not just the largest outliers
@@ -44,7 +43,7 @@ SLOW_FRAME = 0.05 # the full 20 Hz budget, not just the largest outliers
# would be dropped: modeld's own work around run() takes the rest of the 50 ms.
# A held frame is a plan one frame old, which the 10 s plan and the actuator
# delay both dwarf, where a dropped frame is the same stale plan plus a count
# toward selfdrived's modeldLagging. None waits the client's deadline, as before
# toward selfdrived's modeldLagging. None waits the client's full deadline
HOLD_FRAME = 0.046
# Held frames the large model may make before it is behind rather than
# tailing: this many in a row, or more than HOLDS_ALLOWED within HOLD_WINDOW.
@@ -57,12 +56,16 @@ HOLD_FRAME = 0.046
HOLDS_IN_A_ROW = 5
HOLDS_ALLOWED = 20
HOLD_WINDOW = 10.0
# How long a host may answer none of its shadow frames before the link is
# abandoned, where a driving one gets the client's deadline
# (link.INFERENCE_TIMEOUT, 0.2 s). The small model drives meanwhile, and a
# phone's first frames after a join are Neural Engine warm-up: at 0.2 s an
# iPhone 18 Pro lost 11 of 18 joins inside 0.33 s (2026-10-04)
SHADOW_SILENCE = 1.0
# The first frames after a swap, which the fork holds engagement off for (a
# second at 20 Hz): a single held frame among them is behind. A host cold from
# a reconnect proves itself here, before anyone can engage, rather than at the
# wheel, where a slow host's return is a soft disable within a second
PROVING_FRAMES = 20
# the first of them never hand back, held or not: the first after a join
# carries the history reset, and a Mac's is ~100 ms of CoreML warm-up. A
# single slow frame later is the comma's own stall, a warp or a send, which
# handing back would not fix; only held frames say the host is behind
SETTLING_FRAMES = 3
# frames between asks for the server's telemetry, which rides on the response:
# every second one, as modeld sent a chestnut's state (20 Hz over 10 Hz)
TELEMETRY_EVERY = 2
@@ -70,12 +73,6 @@ TELEMETRY_EVERY = 2
TELEMETRY_PERIOD = 1.0
# frames Trips keeps the timings of: a minute at 20 Hz
TRIPS_KEPT = 1200
# shadow frames in a row that would not have been held (check_shadow) before
# the large model may drive (joining reads `keeping_up`): a second at 20 Hz.
# A host cold from a reconnect proves itself with the small model driving,
# not at the wheel, where an iPhone's every return was a soft disable
# within a second (2026-10-04)
PROVING_FRAMES = 20
class Trips:
@@ -86,7 +83,6 @@ class Trips:
budget it cannot measure. Bounded to the last TRIPS_KEPT frames."""
def __init__(self):
self.sent = 0 # frames sent; the ones never ended ran with the small model driving
self.frames = 0 # frames waited for and published
self.over = 0 # frames past SLOW_FRAME, the whole 20 Hz budget
self.held = 0 # frames whose reply was late and published the previous one
@@ -102,9 +98,9 @@ class Trips:
self._server_ms.append(server_us / 1e3)
def summary(self) -> dict:
"""frames, over, held, shadowed, span_s, and over the frames kept: p50_ms,
p99_ms, max_ms of the whole frame and server_ms, the server's mean total."""
out = {'frames': self.frames, 'over': self.over, 'held': self.held, 'shadowed': self.sent - self.frames,
"""frames, over, held, span_s, and over the frames kept: p50_ms, p99_ms,
max_ms of the whole frame and server_ms, the server's mean total."""
out = {'frames': self.frames, 'over': self.over, 'held': self.held,
'span_s': round(time.monotonic() - self.started, 1)}
if self._whole_ms:
whole = sorted(self._whole_ms)
@@ -115,12 +111,12 @@ class Trips:
@dataclass
class Frame:
"""One frame on its way to the host: when the warp and the readback
finished, the bytes the wire takes, then its seq and send time once sent."""
"""One frame on its way to the host: when its warp started, was launched
and finished, then its seq and send time once sent. The bytes are the
warp's output (Warp.output)."""
t0: float
t1: float
t2: float
data: object
seq: int | None = None
sent: float = 0.0
telemetry: bool = False
@@ -134,18 +130,14 @@ class JetlinkModelState:
action function off the ModelState; stock modeld has them as module
constants. This is comma's large model, so they are comma's.
A frame is prepare(), send() and end(). run() is all three, as modeld calls
it. The joining model (joining.JoiningModelState) prepares and sends every
frame the small model drives and never ends them, so the host's model is
warm and current at the swap; it reads `behind` after each driven frame.
A frame is prepare(), send() and end(); run() is all three, as modeld calls
it. The joining model (joining.JoiningModelState) reads `behind` after each
frame.
"""
prev_desire: np.ndarray # for tracking the rising edge of the pulse
def __init__(self, cam_w: int, cam_h: int, client, spec, warp, *, face, log, event):
from tinygrad.device import Device
from tinygrad.tensor import Tensor
self._tensor = Tensor
def __init__(self, client, spec, warp, *, face, log, event):
self._log = log
# (name, **fields): a structured log line, cloudlog.event on a comma
self._event = event
@@ -161,19 +153,13 @@ class JetlinkModelState:
self.client = client
self.spec = spec
# Over a phone's cable, hand the socket the warp's GPU mapping itself: the
# kernel copies it while the first segments are already on the wire, where
# copying it here first held the send back 2.5 ms. On the Mac stand-in the
# comma's side of a frame was 0.6 ms faster at p50 and 2 ms at p99. USB
# keeps the host copy it was measured with. The client's transport says
# which, as the owner lent it
self.send_from_gpu = client.t.link_info().get('kind') == 'cable'
# not chestnut hardware, but the same role: modelV2.big, the UI and the
# model manager key off this flag
self.chestnut = True
# a warm warp, loaded ahead: the first call costs ~2 s and this can run on
# modeld's frame thread (warp.warm)
# a warp.Warp or the adapter's model_warp, loaded and warmed ahead: its
# first call links the JIT, and this runs on modeld's frame thread. Frames
# go out of its output as they are, over either transport
self.warp = warp
self.input_shapes = spec.input_shapes
@@ -182,26 +168,16 @@ class JetlinkModelState:
# from the same field
self.frame_skip = spec.frame_skip
# the warp's own two inputs stay separate NPY tensors; everything past the
# warp is the server's. Writing the numpy array is what feeds the JIT
self.npy = {'tfm': np.zeros((3, 3), dtype=np.float32),
'big_tfm': np.zeros((3, 3), dtype=np.float32)}
self.warp_inputs = {k: Tensor(v, device='NPY').realize() for k, v in self.npy.items()}
# compile_modeld.make_input_queues' packed_npy_inputs, minus the GPU queues
# the server owns; for a stateful graph, minus prev_feat too
# compile_modeld.make_input_queues' packed_npy_inputs, minus the warp's
# inputs and the GPU queues the server owns; for a stateful graph, minus
# prev_feat too
self.packed = np.zeros(spec.packed_nelem, dtype=np.float32)
self.npy.update({k: self.packed[at].reshape(shape) for k, (at, shape) in spec.packed_layout.items()})
self.npy = {k: self.packed[at].reshape(shape) for k, (at, shape) in spec.packed_layout.items()}
# read once: it must be the device the cached JIT was compiled against
self.warp_dev = Device.DEFAULT
self.prev_desire = np.zeros(face.desire_len, dtype=np.float32)
self.parser = face.parser()
self.frame_size = face.frame_size(cam_w, cam_h)
# the camera buffers modeld hands over, whatever the graph calls its inputs
self.vision_input_names = ['img', 'big_img']
self.full_frames: dict = {}
self._blob_cache: dict = {}
self._need_reset = True
self._frame_id = 0
self._last_logged = 0.0
@@ -218,8 +194,8 @@ class JetlinkModelState:
self._holds: deque[float] = deque()
self._holds_in_a_row = 0
self.behind: str | None = None
# shadow frames in a row that would not have been held
self._kept_up = 0
# whether the last frame published the one before it: the runtime record's
self.held = False
def slice_outputs(self, model_outputs: np.ndarray, output_slices: dict[str, slice]) -> dict[str, np.ndarray]:
return {k: model_outputs[np.newaxis, v] for k, v in output_slices.items()}
@@ -236,28 +212,22 @@ class JetlinkModelState:
return
self._last_logged = now
self._event("jetlinkTelemetry", dead=bool(self.client.dead), **telemetry)
send = getattr(self.client.t, 'last_send', None)
if send:
self._event("jetlinkSend", nonce=self.client.nonce, frame=self._frame_id, totals=self.client.t.send_totals.copy(), **send)
def prepare(self, bufs: dict, transforms: dict[str, np.ndarray], inputs: dict[str, np.ndarray]) -> None:
"""Take this frame up: read what the host has answered so far, then warp
the frame for it. send() puts it on the link and end() waits for its
answer. A frame sent and never ended ran on the host with the small model
driving (a shadow frame); its timings reach the log here, at the next."""
frame = self._frame
if frame is not None and frame.seq is not None and (self._frame_id <= 3 or frame.sent - frame.t0 > SLOW_FRAME / 2):
# the frame before was sent and never ended: a shadow frame
self._log.warning("jetlink: shadow frame %d warp %.1f data %.1f send %.1f ms; %d unanswered", self._frame_id,
(frame.t1 - frame.t0) * 1e3, (frame.t2 - frame.t1) * 1e3, (frame.sent - frame.t2) * 1e3,
self.client.unanswered)
"""Take this frame up: start the warp, and while the GPU runs it, read
what the host has answered so far (a held frame's late reply) and pack
the rest of the inputs. send() puts it on the link and end() waits for
its answer."""
t0 = time.perf_counter()
self.warp.start(_address(bufs['img']), _address(bufs['big_img']), transforms['img'], transforms['big_img'])
t1 = time.perf_counter()
# the GPU is warping; nothing below is an input to it
self.client.drain()
self.log_telemetry()
for key in bufs.keys():
ptr = np.frombuffer(bufs[key].data, dtype=np.uint8).ctypes.data
cache_key = (key, ptr)
if cache_key not in self._blob_cache:
self._blob_cache[cache_key] = self._tensor.from_blob(ptr, (self.frame_size,), dtype='uint8', device=self.warp_dev)
self.full_frames[key] = self._blob_cache[cache_key]
# Model decides when action is completed, so desire input is just a pulse triggered on rising edge.
# Under whichever name the loop keyed it: stock modeld's desire_pulse, or a modeld_v2 bundle's own
desire = inputs[next(k for k in inputs if k.startswith('desire'))]
@@ -266,124 +236,105 @@ class JetlinkModelState:
self.prev_desire[:] = desire
self.npy['traffic_convention'][:] = inputs['traffic_convention']
self.npy['action_t'][:] = inputs['action_t']
self.npy['tfm'][:, :] = transforms['img'][:, :]
self.npy['big_tfm'][:, :] = transforms['big_img'][:, :]
t0 = time.perf_counter()
warped = call_warp(self.warp, **self.warp_inputs, frame=self.full_frames['img'], big_frame=self.full_frames['big_img'])
t1 = time.perf_counter()
# .data() rather than .numpy(): same ~2.5 ms mean (a write-combined GPU
# mapping read), but no per-frame allocation and no 52 ms outlier. The
# mapping is safe to send: infer_begin returns only once the socket has
# copied all of it, before the next warp can write it
if self.send_from_gpu:
data = warped._buffer().as_memoryview(allow_zero_copy=True)
else:
data = warped.data()
self._frame = Frame(t0, t1, time.perf_counter(), data)
# free again once infer_begin returns: the gadget's io_submit and the
# cable's sendmsg have copied it by then, before the next warp writes it
self.warp.wait()
self._frame = Frame(t0, t1, time.perf_counter())
def send(self, want_telemetry: bool = False, silence: float | None = SHADOW_SILENCE) -> None:
def send(self, want_telemetry: bool = False) -> None:
"""The prepared frame to the host. It asks for the server's telemetry
when the log is due for it, or when told to: modeld asks on the frames it
would have sent a chestnut's state on. Sent from outside, it is a shadow
frame and a quiet host has `silence`; run() sends with the client's
deadline."""
would have sent a chestnut's state on.
With an output to hold, a frame the link cannot take without waiting for
the host to drain earlier ones is not sent, and end() holds it: the same
plan one frame old a late reply publishes, where waiting stalls the frame
loop on a host that is behind."""
frame = self._frame
self._frame_id += 1
frame.telemetry = want_telemetry or time.monotonic() - self._last_logged >= TELEMETRY_PERIOD
frame.seq = self.client.infer_begin(frame.data, self.packed, self._frame_id, reset=self._need_reset,
want_state=frame.telemetry, silence=silence)
try:
frame.seq = self.client.infer_begin(self.warp.output, self.packed, self._frame_id, reset=self._need_reset,
want_state=frame.telemetry, skip_if_busy=self._can_hold)
except Exception:
self._log.warning("jetlink: frame %d send failed: %s", self._frame_id, getattr(self.client.t, 'last_send', {}))
raise
frame.sent = time.perf_counter()
frame.data = None
self._need_reset = False
self.trips.sent += 1
@property
def sent(self) -> bool:
"""Has the prepared frame gone out?"""
return self._frame is not None and self._frame.seq is not None
if frame.seq is not None:
self._need_reset = False
def end(self, after_enqueue: Callable[[], None] | None = None) -> dict[str, np.ndarray]:
"""The sent frame's output, as modeld blocks on a chestnut's, but not past
HOLD_FRAME once there is an output to publish again: a frame that long
is a dropped camera frame. Only a stall past the client's deadline raises,
into the joining state's demotion to the small model."""
is a dropped camera frame. Only a stall past the client's deadline, or an
output that is not finite, raises, into the joining state's demotion to
the small model."""
frame, self._frame = self._frame, None
# publish health while the Jetson works
if after_enqueue is not None:
after_enqueue()
waiting_from = time.perf_counter()
hold = None
if HOLD_FRAME and self.client.last_output is not None:
hold = self._hold_left(frame)
model_output = self.client.infer_end(frame.seq, hold=hold)
if frame.seq is None:
model_output = None # not sent (see send): held
else:
try:
model_output = self.client.infer_end(frame.seq, hold=self._hold_left(frame) if self._can_hold else None)
except NotFinite:
# answered, so the leave's summary counts it
self.trips.record(time.perf_counter() - frame.t0, self.client.last_timings[2])
raise
t4 = time.perf_counter()
held = model_output is None
held = self.held = model_output is None
self.behind = self._note_hold(held)
outputs = self._outputs(self.client.last_output if held else model_output)
self.trips.record(t4 - frame.t0, self.client.last_timings[2])
outputs = self._outputs(self.client.last_output if held else model_output)
# a frame past the budget is a dropped camera frame; send against reply
# says which end it was. Held frames are a steady few on a marginal host,
# so after the first they go to the log at TELEMETRY_PERIOD
log_hold = held and (self.trips.held <= 3 or t4 - self._last_hold_logged >= TELEMETRY_PERIOD)
if self._frame_id <= 3 or t4 - frame.t0 > SLOW_FRAME or log_hold:
note = ''
if held:
self._last_hold_logged = t4
note = f', held ({self.trips.held} so far{", not sent" if frame.seq is None else ""})'
# persisted on the comma so a drive can separate server execution from
# receive stalls once the Jetson is offline; server total excludes USB
gpu_us, queue_us, total_us = self.client.last_timings
receive = getattr(self.client.t, 'last_receive', {})
self._log.warning("jetlink: frame %d warp %.1f data %.1f send %.1f wait %.1f ms%s; "
"server gpu %.1f queue %.1f total %.1f ms; ffs maxima prepare %.1f read_wait %.1f handoff %.1f ms",
# over the cable: how frames go, how many never came back, and what the
# kernel dropped on the way in (softnet), since the link came up
drops = getattr(self.client.t, 'net_drops', lambda: None)()
cable = (f"; frames {'as datagrams' if self.client.t.datagrams else 'on the stream'}, " +
f"{self.client.frames_lost} lost, net drops {drops}" if drops is not None else '')
self._log.warning("jetlink: frame %d warp %.1f data %.1f send %.1f wait %.1f ms%s; " +
"server gpu %.1f queue %.1f total %.1f ms; ffs maxima prepare %.1f read_wait %.1f handoff %.1f ms%s",
self._frame_id, (frame.t1 - frame.t0) * 1e3, (frame.t2 - frame.t1) * 1e3,
(frame.sent - frame.t2) * 1e3, (t4 - waiting_from) * 1e3,
f', held ({self.trips.held} so far)' if held else '',
note,
gpu_us / 1e3, queue_us / 1e3, total_us / 1e3, receive.get('prepare', 0.0) * 1e3,
receive.get('read_wait', 0.0) * 1e3, receive.get('handoff', 0.0) * 1e3)
receive.get('read_wait', 0.0) * 1e3, receive.get('handoff', 0.0) * 1e3, cable)
return outputs
def run(self, bufs: dict, transforms: dict[str, np.ndarray],
inputs: dict[str, np.ndarray], after_enqueue: Callable[[], None] | None = None) -> dict[str, np.ndarray]:
self.prepare(bufs, transforms, inputs)
self.send(after_enqueue is not None, silence=None)
self.send(after_enqueue is not None)
return self.end(after_enqueue)
@property
def keeping_up(self) -> bool:
"""Would the host have driven the last PROVING_FRAMES shadow frames
without a hold? What the joining model swaps on; nothing while it drives."""
return self._kept_up >= PROVING_FRAMES
def check_shadow(self) -> None:
"""Score the shadow frame just sent as end() would have, now that the
small model's own frame is done: kept up when its reply is back HOLD_FRAME
or less after its warp began, waited for until then as end() waits. The
joining model calls this once per shadow frame; a reply not back by then
is read by the next prepare(), and starts the proof over. The shadow
frame went out after the small model's work was queued, later than a
driven one, so a host that passes here does not hold at the wheel."""
frame = self._frame
if frame is None or frame.seq is None:
return
self.client.drain()
left = self._hold_left(frame)
if not self.client.unanswered:
kept = left >= 0
elif self.client.unanswered == 1 and left > 0:
kept = self.client.infer_end(frame.seq, hold=left) is not None
else:
# past the hold, or behind older frames: replies come in order, so
# this one cannot make it, and waiting would only hold the small model
kept = False
self._kept_up = self._kept_up + 1 if kept else 0
def _can_hold(self) -> bool:
"""Is there an output to publish again instead of waiting (HOLD_FRAME)?"""
return bool(HOLD_FRAME) and self.client.last_output is not None
@staticmethod
def _hold_left(frame) -> float:
"""What is left of the hold for `frame`, from its warp's start."""
return (HOLD_FRAME or SLOW_FRAME) - (time.perf_counter() - frame.t0)
return HOLD_FRAME - (time.perf_counter() - frame.t0)
def _note_hold(self, held: bool) -> str | None:
"""Why the large model should hand back after this frame, if it should:
any held frame among its first PROVING_FRAMES past SETTLING_FRAMES,
HOLDS_IN_A_ROW held frames running, or more than HOLDS_ALLOWED in
HOLD_WINDOW. None while it is keeping up."""
if not held:
@@ -395,6 +346,10 @@ class JetlinkModelState:
while now - self._holds[0] > HOLD_WINDOW:
self._holds.popleft()
self._holds_in_a_row += 1
if self._frame_id <= SETTLING_FRAMES:
return None
if self._frame_id <= PROVING_FRAMES:
return f'held frame {self._frame_id} of the first {PROVING_FRAMES}'
if self._holds_in_a_row >= HOLDS_IN_A_ROW:
return f'held {self._holds_in_a_row} frames in a row'
if len(self._holds) > HOLDS_ALLOWED:
@@ -406,10 +361,17 @@ class JetlinkModelState:
gives the same dict again: the parser's softmax works in place on it."""
if self._parsed is not None and self._parsed[0] is model_output:
return self._parsed[1]
# the non-finite check runs on the server (Status.NOT_FINITE -> LinkError),
# so modeld's big->small failover fires as it does for a chestnut
# the server checks first (Status.NOT_FINITE, which the client raises as
# this). This is for one that did not, or bytes the link changed: a raw
# inf is a corrupt output even where the parser would clip it finite. A
# sum allocates nothing, and any NaN or inf makes it one; these outputs
# are far from overflow
if not np.isfinite(model_output.sum()):
raise NotFinite(f"frame {self._frame_id}: the output is not finite")
outputs_dict = self.parser.parse_outputs(self.slice_outputs(model_output, self.output_slices))
self.spec.feed_back(self.packed, model_output)
# a finite output can still parse to inf, by a parser that does not clip
if not np.isfinite(sum(float(value.sum()) for value in outputs_dict.values())):
raise NotFinite(f"frame {self._frame_id}: the parsed output is not finite")
if SEND_RAW_PRED:
outputs_dict['raw_pred'] = model_output.copy()
self._parsed = (model_output, outputs_dict)
@@ -419,3 +381,7 @@ class JetlinkModelState:
"""Let go of the link; the joining state calls this on a model it retires."""
self.client.close()
def _address(buf) -> int:
"""Where a camera buffer modeld hands over (a VisionBuf) keeps its bytes."""
return np.frombuffer(buf.data, dtype=np.uint8).ctypes.data
+431 -139
View File
@@ -7,124 +7,246 @@ See the LICENSE file in the root directory for more details.
Which large model runs, and where its bytes are.
The large model is the model manager's big-model pick, the same slot a
chestnut runs from (Keys.big_model). Its bundles are tinygrad pkls for a GPU
the Jetson does not have, but each one names the comma commit it was compiled
from, and that commit's ONNX in comma's LFS is what the Jetson runs. The
catalog says what exists, the slot says which one, the pointer at the commit
says which bytes. A commit that ships a precompiled pkl instead names its
export, and jetlink's registry follows that to comma's model repo; see
jetlink.registry.lfs.
chestnut runs from (Keys.big_model). It names a comma commit, and what the
Jetson runs is the ONNX that commit was built from: the model index
(jetlink.registry.index) says which, for every big-model commit, and lists
what can be picked. The comma keeps the last index that parsed under
model_dir(), so it names, sizes and lists its models with no network; a pick
the copy does not know fetches it again (resolve).
Without a chestnut fitted the model manager's big-model list is the index's
(big_catalog), so what the comma lists is what the Jetson runs. With one, the
list is sunnypilot's own, and jetlink stays out of it.
Without a model manager (Keys.big_model and Keys.catalog None) there is no
pick and no catalog, and the large model is jetlink's own default, named by its
ref: its pointer resolves from the ref as any pick's does.
pick and no catalog, and the large model is the one picked on the server, else
jetlink's own default, named by its ref.
A fork with a picker of its own but no catalog jetlink reads (Keys.big_model
without Keys.catalog, StarPilot's) may name its pick by the ONNX's sha256
instead of a ref, which is all its catalog knows of a model; the index sizes
it. With no catalog no model manager owns the slot either, so jetlink writes a
newer pick from the server into it itself, and the fork's picker shows what
drives.
"""
from __future__ import annotations
import json
import os
import re
import time
from pathlib import Path
from jetlink.registry.catalog import DEFAULT_BIG_MODEL_NAME, DEFAULT_BIG_MODEL_REF
from jetlink.registry.index import (DEFAULT_BIG_MODEL_NAME, DEFAULT_BIG_MODEL_REF, ModelIndex, NetworkError, Pointer, RegistryError,
is_ref, is_sha256, parse_index)
POINTER_TIMEOUT = 10.0
_REF = re.compile(r'[0-9a-f]{40}')
# the build date a catalog name ends in, " (September 17, 2026)"; any other parenthesis stays
_TRAILING_DATE = re.compile(r' \([A-Za-z]+ \d{1,2}, \d{4}\)$')
# the index and the slot are JSON params, and the UI names the active model
# every frame; the status line can lag a new pick by this long
# the index and the slot are a file and a JSON param, and the UI names the
# active model every frame; the status line can lag a new pick by this long
INDEX_TTL = 2.0
# the comma's copy of the model index, under model_dir()
INDEX_FILE = 'index.json'
# a pick the comma's copy does not know fetches the index again, at most this often
INDEX_MISS_RETRY = 60.0
# A big model's download over a car's connection: the waits between the
# attempts of one provisioning run, one more attempt than waits. Each carries
# on from the .part the last left, so a stall costs the wait, not the bytes
# (lfs.lfs_download)
DOWNLOAD_RETRY_DELAYS = (5.0, 15.0, 30.0, 60.0, 120.0)
# server_pick() before this process has heard a hello
_UNHEARD = object()
# heard() told nothing of the hello's own pick: an older caller
_UNTOLD = object()
# the slot as jetlink saw it last, under model_dir(): to tell a slot the user
# emptied (the default, chosen) from one never filled
SLOT_STATE = 'slot.json'
def _dated(pick) -> dict | None:
"""A server's pick as its hello carries it, dated by this clock:
{ref, sha256, nbytes, name, at}. None for none, or one naming no model."""
if not isinstance(pick, dict) or not isinstance(pick.get('age_s'), (int, float)):
return None
ref = pick['ref'] if is_ref(pick.get('ref')) else None
sha256 = pick['sha256'] if is_sha256(pick.get('sha256')) else None
if ref is None and sha256 is None:
return None
return {'ref': ref, 'sha256': sha256, 'nbytes': pick.get('nbytes'), 'name': pick.get('name'),
'at': time.time() - float(pick['age_s'])}
class Models:
def __init__(self, op):
self.op = op
self._index_cache: tuple[float, list[dict], dict[str, dict]] | None = None
self._slot_cache: tuple[float, dict | None] | None = None
# (looked at, the file's (mtime, size), the index it held and its rows)
self._index_cache: tuple[float, tuple | None, ModelIndex | None, list[dict]] | None = None
self._refresh_after = 0.0
self._slot_cache: tuple[float, dict | None, float | None] | None = None
# SLOT_STATE as this process last read or wrote it
self._slot_state: dict | None = None
# the pick of the last hello this process heard, and the owner's record
# of the last hello any process heard
self._heard: dict | None | object = _UNHEARD
self._record_cache: tuple[float, dict | None] | None = None
def catalog(self) -> list[dict]:
"""sunnypilot's big-model bundles as {name, ref}, newest first, as the model
manager's own picker lists them. From the cached JSON rather than the parsed
bundles: parsing builds capnp objects and writes chunk manifests, for two
fields. Never raises."""
try:
key = self.op.keys.catalog
bundles = ((self.op.get(key) if key else None) or {}).get('bundles', [])
found = [b for b in bundles if _REF.fullmatch(str(b.get('ref')))
and int(b.get('minimum_selector_version', 0)) == self.op.catalog_selector]
except Exception:
self.op.log.exception("jetlink: could not read the big-model catalog")
return []
found.sort(key=lambda b: int(b.get('index', 0)), reverse=True)
return [{'name': str(b.get('display_name') or b['ref'][:10]), 'ref': b['ref']} for b in found]
# -- the model index --------------------------------------------------------
def pointers(self) -> dict[str, dict]:
value = self.op.get(self.op.keys.pointers)
return value if isinstance(value, dict) else {}
def index_path(self) -> Path:
return self.model_dir() / INDEX_FILE
def fetch_pointer(self, ref: str) -> tuple[str, int]:
"""The oid and size of the ONNX a comma commit names, in its tree or, for a
precompiled-pkl commit, in comma's model repo. The Jetson's registry does
the same lookup, so the two ends agree on every model's identity."""
from jetlink.registry.lfs import fetch_pointer as registry_fetch_pointer
pointer = registry_fetch_pointer(ref, timeout=POINTER_TIMEOUT)
return pointer.oid, pointer.size
def resolve_pointer(self, ref: str) -> tuple[str, int]:
"""The oid and size behind a catalog model, fetched the first time and kept for good."""
known = self.pointers()
if ref in known:
return known[ref]['oid'], int(known[ref]['size'])
oid, size = self.fetch_pointer(ref)
known[ref] = {'oid': oid, 'size': size}
# blocking: the next lookup reads this back, and a put still in flight would be lost under it
self.op.put(self.op.keys.pointers, known, block=True)
self._index_cache = None
self.op.log.warning("jetlink: %s is %s, %d MB", ref[:10], oid[:16], size >> 20)
return oid, size
@staticmethod
def _row(name: str, ref: str, known: dict[str, dict]) -> dict:
p = known.get(ref) or {}
return {'name': name, 'ref': ref, 'oid': p.get('oid'), 'size': int(p['size']) if p.get('size') else None}
def _index(self) -> tuple[list[dict], dict[str, dict]]:
"""The catalog's rows and the pointers behind them, read together once per INDEX_TTL."""
now = time.monotonic()
if self._index_cache is None or now - self._index_cache[0] >= INDEX_TTL:
known = self.pointers()
self._index_cache = (now, [self._row(b['name'], b['ref'], known) for b in self.catalog()], known)
return self._index_cache[1], self._index_cache[2]
def index(self) -> ModelIndex | None:
"""The comma's copy of the model index, None before the first fetch.
Looked at once per INDEX_TTL and parsed again only when the file
changed. Never raises."""
return self._read_index()[0]
def model_index(self) -> list[dict]:
"""Every catalog model, {name, ref, oid, size}. oid and size are None until
the model has been selected and resolved. No network."""
return self._index()[0]
"""Every model the index lists, {name, ref, oid, size}, in its order. No network."""
return self._read_index()[1]
def _read_index(self) -> tuple[ModelIndex | None, list[dict]]:
now = time.monotonic()
cache = self._index_cache
if cache is not None and now - cache[0] < INDEX_TTL:
return cache[2], cache[3]
path = self.index_path()
try:
st = path.stat()
seen = (st.st_mtime_ns, st.st_size)
except OSError:
seen = None
if cache is not None and cache[1] == seen:
# the same file, parsed or not: a copy that does not parse is told of once
index = cache[2]
else:
index = None
if seen is not None:
try:
index = parse_index(json.loads(path.read_text()))
except (OSError, ValueError, RegistryError):
self.op.log.exception("jetlink: the comma's model index does not parse")
self._keep_index(now, seen, index)
return self._index_cache[2], self._index_cache[3]
def _keep_index(self, now: float, seen: tuple | None, index: ModelIndex | None) -> None:
rows = self._index_cache[3] if self._index_cache is not None and self._index_cache[2] is index else \
[{'name': m.name, 'ref': m.ref, 'oid': m.oid, 'size': m.size} for m in index.models] if index else []
self._index_cache = (now, seen, index, rows)
def refresh_index(self) -> ModelIndex:
"""The model index, fetched and kept as the comma's copy, which is left
alone when nothing changed so no reader parses it again. Raises a
RegistryError for one that cannot be had or used, and keeps the copy."""
from jetlink.comma import gadget
from jetlink.registry.index import fetch_index
data, index = fetch_index()
path = self.index_path()
if gadget.read_record(path) != data:
gadget.write_record(path, data)
st = path.stat()
self._keep_index(time.monotonic(), (st.st_mtime_ns, st.st_size), index)
return index
def _row(self, name: str, ref: str | None, sha256: str | None = None) -> dict:
"""A model as a row: its ONNX by its ref, from the index, else by its hash
and sized from the index. oid or size is None where the index does not know."""
index = self.index()
pointer = index.pointer(ref) if index is not None and ref else None
if pointer is not None:
return {'name': name, 'ref': ref, 'oid': pointer.oid, 'size': pointer.size}
return {'name': name, 'ref': ref, 'oid': sha256, 'size': index.size(sha256) if index is not None and sha256 else None}
def resolve(self, ref: str | None, sha256: str | None) -> tuple[str, int]:
"""A pick's oid and size, from the index; one the comma's copy does not
know fetches it again, at most once per INDEX_MISS_RETRY. Raises a
RegistryError for a model the index does not know, or no index at all."""
if (found := self._identity(ref, sha256)) is None and time.monotonic() >= self._refresh_after:
self._refresh_after = time.monotonic() + INDEX_MISS_RETRY
self.refresh_index()
found = self._identity(ref, sha256)
if found is None:
raise RegistryError(f"the model index does not know {(ref or sha256 or 'the model')[:16]}")
return found
def _identity(self, ref: str | None, sha256: str | None) -> tuple[str, int] | None:
row = self._row('', ref, sha256)
return (row['oid'], int(row['size'])) if row['oid'] and row['size'] else None
def selected_slot(self) -> dict | None:
"""The big-model slot's pick as {name, ref}, from the raw param rather than a
parsed bundle, and memoised: the UI asks every frame."""
"""The big-model slot's pick as {name, ref, sha256}, from the raw param
rather than a parsed bundle, and memoised with when it was made
(picked_at): the UI asks every frame. It names its model by the catalog's
ref, by the ONNX's sha256 (a fork whose catalog knows only that), or by
both; the one it lacks is None."""
now = time.monotonic()
if self._slot_cache is not None and now - self._slot_cache[0] < INDEX_TTL:
return self._slot_cache[1]
key = self.op.keys.big_model
slot = self.op.get(key) if key else None
ref = slot.get('ref') if isinstance(slot, dict) else None
pick = None
if isinstance(ref, str) and ref:
pick = {'name': str(slot.get('displayName') or ref[:10]), 'ref': ref}
self._slot_cache = (now, pick)
slot = slot if isinstance(slot, dict) else {}
ref = slot['ref'] if isinstance(slot.get('ref'), str) and slot['ref'] else None
sha256 = slot['sha256'] if is_sha256(slot.get('sha256')) else None
pick, at = None, None
if ref or sha256:
pick = {'name': str(slot.get('displayName') or (ref or sha256)[:10]), 'ref': ref, 'sha256': sha256}
try:
at = os.stat(Path(self.op.params_dir()) / key).st_mtime
except OSError:
pass
self._note_slot(pick)
self._slot_cache = (now, pick, at)
return pick
def _note_slot(self, pick: dict | None) -> None:
"""Keep SLOT_STATE in step with the slot: what is in it, and when it was
emptied. A pick taken out is the default chosen (the model manager's
Default, here or on sunnylink), a pick like any other, which the hello
names and a server's older pick must not undo. Read again only when the
slot no longer matches what this process knows, so per process it costs
a file read at a change. Never raises."""
last = {'ref': pick['ref'], 'sha256': pick['sha256']} if pick else None
state = self._slot_state
if state is not None and state.get('last') == last:
return
path = self.model_dir() / SLOT_STATE
try:
state = json.loads(path.read_text())
state = state if isinstance(state, dict) else {}
except (OSError, ValueError):
state = {}
if state and state.get('last') == last:
self._slot_state = state
return
if last is None and not state:
# empty with nothing known before it: never picked, as far as we know
self._slot_state = {'last': None, 'cleared_at': None}
return
state = {'last': last, 'cleared_at': time.time() if last is None else None}
self._slot_state = state
from jetlink.comma import gadget
try:
gadget.write_record(path, state)
except OSError:
self.op.log.exception("jetlink: could not keep the big-model slot's state")
def default_chosen_at(self) -> float | None:
"""When the slot was emptied by this clock, the default chosen; None while
it holds a pick, or was never filled."""
if self.selected_slot() is not None or self._slot_state is None:
return None
at = self._slot_state.get('cleared_at')
return float(at) if isinstance(at, (int, float)) else None
def default_model(self) -> dict | None:
"""What runs with no pick: jetlink's default big model, else the newest the
catalog lists. Not the chestnut's default, which is the model in the tree.
A fork with no catalog at all (Keys.catalog None) gets jetlink's default by
its ref; one whose catalog has not been fetched yet waits for it, as ever."""
if self.op.keys.catalog is None:
return self._row(DEFAULT_BIG_MODEL_NAME, DEFAULT_BIG_MODEL_REF, self._index()[1])
"""What runs with no pick: the index's default, else the first it lists.
Not the chestnut's default, which is the model in the tree. Before the
comma has an index, jetlink's own by its ref, which a provisioning run
resolves by fetching one."""
if (index := self.index()) is None:
return self._row(DEFAULT_BIG_MODEL_NAME, DEFAULT_BIG_MODEL_REF)
models = self.model_index()
return next((m for m in models if m['ref'] == DEFAULT_BIG_MODEL_REF), models[0] if models else None)
return next((m for m in models if m['ref'] == index.default), models[0] if models else None)
def default_model_name(self) -> str | None:
"""default_model()'s name without the catalog's trailing build date, the
@@ -134,12 +256,156 @@ class Models:
return _TRAILING_DATE.sub('', model['name']) if model else None
def selected_model(self) -> dict | None:
"""The slot's pick, listed in the catalog or not: a ref is enough to find its
pointer. With no pick, default_model()."""
if (pick := self.selected_slot()) is not None:
return self._row(pick['name'], pick['ref'], self._index()[1])
"""The model picked last, here or on the server: the slot's pick, listed
or not (the index knows every ref it ever saw), unless the server's last
hello named a newer one. With neither, default_model()."""
if (theirs := self._newer_server_pick()) is not None:
return self._server_row(theirs)
if (own := self.selected_slot()) is not None:
return self._own_row(own)
return self.default_model()
def _own(self) -> tuple[dict | None, float | None]:
"""Our pick as a row, and when it was made by this clock: the slot's, or
the default when it was chosen by emptying the slot. (None, None) with
neither."""
if (own := self.selected_slot()) is not None:
return self._own_row(own), self.picked_at()
if (at := self.default_chosen_at()) is not None and (default := self.default_model()) is not None:
return default, at
return None, None
def _own_row(self, own: dict) -> dict:
return self._row(own['name'], own['ref'], own['sha256'])
# -- picks on both ends -----------------------------------------------------
# A pick is made on either end: in the comma's list (the default included,
# chosen by emptying the slot), or on the server (its web page, an app's Use
# Model). Each hello carries the comma's own pick, when it was made by this
# clock and how long ago, and the server answers with the newer of that and
# its own (PickStore in JetlinkServer), which it settles by what the comma
# named before rather than by its clock where it can: a Jetson's clock
# starts again behind at every power-on. The answer is kept with the rest of
# the hello (gadget.SERVER, through the owner) along with the pick the hello
# carried, and selected_model() takes the server's when that is still our
# pick: the server chose knowing it. So a model picked on the server drives
# without being picked here too, and one picked here goes to the server at
# the next hello.
def picked_at(self) -> float | None:
"""When the slot was last written, by this clock: when the pick was made.
None with no pick of our own, or no date for it."""
return self._slot_cache[2] if self.selected_slot() is not None and self._slot_cache else None
def hello_pick(self) -> dict | None:
"""Our own pick, for the hello: {ref, sha256, nbytes, name, age_s, at},
its oid and size where the index knows them (no network here), `at` when it
was made by this clock. None with nothing picked here, or no date for it:
the server's pick, if any, stands."""
row, at = self._own()
if row is None or at is None or not (row['ref'] or row['oid']):
return None
return {'ref': row['ref'], 'sha256': row['oid'], 'nbytes': row['size'], 'name': row['name'],
'age_s': round(max(0.0, time.time() - at), 1), 'at': round(at, 3)}
def heard(self, hello: dict, asked=_UNTOLD) -> dict:
"""The server's hello with its `pick` dated by this clock (_dated), and
`asked`, the hello_pick() the hello carried, kept with it: which is how
the owner keeps it (lending.SERVER_FIELDS) and server_pick() reads it.
This process goes by it at once, whatever the owner does with it."""
self._heard = _dated(hello.get('pick'))
if self._heard is not None and asked is not _UNTOLD:
self._heard['asked'] = {k: asked.get(k) for k in ('ref', 'sha256', 'at')} if isinstance(asked, dict) else None
return {**hello, 'pick': self._heard} if self._heard is not None else hello
def server_pick(self) -> dict | None:
"""The pick the server last answered a hello with, {ref, sha256, nbytes,
name, at}, or None: a server too old to say, or one with no pick. What
this process heard last, else the owner's record of the last hello: the
UI says no hello, and reads it every frame."""
if self._heard is not _UNHEARD:
return self._heard
now = time.monotonic()
if self._record_cache is None or now - self._record_cache[0] >= INDEX_TTL:
from jetlink.comma import gadget
pick = (gadget.read_record(gadget.SERVER) or {}).get('pick')
self._record_cache = (now, pick if isinstance(pick, dict) and isinstance(pick.get('at'), (int, float)) else None)
return self._record_cache[1]
def _newer_server_pick(self) -> dict | None:
"""The server's last pick, when it is another model than ours and was
picked after it, or we have none. The server settled that when the hello
carried this pick of ours; a pick made here since that hello is newer.
An answer kept without the pick it was asked with (an older jetlink) goes
by its date."""
theirs = self.server_pick()
if theirs is None:
return None
own, at = self._own()
if own is None:
return theirs
if self._same(theirs, own):
return None
if 'asked' in theirs:
asked = theirs['asked']
fresh = isinstance(asked, dict) and self._same(asked, own) and isinstance(asked.get('at'), (int, float)) \
and at is not None and abs(asked['at'] - at) < 1.0
return theirs if fresh else None
return None if theirs['at'] <= (at or 0.0) else theirs
@staticmethod
def _same(pick: dict, row: dict) -> bool:
"""One model: by the catalog ref where both have one, since two refs can
share one export, else by the hash. The server's PickStore.sameModel."""
if pick.get('ref') and row['ref']:
return pick['ref'] == row['ref']
return bool(pick.get('sha256')) and pick['sha256'] == row['oid']
def _server_row(self, pick: dict) -> dict:
"""The server's pick as a row: named as we list it, with the server's oid
and size, which name the bytes it has."""
listed = next((m for m in self.model_index() if pick['ref'] and m['ref'] == pick['ref']), None)
row = self._row(listed['name'] if listed else pick.get('name') or (pick['ref'] or pick['sha256'])[:16],
pick['ref'], pick['sha256'])
if pick['sha256'] and pick.get('nbytes'):
row['oid'], row['size'] = pick['sha256'], int(pick['nbytes'])
return row
def adopt(self) -> None:
"""Make a newer pick from the server ours. With a catalog, ask the model
manager for it (Keys.select), so the comma's own list shows what drives:
only a model the catalog lists, which is all the model manager takes; any
other drives all the same (selected_model). Without one, no model manager
owns the slot, so the pick is written into it, whatever the model. Never
raises."""
try:
if (theirs := self.server_pick()) is None or self._newer_server_pick() is None:
return
model, keys = self._server_row(theirs), self.op.keys
if keys.catalog is None:
if keys.big_model:
self.op.log.warning("jetlink: %s was picked on the server, picking it here too", model['name'])
slot = {k: v for k, v in (('displayName', model['name']), ('ref', model['ref']), ('sha256', model['oid'])) if v}
self.op.put(keys.big_model, slot, block=True)
self._slot_cache = None
return
# a download the user asked for that the model manager has not taken
# yet is left alone: the next hello asks again
key = keys.select
if key and model['ref'] and self.op.get(key) is None and model['ref'] in self._catalog_refs():
self.op.log.warning("jetlink: %s was picked on the server, picking it here too", model['name'])
self.op.put(key, model['ref'])
self._slot_cache = None
except Exception:
self.op.log.exception("jetlink: could not take the server's pick")
def _catalog_refs(self) -> set[str]:
"""The refs the model manager's catalog lists: the index's without a
chestnut fitted (big_catalog), else sunnypilot's."""
key = self.op.keys.catalog
bundles = ((self.op.get(key) if key else None) or {}).get('bundles')
return {b['ref'] for b in bundles if isinstance(b, dict) and is_ref(b.get('ref'))} if isinstance(bundles, list) else set()
def selected_model_name(self) -> str | None:
selected = self.selected_model()
return selected['name'] if selected else None
@@ -154,17 +420,18 @@ class Models:
"""One file per model, so switching back does not re-download."""
return f"{model['oid'][:16]}.onnx"
def model_path(self, model: dict) -> Path:
"""Where a model's ONNX lives, whether or not it is there yet."""
return self.model_dir() / self.model_file_name(model)
def shipped_model_path(self) -> Path | None:
"""The chosen large model, if it has been fetched. Keyed on the oid, not
the in-tree pointer, which moves with upstream syncs; the size is the cheap
check that the file is the one we mean."""
model = self.selected_model()
if model is None or not model['oid']:
if model is None or not self.has_file(model):
return None
path = self.model_dir() / self.model_file_name(model)
if path.is_file() and path.stat().st_size == model['size']:
return path
return None
return self.model_path(model)
def lfs_endpoints(self) -> list[str]:
"""Where a model's bytes are asked for, nearest first: the LFS server this
@@ -182,63 +449,88 @@ class Models:
pass
return out + [e for e in LFS_ENDPOINTS if e not in out]
def fetch_shipped_model(self, progress=None, should_stop=None) -> Path | None:
def fetch_shipped_model(self, progress=None, should_stop=None, retrying=None) -> Path | None:
"""Download the chosen large model if it is not here yet; None when nothing
is chosen. The registry streams it to a .part file and hashes it on the way,
so only the whole model ever takes the name."""
from jetlink.registry.catalog import NetworkError
from jetlink.registry.lfs import Pointer, lfs_download, lfs_resolve
so only the whole model ever takes the name.
A transfer that fails is tried again after each of DOWNLOAD_RETRY_DELAYS,
carrying on from the .part it left; once they are spent the .part outlives
the run for the next one. Each attempt asks the LFS server again:
the address it hands out expires. `retrying(error, delay)` hears of each
wait; a run that is stopped stops waiting."""
model = self.selected_model()
if model is None or not model['oid']:
return None
dest = self.model_dir() / self.model_file_name(model)
if dest.is_file() and dest.stat().st_size == model['size']:
dest = self.model_path(model)
if self.has_file(model):
return dest
pointer = Pointer(model['oid'], int(model['size']))
for endpoint in self.lfs_endpoints():
href = lfs_resolve(endpoint, pointer)
if href is None:
continue
for delay in (*DOWNLOAD_RETRY_DELAYS, None):
try:
return self._fetch_once(pointer, dest, progress, should_stop)
except NetworkError as e:
if delay is None:
raise
self.op.log.warning("jetlink: download of %s failed (%s), trying again in %.0f s", pointer.oid[:16], e, delay)
if retrying is not None:
retrying(e, delay)
end = time.monotonic() + delay
while time.monotonic() < end:
if should_stop is not None and should_stop():
raise
time.sleep(min(1.0, end - time.monotonic()))
def _fetch_once(self, pointer, dest: Path, progress, should_stop) -> Path:
from jetlink.registry.lfs import lfs_download, lfs_hrefs
for endpoint, href in lfs_hrefs(self.lfs_endpoints(), pointer):
self.op.log.warning("jetlink: fetching the large model (%d MB) from %s", pointer.size >> 20, endpoint)
return lfs_download(href, pointer, dest, progress=progress, should_stop=should_stop)
raise NetworkError(f"no LFS server has {pointer.oid[:16]}")
def name_for(self, oid: str) -> str:
"""The index's name for the model with this oid, or the oid's first 16
characters when it lists none."""
index = self.index()
listed = index.by_oid.get(oid) if index is not None else None
return listed.name if listed is not None else oid[:16]
def size_for(self, oid: str) -> int | None:
"""The byte count of the ONNX with this oid, as the index knows it."""
index = self.index()
return index.size(oid) if index is not None else None
def has_file(self, model: dict) -> bool:
"""Is this model's ONNX on the comma, whole? Its size is the cheap check."""
if not model.get('oid') or not model.get('size'):
return False
try:
return self.model_path(model).stat().st_size == model['size']
except OSError:
return False
# -- the model manager's catalog --------------------------------------------
def big_catalog(self, catalog: dict) -> dict:
"""The big-model catalog with every newer one sunnypilot has published folded in.
A Jetson runs the commit's ONNX, so a model sunnypilot only builds for its next
runtime is still one it can run; see jetlink.registry.catalog.fetch_catalogs.
Never raises: a probe that fails keeps what the last one found."""
try:
from jetlink.registry.catalog import fetch_catalogs, merge_catalogs
merged = merge_catalogs([catalog, fetch_catalogs()], selector=self.op.catalog_selector)
added = len(merged.get('bundles', [])) - len(catalog.get('bundles', []))
if added <= 0:
return catalog
self.op.log.warning("jetlink: %d model(s) only newer catalogs list", added)
return merged
except Exception:
self.op.log.exception("jetlink: could not check for newer catalogs")
return self._found_before(catalog)
def big_catalog(self, selector: int) -> dict:
"""The index's models as a catalog in sunnypilot's shape, for the model
manager's big-model list when no chestnut is fitted: what the comma lists
is then what the Jetson runs, each with the index's fields, in its folder
and order. Only `selector` is the fork's (its model manager's
REQUIRED_JSON_VERSION, which it parses), and no artifacts: a chestnut
has nothing to download, and an accelerator runs the ONNX. The index is
fetched again; raises a RegistryError when it cannot be, so the model
manager keeps the list it has."""
models = self.refresh_index().models
return {'bundles': [{'ref': m.ref, 'display_name': m.name, 'short_name': m.short_name or m.ref[:7], 'index': len(models) - i,
'is_big': True, 'is_20hz': m.is_20hz, 'generation': m.generation, 'environment': m.environment,
'runner': m.runner, 'minimum_selector_version': str(selector), 'build_time': m.build_time,
'overrides': {'folder': m.folder}, 'models': []} for i, m in enumerate(models)]}
def listed_ref(self, ref: str) -> str | None:
"""The ref the index lists a model under: its own, or the newest one with
the same ONNX (a recompile is listed once). None for a model it does not
list. No network."""
index = self.index()
listed = index.listed(ref) if index is not None and is_ref(ref) else None
return listed.ref if listed is not None else None
def _found_before(self, catalog: dict) -> dict:
"""The catalog with the models the last probe found folded in again, from the
model manager's cached copy: every entry there the fetched catalog does not
list. Not only merge_catalogs' entries with no artifacts: a newer catalog at
the same selector version comes through with its builds (v26 lists Cinque
Terre V3 that way). Dropped with a probe that failed, a pick only a newer
catalog lists would be reset at the manager's next start and the owner would
provision the default in its place; a refresh on a flaky network is enough.
A model sunnypilot withdrew stays listed until a probe works."""
try:
listed = {b.get('ref') for b in catalog.get('bundles', [])}
key = self.op.keys.catalog
cached = ((self.op.get(key) if key else None) or {}).get('bundles', [])
kept = [b for b in cached if isinstance(b, dict) and b.get('ref') not in listed]
except Exception:
return catalog
if not kept:
return catalog
self.op.log.warning("jetlink: keeping %d model(s) the last probe found", len(kept))
return {**catalog, 'bundles': [*catalog.get('bundles', []), *kept]}
+96 -29
View File
@@ -84,32 +84,71 @@ class ProvisioningRun:
# -- provisioning ---------------------------------------------------------
def fetch_model(self):
"""Download the pinned large model, once.
"""Download the picked large model, if the comma has not got it whole.
Minutes on a slow link, so it reports progress and stops when the owner
stops the run; it is the one call in a run that blocks for long.
stops the run; it is the one call in a run that blocks for long. A stall is
retried within the run and resumed from where it stopped, by this run or
the next (Models.fetch_shipped_model); a run gives up only once those
retries are spent, and the .part waits for the next one.
"""
if self.fetch_failed:
return None
parts = self.parts
model = parts.models.selected_model() or {}
size = model.get('size') or 0
got = 0.0
def progress(frac: float) -> None:
nonlocal got
got = frac
got_mb, total_mb = int(frac * size) >> 20, size >> 20
parts.progress.report('download', frac, f"downloading {got_mb} of {total_mb} MB" if size else 'downloading',
code='downloading', args={'got_mb': got_mb, 'total_mb': total_mb} if size else None)
def retrying(error, delay: float) -> None:
parts.progress.report('download', got, f"download stalled, retrying in {delay:.0f} s",
code='download_stalled', args={'retry_s': round(delay)})
try:
path = self.parts.models.fetch_shipped_model(
progress=lambda frac: self.parts.progress.report('download', frac, 'downloading'),
should_stop=lambda: self.stop,
)
path = parts.models.fetch_shipped_model(progress=progress, should_stop=lambda: self.stop, retrying=retrying)
except Exception:
self.log.exception("jetlink: could not fetch the large model")
self.parts.progress.report('failed', 1.0, 'could not download the large model')
# one attempt per run; retrying a gigabyte on a loop is worse than staying small
if self.stop:
self.log.warning("jetlink: download stopped, the next run carries on from where it got to")
else:
# the owner starts another run after its backoff, which resumes the .part
self.log.exception("jetlink: could not fetch the large model")
parts.progress.report('failed', 1.0, 'download failed, retrying later', code='download_failed')
self.fetch_failed = True
return None
if path is not None and model.get('oid'):
link.remember_hash(path, model['oid']) # the download proved it; the upload need not read it again
return path
def needs_download(self) -> bool:
"""Could the Jetson need the picked model from the comma? Only while its
engine is not known to be built and the file is not here."""
parts = self.parts
entry = parts.models.selected_model()
if entry is None:
return False
sha256, _ = link.identity(parts, entry)
if parts.spec.engine_ready_for(sha256):
return False
return parts.models.shipped_model_path() is None
def provision(self) -> bool:
"""Make the Jetson ready for the selected model; a host is attached. The
file is fetched only when the server asks for the bytes: the Jetson keeps
its own copy of every ONNX and never prunes it."""
"""Make the Jetson ready for the picked model; a host is attached. The
hello settles which pick that is, the comma's or a newer one made on the
server. A server without the model downloads it itself; only one that
cannot (no internet, or too old) gets the bytes from the comma, fetched
here then."""
from jetlink.client import EngineMissing
parts = self.parts
parts.progress.report('connect', 0.0, 'connecting', code='connecting')
hello = self.hello()
self.log.warning("jetlink: server %s trt %s", hello.get('device'), hello.get('trt_version'))
parts.models.adopt()
entry = parts.models.selected_model()
if entry is None:
# no catalog yet; not an error
@@ -118,48 +157,65 @@ class ProvisioningRun:
return False
sha256, nbytes = link.identity(parts, entry)
# only needed if the server turns out not to have this model; None is a
# legitimate state here, see EngineMissing below
# only needed if the server turns out not to have this model and cannot
# get it; None is a legitimate state here, see EngineMissing below
model_path = parts.models.shipped_model_path()
self.log.warning("jetlink: provisioning %s (%d MB, sha %s)",
entry.get('name', sha256[:16]), nbytes >> 20, sha256[:16])
parts.progress.report('connect', 0.0, 'connecting')
def ensure(path):
return link.ensure(parts, self.client, sha256, nbytes, path, progress=parts.progress.report_with_eta,
should_stop=lambda: self.stop)
should_stop=lambda: self.stop, ref=entry.get('ref'))
hello = self.hello()
self.log.warning("jetlink: server %s trt %s", hello.get('device'), hello.get('trt_version'))
try:
spec = ensure(model_path)
except EngineMissing:
# the server has nothing to build from, and neither have we: fetch the
# model and hand it over in this run. The owner lends the link for the
# whole run, so leaving after the download only put the build a
# WORKER_BACKOFF later, five minutes of a finished download doing nothing
# the server has nothing to build from and could not download it, and
# neither have we: fetch the model and hand it over in this run. The
# owner lends the link for the whole run; leaving after the download
# would put the build a WORKER_BACKOFF later
if model_path is not None or (model_path := self.fetch_model()) is None:
raise
# a download of minutes can outlast the session; a hello starts a new one
self.hello()
spec = ensure(model_path)
parts.progress.report('ready', 1.0, 'engine ready')
parts.progress.report('ready', 1.0, 'engine ready', code='engine_ready')
self.log.warning("jetlink: engine ready for %s", spec.sha256[:16])
return True
def hello(self) -> dict:
"""Say hello, and pass the answer on to the owner, which needs its
sleep_after to decide whether letting go of the gadget is worth what it
costs and never speaks the protocol to learn it."""
hello = self.client.hello(timeout=10.0)
"""Say hello with our pick, and pass the answer on to the owner, which
needs its sleep_after to decide whether letting go of the gadget is worth
what it costs, never speaks the protocol to learn it, and keeps the
server's pick and whether it downloads for the comma (Models.heard)."""
models = self.parts.models
sent = models.hello_pick()
hello = models.heard(self.client.hello(timeout=10.0, pick=sent), sent)
if self.loan is not None:
self.loan.note_server(hello)
return hello
# -- the parked car -------------------------------------------------------
def without_jetson(self) -> None:
"""No Jetson came to the bind: a car whose Jetson is switched with the
ignition has none while parked. Only the Jetson needs the model, and one
that can download it gets it itself when it is on; the comma fetches it
now only for a Jetson that cannot (no internet when it was last here, or
too old to say), so the build can start the moment it is."""
if not self.has_work():
return
if self.needs_download():
if server_fetches():
self.parts.progress.report('waiting', 0.0, 'the jetson downloads it when it is on', code='waiting_for_host')
return
if self.fetch_model() is None:
return
self.parts.progress.report('waiting', 0.0, 'downloaded, builds when the jetson is on',
code='downloaded_waiting_host')
def has_work(self) -> bool:
"""Is there a reason to wake the Jetson? Only things the link can fix count."""
spec = self.parts.spec.load()
@@ -223,7 +279,10 @@ class ProvisioningRun:
self.log.warning("jetlink: no warp built for this camera, nothing to provision for")
return True
if not self.has_work():
# Nothing to build, unless a model was picked on the server since: a
# Jetson awake on the bus is asked, which costs a hello and no wake. Not
# a phone's cable, which is there only once the app dials in
if not self.has_work() and not (gadget.host_attached() and gadget.link_kind(self.parts.settings.mode()) == 'usb'):
self.log.warning("jetlink: nothing to provision")
return True
@@ -233,16 +292,24 @@ class ProvisioningRun:
return False
if not self.wait_for_jetson():
self.log.warning("jetlink: no jetson within %.0f s, leaving it for the next run", WAKE_TIMEOUT)
self.close_link()
self.without_jetson()
return False
finished = self.provision()
except Exception:
self.log.exception("jetlink: provisioning failed")
self.parts.progress.report('failed', 1.0, 'see the log')
self.parts.progress.report('failed', 1.0, 'see the log', code='failed')
finally:
self.close_link()
return finished
def server_fetches() -> bool:
"""Did the server the comma last spoke to say it downloads a model itself
(its hello's `fetches`, as the owner keeps it)? No for one too old to say."""
return (gadget.read_record(gadget.SERVER) or {}).get('fetches') is True
def main(argv: list[str] | None = None) -> None:
"""One provisioning round over the fork's adapter, as the owner starts it.
Exits 0 when nothing is left to do, and 1 when the owner should try again."""
+25 -11
View File
@@ -4,7 +4,7 @@ Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
The picked model's spec, and whether its engine is built, in one record.
The spec of the last model a server built (the pick, or a stand-in for it), and whether its engine is built, in one record.
Reading the shapes and output slices means parsing a 766 MB ONNX. The server
does that when it builds the engine and answers with the spec; provisioning
@@ -13,7 +13,7 @@ record also says whether the server has built the engine for the sha it names,
so the spec and the readiness can never name different models. It must
survive a reboot, or every ignition rebuilds a 160 s engine.
A param today (Keys.spec), through the adapter's get and put.
Stored as a param (Keys.spec), through the adapter's get and put.
"""
from __future__ import annotations
@@ -27,11 +27,12 @@ class SpecRecord:
value = self.op.get(self.op.keys.spec)
return value if isinstance(value, dict) else None
def load(self):
"""The recorded ModelSpec, or None if there is not a usable one."""
def load(self, d: dict | None = None):
"""The recorded ModelSpec, or None if there is not a usable one. `d` is
the record, when the caller has read it already."""
from jetlink.spec import ModelSpec
try:
d = self._raw()
d = self._raw() if d is None else d
return ModelSpec.from_dict(d) if d else None
except Exception:
self.op.log.exception("jetlink: cached spec is unreadable")
@@ -43,12 +44,25 @@ class SpecRecord:
def engine_ready_for(self, sha256: str | None) -> bool:
"""Has the server built the engine for this model? Params only."""
d = self._raw()
return bool(sha256) and d is not None and d.get('sha256') == sha256 and d.get('ready') is True
return bool(sha256) and self.built_sha() == sha256
def clear_ready(self) -> None:
"""The engine is no longer known to be built. The spec stays: it still
sizes the warp, and the next provisioning run asks again."""
def built_sha(self) -> str | None:
"""ready_spec()'s sha256, without making the spec of it."""
d = self._raw()
if d is not None and d.get('ready'):
return d.get('sha256') if d is not None and d.get('ready') is True else None
def ready_spec(self):
"""The last model whose engine the server built, whichever model is picked
now: what drives while a new pick is still being fetched or built. None
without one."""
d = self._raw()
return self.load(d) if d is not None and d.get('ready') is True else None
def clear_ready(self, sha256: str | None = None) -> None:
"""The engine is no longer known to be built. The spec stays: it still
sizes the warp, and the next provisioning run asks again. With `sha256`,
only if the record is that model's: a new pick the server has nothing of
says nothing about the last model it built, which still drives."""
d = self._raw()
if d is not None and d.get('ready') and (sha256 is None or d.get('sha256') == sha256):
self.op.put(self.op.keys.spec, {**d, 'ready': False})
+195 -24
View File
@@ -22,13 +22,27 @@ from jetlink.comma import gadget
# -- progress -----------------------------------------------------------------
# Written by the provisioning run and the joining state, read by the UI: a
# param today (Keys.progress), because the writer is another process.
# param (Keys.progress), because the writer is another process.
# Each report is a file write, and the UI reads it at 5 Hz. An upload reports
# once per 4 MB chunk, 440 of them for a 1.7 GB model, and onroad that is IO a
# recording would have to share the disk with.
PROGRESS_MIN_INTERVAL = 0.25
# what a progress record's `code` may be, for a fork that words the line
# itself; `msg` stays the English one. `args`, where a code has them:
# downloading, download and upload {got_mb, total_mb}, download_stalled
# {retry_s}, reconnecting {why: lost, behind, load_failed or bad_output},
# build {eta_s}. downloading is the comma fetching the model, download the
# server fetching it itself. From download on they are stage names, and the
# server's stages are its own:
# a server can add one, so a fork falls back to `msg` for a code it does not
# know. A server message with no stage has no code
PROGRESS_CODES = ('waiting_for_host', 'finding_model', 'model_missing', 'ready_waiting_window', 'reconnecting',
'connecting', 'downloading', 'download_stalled', 'download_failed', 'downloaded_waiting_host',
'engine_ready', 'failed', 'download', 'upload', 'patch', 'parse', 'convert', 'compile', 'build',
'load', 'warm')
def estimated_build_seconds(size: int) -> int:
"""Orin Nano Super, TensorRT 10.3: the 766 MB models built in 102 to 166 s,
@@ -57,21 +71,28 @@ class Progress:
return None
return value if isinstance(value, dict) else None
def report(self, stage: str, frac: float, msg: str = '', drops: int = 0) -> None:
def report(self, stage: str, frac: float, msg: str = '', drops: int = 0, code: str | None = None,
args: dict | None = None) -> None:
"""Never raises: called from except handlers. A fraction's ticks are held to
4 Hz within a stage; a report with no fraction (a join's state) and the end
of a stage always go through, so the panel's last word is never dropped. A
join says 'waiting for jetlink' and 'checking the link keeps up' 50 ms apart;
join says 'waiting for jetlink' and 're-engage to switch' moments apart;
holding the second left the first on the panel for the rest of the drive.
`msg` is the panel's one short line; `drops`, once the link has dropped often
enough to blame the cable, is the panel's to word."""
enough to blame the cable, is the panel's to word; `code` and `args` say
`msg` for a fork with its own words (PROGRESS_CODES)."""
last_stage, last_at = self._last
now = time.monotonic()
if 0.0 < frac < 1.0 and stage == last_stage and now - last_at < PROGRESS_MIN_INTERVAL:
return
self._last = (stage, now)
record = {'stage': stage, 'frac': round(frac, 4), 'msg': msg, 'drops': drops}
if code is not None:
record['code'] = code
if args:
record['args'] = args
try:
self.op.put(self.op.keys.progress, {'stage': stage, 'frac': round(frac, 4), 'msg': msg, 'drops': drops})
self.op.put(self.op.keys.progress, record)
except Exception:
self.op.log.exception("jetlink: could not report progress")
@@ -85,11 +106,17 @@ class Progress:
"""Progress, with how long the build still has to run, from the model's
size. Only the build: the upload reports MB of MB and a connect has nothing
to predict."""
if stage == 'build':
size = self._size() if self._size is not None else None
if size:
msg = _eta(estimated_build_seconds(size) * max(0.0, 1.0 - frac))
self.report(stage, frac, msg)
args = None
size = self._size() if self._size is not None and stage in ('build', 'upload', 'download') else None
if size and stage == 'build':
left = estimated_build_seconds(size) * max(0.0, 1.0 - frac)
msg, args = _eta(left), {'eta_s': round(left)}
elif size:
args = {'got_mb': int(frac * size) >> 20, 'total_mb': size >> 20}
if stage == 'download' and args:
# the server downloading the model itself: not the comma's own 'downloading'
msg = f"jetson downloading {args['got_mb']} of {args['total_mb']} MB"
self.report(stage, frac, msg, code=stage or None, args=args)
# -- what is on the other end -------------------------------------------------
@@ -168,8 +195,13 @@ def usb_port() -> str | None:
# -- whether the link can run --------------------------------------------------
# the offroad alert's text for a device whose build made no warp for its camera
# the offroad alert's text for a device whose checkout has no warp for its camera
NO_WARP = "no warp built for this camera"
# how a failed snapshot starts its reason (the owner's backoff: gadget.BACKING_OFF)
STATUS_FAILED = "jetlink status failed"
# Status.reason_code: the reason's kind, for a fork with its own words. Any
# reason that is none of the others is the gadget's, its text the detail
REASON_CODES = ('no_warp', 'service_stopped', 'backing_off', 'status_failed', 'gadget')
def unavailable(parts, record: dict | None) -> str | None:
@@ -187,21 +219,61 @@ def unavailable(parts, record: dict | None) -> str | None:
return None if parts.warps.built() else NO_WARP
def _built_for_the_pick(parts) -> bool:
spec = parts.spec.load()
selected = parts.models.selected_model()
return (spec is not None and selected is not None and spec.sha256 == selected['oid']
and parts.spec.engine_ready_for(spec.sha256))
def reason(parts, mode: str) -> str | None:
"""Why the link cannot run, for someone who asked for it only: with it off,
a device that cannot present the gadget simply does not offer the feature."""
return unavailable(parts, owner_record()[0]) if parts.enabled(mode) else None
# -- what modeld runs ------------------------------------------------------------
# a big model drives while its last answer was this recent when the record
# was written: five frames at 20 Hz, so a held frame or two still counts
OUTPUT_FRESH = 0.25
# and while the record itself is this recent: a modeld that froze stops
# reading as driving within it. Two writer periods, since the writer runs at
# background priority and a late write must not read as a hand-back; below the
# owner's HEARTBEAT_TIMEOUT, which `running` keeps
ACTIVE_FRESH = 2 * gadget.RECORD_PERIOD
class Runtime(NamedTuple):
state: str | None = None # the joining model's state (STATES)
active: bool = False # the big model drives modeld's frames now
sha256: str | None = None # and which model it is, while it does
checkpoint: str | None = None
def runtime() -> Runtime:
"""The joining model's state, whether the big model drives now and which
model it is, from modeld's runtime record (gadget.MODELD); Runtime() without
a live one: no modeld with the link since boot, or one that stopped, died
or stopped writing (gadget.HEARTBEAT_TIMEOUT, as the owner's). Never raises."""
record = gadget.read_record(gadget.MODELD)
try:
if record is None or record.get('stopping') or not gadget.owner_alive(record) \
or not gadget.pid_alive(record.get('pid')):
return Runtime()
# the answer's age when written: the writer wakes once a second, the frames 20 times
answered = record['at'] - record.get('last_output_at', 0.0) < OUTPUT_FRESH
active = bool(record.get('active')) and answered and time.monotonic() - record['at'] < ACTIVE_FRESH
def text(key: str, shown: bool = True) -> str | None:
value = record.get(key)
return value if shown and isinstance(value, str) else None
return Runtime(text('state'), active, text('sha256', active), text('checkpoint', active))
except (TypeError, KeyError):
return Runtime()
# -- the snapshot ----------------------------------------------------------------
# Status.phase, in the order it is decided (see there). Plain strings, and
# like the codes only ever added to: a fork maps one it does not know to its
# own default
PHASES = ('unavailable', 'off', 'active', 'waiting', 'reconnecting', 'failed', 'preparing', 'connecting', 'prepared')
class Status(NamedTuple):
"""Everything a reader shows, taken at once. Fields are only ever added."""
enabled: bool # the setting is on and no chestnut is fitted
@@ -214,11 +286,87 @@ class Status(NamedTuple):
progress: dict | None # {stage, frac, msg} while provisioning or joining
model: str | None # the big model it will run: the pick, else jetlink's default
default_model: str | None # jetlink's default, named like the chestnut's (no build date)
standin: str | None = None # the last model built, which drives while the pick is not ready
running: str | None = None # the joining model's state (STATES) in a live modeld, by its record (runtime)
active: bool = False # the big model drives modeld's frames now, by the same record
running_sha256: str | None = None # the model it drives with, while active
running_checkpoint: str | None = None
@property
def runnable(self) -> bool:
"""Is a big model built to run: the pick, or the stand-in for it?"""
return self.ready or self.standin is not None
@property
def active_model(self) -> str | None:
"""model, once it can run."""
return self.model if self.ready else None
"""The big model that runs: the pick once it is built, else the stand-in."""
return self.model if self.ready else self.standin
@property
def shown(self) -> bool:
"""Anything of the link's to show: it is on, a host is there, or progress."""
return self.enabled or self.present or self.progress is not None
@property
def holds_port(self) -> bool:
"""The link holds the comma's USB port, so ADB cannot have it."""
return self.enabled
@property
def port_state(self) -> str | None:
"""The port line's: 'connected' with a host on the link, else the CC
pin's 'empty' or 'device' (a cable with something live behind it, it
cannot say what); None where the kernel does not say."""
if self.present:
return 'connected'
if self.port is None:
return None
return 'empty' if self.port == 'empty' else 'device'
@property
def reason_code(self) -> str | None:
"""`reason` as one of REASON_CODES, None without one."""
reason = self.reason
if reason is None:
return None
if reason == NO_WARP:
return 'no_warp'
if reason == STOPPED:
return 'service_stopped'
if reason.startswith(gadget.BACKING_OFF):
return 'backing_off'
return 'status_failed' if reason.startswith(STATUS_FAILED) else 'gadget'
@property
def phase(self) -> str:
"""One of PHASES, what a panel's state chip says, decided in that order.
Why the link cannot run comes first (a failed snapshot has the reason
with enabled False), then the setting, then what a live modeld says it
runs, then the progress stage, then the records. Without a live record
the progress line decides, and it can be a drive old: a modeld that is
never closed leaves its join's last 'connect' line, which reads
connecting offroad, as the icon reads loading. A big model that stopped
answering while it drives is reconnecting: it is about to hand back. A
build inside a join is preparing; a connect is connecting, a join's or a
provisioning run's."""
if self.reason is not None:
return 'unavailable'
if not self.enabled:
return 'off'
if self.active:
return 'active'
if self.running == 'ready':
return 'waiting'
if self.running in ('retrying', 'running'):
return 'reconnecting'
stage = str((self.progress or {}).get('stage') or '')
if stage == 'failed':
return 'failed'
if stage not in ('', 'ready', 'connect'):
return 'preparing'
if self.running == 'joining' or stage == 'connect':
return 'connecting'
return 'prepared' if self.runnable else 'preparing'
def icon(self, started: bool, model_seen: bool, running_big: bool, state: str) -> str:
"""The chestnut icon's state for the link: a ChestnutState value.
@@ -234,7 +382,7 @@ class Status(NamedTuple):
return 'disconnected'
if stage and stage != 'ready':
return 'failed' if stage == 'failed' else 'loading'
return 'ready' if self.ready else 'uncompiled'
return 'ready' if self.runnable else 'uncompiled'
if model_seen and running_big:
return 'active'
@@ -247,7 +395,7 @@ class Status(NamedTuple):
# nothing is in control, so a driver who stays engaged keeps the small model
if state == 'ready':
return 'waiting'
if not self.ready:
if not self.runnable:
return 'uncompiled'
if state == 'running':
return 'active'
@@ -258,21 +406,44 @@ def read(parts, mode: str) -> Status:
"""Everything at once, over the link setting the caller read: each file once."""
record, live = owner_record()
enabled = parts.enabled(mode)
live_model = runtime() if enabled else Runtime()
reason = unavailable(parts, record) if enabled else None
# the last model the server built; the pick's, or the stand-in that drives
# until the pick is built (link.open_link)
built = parts.spec.built_sha() if enabled and reason is None else None
selected = parts.models.selected_model() if built is not None else None
ready = built is not None and selected is not None and built == selected['oid']
return Status(
enabled=enabled,
mode=mode,
transport=link_transport(mode, live),
present=bool(live.get('present')) if live is not None else parts.presence.present(),
port=usb_port(),
ready=enabled and reason is None and _built_for_the_pick(parts),
ready=ready,
reason=reason,
progress=parts.progress.read(),
model=parts.models.selected_model_name(),
default_model=parts.models.default_model_name(),
standin=parts.models.name_for(built) if built is not None and not ready else None,
running=live_model.state,
active=live_model.active,
running_sha256=live_model.sha256,
running_checkpoint=live_model.checkpoint,
)
def model_state(parts, ref: str) -> str | None:
"""One listed model, for the picker's list: 'ready' when the Jetson has
built it (the spec record), 'downloaded' when the comma has its file, else
None. Records and one stat."""
model = next((m for m in parts.models.model_index() if m['ref'] == ref), None)
if model is None:
return None
if parts.spec.engine_ready_for(model['oid']):
return 'ready'
return 'downloaded' if parts.models.has_file(model) else None
def failed(error: str, mode: str) -> Status:
"""What a reader gets when the snapshot itself failed: nothing to show, the
setting as it is, and, for someone who asked for the link, the failure where
@@ -282,4 +453,4 @@ def failed(error: str, mode: str) -> Status:
def failure(error: str, mode: str) -> str | None:
return f"jetlink status failed: {error}" if mode != 'off' else None
return f"{STATUS_FAILED}: {error}" if mode != 'off' else None
+260
View File
@@ -0,0 +1,260 @@
"""
Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
The Openpilot interface over stock openpilot's paths: the base a fork's
adapter subclasses, overriding only what its fork does differently.
The one jetlink module that imports openpilot, and only inside a method, where
it is used: the top level is the standard library and interface.py, because
the resident owner imports this module (through the fork's owner_config()).
Which method runs where matters. owner_config() imports only
openpilot.common.basedir (os alone); anything under common.hardware loads
capnp, swaglog loads zmq, and model_face() imports modeld itself, so it is for
modeld alone, where that module is already loaded.
Data are class attributes, behaviour small methods, each a fork may override;
one override point per value: a fork sets KEYS, and the interface's keys
reads it. It is jetlink's contract:
renaming or removing one, or changing what one means, is a breaking change
and bumps API. scripts/upstream (the upstream-paths CI job) checks the paths
and literals here against commaai/openpilot master weekly.
A fork's adapter module defines its subclass lazily, as its top level must
import without a jetlink checkout: docs/porting.md, "The adapter module".
Defined there, the class's module names the adapter module the provisioning
run is started with, so it needs no ADAPTER_MODULE.
"""
from __future__ import annotations
import os
import time
from functools import cached_property
from pathlib import Path
# root.AGNOS is openpilot's own test for a comma (common.hardware.AGNOS), which
# that package answers only after loading capnp; root is on the owner's path
from jetlink.comma import root
from jetlink.openpilot.interface import Keys, ModelFace, OwnerConfig
# how long a Params or SubMaster that failed to load is left before the next
# try: in_control() asks on every realtime frame
RETRY_S = 5.0
# what the base engaged() reads, by service: only those in IN_CONTROL_SERVICES
_ENGAGED = {'carControl': ('enabled', 'latActive', 'longActive'), 'selfdriveState': ('enabled', 'active')}
# what marks stock modeld's ModelState, which small_reset() zeroes (and its prev_desire)
_MODEL_STATE = ('input_queues', 'state_pairs', 'packed_input')
class Stock:
"""jetlink.openpilot.interface.Openpilot over stock openpilot (the 0.11 layout)."""
# the fork's adapter module, which the provisioning run imports; None for
# the module the subclass is defined in
ADAPTER_MODULE: str | None = None
# the canonical names, which a fork declares in params_keys.h. No model
# manager upstream: no big-model slot or catalog, so jetlink runs its default
KEYS = Keys(link='JetlinkLink', offroad='IsOffroad', progress='JetlinkProgress', spec='JetlinkSpec',
charge_phone='JetlinkChargePhone')
# comma's chestnut, running and in its ROM (common.hardware.usb's
# CHESTNUT_USB_IDS + CHESTNUT_ROM_USB_IDS, which CI holds this to): written
# out, as the owner cannot import that package
CHESTNUT_IDS = frozenset({(0xADD1, 0x0001), (0x3801, 0x0001), (0x174C, 0x2464), (0x174C, 0x2463)})
# what in_control() reads; carState too, so a dead card counts as in control.
# It goes with engaged(): the base reads only the services listed here, so a
# fork that adds one (zoompilot's carControlSP) overrides engaged() to read it
IN_CONTROL_SERVICES = ('carState', 'carControl', 'selfdriveState')
# modeld's driving warp, which its SConscript compiles per camera
WARP_DIR = 'openpilot/selfdrive/modeld/models'
WARP_NAME = 'driving_warp_{cam_w}x{cam_h}_tinygrad.pkl'
OWNER_LOG = Path('/data/log/jetlink-owner.log')
def __init__(self):
# nothing imported here: owner_config() builds one in the owner
self._stores: dict[Path, object] = {}
self._params_after = 0.0
self._sm = None
self._sm_after = 0.0
self._in_control_error: str | None = None
# -- the readers --------------------------------------------------------------
# the interface's members, over the class attributes a fork sets
@property
def keys(self) -> Keys:
return self.KEYS
@cached_property
def log(self):
from openpilot.common.swaglog import cloudlog
return cloudlog
@cached_property
def basedir(self) -> Path:
# the checkout's root, which holds .lfsconfig and the openpilot package
from openpilot.common.basedir import BASEDIR
return Path(BASEDIR)
def params_dir(self) -> Path:
# params.cc and hw.h's rule: PARAMS_ROOT, else /data/params on a comma and
# $HOME/.comma<OPENPILOT_PREFIX>/params elsewhere, then /<OPENPILOT_PREFIX,
# or d>. HOME unset gives /.comma, as the C++ concatenation does. The
# environment only, per call, so it follows a prefix as Params does
prefix = os.environ.get('OPENPILOT_PREFIX', '')
store = os.environ.get('PARAMS_ROOT')
if store is None:
store = '/data/params' if root.AGNOS else os.environ.get('HOME', '') + '/.comma' + prefix + '/params'
return Path(store) / os.environ.get('OPENPILOT_PREFIX', 'd')
def _params(self):
# one Params per store: making one costs more than the read on a comma, and
# the UI reads several five times a second. By store, for a test's prefix
where = self.params_dir()
store = self._stores.get(where)
if store is None:
# one that failed to load is not tried again for RETRY_S: get() is on the UI's frame
if time.monotonic() < self._params_after:
raise RuntimeError("openpilot's Params failed to load, retrying shortly")
try:
from openpilot.common.params import Params
store = self._stores[where] = Params()
except Exception:
self._params_after = time.monotonic() + RETRY_S
raise
return store
def get(self, key: str):
# hardwared's and the UI's threads read here, which UnknownKeyName (a
# params library older than the key) must not take down
try:
return self._params().get(key)
except Exception:
return None
def chestnut_present(self) -> bool:
# any chestnut id, its ROM's included, the owner's walk: never the port
# beside one, even one modeld ignores until its firmware matches
from jetlink.comma.port import chestnut_attached
return chestnut_attached(self.CHESTNUT_IDS)
def camera(self) -> tuple[int, int, int, int]:
# modeld takes the size from camerad's buffer; a comma four's os04c10 is
# the 1344x760 one, every other device's the 1928x1208
from openpilot.common.hardware import HARDWARE
from openpilot.common.transformations.camera import _ar_ox_fisheye, _os_fisheye
from openpilot.common.transformations.model import MEDMODEL_INPUT_SIZE
camera = _os_fisheye if HARDWARE.get_device_type() == 'mici' else _ar_ox_fisheye
return camera.width, camera.height, *MEDMODEL_INPUT_SIZE
def warp_path(self, cam_w: int, cam_h: int, model_w: int, model_h: int) -> Path:
# scons builds it for the one model input size, which jetlink checks the warp makes
return self.basedir / self.WARP_DIR / self.WARP_NAME.format(cam_w=cam_w, cam_h=cam_h, model_w=model_w, model_h=model_h)
# -- the provisioning run --------------------------------------------------------
def put(self, key: str, value, *, block: bool = False) -> None:
self._params().put(key, value, block=block)
def remove(self, key: str) -> None:
self._params().remove(key)
def model_root(self) -> Path:
# sunnypilot's Paths.model_root(), where there is one; upstream has none,
# and the same place it would be
from openpilot.common.hardware.hw import Paths
if hasattr(Paths, 'model_root'):
return Path(Paths.model_root())
return Path('/data/media/0/models') if root.AGNOS else Path(Paths.comma_home()) / 'media' / '0' / 'models'
# -- modeld ---------------------------------------------------------------------
def parser(self):
"""A new Parser for comma's large model's outputs."""
from openpilot.selfdrive.modeld.parse_model_outputs import Parser
return Parser()
def model_constants(self):
"""The ModelConstants modeld reads off the model."""
from openpilot.selfdrive.modeld.constants import ModelConstants
return ModelConstants
def action_function(self):
"""modeld's get_action_from_model."""
from openpilot.selfdrive.modeld.modeld import get_action_from_model
return get_action_from_model
def model_face(self) -> ModelFace:
from openpilot.selfdrive.modeld.constants import ModelConstants
from openpilot.selfdrive.modeld.modeld import LAT_SMOOTH_SECONDS, LONG_SMOOTH_SECONDS
from openpilot.system.camerad.cameras.nv12_info import get_nv12_info
# desire_len is comma's large model's, which is stock modeld's
return ModelFace(parser=self.parser, frame_size=lambda w, h: get_nv12_info(w, h)[3],
desire_len=ModelConstants.DESIRE_LEN, constants=self.model_constants(),
lat_smooth_seconds=LAT_SMOOTH_SECONDS, long_smooth_seconds=LONG_SMOOTH_SECONDS,
get_action_from_model=self.action_function())
def engaged(self, sm) -> bool:
"""Is openpilot in control, off fresh and valid IN_CONTROL_SERVICES?
carControl's enabled or either axis, or selfdriveState's enabled or active,
of those services the fork lists."""
return any(getattr(sm[service], field) for service, fields in _ENGAGED.items()
if service in self.IN_CONTROL_SERVICES for field in fields)
def in_control(self) -> bool:
# on modeld's frame thread before every frame: a poll that never waits, and
# a service late or invalid, or any failure, holds the swap off, never modeld
try:
if self._sm is None:
# one try per RETRY_S, not one per frame
if time.monotonic() < self._sm_after:
return True
self._sm_after = time.monotonic() + RETRY_S
from openpilot.cereal import messaging
self._sm = messaging.SubMaster(list(self.IN_CONTROL_SERVICES))
services = self.IN_CONTROL_SERVICES
self._sm.update(0)
result = not (self._sm.all_alive(services) and self._sm.all_valid(services)) or self.engaged(self._sm)
except Exception as e:
# once per distinct error: this runs 20 times a second
if self._in_control_error != (text := f"{type(e).__name__}: {e}"):
self._in_control_error = text
try:
self.log.error("jetlink: in_control() failed: %s", text)
except Exception:
pass
return True
self._in_control_error = None
return bool(result)
def event(self, name: str, **fields) -> None:
self.log.event(name, **fields)
def small_reset(self, small):
"""Stock modeld's ModelState, as its warmup leaves it: the recurrent state
on the GPU, the packed host inputs and the desire edge, zeroed in place.
None for another shape, so jetlink's own reset runs."""
if not all(hasattr(small, name) for name in _MODEL_STATE):
return None
from jetlink.openpilot.warp import reset_for_stock
return reset_for_stock(small, getattr(small, 'prev_desire', None))
# -- the adapter module's, for jetlinkd --------------------------------------------
@classmethod
def owner_config(cls) -> OwnerConfig:
"""What jetlinkd needs, data only: openpilot.common.basedir is the one import."""
from openpilot.common.basedir import BASEDIR
op = cls()
# the provisioning run starts in the checkout with it on the path, where
# the launch script links jetlink in
return OwnerConfig(params_dir=op.params_dir(), keys=op.keys, chestnut_ids=cls.CHESTNUT_IDS,
adapter=cls.ADAPTER_MODULE or cls.__module__, cwd=Path(BASEDIR), env={'PYTHONPATH': BASEDIR},
log_file=cls.OWNER_LOG)
@classmethod
def main(cls) -> None:
"""jetlinkd: hold the USB gadget until manager stops this process."""
from jetlink.openpilot.owner import main
main(cls.owner_config())
+453
View File
@@ -0,0 +1,453 @@
"""
Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
A kit a fork runs in its own CI, against its real adapter and modelds, and
the fakes jetlink's own tests share.
check_adapter(module) the adapter module: every side of Openpilot, a top
level of the standard library alone, an owner_config()
that imports nothing heavy, an in_control() that
answers a bool at once
check_seam(path) a modeld's main(): prepare() before it goes realtime,
attach() once the small model is built and its
result run, handed_over() read
check_fallback(obj) the fork's own hooks for no usable jetlink: each
answers as Off does, over HOOK_CALLS
install_guard() an audit hook a conftest starts and stops around each
test, which records a reach for the machine's own
params, /dev/shm records, sysfs or sudo
FakeJoinedModel, FakeSubMaster, RecordingLog, and tinygrad over numpy
(fake_tinygrad)
The checks return their problems, [] when there are none, so one assertion
shows them all: assertEqual(check_adapter(adapter_module), []).
Not on the owner's path, and no test framework or numpy at module level: a
fork imports this from its tests only.
"""
from __future__ import annotations
import ast
import json
import os
import subprocess
import sys
import time
from collections.abc import Iterable
from pathlib import Path
from types import ModuleType
from jetlink.openpilot.interface import Openpilot, conformance
# jetlink's own heavy half, which the owner must not reach: numpy, and urllib
# with ssl and email behind it
HEAVY_JETLINK = ('jetlink.client', 'jetlink.spec', 'jetlink.queues', 'jetlink.registry')
# -- the adapter module ----------------------------------------------------------
_PROBE = '''
import importlib, json, sys
before = set(sys.modules)
module = importlib.import_module(sys.argv[1])
found = {'import': sorted(set(sys.modules) - before)}
before = set(sys.modules)
try:
config = module.owner_config()
found['owner_config'] = sorted(set(sys.modules) - before)
from jetlink.openpilot.interface import OwnerConfig
found['config'] = isinstance(config, OwnerConfig)
except Exception as e:
found['error'] = f'{type(e).__name__}: {e}'
print(json.dumps(found))
'''
def _foreign(names, own: str, heavy, allowed=()) -> list[str]:
"""What is neither the standard library nor jetlink's light half, nor of
the fork's package `own`, nor `allowed`: by the outermost module of each."""
found = {n for n in names if n not in allowed and (n.startswith((*heavy, *HEAVY_JETLINK)) or
n.split('.')[0] not in (*sys.stdlib_module_names, 'jetlink', own))}
return sorted(n for n in found if not any(n.startswith(f + '.') for f in found))
def check_adapter(module: ModuleType, *, heavy: tuple[str, ...] = ()) -> list[str]:
"""The adapter module's problems. Its top level imports the standard
library alone, as manager and the resident owner import it. owner_config()
may import more: anything of the fork's own package that pulls in no third
party, so 'openpilot.common.params' passes unless it is named in `heavy`. A
fork should name its heavy modules there (params, swaglog, cereal). Both
in a fresh interpreter on this one's path, so a module this process has
loaded already counts."""
name = module.__name__
problems = [f"{name}.{member}(): missing" for member in ('adapter', 'owner_config')
if not callable(getattr(module, member, None))]
if problems:
return problems
# on this interpreter's path, as a fork's CI has set it up
try:
run = subprocess.run([sys.executable, '-c', _PROBE, name], capture_output=True, text=True, timeout=120,
env={**os.environ, 'PYTHONPATH': os.pathsep.join(p for p in sys.path if p)})
# the probe's line is the last: the module may print as it imports
found = json.loads(run.stdout.strip().splitlines()[-1])
except subprocess.TimeoutExpired:
return [f"{name} did not import and build its owner_config() in a fresh interpreter within 120 s"]
except (IndexError, ValueError):
return [f"{name} does not import in a fresh interpreter: {run.stderr.strip()[-500:]}"]
# its own packages' __init__s, which run first
if top := _foreign(found['import'], '', heavy, {name.rsplit('.', i)[0] for i in range(name.count('.') + 1)}):
problems.append(f"{name}'s top level imports {top}: manager and the resident owner import it")
if 'error' in found:
problems.append(f"owner_config() raised {found['error']}")
elif owner := _foreign(found['owner_config'], name.split('.')[0], heavy):
problems.append(f"owner_config() imports {owner}: the resident owner calls it")
if found.get('config') is False:
problems.append("owner_config(): not an OwnerConfig")
try:
op = module.adapter()
except Exception as e:
return [*problems, f"adapter() raised {type(e).__name__}: {e}"]
problems += [f"adapter: {p}" for p in conformance(op, Openpilot)]
if not callable(getattr(op, 'in_control', None)):
return problems
try:
op.in_control() # the first may set up what it reads
start = time.monotonic()
answer, took = op.in_control(), time.monotonic() - start
except Exception as e:
return [*problems, f"in_control() raised {type(e).__name__}: {e}"]
if not isinstance(answer, bool):
problems.append(f"in_control() answered {answer!r}, not a bool")
if took > 0.05:
problems.append(f"in_control() took {took * 1e3:.0f} ms: modeld asks before every frame")
return problems
# -- the modeld seam ---------------------------------------------------------------
def check_seam(modeld_path: str | Path) -> list[str]:
"""The problems of a modeld's main() with the hooks, read off its source
(importing a modeld costs tinygrad and a vision stream). The hooks are
found as the receiver of attach(model, small, cam_w, cam_h): the fork's
module (jetlink_adapter.attach) or its Hooks (HOOKS.attach) alike. Calls
are ordered as the source reads, so one in a branch that never runs (an
`if False:`) counts as made. state() is the fork's to publish where it has
a message for it, so it is not asked for."""
path = Path(modeld_path)
main = next((n for n in ast.parse(path.read_text(), filename=str(path)).body
if isinstance(n, ast.FunctionDef) and n.name == 'main'), None)
if main is None:
return [f"{path.name}: no main()"]
def at(n: ast.AST) -> tuple[int, int]:
return n.lineno, n.col_offset
nodes = list(ast.walk(main))
calls = sorted((n for n in nodes if isinstance(n, ast.Call)), key=at)
def called(name: str, facade: str | None = None) -> list[tuple[int, int]]:
return [at(c) for c in calls if (c.func.attr if isinstance(c.func, ast.Attribute) else getattr(c.func, 'id', None)) == name
and (facade is None or isinstance(c.func, ast.Attribute) and ast.unparse(c.func.value) == facade)]
def stored(target: str) -> list[tuple[int, int]]:
return [at(n) for n in nodes if isinstance(getattr(n, 'ctx', None), ast.Store) and ast.unparse(n) == target]
attach = next((c for c in calls if isinstance(c.func, ast.Attribute) and c.func.attr == 'attach'
and len(c.args) + len(c.keywords) == 4), None)
if attach is None:
return [f"{path.name}: main() never calls attach(model, small, cam_w, cam_h)"]
facade = ast.unparse(attach.func.value)
problems, prepare, realtime = [], called('prepare', facade), called('config_realtime_process')
if not prepare:
problems.append(f"main() never calls {facade}.prepare()")
elif realtime and prepare[0] >= realtime[0]:
problems.append("prepare() comes after config_realtime_process(): the GPU's thread would inherit the realtime core")
elif prepare[0] >= at(attach):
problems.append("attach() comes before prepare(), so the link never joins")
if not realtime:
problems.append("main() never calls config_realtime_process()")
small = attach.args[1] if len(attach.args) > 1 else next((k.value for k in attach.keywords if k.arg == 'small'), None)
if isinstance(small, ast.Name) and not any(p < at(attach) for p in stored(small.id)):
problems.append(f"attach() comes before {small.id} is built")
# the name its result is bound to, which the frame loop must run
bound = next((t.id for n in nodes if isinstance(n, (ast.Assign, ast.AnnAssign)) and n.value is attach
for t in getattr(n, 'targets', [getattr(n, 'target', None)]) if isinstance(t, ast.Name)), None)
if bound is None:
problems.append("attach()'s result is dropped: modeld would never run the joined model")
elif not any(p > at(attach) for p in called('run', bound)):
problems.append(f"attach()'s result, {bound}, is never run: modeld would keep driving the model it had")
elif not any(p > at(attach) for p in stored(f'{bound}.frame_drop_ratio')):
problems.append(f"main() never writes {bound}.frame_drop_ratio: a host that drops camera frames would never hand back")
if not called('handed_over', facade):
problems.append(f"main() never calls {facade}.handed_over(model)")
return [f"{path.name}: {p}" for p in problems]
# -- the fork's fallback ------------------------------------------------------------------
_MODEL = object()
# every hook a fork's lines may call, and the arguments each is checked with:
# the one list of them (jetlink's tests hold Hooks to it)
HOOK_CALLS = {'should_run': [(False, None, None)], 'status': [()], 'reason': [()], 'prepare': [(False,), (True,)],
'attach': [(_MODEL, object(), 1928, 1208)], 'handed_over': [(_MODEL,)], 'state': [(_MODEL,)],
'shutdown_step': [(False,), (True, 'test')], 'request_shutdown': [('test',)], 'shutdown_pending': [()],
'model_state': [('f' * 40,)], 'lists_big_models': [()], 'big_catalog': [(21,)], 'listed_ref': [('f' * 40,)],
'should_extend_catalog': [()], 'extend_catalog': [({'bundles': []},)],
'runtime': [()], 'swap_events': [(0.01,)]}
def check_fallback(fallback, hooks: Iterable[str] | None = None, *, link_on=None) -> list[str]:
"""The problems of the fork's own hooks for a jetlink that is missing or
too old to have Off: each of `hooks`, the ones the fork's lines call (by
default every hook it has, so pass them to have a missing one named),
there and answering as Off does, the link off. reason() is the fork's to
word, a str or None, and None while `link_on()`, the fork's read of the
setting, says off: nobody who left the link off is nagged. swap_events()
may be None where the fork's lines check for it. link_on() reads the
params store, so the test sets PARAMS_ROOT or OPENPILOT_PREFIX first, or
it reads the machine's own."""
from jetlink.openpilot.events import Flags
from jetlink.openpilot.hooks import Off
def flags(tracker):
found = tracker.update(True, False, True, state='ready')
return tuple(bool(getattr(found, f)) for f in Flags._fields), bool(tracker.settling)
problems = []
for name in hooks if hooks is not None else [n for n in HOOK_CALLS if hasattr(fallback, n)]:
if name not in HOOK_CALLS or not callable(getattr(fallback, name, None)):
problems.append(f"{name}(): missing" if name in HOOK_CALLS else f"{name}(): not a hook")
continue
for args in HOOK_CALLS[name]:
try:
got, want = getattr(fallback, name)(*args), getattr(Off(), name)(*args)
if name == 'swap_events':
got, want = (want, want) if got is None else (flags(got), flags(want))
except Exception as e:
problems.append(f"{name}() raised {type(e).__name__}: {e}")
continue
if name == 'reason':
try:
off = link_on is not None and not link_on()
except Exception as e:
problems.append(f"link_on() raised {type(e).__name__}: {e}")
continue
same = got is None or (isinstance(got, str) and not off)
else:
same = got is want if any(want is a for a in args) else (type(got), got) == (type(want), want)
if not same:
problems.append(f"{name}() answered {got!r}, where the link off is {want!r}")
return problems
# -- the guard ------------------------------------------------------------------------
# the machine's own params store, jetlink's records, sysfs, FunctionFS and a
# PC's openpilot params
FORBIDDEN = ('/data/', '/dev/shm/', '/dev/ffs', '/sys/', str(Path.home() / '.comma') + os.sep)
# read by a library on import, never jetlink's own reach: tinygrad's CPU quota
ALLOWED = ('/sys/fs/cgroup/cpu.max',)
# the audit events Guard reads a path from, and the argument it is
_PATH_ARG = {'open': 0, 'os.listdir': 0, 'os.scandir': 0, 'socket.connect': 1}
class Guard:
"""Records, between start() and stop(), every open, listing, socket connect
or root-script run that reaches a forbidden path. Recorded, not refused:
many of the paths are read inside `except OSError`, so a refusal would only
hide the reach. A test that reaches the live params store can clear a
real setting such as JetlinkSpec."""
def __init__(self, forbidden: tuple[str, ...] = FORBIDDEN):
self.forbidden = tuple(forbidden)
self.touched: list[str] | None = None
def start(self) -> None:
self.touched = []
def stop(self) -> list[str]:
"""What was reached since start(), once each."""
touched, self.touched = self.touched or [], None
return sorted(set(touched))
def __call__(self, event: str, args) -> None:
touched = self.touched
if touched is None:
return
if event == 'subprocess.Popen':
# the root script is sudo on a comma
argv = args[1] if len(args) > 1 and isinstance(args[1], (list, tuple)) else []
if (hit := next((str(a) for a in argv if 'jetlink-root.sh' in str(a) or str(a) == 'sudo'), None)) is not None:
touched.append(f"{event} {hit}")
return
index = _PATH_ARG.get(event)
value = args[index] if index is not None and len(args) > index else None
if isinstance(value, (str, bytes, os.PathLike)):
path = os.path.abspath(os.fsdecode(value))
if (path + os.sep).startswith(self.forbidden) and path not in ALLOWED:
touched.append(f"{event} {path}")
def install_guard(forbidden: tuple[str, ...] = FORBIDDEN) -> Guard:
"""A Guard, installed as this process's audit hook (for good: Python has no
removing one). Install once, in a conftest, and start and stop it around
each test."""
guard = Guard(forbidden)
sys.addaudithook(guard)
return guard
# -- fakes ---------------------------------------------------------------------------
class FakeJoinedModel:
"""What attach() returns, for a fork's modeld tests: drives as `small`;
hand_over() is a swap or a hand-back."""
def __init__(self, small=None, *, state: str = 'joining', chestnut: bool = False, constants=None):
self.small = small
self.handovers = 0
self.big_model_state = state
self.chestnut = chestnut
self.constants = constants
self.LAT_SMOOTH_SECONDS = self.LONG_SMOOTH_SECONDS = self.frame_drop_ratio = self.lat_delay = 0.0
self.runs, self.closed = 0, False
def hand_over(self, state: str = 'running') -> None:
self.handovers += 1
self.big_model_state = state
def run(self, bufs, transforms, inputs, after_enqueue=None):
self.runs += 1
return self.small.run(bufs, transforms, inputs, after_enqueue) if self.small is not None else {}
def get_action_from_model(self, *args):
return ('action', args)
def close(self) -> None:
self.closed = True
class _Blank:
"""A message never received, as cereal's SubMaster holds one: every field
reads falsy, a nested one too."""
def __getattr__(self, name: str):
if name.startswith('__'):
raise AttributeError(name)
return self
def __bool__(self) -> bool:
return False
class FakeSubMaster:
"""cereal's SubMaster over fixed messages, for an adapter's engaged() and
in_control() tests: what Stock and StarPilot's adapter read of it. A
service given a message is seen, alive and valid; any other is none of
them until update() receives it, and reads as a blank message whose every
field is falsy. A test changes `data`, `alive` and `valid` as it goes.
update() keeps its timeouts: in_control() is on modeld's frame thread and
must never wait (all 0). In for the real one: mock.patch.object(messaging,
'SubMaster', lambda services: FakeSubMaster(services, **messages)). Unlike
cereal's: a service is seen from construction, not from its first receive;
a blank field is falsy but equals nothing (a capnp default equals 0 or
False); and there is no updated, frame, freq_ok or logMonoTime."""
def __init__(self, services: Iterable[str] = (), **messages):
self.services = list(dict.fromkeys([*services, *messages]))
self.data = dict(messages)
self.seen = {s: s in messages for s in self.services}
self.alive = dict(self.seen)
self.valid = dict(self.seen)
self.timeouts: list[float] = []
def update(self, timeout: float = 100) -> None:
self.timeouts.append(timeout)
for s in self.services:
self.seen[s] = self.seen[s] or (s in self.data and self.alive[s])
def all_alive(self, service_list=None) -> bool:
return all(self.alive[s] for s in service_list or self.services)
def all_valid(self, service_list=None) -> bool:
return all(self.valid[s] for s in service_list or self.services)
def __getitem__(self, service: str):
if service not in self.seen:
raise KeyError(service) # not subscribed, as cereal's
return self.data.get(service, _BLANK)
_BLANK = _Blank()
def _level(name: str):
def log(self, msg, *args, **kwargs):
try:
text = str(msg) % args if args else str(msg)
except (TypeError, ValueError):
text = f"{msg} {args}"
self.records.append((name, text))
return log
class RecordingLog:
"""cloudlog's face, keeping every line: (level, message with its arguments)."""
debug, info, warning, error, exception, critical = map(_level, ('debug', 'info', 'warning', 'error', 'exception', 'critical'))
def __init__(self):
self.records: list[tuple[str, str]] = []
def lines(self, level: str | None = None) -> list[str]:
return [text for lvl, text in self.records if level is None or lvl == level]
def has(self, fragment: str, level: str | None = None) -> bool:
return any(fragment in text for text in self.lines(level))
# The fork's tinygrad is not jetlink's to install. What jetlink calls of it is
# small, and these stand-ins do it with numpy; the fork's tests run the real one.
class FakeTensor:
def __init__(self, data=None, device=None, dtype=None):
import numpy as np
self.array = np.asarray(data) if data is not None else np.zeros(0)
self.device = device
def realize(self, *others):
return self
def assign(self, value):
self.array[...] = value
return self
def numpy(self):
return self.array
class FakeDevice:
DEFAULT = 'CPU'
def fake_jit(fn=None, prune=False):
"""TinyJit as a decorator or a wrapper: the function as it is."""
return (lambda f: f) if fn is None else fn
def fake_tinygrad() -> dict[str, ModuleType]:
"""sys.modules entries for what jetlink imports of tinygrad; patch them in
with mock.patch.dict(sys.modules, fake_tinygrad())."""
from types import SimpleNamespace
def module(name, **attrs):
m = ModuleType(name)
m.__dict__.update(attrs)
return m
return {
'tinygrad': module('tinygrad', Tensor=FakeTensor, TinyJit=fake_jit, Device=FakeDevice),
'tinygrad.tensor': module('tinygrad.tensor', Tensor=FakeTensor),
'tinygrad.device': module('tinygrad.device', Device=FakeDevice),
'tinygrad.helpers': module('tinygrad.helpers', PARALLEL=SimpleNamespace(value=8)),
'tinygrad.engine': module('tinygrad.engine'),
'tinygrad.engine.jit': module('tinygrad.engine.jit', TinyJit=fake_jit),
}
+192 -167
View File
@@ -4,92 +4,82 @@ Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
The comma-side warp JIT: how it is built, where it lives, what loads it, and
the small model's reset for a fallback.
The comma-side warp: openpilot's own, where it lives, what loads it, how the
frame loop runs it (Warp), and the small model's reset for a fallback.
The warp stays on the comma (see model_state), and upstream's fused run_model
JIT (openpilot #38684) has no warp to borrow, so comma's make_warp graph is
JIT-compiled as a build target: the fork's build runs
`python -m jetlink.openpilot.warp` once per camera it builds for. A source
build makes the one for its own camera, a prebuilt release one for every
camera it installs on. Nothing compiles one at runtime: in modeld the ~9 s
compile would hold back the first frame on every ignition, and in a
provisioning run, which only runs offroad, it was lost to ignition. A device
without one runs the small model.
The warp stays on the comma (see model_state). openpilot's modeld runs it as
a JIT of its own, driving_warp_{w}x{h}_tinygrad.pkl, one per camera, and the
link runs the same pickle: both camera frames in as one (2, frame size) uint8
input_frame, their transforms as one (2, 3, 3) M_inv, and out the
(2, 6, 128, 256) uint8 frame the link sends. The fork's adapter says where it
is. Nothing compiles one at runtime: a device without one runs the small
model.
load() is what stands between a bad pickle and the car.
tinygrad is the fork's, and only modeld and the build have it: every import of
it here is inside the function that needs it.
tinygrad is the fork's, and only modeld has it: every import of it here is
inside the function that needs it.
"""
from __future__ import annotations
import argparse
import ctypes
import pickle
import sys
from pathlib import Path
# what TinyJit records for the keyword call in call_warp: sorted(kwargs)
WARP_INPUT_NAMES = ['big_frame', 'big_tfm', 'frame', 'tfm']
def call_warp(warp, tfm, big_tfm, frame, big_frame):
"""Call a warp JIT. Every caller goes through here, capture included.
TinyJit names inputs from enumerate(args) plus sorted(kwargs) and refuses a
call whose names differ from the capture. A positional compile and a keyword
call raised JitError on the first frame of a drive.
"""
return warp(tfm=tfm, big_tfm=big_tfm, frame=frame, big_frame=big_frame)
# what the warp's TinyJit was captured with: sorted(kwargs) of modeld's call
WARP_INPUT_NAMES = ['M_inv', 'input_frame']
# KGSL allocation flags (msm_kgsl.h) for memory the GPU's accesses snoop the
# CPU's caches on, mapped write-back: KGSL_MEMFLAGS_IOCOHERENT, which
# tinygrad's kgsl bindings lack, and KGSL_CACHEMODE_WRITEBACK (3 << 26). See
# Warp
COHERENT_WRITEBACK = (1 << 31) | (3 << 26)
def init_device(log) -> None:
"""Bring the GPU up now, on the caller's thread.
"""Bring the GPU up now, on the caller's thread, and turn tinygrad's
compile pool off for the process.
tinygrad initialises the device on its first kernel run and spawns a libusb
event thread doing it. A thread created after config_realtime_process(7, 54)
inherits SCHED_FIFO 54 and the core-7 pin and preempts the frame loop; that
cost 5% of frames once. Failure is not a reason to refuse the accelerator.
inherits SCHED_FIFO 54 and the core-7 pin and preempts the frame loop,
enough to drop ~5% of frames. Failure is not a reason to refuse the accelerator.
"""
try:
# modeld never needs the pool (engine/worker.py), and its PARALLEL idle
# interpreters' handler threads would inherit FIFO 54 on core 7
from tinygrad.helpers import PARALLEL
PARALLEL.value = 0
except Exception:
log.exception("jetlink: could not turn tinygrad's compile pool off")
try:
from tinygrad.tensor import Tensor
Tensor([0.0]).realize()
except Exception:
log.exception("jetlink: could not bring the gpu up before modeld goes realtime")
# the same trap for tinygrad's compile pool (engine/worker.py): created on
# the first compile, after modeld goes realtime, its handler threads sat at
# SCHED_FIFO 54 on core 7. An older tinygrad or PARALLEL=0 is not a failure
try:
from tinygrad.engine.worker import get_worker_pool
get_worker_pool()
except Exception:
log.exception("jetlink: could not start tinygrad's compile pool before modeld goes realtime")
class Warps:
"""The warps the build made for this device, as the fork's adapter says where."""
"""The warps this device's checkout has, where the fork's adapter says."""
def __init__(self, op):
self.op = op
# nothing compiles a warp at runtime and the build runs before manager, so
# the answer holds for the life of the process; the UI asks at 5 Hz
# nothing makes a warp at runtime and the checkout's are there before
# manager, so the answer holds for the life of the process; the UI asks
# at 5 Hz
self._built: bool | None = None
def geometry(self) -> tuple[int, int, int, int]:
"""(cam_w, cam_h, model_w, model_h) for this device: the choice modeld's
build makes, so the warp built is the one modeld asks for. If they
disagree, load() raises and the drive is small-model."""
"""(cam_w, cam_h, model_w, model_h) for this device: the warp modeld
loads. If the link's model disagrees, load() raises and the drive is
small-model."""
return tuple(self.op.camera())
def path(self, cam_w: int, cam_h: int, model_w: int, model_h: int) -> Path:
return Path(self.op.warp_path(cam_w, cam_h, model_w, model_h))
def is_cached(self, cam_w: int, cam_h: int, model_w: int, model_h: int) -> bool:
"""Is there a warp for this geometry?
Presence only. Staleness is the build's job: the target depends on tinygrad
and the capture sources. A pickle from an incompatible tinygrad raises in load().
"""
"""Is there a warp for this geometry? Presence only: a pickle from an
incompatible tinygrad raises in load()."""
return self.path(cam_w, cam_h, model_w, model_h).is_file()
def built(self) -> bool:
@@ -99,155 +89,190 @@ class Warps:
self._built = self.is_cached(*self.geometry())
return self._built
def load(self, cam_w: int, cam_h: int, model_w: int, model_h: int):
"""The built warp JIT. Raises if it is not there or is stale.
def load(self, cam_w: int, cam_h: int, model_w: int, model_h: int) -> dict:
"""The warp as openpilot pickles it: {'run': its TinyJit, 'input_specs':
{name: (shape, dtype, device)}}. Raises if it is not there or is not one
the frame loop can run.
modeld's big-model load is wrapped in the fallback to the small model, and a
warp that cannot be trusted must not reach the car.
"""
if not self.is_cached(cam_w, cam_h, model_w, model_h):
raise RuntimeError(f"no warp built for {cam_w}x{cam_h} -> {model_w}x{model_h}; "
"the fork's build makes it (python -m jetlink.openpilot.warp)")
with open(self.path(cam_w, cam_h, model_w, model_h), 'rb') as f:
path = self.path(cam_w, cam_h, model_w, model_h)
if not path.is_file():
raise RuntimeError(f"no warp for {cam_w}x{cam_h} -> {model_w}x{model_h} at {path}")
with open(path, 'rb') as f:
warp = pickle.load(f)
if not isinstance(warp, dict) or not {'run', 'input_specs'} <= warp.keys():
raise RuntimeError(f"{path.name} is not a driving warp: {type(warp).__name__}")
# a JIT pickled before TinyJit captured loads fine and computes nothing; one
# captured with a different call convention raises JitError on the first
# frame of a drive. Both have happened
captured = getattr(warp, 'captured', None)
# captured under other names raises JitError on the first frame of a drive
captured = getattr(warp['run'], 'captured', None)
if captured is None:
raise RuntimeError("cached warp was pickled before it captured; it computes nothing")
raise RuntimeError("the warp was pickled before it captured; it computes nothing")
names = list(getattr(captured, 'expected_names', []))
if names != WARP_INPUT_NAMES:
raise RuntimeError(f"cached warp expects {names}, call_warp passes {WARP_INPUT_NAMES}")
raise RuntimeError(f"the warp expects {names}, the frame loop passes {WARP_INPUT_NAMES}")
specs = warp['input_specs']
frames, tfm = tuple(specs['input_frame'][0]), tuple(specs['M_inv'][0])
if len(frames) != 2 or frames[0] != 2 or tfm != (2, 3, 3):
raise RuntimeError(f"the warp takes frames {frames} and transforms {tfm}, not two of each")
made = tuple(getattr(captured.ret, 'shape', ()))
if made != (2, 6, model_h // 2, model_w // 2):
raise RuntimeError(f"the warp makes {made}, not a {model_w}x{model_h} model's input")
return warp
def warm(warp, frame_size: int) -> None:
"""Run a loaded warp JIT until it is cheap to call. `frame_size` is the
camera's NV12 buffer size (ModelFace.frame_size).
class Warp:
"""The warp as modeld's frame loop runs it: start() with two camera buffers
and their transforms, wait(), and `output` holds the warped frame, where the
link sends it from.
Measured: loading 0.3 s, the first call 1.9 s, the second 5 ms. Paid on
modeld's frame loop that was ~26 dropped frames and 16 s of modeldLagging
after every join.
openpilot's warp takes both frames as one buffer, so start() copies the
camera buffers in, as modeld does, and the transforms beside them. Two
things the JIT alone does not do, measured on the comma:
- Its output lives in GPU memory the CPU reads through its cache. tinygrad
maps a QCOM buffer write-combined, which the CPU reads uncached: copying
the 393 KB out takes 2.9 ms, the kernel's copy straight from that mapping
7.3 ms. The Adreno 630 is IO-coherent, so KGSL memory flagged IOCOHERENT
and write-back is right to read once the GPU is done: 0.22 ms for the
kernel's copy, the GPU's own time unchanged. It moves before the first
call, which links the JIT to its buffers' addresses.
- TinyJit prepares and checks every call's inputs, a graph rewrite per
input: 0.97 ms of a 1.93 ms call. Every frame's inputs are the same two
buffers, which start() writes into, so they are checked once, by the
warm-up's calls through TinyJit, and a frame replays the capture.
The warm-up, the link of the JIT and its first runs, is paid here rather
than on modeld's frame loop.
"""
import numpy as np
def __init__(self, warp: dict, frame_size: int):
import numpy as np
from tinygrad.device import Device
from tinygrad.tensor import Tensor
jit, specs = warp['run'], warp['input_specs']
(frames_shape, _, _), (tfm_shape, _, _) = specs['input_frame'], specs['M_inv']
# what it reads of each camera buffer: modeld's frame_copy_size, short of
# the buffer's end
self._frame_size = frames_shape[1]
if self._frame_size > frame_size:
raise RuntimeError(f"the warp reads {self._frame_size} bytes a frame, past a {frame_size} byte camera buffer")
out = jit.captured.ret.uop.base.buffer
self._device = out.device
if self._device.startswith('QCOM'):
make_coherent(out)
# the two buffers every frame passes, written in place by start()
self._tensors = {name: Tensor(np.zeros(shape, dtype=dtype), device=device).realize()
for name, (shape, dtype, device) in specs.items()}
for _ in range(2):
jit(**self._tensors)
self.wait = Device[self._device].synchronize
self.wait()
self.output = out.as_memoryview(allow_zero_copy=True)
self._frames = np.frombuffer(self._view('input_frame'), dtype=np.uint8).reshape(frames_shape)
self._at = [self._frames[i].ctypes.data for i in range(2)]
self._tfm = np.frombuffer(self._view('M_inv'), dtype=np.float32).reshape(tfm_shape)
self._replay = jit.captured
self._inputs = [self._tensors[name].uop.base for name in WARP_INPUT_NAMES]
def _view(self, name: str) -> memoryview:
"""The CPU's view of an input buffer, not a copy of it."""
return self._tensors[name].uop.base.buffer.as_memoryview(allow_zero_copy=True)
def start(self, frame: int, big_frame: int, tfm, big_tfm) -> None:
"""Warp the camera buffers at these addresses under their transforms.
`output` is the frame once wait() returns, until the next start(). The
GPU is idle here: every start() is waited for before the next."""
ctypes.memmove(self._at[0], frame, self._frame_size)
ctypes.memmove(self._at[1], big_frame, self._frame_size)
self._tfm[0] = tfm
self._tfm[1] = big_tfm
self._replay(self._inputs, {})
def make_coherent(out) -> None:
"""Move a QCOM buffer to KGSL memory flagged IOCOHERENT and write-back, so
the CPU reads it through its cache once the GPU is done (see Warp). Raises
if the kernel keeps either flag back (the allocation's record holds its
answer): write-back memory that is not coherent reads stale frames.
For an adapter's model_warp too. Move a buffer before the first call of
the JIT that writes it: that call links its address into the JIT, which
would keep writing the memory this frees."""
from tinygrad.device import Device
from tinygrad.tensor import Tensor
frames = [np.zeros(frame_size, dtype=np.uint8) for _ in range(2)]
blobs = [Tensor.from_blob(f.ctypes.data, (frame_size,), dtype='uint8', device=Device.DEFAULT) for f in frames]
eye = [np.eye(3, dtype=np.float32) for _ in range(2)]
tfm, big_tfm = (Tensor(e, device='NPY').realize() for e in eye)
for _ in range(2):
call_warp(warp, tfm, big_tfm, blobs[0], blobs[1]).realize()
Device.default.synchronize()
dev = Device[out.device]
mem = dev._gpu_alloc(out.nbytes, flags=COHERENT_WRITEBACK)
if mem.meta[0].flags & COHERENT_WRITEBACK != COHERENT_WRITEBACK:
dev._gpu_free(mem)
raise RuntimeError(f"the GPU driver kept back IO-coherent memory (flags {mem.meta[0].flags:#x})")
out.deallocate()
out.allocate(opaque=mem)
def prepare_reset(model):
"""Capture the small model's reset before driving, keeping its JIT's buffer identities.
Its history is stale after the Jetson ran, so a fallback starts from the same
zero history as modeld startup. Nothing is allocated or compiled on the
failure frame.
The small model is whatever bundle the user picked, stock modeld's or a
modeld_v2 one, so the history is whatever GPU queues it has; the NPY tensors
are zeroed through their numpy views. Duck-typed on openpilot's ModelState:
input_queues, numpy_inputs (modeld_v2) or npy (modeld), prev_desire. The
fork's tests pin those names.
"""
def reset_queues(queues, arrays, prev_desire=None):
"""A small model's reset, captured now: `queues`, its tensors on the GPU,
zeroed by one TinyJit, then `prev_desire` and each numpy array in `arrays`
in place. Every buffer keeps its identity, which the model's own JIT is
linked to, and the reset allocates and compiles nothing, so it may run on
the frame thread. What an adapter's small_reset returns."""
from tinygrad import Tensor, TinyJit
queues = tuple(q for q in model.input_queues.values() if q.device != 'NPY')
npy = model.numpy_inputs if hasattr(model, 'numpy_inputs') else model.npy
queues, arrays = tuple(queues), tuple(arrays)
@TinyJit
def clear():
Tensor.realize(*(q.assign(0) for q in queues))
for _ in range(3):
clear()
# TinyJit captures on its second call, and one with nothing to run raises
# there. Its kernels compile here, after init_device() turned the compile
# pool off
if queues:
for _ in range(3):
clear()
def reset():
clear()
model.prev_desire.fill(0)
for array in npy.values():
if queues:
clear()
if prev_desire is not None:
prev_desire.fill(0)
for array in arrays:
array.fill(0)
return reset
# -- the build ------------------------------------------------------------------
def reset_for_stock(state, prev_desire=None):
"""The reset of stock modeld's ModelState layout, captured now, as its warmup
zeroes it: the recurrent state on the GPU (input_queues named by
state_pairs) and the one packed host buffer (packed_input), and the desire
edge. `state` is the ModelState, or a modeld_v2 native bundle's adapter,
which keeps the same layout."""
return reset_queues([state.input_queues[name] for name in state.state_pairs], (state.packed_input,), prev_desire)
def compile_warp(graph, frame_size: int, out: Path) -> Path:
"""JIT the warp graph and pickle it to `out`. Holds the GPU while it runs.
Three runs before pickling: TinyJit captures on the second call, and a
pickle taken earlier is an empty jit that silently does nothing.
def prepare_reset(model):
"""Capture the small model's reset before driving, keeping its JIT's buffer identities.
Its history is stale after the Jetson ran, so a fallback starts from the
zero history modeld's warmup leaves it at. Nothing is allocated or compiled
on the failure frame, so never through modeld_v2's reset_warmup_buffers(),
which compiles on it. jetlink's own, for an adapter without small_reset
(interface.ModelSide).
The small model is whatever the fork's modeld runs, and each keeps its
history its own way. Stock modeld's ModelState, and a modeld_v2 native
bundle's adapter: the recurrent state on the GPU (state_pairs) and one
packed host buffer (packed_input), as their warmup zeroes them. A modeld_v2
legacy bundle's adapter: history queues on the GPU, and numpy inputs. Any
other ModelState with input_queues (StarPilot's): every queue on the GPU,
and its numpy inputs (numpy_inputs, or npy); its own _reset_state() makes
new tensors, which its JIT is not linked to. The fork's tests pin those names.
"""
import numpy as np
from tinygrad.device import Device
from tinygrad.engine.jit import TinyJit
from tinygrad.tensor import Tensor
warp_jit = TinyJit(graph, prune=True)
# one set of input tensors: TinyJit captures against the buffers it is
# first handed. Random so nothing constant-folds
rng = np.random.default_rng(42)
tfm_npy, big_tfm_npy = np.eye(3, dtype=np.float32), np.eye(3, dtype=np.float32)
tfm = Tensor(tfm_npy, device='NPY')
big_tfm = Tensor(big_tfm_npy, device='NPY')
frame = Tensor.randint(frame_size, low=0, high=256, dtype='uint8', device=Device.DEFAULT).realize()
big_frame = Tensor.randint(frame_size, low=0, high=256, dtype='uint8', device=Device.DEFAULT).realize()
for _ in range(3):
tfm_npy[:] = rng.standard_normal((3, 3)).astype(np.float32)
big_tfm_npy[:] = rng.standard_normal((3, 3)).astype(np.float32)
call_warp(warp_jit, tfm, big_tfm, frame, big_frame).realize()
Device.default.synchronize()
out = Path(out)
out.parent.mkdir(parents=True, exist_ok=True)
# through a temporary: a compile killed mid-write leaves nothing under the
# name load() opens
tmp = out.with_suffix('.pkl.tmp')
with open(tmp, 'wb') as f:
pickle.dump(warp_jit, f)
tmp.replace(out)
return out
def size(text: str) -> tuple[int, int]:
"""'WxH' as (w, h)."""
w, sep, h = text.lower().partition('x')
if not sep:
raise argparse.ArgumentTypeError(f"expected WxH, not {text!r}")
try:
return int(w), int(h)
except ValueError:
raise argparse.ArgumentTypeError(f"expected WxH, not {text!r}") from None
def main(argv: list[str] | None = None) -> None:
"""Build the warp for one camera, as the fork's build runs it."""
from jetlink.openpilot.interface import load_adapter
p = argparse.ArgumentParser(prog='python -m jetlink.openpilot.warp', description=main.__doc__)
p.add_argument('--adapter', required=True, help="the fork's adapter module")
p.add_argument('--camera', type=size, required=True, help='camera resolution, WxH')
p.add_argument('--model', type=size, required=True, help='model input, WxH')
p.add_argument('--output', type=Path, required=True)
args = p.parse_args(argv)
(cam_w, cam_h), (model_w, model_h) = args.camera, args.model
op = load_adapter(args.adapter)
print(f"Compiling jetlink warp for {cam_w}x{cam_h} -> {model_w}x{model_h}...")
# before anything of tinygrad's is imported here: comma's graph module
# patches tinygrad's firmware fetch as it loads
graph, frame_size = op.make_warp(cam_w, cam_h, model_w, model_h)
out = compile_warp(graph, frame_size, args.output)
print(f" Saved to {out}")
if __name__ == "__main__":
sys.exit(main())
adapter = getattr(model, 'adapter', None)
keeper = model if adapter is None else adapter
prev_desire = getattr(model, 'prev_desire', None)
if adapter.is_native if adapter is not None else hasattr(model, 'state_pairs'):
return reset_for_stock(keeper, prev_desire)
queues = [q for q in keeper.input_queues.values() if q.device != 'NPY']
arrays = (keeper.numpy_inputs if hasattr(keeper, 'numpy_inputs') else keeper.npy).values()
return reset_queues(queues, arrays, prev_desire)
+56 -1
View File
@@ -15,6 +15,7 @@ vectored write out, one read into a preallocated buffer back.
"""
from __future__ import annotations
import functools
import struct
from enum import IntEnum
@@ -42,7 +43,7 @@ GADGET_TX_ALIGN = 16 * 1024
# The comma's gadget as a USB host finds it: these IDs (pid.codes' test
# allocation; get a real PID before distributing this), which
# scripts/comma/jetlink-root.sh presents, then the link's interface by its class
# jetlink/comma/jetlink-root.sh presents, then the link's interface by its class
# triple (transport/ffs.py), because the comma set to iOS presents a composite
# gadget and a reordered config could move the number. Endpoint addresses are
# read from the descriptors, never assumed: FunctionFS renumbers them at bind.
@@ -114,6 +115,54 @@ INFER_RESP_SIZE = struct.calcsize(INFER_RESP_FMT)
_infer_resp = struct.Struct(INFER_RESP_FMT)
# A frame over the phone's cable as UDP datagrams (TcpTransport.use_datagrams):
# the INFER_REQ's stream bytes, header and pad included, cut into equal pieces
# of at most DATAGRAM_PAYLOAD, each behind a DATAGRAM_HEADER. The comma's kernel
# cuts a datagram into IP fragments after netfilter and routing, so the stack's
# per-packet work runs once a datagram, about 7 times a frame, where TCP runs it
# for each of ~272 segments: measured 7.35 vs 4.3 ms a frame.
# The server offers it in HELLO_RESP (frame_port, frame_token) on the cable only.
# A datagram with another token is from an earlier session and is dropped.
DATAGRAM_MAGIC = 0x4D52464A # b'JFRM'
# magic, token, seq, offset, total: where this piece goes in a message of `total` bytes
DATAGRAM_HEADER_FMT = '<IIIII'
DATAGRAM_HEADER_SIZE = struct.calcsize(DATAGRAM_HEADER_FMT)
# UDP carries 65507 bytes at most; equal pieces of up to this, 7 for a big model's frame
DATAGRAM_PAYLOAD = 65000
_datagram_header = struct.Struct(DATAGRAM_HEADER_FMT)
def pack_datagram_header(token: int, seq: int, offset: int, total: int) -> bytes:
return _datagram_header.pack(DATAGRAM_MAGIC, token, seq, offset, total)
def pack_datagram_header_into(buf, token: int, seq: int, offset: int, total: int) -> None:
_datagram_header.pack_into(buf, 0, DATAGRAM_MAGIC, token, seq, offset, total)
def unpack_datagram_header(buf) -> tuple[int, int, int, int]:
"""(token, seq, offset, total); ProtocolError for anything not ours."""
magic, token, seq, offset, total = _datagram_header.unpack_from(buf)
if magic != DATAGRAM_MAGIC:
raise ProtocolError(f"bad datagram magic 0x{magic:08x}")
return token, seq, offset, total
def datagram_pieces(total: int) -> tuple[tuple[int, int], ...]:
"""(offset, size) of each datagram for a message of `total` bytes: as few as
DATAGRAM_PAYLOAD allows, equal to within a byte. The same every frame of a
model, so kept."""
return _pieces(total, DATAGRAM_PAYLOAD)
@functools.lru_cache(maxsize=8)
def _pieces(total: int, payload: int) -> tuple[tuple[int, int], ...]:
n = max(1, -(-total // payload))
base, extra = divmod(total, n)
sizes = [base + (1 if i < extra else 0) for i in range(n)]
return tuple((sum(sizes[:i]), size) for i, size in enumerate(sizes))
class ProtocolError(RuntimeError):
pass
@@ -153,3 +202,9 @@ class Status(IntEnum):
BAD_SHAPE = 2
INFER_FAILED = 3
NOT_FINITE = 4 # model produced NaN/Inf; caller must fall back
class NotFinite(ValueError):
"""A frame's output with a NaN or an inf in it, by the server's word
(Status.NOT_FINITE) or the comma's own check: the host answered, with
nothing to drive on, and the link is as good as it was. Not a LinkError."""
+3 -4
View File
@@ -11,8 +11,8 @@ openpilot folds these into the tinygrad JIT on the GPU. Shipping the history
across the link would cost ~10 MB a frame, so the queues live on the server and
the comma sends only the newest warped frame and the packed scalars. The hidden
state the graph returns stays there too: the next frame pushes it into the
features queue, where modeld's prev_feat went. The fork's tests/test_queues.py
checks this against the tinygrad original, and the staging conformance fixture
features queue, where modeld's prev_feat went. tests/test_queues.py holds this
to openpilot's tinygrad original, and the staging conformance fixture
(JetlinkKit/Scripts/make_conformance_fixtures.py) holds the Swift server's
queues to this, bit for bit.
@@ -59,12 +59,11 @@ class PolicyQueues:
did. The queues stay until the client resets them."""
self.prev_feat[...] = 0
def after_run(self, outputs: dict[str, np.ndarray], dest=None) -> None:
def after_run(self, outputs: dict[str, np.ndarray]) -> None:
"""Keep this frame's hidden state for the next one.
Only after a frame whose outputs are all finite: modeld fed back only
what infer_end returned, and it raises on NOT_FINITE and on a failed run.
`dest` is unused; the fork's test_queues still passes it.
"""
self.prev_feat.reshape(-1)[...] = np.asarray(outputs[DRIVING_OUTPUT], np.float32).reshape(-1)[self._hidden]
+2 -2
View File
@@ -4,8 +4,8 @@ Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
Which large models exist and how to get their bytes: sunnypilot's catalog
(catalog) and a model's ONNX by its git-lfs pointer (lfs).
Which large models exist and how to get their bytes: the model index, which
names every big model's ONNX (index), and an ONNX by its oid (lfs).
The comma imports both, so this package stays stdlib only and imports nothing
itself. The server's side of it is JetlinkRegistry in Swift, held to these
-189
View File
@@ -1,189 +0,0 @@
"""
Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
sunnypilot's big-model catalog: which large models exist and which commit each one is.
The catalog is the same JSON the comma's model manager caches for its chestnut
slot, so a model picked here is a model the comma can ask for. A bundle's
artifacts are tinygrad pkls for a GPU we do not have; the only field that
matters is `ref`, the comma openpilot commit the bundle was compiled from,
because that commit's ONNX is what a jetlink server runs.
Stdlib only, and every network call takes an `opener` so tests stay offline.
"""
from __future__ import annotations
import json
import re
import urllib.error
import urllib.request
from dataclasses import dataclass
CATALOG_URL_TEMPLATE = 'https://raw.githubusercontent.com/sunnypilot/sunnypilot-models/refs/heads/gh-pages/docs/driving_models_chestnut_v{version}.json'
# v26 is v25 plus Cinque Terre V3, at the same selector version. v27 onwards
# are selector 20 and a newer tinygrad, for sunnypilot's next sync.
CATALOG_VERSION = 26
CATALOG_URL = CATALOG_URL_TEMPLATE.format(version=CATALOG_VERSION)
# sunnypilot publishes a new catalog version for new models or a new runtime,
# and keeps the old ones. The versions after the pinned one are probed up to
# the first that is not there, so a model published later is listed without a
# release of this package. See merge_catalogs.
PROBE_LIMIT = 10
# The selector version the fork requires (REQUIRED_JSON_VERSION on the comma).
# It is a string in the JSON; bundles at any other version describe fields we
# would misread.
REQUIRED_SELECTOR_VERSION = 19
# Cinque Terre V3 Model (September 17, 2026)
DEFAULT_BIG_MODEL_REF = 'bf3e3631b3f91d92a1020a5e0dd4298b93ff4244'
# its name as sunnypilot's catalog lists it, without the build date: what a
# comma with no catalog to name it from shows (jetlink.openpilot, on a fork
# without sunnypilot's model manager)
DEFAULT_BIG_MODEL_NAME = 'Cinque Terre V3 Model'
CATALOG_TIMEOUT = 10.0
_REF = re.compile(r'[0-9a-f]{40}')
_SHA256 = re.compile(r'[0-9a-f]{64}')
class RegistryError(Exception):
"""Anything the registry refuses to do."""
class NetworkError(RegistryError):
"""A server could not be reached or did not answer sensibly."""
class VerifyError(RegistryError):
"""Bytes arrived, but not the bytes that were asked for."""
class NotFound(NetworkError):
"""The server answered that there is nothing at the URL."""
@dataclass(frozen=True)
class CatalogModel:
name: str
short_name: str
ref: str
build_time: str
index: int
def is_ref(value: str) -> bool:
"""A comma openpilot commit: 40 lowercase hex characters."""
return isinstance(value, str) and _REF.fullmatch(value) is not None
def is_sha256(value: str) -> bool:
"""A model identity: 64 lowercase hex characters, which is also the LFS oid."""
return isinstance(value, str) and _SHA256.fullmatch(value) is not None
def parse_catalog(data: dict) -> list[CatalogModel]:
"""The big-model bundles, newest first. No IO, and no bundle can raise.
A malformed entry in a catalog served to every comma must cost that entry and
nothing else, so each bundle is parsed in its own try.
"""
found: dict[str, CatalogModel] = {}
for bundle in _bundles(data):
try:
ref = bundle.get('ref')
if not is_ref(ref) or ref in found:
continue
if _selector(bundle) != REQUIRED_SELECTOR_VERSION or not bundle.get('is_big'):
continue
found[ref] = CatalogModel(name=str(bundle.get('display_name') or ref[:10]), short_name=str(bundle.get('short_name') or ''),
ref=ref, build_time=str(bundle.get('build_time') or ''), index=int(bundle.get('index', 0)))
except (AttributeError, TypeError, ValueError):
continue
return sorted(found.values(), key=lambda m: m.index, reverse=True)
def http_get(url: str, timeout: float, opener=None, limit: int = -1) -> bytes:
"""The body at `url`, at most `limit` bytes. A 404 is NotFound, and every
other failure a NetworkError, so a caller only catches what it treats apart."""
opener = opener or urllib.request.urlopen
try:
with opener(url, timeout=timeout) as response:
return response.read(limit)
except urllib.error.HTTPError as e:
raise (NotFound if e.code == 404 else NetworkError)(f"could not fetch {url}: {e}") from e
except (OSError, ValueError) as e:
raise NetworkError(f"could not fetch {url}: {e}") from e
def http_json(url: str, timeout: float, opener=None, kind: type = dict):
"""http_get, parsed, and of the type asked for."""
body = http_get(url, timeout, opener)
try:
data = json.loads(body.decode())
except ValueError as e:
raise NetworkError(f"{url} did not serve JSON: {e}") from e
if not isinstance(data, kind):
raise NetworkError(f"{url} did not serve a JSON {kind.__name__}")
return data
def fetch_catalog(url: str = CATALOG_URL, timeout: float = CATALOG_TIMEOUT, opener=None) -> dict:
"""The catalog JSON. Every failure, transport or content, is a NetworkError."""
return http_json(url, timeout, opener)
def fetch_catalogs(opener=None) -> dict:
"""The pinned catalog merged with every one sunnypilot has published since,
whose commits the server runs too. The probe stops at the first version that
is not there. Any other failure raises: a short list would drop a model
found only past it from whatever the caller caches, so the caller keeps its
last complete one instead."""
found = [fetch_catalog(CATALOG_URL, opener=opener)]
for v in range(CATALOG_VERSION + 1, CATALOG_VERSION + 1 + PROBE_LIMIT):
try:
found.append(fetch_catalog(CATALOG_URL_TEMPLATE.format(version=v), opener=opener))
except NotFound:
break
return merge_catalogs(found)
def merge_catalogs(catalogs: list[dict], selector: int = REQUIRED_SELECTOR_VERSION) -> dict:
"""One catalog in the first one's shape, listing every big model of them all.
A model some catalog lists at `selector` comes through as published, so a
chestnut can still fetch its build. One listed only at another selector
version, which is where sunnypilot puts every model once it moves runtimes,
comes from the newest catalog that has it, retyped to `selector` and with no
artifacts: an accelerator runs the commit's ONNX and needs nothing else from
the entry, and a chestnut has nothing to download.
"""
if not catalogs:
return {}
kept: dict[str, dict] = {}
others: dict[str, dict] = {}
for data in catalogs:
for bundle in _bundles(data):
ref = bundle.get('ref')
if not is_ref(ref):
continue
if _selector(bundle) == selector:
kept.setdefault(ref, bundle)
elif bundle.get('is_big'):
others[ref] = bundle # the newest catalog's entry wins
extra = [{**b, 'minimum_selector_version': str(selector), 'models': []} for ref, b in others.items() if ref not in kept]
return {**catalogs[0], 'bundles': [*kept.values(), *extra]}
def _bundles(data: dict) -> list[dict]:
bundles = data.get('bundles') if isinstance(data, dict) else None
return [b for b in bundles if isinstance(b, dict)] if isinstance(bundles, list) else []
def _selector(bundle: dict) -> int | None:
try:
return int(bundle.get('minimum_selector_version', 0))
except (TypeError, ValueError):
return None
+193
View File
@@ -0,0 +1,193 @@
"""
Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
Which big models a Jetson can run, and which ONNX each one is: the model
index, zoompilot/jetlink-model-index.
A big model is a comma openpilot commit (its ref), and what a Jetson runs is
the ONNX that commit was built from. Finding that ONNX takes reading comma's
trees, its precompiled pkls' weights and its model repo, so the index repo does
it once an hour for every commit any catalog, comma master or comma pull
request has named, and publishes the answers:
default the model a Jetson runs with nothing picked
refs every big-model commit ever seen -> {oid, size}: an old pick still resolves
onnx every ONNX comma has published -> {size}: a pick by hash alone is sized
models what to list, one entry per ONNX, in display order, with its folder
and the catalog fields a list in sunnypilot's shape needs
The comma and the server each keep the last index that parsed, so both work
offline with what they had, and neither looks anything up itself.
Stdlib only, and every network call takes an `opener` so tests stay offline.
"""
from __future__ import annotations
import json
import re
import urllib.request
from dataclasses import dataclass, field
INDEX_URL = 'https://raw.githubusercontent.com/zoompilot/jetlink-model-index/main/index/v1.json'
# the index's own version: another one describes fields we would misread
SCHEMA = 1
INDEX_TIMEOUT = 10.0
# a listed model with no folder of its own
OTHER_FOLDER = 'Other Models'
# the runtime fields of a listed model the index has none for (an index older
# than them): what sunnypilot's big models are built for
RUNTIME = {'generation': '12', 'environment': 'development', 'runner': 'tinygrad'}
# what runs with nothing picked before the comma or server has an index, which
# names its own (ModelIndex.default): Cinque Terre V3 Model (September 17, 2026)
DEFAULT_BIG_MODEL_REF = 'bf3e3631b3f91d92a1020a5e0dd4298b93ff4244'
# its name without the build date: what a comma with no index to name it from
# shows (jetlink.openpilot, on a fork without sunnypilot's model manager)
DEFAULT_BIG_MODEL_NAME = 'Cinque Terre V3 Model'
_REF = re.compile(r'[0-9a-f]{40}')
_SHA256 = re.compile(r'[0-9a-f]{64}')
class RegistryError(Exception):
"""Anything the registry refuses to do."""
class NetworkError(RegistryError):
"""A server could not be reached or did not answer sensibly."""
class VerifyError(RegistryError):
"""Bytes arrived, but not the bytes that were asked for."""
class IndexInvalid(RegistryError):
"""An index that cannot be used: another schema, or nothing listed."""
def is_ref(value) -> bool:
"""A comma openpilot commit: 40 lowercase hex characters."""
return isinstance(value, str) and _REF.fullmatch(value) is not None
def is_sha256(value) -> bool:
"""A model identity: 64 lowercase hex characters, which is also the LFS oid."""
return isinstance(value, str) and _SHA256.fullmatch(value) is not None
@dataclass(frozen=True)
class Pointer:
oid: str # the ONNX SHA-256
size: int
@dataclass(frozen=True)
class IndexModel:
ref: str
oid: str
size: int
name: str # as sunnypilot's catalog names it, build date and all
short_name: str # '' when the index has none
folder: str
build_time: str # ISO-8601, or ''
pr: int | None # the comma pull request a model listed only as one is
is_20hz: bool
generation: str # the runtime it was built for, as sunnypilot's catalog says
environment: str
runner: str
@dataclass(frozen=True)
class ModelIndex:
models: tuple[IndexModel, ...] # in display order
refs: dict[str, Pointer] # every ref the index resolves, the listed ones included
sizes: dict[str, int] # every ONNX the index knows, by oid
default: str | None = None # the listed ref that runs with nothing picked
# the listed models by their ONNX: one entry per ONNX, so one each
by_oid: dict[str, IndexModel] = field(init=False, repr=False, compare=False)
def __post_init__(self):
object.__setattr__(self, 'by_oid', {m.oid: m for m in reversed(self.models)})
def pointer(self, ref: str) -> Pointer | None:
return self.refs.get(ref)
def size(self, oid: str) -> int | None:
return self.sizes.get(oid)
def listed(self, ref: str) -> IndexModel | None:
"""The listed model for a ref's ONNX: its own entry, or for a recompile of a
listed model, the newest ref's (each ONNX is listed once)."""
pointer = self.refs.get(ref)
return self.by_oid.get(pointer.oid) if pointer is not None else None
def _pointer(value) -> Pointer | None:
if not isinstance(value, dict) or not is_sha256(value.get('oid')):
return None
size = _size(value.get('size'))
return Pointer(value['oid'], size) if size else None
def _size(value) -> int | None:
# bool is an int; a size is not
return value if isinstance(value, int) and not isinstance(value, bool) and value > 0 else None
def _text(value) -> str:
return value if isinstance(value, str) else ''
def parse_index(data) -> ModelIndex:
"""The index, or IndexInvalid naming why it cannot be used. No IO. An entry
that is malformed costs that entry and nothing else; an index of another
schema, or one listing nothing, is refused whole, so a caller keeps the
last one that parsed rather than an empty list."""
if not isinstance(data, dict):
raise IndexInvalid('the index is not a JSON object')
if data.get('schema') != SCHEMA:
raise IndexInvalid(f"the index is schema {data.get('schema')!r}, not {SCHEMA}")
refs = {ref: p for ref, value in _items(data.get('refs')) if is_ref(ref) and (p := _pointer(value))}
sizes = {oid: s for oid, value in _items(data.get('onnx')) if is_sha256(oid) and isinstance(value, dict) and (s := _size(value.get('size')))}
models: dict[str, IndexModel] = {}
for entry in data.get('models') if isinstance(data.get('models'), list) else []:
if not isinstance(entry, dict) or not is_ref(entry.get('ref')) or entry['ref'] in models or (p := _pointer(entry)) is None:
continue
ref = entry['ref']
models[ref] = IndexModel(ref=ref, oid=p.oid, size=p.size, name=_text(entry.get('name')) or ref[:10],
short_name=_text(entry.get('short_name')), folder=_text(entry.get('folder')) or OTHER_FOLDER,
build_time=_text(entry.get('build_time')), pr=_size(entry.get('pr')),
is_20hz=entry['is_20hz'] if isinstance(entry.get('is_20hz'), bool) else True,
**{k: _text(entry.get(k)) or v for k, v in RUNTIME.items()})
if not models:
raise IndexInvalid('the index lists no model')
# a listed model is what is shown and run, so its own entry names its ONNX
for m in models.values():
refs[m.ref] = Pointer(m.oid, m.size)
for p in refs.values():
sizes.setdefault(p.oid, p.size)
default = data.get('default')
return ModelIndex(models=tuple(models.values()), refs=refs, sizes=sizes, default=default if default in models else None)
def _items(value) -> list[tuple]:
return list(value.items()) if isinstance(value, dict) else []
def fetch_index(url: str = INDEX_URL, timeout: float = INDEX_TIMEOUT, opener=None) -> tuple[dict, ModelIndex]:
"""The index as served, and parsed: the raw JSON is what a caller keeps.
A transport failure is a NetworkError, an index that cannot be used
IndexInvalid; both are RegistryErrors, and either way nothing is kept."""
opener = opener or urllib.request.urlopen
try:
with opener(url, timeout=timeout) as response:
body = response.read()
except (OSError, ValueError) as e: # HTTPError is an OSError
raise NetworkError(f"could not fetch {url}: {e}") from e
try:
data = json.loads(body.decode())
except ValueError as e:
raise NetworkError(f"{url} did not serve JSON: {e}") from e
return data, parse_index(data)
+90 -145
View File
@@ -4,21 +4,14 @@ Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
Getting a large model's ONNX by its git-lfs oid.
Getting a large model's ONNX by its oid, the one the model index names
(jetlink.registry.index).
comma overwrites one file per model, so the commit is the only name a big
model's ONNX has. GitHub's raw host serves the LFS pointer for any commit it
holds, merged or not, and that pointer carries the oid and size the comma will
ask a jetlink server for. The bytes themselves are on comma's LFS servers,
which is GitLab and not GitHub: each is asked in turn because which one has an
object varies with the model's age.
Since openpilot #38930 (2026-09-16) a commit can ship a precompiled tinygrad
pkl instead, with no ONNX in the tree at all; Cinque Terre V3 is one. Its
subject names the export ("Use f78ed37d for the precompiled eGPU driving
model") and the ONNX is in comma's HuggingFace model repo, in the folder that
id starts. sunnypilot's model builds find it the same way. That repo speaks
the LFS batch protocol too, so it is one more endpoint to ask.
The bytes are on comma's LFS servers. Since openpilot #39206 comma's own LFS
client stores objects in a HuggingFace bucket, read by oid; the older LFS
servers, and comma's model repo for the exports behind a precompiled pkl,
speak the LFS batch protocol, and which one has an object varies with the
model's age, so each is asked in turn.
The zoompilot fork downloads through this module too, asking its own
.lfsconfig endpoint first. No openpilot imports.
@@ -28,38 +21,29 @@ from __future__ import annotations
import hashlib
import json
import logging
import re
import shutil
import urllib.parse
import urllib.request
from collections.abc import Callable
from dataclasses import dataclass
from pathlib import Path
from jetlink.registry.catalog import NetworkError, NotFound, RegistryError, VerifyError, http_get, http_json, is_sha256
from jetlink.registry.index import NetworkError, Pointer, RegistryError, VerifyError
__all__ = ['BUCKET', 'LFS_ENDPOINTS', 'Pointer', 'lfs_download', 'lfs_hrefs', 'lfs_resolve']
log = logging.getLogger('jetlink.registry')
BIG_ONNX = 'big_driving_supercombo.onnx'
POINTER_URL = 'https://raw.githubusercontent.com/commaai/openpilot/{ref}/openpilot/selfdrive/modeld/models/' + BIG_ONNX
# a commit's subject without the API, whose anonymous limit a car behind CGNAT shares
COMMIT_PATCH_URL = 'https://github.com/commaai/openpilot/commit/{ref}.patch'
# where comma's LFS client keeps objects since openpilot #39206. A HuggingFace
# bucket is not an LFS server: an object is read by its oid under it (lfs_resolve)
BUCKET = 'https://huggingface.co/buckets/commaai/openpilot-lfs'
DRIVING_MODELS_REPO = 'commaai/openpilot_driving_models'
DRIVING_MODELS_TREE_URL = f'https://huggingface.co/api/models/{DRIVING_MODELS_REPO}/tree/main'
LFS_ENDPOINTS = (
BUCKET,
'https://gitlab.com/commaai/openpilot-lfs.git/info/lfs', # every object, older and PR-branch models included
'https://huggingface.co/commaai/openpilot-lfs.git/info/lfs', # where comma is moving them; the current ones
'https://huggingface.co/commaai/openpilot-lfs.git/info/lfs', # the current ones
f'https://huggingface.co/{DRIVING_MODELS_REPO}.git/info/lfs', # the exports behind a precompiled pkl
)
# an export folder is a uuid; the subject names its first eight
_EXPORT_ID = re.compile(r'\b[0-9a-f]{8}\b')
LFS_MEDIA_TYPE = 'application/vnd.git-lfs+json'
POINTER_TIMEOUT = 10.0
CONNECT_TIMEOUT = 30.0
# A pointer is 134 bytes. Anything larger is the ONNX itself, served by a host
# that resolved the LFS filter for us, and reading a gigabyte to find that out
# is not on.
POINTER_MAX = 4096
CHUNK = 4 << 20
FREE_SLACK = 64 << 20
@@ -67,102 +51,30 @@ ProgressFn = Callable[[float], None]
StopFn = Callable[[], bool]
@dataclass(frozen=True)
class Pointer:
oid: str # the ONNX SHA-256
size: int
def parse_pointer_text(text: str) -> Pointer | None:
"""The oid and size in a git-lfs pointer's text, or None if it is not one."""
if not isinstance(text, str) or len(text.encode('utf-8', 'replace')) > POINTER_MAX:
return None
oid = None
size = None
for line in text.splitlines():
key, _, value = line.partition(' ')
if key == 'oid':
oid = value.removeprefix('sha256:').strip()
elif key == 'size':
try:
size = int(value)
except ValueError:
return None
if not is_sha256(oid) or size is None or size <= 0:
return None
return Pointer(oid, size)
def fetch_pointer(ref: str, timeout: float = POINTER_TIMEOUT, opener=None) -> Pointer:
"""The oid and size of the ONNX at a comma commit: in its tree, or for a
commit that ships a precompiled pkl instead, the export its subject names."""
def _bucket_href(bucket: str, pointer: Pointer, timeout: float, opener) -> str | None:
"""A bucket's address for the object, or None when it does not have it or
cannot be reached: its first byte is asked for, as cheap as a HEAD."""
url = f"{bucket}/resolve/sha256/{pointer.oid}"
try:
text = http_get(POINTER_URL.format(ref=ref), timeout, opener, POINTER_MAX).decode('utf-8', 'replace')
except NotFound:
return fetch_export_pointer(ref, timeout=timeout, opener=opener)
pointer = parse_pointer_text(text)
if pointer is None:
raise RegistryError(f"{ref[:10]} did not serve an lfs pointer")
return pointer
def commit_subject(ref: str, timeout: float = POINTER_TIMEOUT, opener=None) -> str:
"""A comma commit's subject line, from the head of its patch."""
url = COMMIT_PATCH_URL.format(ref=ref)
lines = http_get(url, timeout, opener, POINTER_MAX).decode('utf-8', 'replace').splitlines()
for i, line in enumerate(lines):
if line.startswith('Subject:'):
subject = [line.removeprefix('Subject:').strip()]
# a long subject is folded onto indented lines; the headers end at a blank one
for cont in lines[i + 1:]:
if not cont[:1].isspace() or not cont.strip():
break
subject.append(cont.strip())
return re.sub(r'^\[PATCH[^\]]*\]\s*', '', ' '.join(subject))
raise RegistryError(f"{url} has no subject line")
def _tree(path: str, timeout: float, opener) -> list[dict]:
url = DRIVING_MODELS_TREE_URL + (f"/{urllib.parse.quote(path)}?recursive=true" if path else '')
return [e for e in http_json(url, timeout, opener, list) if isinstance(e, dict) and isinstance(e.get('path'), str)]
def fetch_export_pointer(ref: str, timeout: float = POINTER_TIMEOUT, opener=None) -> Pointer:
"""The big ONNX a precompiled-pkl commit was built from, in comma's model repo."""
subject = commit_subject(ref, timeout=timeout, opener=opener)
ids = list(dict.fromkeys(_EXPORT_ID.findall(subject)))
if not ids:
raise RegistryError(f"{ref[:10]} has no {BIG_ONNX} and its subject names no export: {subject!r}")
folders = [e['path'] for e in _tree('', timeout, opener) if e.get('type') == 'directory']
for export in ids:
matches = [f for f in folders if f.startswith(export)]
if not matches:
continue
if len(matches) > 1:
raise RegistryError(f"{ref[:10]}: {export} starts {len(matches)} folders in {DRIVING_MODELS_REPO}")
files = [e for e in _tree(matches[0], timeout, opener)
if e.get('type') == 'file' and e['path'].rsplit('/', 1)[-1] == BIG_ONNX]
if len(files) > 1:
# a subject that names the checkpoint, as '1a421175-.../12864' does, picks one
files = [f for f in files if f['path'].rsplit('/', 1)[0] in subject] or files
if len(files) != 1:
raise RegistryError(f"{ref[:10]}: {len(files)} copies of {BIG_ONNX} under {matches[0]}")
lfs = files[0].get('lfs') or {}
oid, size = lfs.get('oid'), lfs.get('size')
if not is_sha256(oid) or not isinstance(size, int) or size <= 0:
raise RegistryError(f"{files[0]['path']} is not an lfs object")
log.info("%s names export %s: %s", ref[:10], export, files[0]['path'])
return Pointer(oid, size)
raise RegistryError(f"{ref[:10]}: no folder in {DRIVING_MODELS_REPO} for {', '.join(ids)}")
with opener(urllib.request.Request(url, headers={'Range': 'bytes=0-0'}), timeout=timeout) as response:
response.read(1)
except (OSError, ValueError) as e:
log.warning("%s has no %s (%s)", bucket, pointer.oid[:16], e)
return None
return url
def lfs_resolve(endpoint: str, pointer: Pointer, timeout: float = CONNECT_TIMEOUT, opener=None) -> str | None:
"""Ask one LFS server for a download href, or None if it does not have it.
A HuggingFace bucket, comma's (BUCKET) or one a checkout's .lfsconfig
names, is asked for the object itself.
A server that is down is not different from a server that lacks the object:
either way the caller moves to the next one, so nothing raises here.
"""
opener = opener or urllib.request.urlopen
if '/buckets/' in endpoint:
return _bucket_href(endpoint, pointer, timeout, opener)
body = json.dumps({
'operation': 'download',
'transfers': ['basic'],
@@ -189,48 +101,63 @@ def lfs_resolve(endpoint: str, pointer: Pointer, timeout: float = CONNECT_TIMEOU
return None
def lfs_hrefs(endpoints, pointer: Pointer, timeout: float = CONNECT_TIMEOUT, opener=None):
"""Each of `endpoints` that has the object, in order, with its download href."""
for endpoint in endpoints:
href = lfs_resolve(endpoint, pointer, timeout=timeout, opener=opener)
if href is not None:
yield endpoint, href
def lfs_download(href: str, pointer: Pointer, dest: Path, progress: ProgressFn | None = None,
should_stop: StopFn | None = None, opener=None) -> Path:
"""Stream to a .part file, hashing as we go, and only then take the name.
A half-written model must never sit where the next start would hand it to a
backend to build from.
backend to build from. A transfer that stalls or is stopped keeps its .part,
and the next call carries on from it with a Range request: 755 MB over a
car's connection need not arrive in one go. Only bytes that prove wrong are dropped.
"""
opener = opener or urllib.request.urlopen
dest = Path(dest)
dest.parent.mkdir(parents=True, exist_ok=True)
free = shutil.disk_usage(dest.parent).free
if free < pointer.size + FREE_SLACK:
raise RegistryError(f"need {pointer.size >> 20} MB for the model, {free >> 20} MB free")
part = dest.with_name(dest.name + '.part')
digest = hashlib.sha256()
written = 0
written = _resume_from(part, pointer.size, digest)
free = shutil.disk_usage(dest.parent).free
if free < pointer.size - written + FREE_SLACK:
raise RegistryError(f"need {(pointer.size - written) >> 20} MB more for the model, {free >> 20} MB free")
# Whole percent only: a gigabyte at 4 MB a chunk would call this a few
# hundred times and the callback may write a param or a socket line.
reported = -1
try:
with opener(href, timeout=CONNECT_TIMEOUT) as response, open(part, 'wb') as out:
while True:
if should_stop is not None and should_stop():
raise RegistryError('download cancelled')
chunk = response.read(CHUNK)
if not chunk:
break
out.write(chunk)
digest.update(chunk)
written += len(chunk)
if progress is not None and pointer.size:
percent = int(100 * written / pointer.size)
if percent != reported:
reported = percent
progress(min(1.0, written / pointer.size))
except RegistryError:
part.unlink(missing_ok=True)
raise
except Exception as e:
part.unlink(missing_ok=True)
raise NetworkError(f"could not download {pointer.oid[:16]}: {e}") from e
if written < pointer.size:
request = urllib.request.Request(href, headers={'Range': f'bytes={written}-'}) if written else href
try:
with opener(request, timeout=CONNECT_TIMEOUT) as response:
if written and response.status != 206:
# the server ignored the Range and sends the whole object
log.warning("%s: no partial content, downloading from the start", pointer.oid[:16])
digest, written = hashlib.sha256(), 0
with open(part, 'ab' if written else 'wb') as out:
while True:
if should_stop is not None and should_stop():
raise RegistryError('download stopped')
chunk = response.read(CHUNK)
if not chunk:
break
out.write(chunk)
digest.update(chunk)
written += len(chunk)
if progress is not None and pointer.size:
percent = int(100 * written / pointer.size)
if percent != reported:
reported = percent
progress(min(1.0, written / pointer.size))
except RegistryError:
raise
except Exception as e:
raise NetworkError(f"could not download {pointer.oid[:16]}: {e}") from e
if written != pointer.size:
part.unlink(missing_ok=True)
@@ -243,3 +170,21 @@ def lfs_download(href: str, pointer: Pointer, dest: Path, progress: ProgressFn |
if progress is not None:
progress(1.0)
return dest
def _resume_from(part: Path, size: int, digest) -> int:
"""How much of the model an earlier attempt left in `part`, hashed into
`digest`; 0, with the file gone, for anything that cannot be a prefix."""
try:
have = part.stat().st_size
except OSError:
return 0
if have > size:
part.unlink(missing_ok=True)
return 0
buf = bytearray(CHUNK)
view = memoryview(buf)
with open(part, 'rb') as f:
while n := f.readinto(buf):
digest.update(view[:n])
return have
+3 -7
View File
@@ -14,14 +14,14 @@ openpilot #38916. feat_dim is prod(fb[2:]); older forks use fb[2], which gives
32 rather than 16384 for the big model's (1,32,32,512) features_buffer.
tests/test_queues.py catches the drift.
The stateful one (openpilot #38916, 2026-09-15; Cinque Terre V3 onwards)
The stateful one (openpilot #38916; Cinque Terre V3 onwards)
carries its history in the graph: the newest warped frame goes in as new_img,
each queue goes in as state_<q> and comes back advanced as next_state_<q>, and
the hidden state never leaves the graph.
Either way the wire carries the newest frame and three scalars, and the reply
the outputs less hidden_state (protocol 3): the queued graph's server feeds its
own hidden state back, which modeld did through prev_feat until then.
own hidden state back, where an older modeld sends prev_feat.
"""
from __future__ import annotations
@@ -32,7 +32,6 @@ from dataclasses import dataclass
from functools import cached_property
from pathlib import Path
from jetlink.onnx_meta import parse_file
from jetlink.protocol import INFER_REQ_SIZE, INFER_RESP_SIZE
# openpilot ModelConstants; duplicated so the server needs no openpilot import
@@ -141,10 +140,6 @@ class ModelSpec:
def packed_nelem(self) -> int:
return sum(math.prod(s) for s in self.packed_shapes.values())
def feed_back(self, packed, output) -> None:
"""Nothing: the server feeds the hidden state back itself (protocol 3).
Kept for the modeld glue that still calls it after every frame."""
@property
def packed_nbytes(self) -> int:
return self.packed_nelem * 4 # float32
@@ -243,6 +238,7 @@ def sha256_file(path: str, bufsize: int = 1 << 20) -> tuple[str, int]:
def spec_from_onnx(path: str, frame_skip: int = DEFAULT_FRAME_SKIP,
sha256: str | None = None, nbytes: int | None = None) -> ModelSpec:
from jetlink.onnx_meta import parse_file # the scripts' and fixtures': modeld and the owner never parse a graph
meta = parse_file(path)
if sha256 is None or nbytes is None:
sha256, nbytes = sha256_file(path)
+222
View File
@@ -0,0 +1,222 @@
"""
Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
Linux native AIO (io_submit), for the gadget's endpoint writes.
A synchronous FunctionFS write holds the endpoint's one usb_request, and
epfile->mutex with it, until the host has taken every byte, so a frame sent as
32 KB writes leaves the bus idle between them: 1.4 ms a frame at 13 writes,
2.8 ms at 25, against one 512 KB write. The AIO path in
ffs_epfile_io gives each iocb its own request, copies the iocb's bytes into it
and queues it before io_submit moves on, then lets go of the mutex. dwc3 puts
every queued request on its TRB ring, so the bus streams them back to back,
and the caller's buffers are free again the moment io_submit returns.
Only what FfsTransport needs: one context, PWRITEV iocbs, and reaping. Linux
only: the comma is aarch64, and CI's x86_64 runs the real thing too.
"""
from __future__ import annotations
import ctypes
import functools
import os
import platform
import time
import numpy as np
# io_setup, io_destroy, io_submit, io_getevents
_SYSCALLS = {'aarch64': (0, 1, 2, 4), 'x86_64': (206, 207, 209, 208)}
IOCB_CMD_PWRITEV = 8
# iovecs one iocb may gather. A request is cut from the message's parts and
# padding; the most it spans is the header, the inference header, the frame,
# the packed inputs and the padding.
IOVECS = 8
class _Iocb(ctypes.Structure):
# struct iocb, little-endian (aio_key before aio_rw_flags)
_fields_ = [('data', ctypes.c_uint64), ('key', ctypes.c_uint32), ('rw_flags', ctypes.c_uint32),
('opcode', ctypes.c_uint16), ('reqprio', ctypes.c_int16), ('fildes', ctypes.c_uint32),
('buf', ctypes.c_uint64), ('nbytes', ctypes.c_uint64), ('offset', ctypes.c_int64),
('reserved2', ctypes.c_uint64), ('flags', ctypes.c_uint32), ('resfd', ctypes.c_uint32)]
class _Event(ctypes.Structure):
_fields_ = [('data', ctypes.c_uint64), ('obj', ctypes.c_uint64), ('res', ctypes.c_int64), ('res2', ctypes.c_int64)]
class _Iovec(ctypes.Structure):
_fields_ = [('base', ctypes.c_void_p), ('len', ctypes.c_size_t)]
class _Timespec(ctypes.Structure):
_fields_ = [('sec', ctypes.c_long), ('nsec', ctypes.c_long)]
class _PyBuffer(ctypes.Structure):
# CPython's Py_buffer, stable since 3.3
_fields_ = [('buf', ctypes.c_void_p), ('obj', ctypes.c_void_p), ('len', ctypes.c_ssize_t),
('itemsize', ctypes.c_ssize_t), ('readonly', ctypes.c_int), ('ndim', ctypes.c_int),
('format', ctypes.c_char_p), ('shape', ctypes.c_void_p), ('strides', ctypes.c_void_p),
('suboffsets', ctypes.c_void_p), ('internal', ctypes.c_void_p)]
_get_buffer = ctypes.pythonapi.PyObject_GetBuffer
_get_buffer.argtypes = [ctypes.py_object, ctypes.POINTER(_PyBuffer), ctypes.c_int]
_get_buffer.restype = ctypes.c_int
_release_buffer = ctypes.pythonapi.PyBuffer_Release
_release_buffer.argtypes = [ctypes.POINTER(_PyBuffer)]
_release_buffer.restype = None
def address(buf) -> tuple[int, int]:
"""Where a contiguous buffer's bytes start, and how many there are;
read-only ones (bytes) included, which ctypes.c_char.from_buffer refuses.
Valid while the caller holds `buf` and nothing resizes it."""
view = _PyBuffer()
_get_buffer(buf, ctypes.byref(view), 0) # PyBUF_SIMPLE: contiguous bytes; raises otherwise
try:
return view.buf or 0, view.len
finally:
_release_buffer(ctypes.byref(view))
class Layout:
"""A message whose spans are `lengths` bytes long, cut into requests of
`size` bytes: for each piece, the request it is in, its iovec within that
request's IOVECS, the span it gathers from and where in it, and its length.
Python loops over the pieces only here; a message of the same shape (every
frame of a link) reuses it through layout()."""
def __init__(self, lengths: tuple[int, ...], size: int):
request, slot, span, offset, length, pieces = [], [], [], [], [], []
r = filled = 0
for j, n in enumerate(lengths):
at = 0
while n:
take = min(n, size - filled)
if len(pieces) == r:
pieces.append(0)
if pieces[r] == IOVECS:
raise ValueError(f'a request gathers more than {IOVECS} buffers')
request.append(r)
slot.append(pieces[r])
span.append(j)
offset.append(at)
length.append(take)
pieces[r] += 1
at, n, filled = at + take, n - take, filled + take
if filled == size:
r, filled = r + 1, 0
self.count = len(pieces)
# where each request's pieces start, and the iovec words they fill
self.first = [0]
for c in pieces:
self.first.append(self.first[-1] + c)
self.words = 2 * (IOVECS * np.array(request, dtype=np.int64) + np.array(slot, dtype=np.int64))
self.span = np.array(span, dtype=np.int64)
self.offset = np.array(offset, dtype=np.uint64)
self.length = np.array(length, dtype=np.uint64)
self.pieces = np.array(pieces, dtype=np.uint64)
@functools.lru_cache(maxsize=8)
def layout(lengths: tuple[int, ...], size: int) -> Layout:
return Layout(lengths, size)
class Aio:
"""A kernel AIO context of `depth` iocbs writing to `fd`, used from one
thread at a time.
submit() queues requests of a Layout, gathered from the spans' addresses
(`bases`), and returns how many the kernel queued; the kernel has copied
those bytes, so the caller may reuse its buffers at once. reap() returns
each finished request's result, bytes written or a negative errno, in no
promised order. The iocb and iovec arrays are reused across submits: the
kernel copies both before io_submit returns.
"""
def __init__(self, fd: int, depth: int):
self._setup, self._destroy, self._submit, self._getevents = _SYSCALLS[platform.machine()]
self._libc = ctypes.CDLL(None, use_errno=True)
self._syscall = self._libc.syscall
self._syscall.restype = ctypes.c_long
self.depth = depth
self._ctx = ctypes.c_ulong(0)
self._call(self._setup, ctypes.c_long(depth), ctypes.byref(self._ctx))
self._iocbs = (_Iocb * depth)()
self._ptrs = (ctypes.POINTER(_Iocb) * depth)(*(ctypes.pointer(c) for c in self._iocbs))
self._iovecs = (_Iovec * (depth * IOVECS))()
iovecs, size = ctypes.addressof(self._iovecs), ctypes.sizeof(_Iovec)
for i, cb in enumerate(self._iocbs):
# everything but the token, the iovec count and the iovecs is fixed
cb.opcode, cb.fildes, cb.buf = IOCB_CMD_PWRITEV, fd, iovecs + i * IOVECS * size
# The per-frame fields as 64-bit words, written with numpy: iocb word 4 is
# the iovec count, an iovec is (address, length), and an event is (data,
# iocb, result, result2).
self._iocb_words = np.frombuffer(self._iocbs, dtype=np.uint64)
self._counts = np.arange(depth) * 8 + 4
self._iovec_words = np.frombuffer(self._iovecs, dtype=np.uint64)
self._events = (_Event * depth)()
self._event_words = memoryview(self._events).cast('B').cast('q')
self._timeout = _Timespec()
def _call(self, nr: int, *args) -> int:
ret = self._syscall(ctypes.c_long(nr), *args)
if ret < 0:
err = ctypes.get_errno()
raise OSError(err, os.strerror(err))
return ret
address = staticmethod(address)
layout = staticmethod(layout)
def submit(self, plan: Layout, bases: list[int], start: int, count: int) -> int:
"""Queue `count` of the plan's requests from `start`, in order, gathered
from the spans at `bases`. Raises OSError only when the kernel took none
of them; a short count means the next one failed, and nothing of it, or of
any after it, was queued."""
if count > self.depth:
raise ValueError(f'{count} requests for a context of {self.depth}')
bases = np.array(bases, dtype=np.uint64)
lo, hi = plan.first[start], plan.first[start + count]
words = plan.words[lo:hi] - 2 * IOVECS * start
self._iovec_words[words] = bases[plan.span[lo:hi]] + plan.offset[lo:hi]
self._iovec_words[words + 1] = plan.length[lo:hi]
self._iocb_words[self._counts[:count]] = plan.pieces[start:start + count] # nbytes counts iovecs for PWRITEV
return self._call(self._submit, self._ctx, ctypes.c_long(count), self._ptrs)
def reap(self, min_nr: int, timeout: float) -> list[int]:
"""Finished requests' results, waiting up to `timeout` s (0: not at all)
for at least `min_nr`; `min_nr` must not exceed what is queued, or this
waits out the whole timeout. The GIL is released while it waits (ctypes).
A signal ends io_getevents with EINTR, and nothing retries a ctypes call
(PEP 475 is os.* only), so this does: modeld's frame thread takes a
SIGUSR2 from msgq ~160 times a second."""
end = time.monotonic() + timeout
while True:
left = max(0.0, end - time.monotonic())
self._timeout.sec = int(left)
self._timeout.nsec = int((left - int(left)) * 1e9)
try:
n = self._call(self._getevents, self._ctx, ctypes.c_long(min_nr), ctypes.c_long(self.depth),
self._events, ctypes.byref(self._timeout))
except InterruptedError:
if time.monotonic() >= end:
return []
continue
return self._event_words[2:4 * n:4].tolist()
def close(self) -> None:
"""Destroy the context. The kernel cancels what is still queued and waits,
uninterruptibly, for it to finish: only call this with nothing in flight,
or after the endpoint has been disabled, which completes everything."""
if self._ctx.value:
ctx, self._ctx = self._ctx, ctypes.c_ulong(0)
self._call(self._destroy, ctx)
+57 -59
View File
@@ -79,6 +79,33 @@ class Transport(ABC):
def send(self, msg_type: int, seq: int, parts=(), flags: int = 0, timeout: float | None = None) -> None:
"""Send one message. `parts` is an iterable of buffers, sent as one message."""
def try_send(self, msg_type: int, seq: int, parts=(), timeout: float | None = None) -> bool:
"""send(), unless the link would first make the caller wait for the peer
to take earlier messages: then False, and nothing was sent. Only a
transport that queues its writes can tell (FfsTransport); the rest send,
within `timeout` as send() does, and say True."""
self.send(msg_type, seq, parts, timeout=timeout)
return True
@property
def datagrams(self) -> bool:
"""Do frames the caller can do without go as datagrams? Only a phone's
cable, once its server offered them (TcpTransport.use_datagrams)."""
return False
def use_datagrams(self, port: int, token: int) -> bool:
"""Send those frames to the server's UDP `port` behind its `token`, where
the link can (TcpTransport); False and nothing changes elsewhere."""
return False
def stop_datagrams(self) -> None:
"""Frames on the link itself again."""
def net_drops(self) -> int | None:
"""Packets the kernel dropped on their way in since the link came up, on a
link that goes through the network stack (TcpTransport); None elsewhere."""
return None
@abstractmethod
def recv(self, timeout: float | None = None) -> Message:
"""Block for one message. Raises LinkTimeout if `timeout` elapses."""
@@ -161,34 +188,23 @@ class RxBuffer:
class StreamTransport(Transport):
"""Framing over any ordered byte stream.
TCP, USB bulk and FunctionFS are all streams, so they all need exactly this.
TCP and FunctionFS are both streams, so they both need exactly this.
Subclasses supply only the two primitives that differ.
"""
# Extra capacity past the current message, for transports whose reads need a
# minimum buffer size (a bulk OUT endpoint wants a whole packet).
read_slack = 0
# Bulk endpoints reject a read whose buffer is not a whole number of packets.
# 0 means "no constraint" (TCP).
packet_size = 0
read_chunk = 1 << 20
# Pad sent messages to a multiple of this and expect the peer's padded
# likewise; 0 uses the one-byte PADDED rule. See protocol.GADGET_TX_ALIGN.
# Pad sent messages to a multiple of this; 0 uses the one-byte PADDED rule.
# The peer's messages always use the PADDED rule: only the gadget pads to a
# burst, and only a USB host (the Swift server) reads what it sends. See
# protocol.GADGET_TX_ALIGN.
tx_align = 0
rx_align = 0
# Largest single write. FunctionFS allocates a contiguous buffer per writev,
# so a 4 MB upload chunk hits ENOMEM on a fragmented device where a few
# hundred KB of inference does not. 0 means no cap (TCP).
write_chunk = 0
def __init__(self, rx_size: int = 1 << 20):
self.rx = RxBuffer(rx_size)
self._desynced = False
self._send_deadline: float | None = None
def _write_timeout(self, default: float | None = None) -> float | None:
def _write_timeout(self) -> float | None:
if self._send_deadline is None:
return default
return None
remaining = self._send_deadline - time.monotonic()
if remaining <= 0:
raise LinkError('send timed out; link abandoned')
@@ -196,9 +212,10 @@ class StreamTransport(Transport):
# -- primitives a subclass must provide ----------------------------------
@abstractmethod
def _write(self, bufs: list[memoryview]) -> int:
"""Write from one or more buffers. Returns bytes written (may be partial)."""
"""Write from one or more buffers. Returns bytes written (may be partial).
A transport that overrides send (FfsTransport) need not provide it."""
raise NotImplementedError
@abstractmethod
def _read_into(self, dest: memoryview, timeout: float | None) -> int:
@@ -211,6 +228,21 @@ class StreamTransport(Transport):
# -- framing -------------------------------------------------------------
def send(self, msg_type: int, seq: int, parts=(), flags: int = 0, timeout: float | None = None) -> None:
bufs = self._frame(msg_type, seq, parts, flags)
self._send_deadline = None if timeout is None else time.monotonic() + timeout
try:
while bufs:
self._write_timeout()
n = self._write(bufs)
if n <= 0:
raise LinkError("peer went away during send")
bufs = advance(bufs, n)
finally:
self._send_deadline = None
def _frame(self, msg_type: int, seq: int, parts, flags: int) -> list[memoryview]:
"""One message as the buffers that go on the wire, in order: the header,
`parts`, then the padding. Nothing is copied."""
# cast('B'): slicing a float32 view in advance() would step by elements
bufs = [memoryview(p).cast('B') for p in parts]
length = sum(b.nbytes for b in bufs)
@@ -223,23 +255,8 @@ class StreamTransport(Transport):
# A bulk transfer only ends on a short packet; see protocol.PACKET_MULTIPLE.
flags |= P.Flag.PADDED
bufs.append(memoryview(_PAD)[:1])
header = P.pack_header(msg_type, seq, length, flags)
bufs.insert(0, memoryview(header))
self._send_deadline = None if timeout is None else time.monotonic() + timeout
try:
while bufs:
self._write_timeout()
n = self._write(take(bufs, self.write_chunk) if self.write_chunk else bufs)
if n <= 0:
raise LinkError("peer went away during send")
bufs = advance(bufs, n)
finally:
self._send_deadline = None
def _clamp_read(self, dest: memoryview) -> int:
"""How many bytes this transport may ask for in one read."""
n = min(dest.nbytes, self.read_chunk)
return (n // self.packet_size) * self.packet_size if self.packet_size else n
bufs.insert(0, memoryview(P.pack_header(msg_type, seq, length, flags)))
return bufs
def _fill(self, need: int, timeout: float | None) -> None:
"""Read until `need` bytes are buffered, or the deadline passes.
@@ -251,15 +268,10 @@ class StreamTransport(Transport):
whatever has already arrived and nothing else: that is how a caller
polls for a reply without blocking (JetlinkClient.drain).
"""
self.rx.reserve(need + self.read_slack)
self.rx.reserve(need)
end = None if timeout is None else time.monotonic() + timeout
while self.rx.available < need:
dest = self.rx.writable()[:self._read_limit(need - self.rx.available)]
if self._clamp_read(dest) == 0:
# No room for a whole packet: every read returns 0 and this loop spins
# while the peer blocks. read_slack is too small; say so, do not hang.
raise LinkError(f"no room to read the rest of a {need} byte message "
f"({self.rx.available} in hand); read_slack too small")
dest = self.rx.writable()[:need - self.rx.available]
remaining = None if end is None else max(0.0, end - time.monotonic())
n = self._read_into(dest, remaining)
if n:
@@ -267,17 +279,6 @@ class StreamTransport(Transport):
elif remaining == 0.0:
raise LinkTimeout(f"only {self.rx.available} of {need} bytes arrived in time")
def _read_limit(self, missing: int) -> int:
"""`missing` bytes of the current message, rounded up to a whole packet.
Keeps the USB host in sync: the gadget's messages are burst-aligned, so a
read for exactly what is left never stays outstanding past the end of a
message. Reading further desynced about once in 400 frames.
"""
if self.packet_size:
return -(-missing // self.packet_size) * self.packet_size
return missing
def recv(self, timeout: float | None = None) -> Message:
if self._desynced:
raise LinkError("stream desynced; the link must be reopened")
@@ -296,10 +297,7 @@ class StreamTransport(Transport):
raise LinkError(f"protocol error, link unusable: {e}") from e
# the remainder of the budget, so one recv cannot block for twice what it
# was given
if self.rx_align:
pad = -(P.HEADER_SIZE + length) % self.rx_align
else:
pad = 1 if flags & P.Flag.PADDED else 0
pad = 1 if flags & P.Flag.PADDED else 0
self._fill(P.HEADER_SIZE + length + pad,
None if end is None else max(0.0, end - time.monotonic()))
self.rx.take(P.HEADER_SIZE)
+263 -134
View File
@@ -11,7 +11,7 @@ has CONFIG_USB_F_FS built in, while a host needs no kernel driver at all, which
an L4T rootfs stripped of the gadget modules does not have. See
docs/transport.md.
Bring-up (scripts/comma/jetlink-root.sh gadget does all of this):
Bring-up (jetlink/comma/jetlink-root.sh gadget does all of this):
configfs gadget -> functions/ffs.jetlink -> mount -t functionfs
write descriptors + strings to ep0 -> ep1 (OUT) and ep2 (IN) appear
echo <udc> > UDC
@@ -28,9 +28,8 @@ import time
from collections import deque
from jetlink import protocol as P
from jetlink.transport.base import UDC_SYSFS, LinkError, LinkTimeout, StreamTransport, take, udc_speed, usb_link_info
from jetlink.transport.base import UDC_SYSFS, LinkError, LinkTimeout, StreamTransport, udc_speed, usb_link_info
from jetlink.transport.priority import background_thread, widen_affinity
from jetlink.transport.watchdog import WriteWatchdog
# --- FunctionFS ABI -------------------------------------------------------
@@ -49,17 +48,19 @@ USB_ENDPOINT_XFER_BULK = 0x02
EP_OUT = 0x01 # host -> device
EP_IN = 0x82 # device -> host
# FunctionFS kmallocs a contiguous buffer per read: order-5 and order-6 failures
# in ffs_epfile_read_iter stalled replies 100-300 ms, and order-2 does not fail.
# Do not go smaller to dodge the rare slow success: one page per read is ~19
# syscalls for a 74 KB reply and cost ~6 ms a frame.
# FunctionFS kmallocs a contiguous buffer per read and frees it on return. 16 KB
# is an order-2 page allocation, which this kernel retries without bound under
# memory pressure; vm.extra_free_kbytes (jetlink-root.sh) keeps that from
# stalling: no reclaim in 3,396 reads while recording. 8 KB would come from
# the slab like the writes, but a reply is 8,356 bytes, so it would take a
# second read: +0.3 ms a frame at p50.
READ_CHUNK = 16 * P.USB_MAX_PACKET
# How much the reader may queue before it stops. Only bounds memory if the
# consumer stalls: inference never needs more than one response.
MAX_QUEUED = 8 << 20
MAX_QUEUED = 512 << 10
# Read buffers kept for reuse. Steady state has one or two in flight, so this is
# only a ceiling for a transient backlog. 16 * 16 KB = 256 KB.
FREE_BUFS = 16
# only a ceiling for a transient backlog. 8 * 16 KB = 128 KB.
FREE_BUFS = 8
# Just below modeld's frame loop (54), so the loop wins a contended core and the
# reader still preempts everything else. See _raise_reader_priority.
READER_RT_PRIORITY = 51
@@ -74,11 +75,23 @@ EP_READY_TIMEOUT = 10.0
# EP_READY_TIMEOUT covers the claim that follows.
EP_OPEN_TIMEOUT = 10.0
# FunctionFS writes cannot time out: the request sits queued until the host
# FunctionFS writes cannot time out: a request sits queued until the host
# drains it, measured at 90 s while a Jetson booted and three minutes on a
# drive. Unbinding the UDC dequeues it, the writev returns ESHUTDOWN, and the
# caller retries. A real write is ~3.6 ms.
# drive. Only unbinding the UDC completes it (ESHUTDOWN). A send waiting for
# the host to take earlier writes waits this long by default.
WRITE_TIMEOUT = 15.0
# Bytes the IN endpoint may hold that the host has not taken. A whole frame is
# 459 KB, so a frame may go out behind one the host has not finished, and a
# third may not (try_send refuses it). The one behind covers a completion the
# kernel has not posted yet as well: FunctionFS posts each from a SCHED_OTHER
# kworker. Uploads stream through it in windows.
QUEUED_LIMIT = 1 << 20
# How long closing waits for queued writes to reach the host (a LEAVE) before
# it drops the gadget to complete them, and how long it then waits for that.
# An endpoint file whose request is still queued stays open in the kernel, and
# the next open of it answers EBUSY.
CLOSE_FLUSH = 0.5
ABORT_DRAIN = 2.0
# where the comma's gadget lives: jetlink-root.sh gadget builds it there and
# mounts its FunctionFS instance here
GADGET = '/sys/kernel/config/usb_gadget/jetlink'
@@ -91,10 +104,13 @@ READER_JOIN_TIMEOUT = 1.0
REBIND_SETTLE = 0.5
_NOT_READY = (errno.EIO, errno.ESHUTDOWN, errno.ENODEV)
# A signal inside a FunctionFS transfer is not a retry: ffs_epfile_io returns
# EINTR mid-transfer, os.writev re-issues the whole call, and the host sees the
# start of the message twice. modeld's msgq raises SIGUSR2 ~160 times a second,
# which cost one link failure per 30 s of driving. Nothing here waits on one.
# A signal inside a synchronous FunctionFS transfer is not a retry:
# ffs_epfile_io dequeues the request and returns EINTR whatever part of it the
# host already took, os.readv/os.writev re-issue the whole call, and the stream
# has lost or repeated bytes. modeld's msgq raises SIGUSR2 ~160 times a second,
# enough to fail a synchronous-write link about once per 30 s of driving.
# The reader masks every signal for its life. Writes are AIO, which never
# waits inside a transfer, so the frame thread needs no mask.
_IO_SIGNALS = signal.valid_signals()
@@ -138,20 +154,30 @@ def build_strings(name: str = 'jetlink') -> bytes:
class FfsTransport(StreamTransport):
"""The gadget transport. Reads run on their own thread.
"""The gadget transport. Reads run on their own thread; writes are AIO.
FunctionFS ignores O_NONBLOCK once the host has enabled the endpoint, so a
read on the caller's thread cannot honour a deadline: a 0.5 s timeout was
measured returning after 14 s. The reader hands whole chunks over a condition
variable the caller can wait on. Writes stay on the caller's thread; a host
that is not reading is a dead link either way.
variable the caller can wait on.
A message goes out as AIO requests of write_chunk bytes, all submitted in
one io_submit on the caller's thread (see aio.py): the kernel has copied the
bytes when it returns, the bus streams the requests back to back, and the
caller never waits inside a transfer. What it can wait on is room
(QUEUED_LIMIT): a host that is not taking data fills it, which a frame
answers by holding (try_send) and anything else by waiting, then dropping
the gadget, under its deadline.
"""
read_chunk = READ_CHUNK
# dwc3 resends a TRB about once in 400 frames. A message that fits one writev
# is replayed whole and the receiver drops it by seq; split across two writes
# the replay lands mid-stream and the link is lost. The largest inference
# request is 400 KB padded, and only uploads, which sha256 covers, are bigger.
write_chunk = 512 * P.USB_MAX_PACKET
# FunctionFS kmallocs one contiguous buffer per request, and AIO holds a
# frame's worth at once. A whole frame in one needs order-7 pages, which
# recording rollover leaves none of; 57 x 32 KB needs 15 order-3 blocks at
# once, and an aged comma can have as few as 3 free: io_submit then stalls
# ~94 ms in compaction. 8 KB is the largest size
# SLUB serves from a slab cache (kmalloc-8192), which never compacts: it
# falls back to order-1 slabs. A whole number of 1 KB packets, so no request
# ends on a short packet.
write_chunk = P.GADGET_TX_ALIGN // 2
tx_align = P.GADGET_TX_ALIGN
def __init__(self, mount: str = MOUNT, gadget: str | None = None,
@@ -185,7 +211,7 @@ class FfsTransport(StreamTransport):
read a dead link left queued keeps them busy: see _open_after_bounce); ep0
never does, which is why the owner keeps it.
The ep0 rule is unchanged and `udc` is what keeps it: the endpoints are
The ep0 rule still holds and `udc` is what keeps it: the endpoints are
still opened only once that controller reads configured. `bounce` is how a
write with no reader is freed, since the unbind that frees it belongs to
the owner. `owner_gadget` is the last resort for when the owner does not
@@ -206,9 +232,9 @@ class FfsTransport(StreamTransport):
def _prepare(self, mount: str, gadget: str | None) -> None:
# This end only receives replies: an INFER_RESP is 8 KB, or 74 KB when
# WANT_HIDDEN asks for the whole output, and the upload goes the other way.
# 256 KB leaves margin the memory-tight comma can spare, and RxBuffer grows
# 128 KB leaves margin the memory-tight comma can spare, and RxBuffer grows
# past it on demand.
super().__init__(rx_size=256 << 10)
super().__init__(rx_size=128 << 10)
self.mount = mount
self.gadget = gadget
self.bound_udc: str | None = None
@@ -217,7 +243,6 @@ class FfsTransport(StreamTransport):
self.ep0 = self.ep_out = self.ep_in = -1
self._state_fd = -1 # held-open UDC 'state' fd; see _udc_state
self._ready_deadline: float | None = None
self._read_size = READ_CHUNK
self._cv = threading.Condition()
self._chunks: deque[tuple[memoryview, float, float, float]] = deque()
self._free: deque[bytearray] = deque() # read buffers the consumer handed back; see _read_loop
@@ -227,9 +252,18 @@ class FfsTransport(StreamTransport):
self._closing = False
self._had_host = False
self._open_lock = threading.Lock()
self._write_aborted = False
self.last_send: dict = {}
self.send_totals: dict = {}
self._reader: threading.Thread | None = None
self._write_guard = WriteWatchdog(self._abort_write)
# the AIO writes: the context once ep2 is open, holding QUEUED_LIMIT in
# requests; requests submitted and reaped over its life, each write_chunk
# bytes (_requests), and when each submit's last one went in; and the
# first failure, which ends the link (see _queue)
self._tx_lock = threading.Lock()
self._aio = None
self._submitted = self._reaped = 0
self._batches: deque[tuple[int, float]] = deque()
self._tx_error: str | None = None
def _udc_state(self) -> str | None:
"""The controller's gadget state, off a held-open fd.
@@ -299,6 +333,11 @@ class FfsTransport(StreamTransport):
raise
self.ep_out = self._open_after_bounce(deadline)
self.ep_in = os.open(os.path.join(self.mount, 'ep2'), os.O_RDWR)
try:
self._aio = _open_aio(self.ep_in, QUEUED_LIMIT // self.write_chunk)
except OSError as e:
self._close_fds(('ep_in', 'ep_out'), None)
raise LinkError(f"no AIO context for the gadget's writes: {e}") from e
self._had_host = True
self._reader = threading.Thread(target=self._read_loop, name='jetlink-ffs-read', daemon=True)
self._reader.start()
@@ -314,9 +353,8 @@ class FfsTransport(StreamTransport):
def _open_after_bounce(self, deadline: float) -> int:
"""ep1 answered EBUSY: a transport this process closed after its link died
left a read queued on it, and FunctionFS keeps that read, and the endpoint
with it, until an unbind completes it. Seen when a Jetson's server
restarted mid-drive: some rejoins met EBUSY until the drive ended. The
unbind is the owner's, so a borrower asks for one, then opens once the
with it, until an unbind completes it, as when a Jetson's server
restarts mid-drive. The unbind is the owner's, so a borrower asks for one, then opens once the
host has the gadget back and the stale read has let go."""
log.warning("jetlink: ep1 is held by a read the last link left queued, asking the owner to bounce the gadget")
if not self._bounce():
@@ -336,8 +374,8 @@ class FfsTransport(StreamTransport):
An exchange leaves a read queued on the endpoint, and FunctionFS keeps it
queued until something completes it: nobody else may read that endpoint
until it does, and the only thing that dequeues it is the unbind. So the
owner gives the endpoints up like this and binds straight back - one
re-enumeration - without ever letting go of ep0, which is the whole point,
owner gives the endpoints up like this and binds straight back (one
re-enumeration) without ever letting go of ep0, which is the whole point,
since the gadget exists only while somebody holds it.
False when there is nothing to give up. Afterwards this transport is bare
@@ -346,6 +384,7 @@ class FfsTransport(StreamTransport):
if self.gadget is None or self._closing or self.ep_out < 0:
return False
udc, self._had_host = self.bound_udc, False
self._settle_writes()
self.unbind() # completes the queued read with ESHUTDOWN
reader, self._reader = self._reader, None
if reader is not None and reader is not threading.current_thread():
@@ -361,7 +400,7 @@ class FfsTransport(StreamTransport):
self._cv.notify_all()
self.rx.start = self.rx.end = 0
self._ready_deadline = None
self._write_aborted = False
self._tx_error = None
time.sleep(REBIND_SETTLE)
self.bind(udc)
return True
@@ -429,88 +468,186 @@ class FfsTransport(StreamTransport):
_close_quietly(self._state_fd)
self._state_fd = -1
def _shrink(self, attr: str) -> bool:
"""Halve a transfer size after the kernel refused to allocate for one.
ENOMEM here is contiguous memory, so it tracks fragmentation: a size that
worked at boot can fail an hour in, which is what a 1.7 GB model does to a
comma. Slow beats broken, and both directions need it.
def _abort_write(self, why: str = 'USB send exceeded its deadline') -> None:
"""Drop the gadget so the writes the host is not taking complete, with
ESHUTDOWN, and the link with them. Nothing else completes a queued
FunctionFS request (see WRITE_TIMEOUT), and one left queued holds its
endpoint file open in the kernel under the next user of the gadget.
"""
floor = (self.packet_size or P.USB_MAX_PACKET) * 16
current = getattr(self, attr)
if current <= floor:
return False
setattr(self, attr, max(floor, current // 2))
if attr == '_read_size':
self._free.clear() # pooled buffers are the old, larger size now
log.warning("jetlink: gadget could not allocate for %s, dropping to %d KB",
attr, getattr(self, attr) >> 10)
return True
def _shrink_write(self) -> bool:
return self._shrink('write_chunk')
def _abort_write(self) -> None:
"""Take the link down so a write nobody is reading returns. See WRITE_TIMEOUT.
On the watchdog thread: the one stuck in writev cannot act.
"""
self._write_aborted = True
log.warning("jetlink: no reader for %.3f s, dropping the gadget to free the write",
getattr(self, '_write_budget', WRITE_TIMEOUT))
self._set_error(f'{why}; link abandoned')
self.last_send['aborted'] = True
self.send_totals['aborts'] = self.send_totals.get('aborts', 0) + 1
log.warning("jetlink: %s, dropping the gadget to free the queued writes", why)
if self._bounce is None:
return self.unbind()
# A borrowed gadget: the unbind that dequeues this belongs to whoever owns
# ep0, so ask. If nobody answers - the owner died, or is wedged itself -
# take the gadget down from here anyway. This runs while a frame thread is
# inside a writev the kernel will never return from on its own, and a
# re-enumeration costs one rejoin where a wedged modeld costs the whole
# drive, the small model included.
# A borrowed gadget: the unbind belongs to whoever owns ep0, so ask. If
# nobody answers (the owner died, or is wedged itself), take the gadget
# down from here anyway: a re-enumeration costs one rejoin, where requests
# nothing completes cost the endpoint until the comma reboots.
if self._bounce():
return
log.error("jetlink: the gadget's owner did not answer; dropping the link from here")
self.unbind(self._owner_gadget)
def send(self, *args, **kwargs) -> None:
# Reset the quantum at each message: a latched shrink would split every
# later request across two writes and re-arm the dwc3 replay (see
# write_chunk). The pressure that forced it is usually gone by the next
# frame.
self.write_chunk = type(self).write_chunk
super().send(*args, **kwargs)
# -- writes: AIO ---------------------------------------------------------
def _write(self, bufs: list[memoryview]) -> int:
def try_send(self, msg_type: int, seq: int, parts=(), timeout: float | None = None) -> bool:
"""Queue one message unless that means waiting for the host: False, and
nothing sent, while writes it has not taken leave no room for this one
(QUEUED_LIMIT). A frame waits for nothing here, `timeout` included; the
caller holds instead (JetlinkModelState)."""
bufs = self._frame(msg_type, seq, parts, 0)
self._ensure_epfiles()
self._write_budget = self._write_timeout(WRITE_TIMEOUT)
# See _IO_SIGNALS: a signal here duplicates data on the wire.
was = signal.pthread_sigmask(signal.SIG_BLOCK, _IO_SIGNALS)
return self._queue(bufs, None, wait=False)
def send(self, msg_type: int, seq: int, parts=(), flags: int = 0, timeout: float | None = None) -> None:
bufs = self._frame(msg_type, seq, parts, flags)
self._ensure_epfiles()
self._queue(bufs, None if timeout is None else time.monotonic() + timeout, wait=True)
def _queue(self, bufs: list[memoryview], deadline: float | None, wait: bool) -> bool:
"""Put one framed message on the IN endpoint as requests of write_chunk
bytes. Returns once the kernel holds every byte, not once the host has
taken them; a failure among earlier requests is this send's LinkError.
`wait` waits for room until `deadline` (WRITE_TIMEOUT from now by
default), then drops the gadget; without it there is no waiting, and
False says the message was not sent."""
started = time.monotonic()
deadline = started + WRITE_TIMEOUT if deadline is None else deadline
total = sum(b.nbytes for b in bufs)
stats = self.last_send = {'bytes': total, 'requests': 0, 'submit_ms': 0.0, 'wait_ms': 0.0,
'backlog_kb': 0, 'backlog_ms': 0.0, 'chunk': self.write_chunk,
'refused': False, 'aborted': False, 'errno': None}
try:
if not self._write_guard.arm(self._write_budget):
raise LinkError('gadget write watchdog already expired or closed')
while True:
try:
n = os.writev(self.ep_in, bufs)
self._had_host = True
return n
except OSError as e:
if self._write_aborted:
# Say whose doing it was: ENODEV alone reads like a cable falling
# out of a socket.
raise LinkError(f"gadget write had no reader for {self._write_budget:.3f}s") from e
# FunctionFS submits a write as one request, so a failed writev put
# nothing on the wire and is safe to retry.
if e.errno in _NOT_READY and self._wait_for_host_ready():
continue
if e.errno == errno.ENOMEM and self._shrink_write():
# A short write is fine: send() loops until the message is out.
bufs = take(bufs, self.write_chunk)
continue
raise LinkError(f"gadget write failed: {e}{self._udc_note()}") from e
with self._tx_lock:
if self._closing or self._aio is None:
raise LinkError('gadget closing')
self._collect()
if self._tx_error is not None:
raise LinkError(self._tx_error)
if queued := self._submitted - self._reaped:
# what the host had not taken when this message came: the measure
# of a host falling behind, which nothing else on this end can see
stats['backlog_kb'] = queued * self.write_chunk >> 10
stats['backlog_ms'] = (started - self._batches[0][1]) * 1e3
if not wait and (queued + total // self.write_chunk) > self._aio.depth:
stats['refused'] = True
return False
# the views in `bufs` keep these addresses valid until io_submit returns
spans = [self._aio.address(b) for b in bufs if b.nbytes]
plan = self._aio.layout(tuple(n for _, n in spans), self.write_chunk)
self._submit_message(plan, [a for a, _ in spans], deadline, stats)
return True
finally:
completed = self._write_guard.disarm()
signal.pthread_sigmask(signal.SIG_SETMASK, was)
if not completed:
raise LinkError('gadget write had no reader before deadline; link abandoned')
self._count(stats)
def _submit_message(self, plan, bases: list[int], deadline: float, stats: dict) -> None:
"""io_submit the message's requests (an aio.Layout over the spans at
`bases`) as room allows: all at once for a frame, in windows for an upload
chunk larger than the context."""
done = 0
while done < plan.count:
room = self._aio.depth - (self._submitted - self._reaped)
if room <= 0:
self._wait_for_room(deadline, stats)
continue
done += self._submit(plan, bases, done, min(room, plan.count - done), stats)
def _submit(self, plan, bases: list[int], start: int, count: int, stats: dict) -> int:
"""io_submit `count` of the message's requests from `start`; how many the
kernel queued. FunctionFS reports a failed write as its completion
(_collect): io_submit itself fails only on a bad context or iocb."""
t0 = time.monotonic()
try:
n = self._aio.submit(plan, bases, start, count)
except OSError as e:
stats['errno'] = e.errno
why = f"gadget write failed: {e}{self._udc_note()}"
self._set_error(why)
raise LinkError(why) from e
now = time.monotonic()
stats['submit_ms'] += (now - t0) * 1e3
stats['requests'] += n
self._submitted += n
self._batches.append((self._submitted, now))
return n
def _wait_for_room(self, deadline: float, stats: dict) -> None:
"""Wait for the host to take queued writes, until `deadline`."""
now = time.monotonic()
if now >= deadline:
self._abort_write(f'the host took no USB data for {now - self._batches[0][1]:.2f} s')
raise LinkError(self._tx_error)
self._collect(1, deadline - now)
stats['wait_ms'] += (time.monotonic() - now) * 1e3
if self._tx_error is not None:
raise LinkError(self._tx_error)
def _set_error(self, why: str) -> None:
"""The link's first write failure, which every send after it raises."""
if self._tx_error is None:
self._tx_error = why
def _collect(self, min_nr: int = 0, timeout: float = 0.0) -> None:
"""Reap finished writes, waiting up to `timeout` for `min_nr` of them. The
first that did not write all of its bytes is the link's failure."""
queued = self._submitted - self._reaped
if not queued:
return
results = self._aio.reap(min(min_nr, queued), timeout)
self._reaped += len(results)
while self._batches and self._batches[0][0] <= self._reaped:
self._batches.popleft() # what is left starts with the oldest still queued
chunk = self.write_chunk
if results.count(chunk) != len(results):
bad = next(r for r in results if r != chunk)
self._set_error(f"gadget write failed: {os.strerror(-bad) if bad < 0 else f'{bad} of {chunk} bytes'}"
f"{self._udc_note()}")
def _count(self, stats: dict) -> None:
"""Session totals, which keep a slow send between the 1 Hz log samples."""
totals = self.send_totals
totals['messages'] = totals.get('messages', 0) + 1
for key in ('bytes', 'requests', 'refused'):
totals[key] = totals.get(key, 0) + stats[key]
for key, top in (('submit_ms', 'max_submit_ms'), ('wait_ms', 'max_wait_ms'), ('backlog_ms', 'max_backlog_ms')):
totals[top] = max(totals.get(top, 0.0), stats[key])
def _settle_writes(self) -> None:
"""Before the endpoint files go: give queued writes CLOSE_FLUSH to reach
the host (a LEAVE), drop the gadget to complete the rest, and destroy the
AIO context once nothing is left in it. io_destroy waits, uninterruptibly,
for what it cancels, and FunctionFS cannot cancel a request while the bus
is suspended (dwc3 refuses in LPM), so it is only called on an empty
context; otherwise the context is left to the process."""
if self._aio is None:
return
if not self._tx_lock.acquire(timeout=CLOSE_FLUSH):
# a send is waiting for room the host is not making; this frees it
self._abort_write('closing a link whose host stopped taking USB data')
if not self._tx_lock.acquire(timeout=ABORT_DRAIN):
log.error("jetlink: a send still holds the gadget's writes; leaving their AIO context to the process")
return
try:
self._drain(CLOSE_FLUSH)
if self._submitted > self._reaped:
self._abort_write(f'{self._submitted - self._reaped} USB writes still queued at close')
self._drain(ABORT_DRAIN)
if self._submitted > self._reaped:
log.error("jetlink: %d USB writes never completed; leaving their AIO context to the process",
self._submitted - self._reaped)
else:
self._aio.close()
self._aio = None
self._submitted = self._reaped = 0
self._batches.clear()
finally:
self._tx_lock.release()
def _drain(self, seconds: float) -> None:
end = time.monotonic() + seconds
while self._submitted > self._reaped and (left := end - time.monotonic()) > 0:
self._collect(1, left)
# -- the reader thread ---------------------------------------------------
@@ -528,8 +665,8 @@ class FfsTransport(StreamTransport):
"""Realtime priority, so a completed read leaves the endpoint at once.
The creator has dropped to SCHED_OTHER, and under recording plus onroad load
the wait to be scheduled after a transfer was 17 ms mean, 23 ms max - over
budget on read_wait alone. The reader copies a chunk and blocks again, so it
the wait to be scheduled after a transfer measures 17 ms mean, 23 ms max,
over budget on read_wait alone. The reader copies a chunk and blocks again, so it
never holds a core. Best effort, and open-coded because jetlink must not
import openpilot.
"""
@@ -539,15 +676,14 @@ class FfsTransport(StreamTransport):
pass
def _read_loop(self) -> None:
# As in _write: an interrupted read drops the packets it already took. This
# thread handles no signals, so mask them for its whole life.
# See _IO_SIGNALS.
signal.pthread_sigmask(signal.SIG_BLOCK, _IO_SIGNALS)
self._widen_affinity()
self._raise_reader_priority()
# Fill the pool up front: recycling alone leaves a gap while a reply's
# chunks arrive and the consumer is a scheduling beat behind, and an
# allocation there reclaims under memory pressure (24 ms, over budget).
self._free.extend(bytearray(self._read_size) for _ in range(FREE_BUFS))
self._free.extend(bytearray(READ_CHUNK) for _ in range(FREE_BUFS))
while not self._closing:
with self._cv:
while self._queued >= MAX_QUEUED and not self._closing:
@@ -566,19 +702,16 @@ class FfsTransport(StreamTransport):
# Reuse a buffer the consumer handed back: a fresh bytearray here was
# measured stalling 20+ ms mid-frame under memory pressure, and the read
# cannot start until it returns. Only this thread pops the free list.
buf = self._free.popleft() if self._free else bytearray(self._read_size)
buf = self._free.popleft() if self._free else bytearray(READ_CHUNK)
read_started = time.monotonic()
try:
# Multiples of the packet size only: the OUT endpoint rejects anything
# else, and _read_size is only ever halved from one.
# A multiple of the packet size: the OUT endpoint rejects anything else.
got = os.readv(self.ep_out, [buf])
except OSError as e:
if self._closing:
return
if e.errno in _NOT_READY and self._wait_for_host_ready():
continue
if e.errno == errno.ENOMEM and self._shrink('_read_size'):
continue
self._fail(f"gadget read failed: {e}{self._udc_note()}")
return
if got == 0:
@@ -621,10 +754,9 @@ class FfsTransport(StreamTransport):
else:
self._chunks.popleft()
# Copied out, so return the buffer to the pool. chunk.obj survives a
# reslice; skip anything not from this pool at the current size, such
# as a shrunk buffer or a test's bytes.
# reslice; skip anything not from this pool, such as a test's bytes.
buf = chunk.obj
if type(buf) is bytearray and len(buf) == self._read_size and len(self._free) < FREE_BUFS:
if type(buf) is bytearray and len(buf) == READ_CHUNK and len(self._free) < FREE_BUFS:
self._free.append(buf)
self._queued -= n
self._cv.notify_all()
@@ -654,7 +786,7 @@ class FfsTransport(StreamTransport):
The endpoints answer ENODEV both before a host configures the gadget and
after it disconnects, and only the first deserves the grace period; giving
it to the second cost 10 s and 201 frames on a mid-drive disconnect. The UDC
it to the second costs a mid-drive disconnect 10 s, about 200 frames. The UDC
state separates them, and it is set in the interrupt that disabled the
endpoint, so it is current when the failed call returns.
"""
@@ -665,18 +797,7 @@ class FfsTransport(StreamTransport):
def close(self) -> None:
self._closing = True
self._write_guard.close()
self._write_guard.thread.join(READER_JOIN_TIMEOUT)
if self._write_guard.thread.is_alive():
# It is stuck inside its own abort, which is already unbinding the
# gadget. This used to raise, to keep a late abort from unbinding a
# gadget the next owner had bound - but the raise came before a single
# fd was closed, so ep0 stayed open for the life of the process and
# every descriptor write after it answered ESRCH. unbind() is
# idempotent, so a late abort finds nothing left to let go of; the leak
# was the worse half by far.
log.warning("jetlink: gadget watchdog teardown did not finish in %.0f s, "
"closing the endpoints anyway", READER_JOIN_TIMEOUT)
self._settle_writes()
# Unbinding disables the endpoints, which completes the reader's pending
# request with ESHUTDOWN and lets the thread exit before its fd goes away.
self.unbind()
@@ -707,6 +828,14 @@ class FfsTransport(StreamTransport):
_close_quietly(fd)
def _open_aio(fd: int, depth: int):
"""The AIO context for ep2's writes (aio.Aio). Imported on first use: the
resident gadget owner imports this module and never writes, and ctypes is
not free."""
from jetlink.transport.aio import Aio
return Aio(fd, depth)
def _close_quietly(fd: int) -> None:
# Runs on its own thread when a read never came back; that thread inherits
# the creator's scheduling, which in modeld is the frame loop's.
+81 -8
View File
@@ -12,13 +12,19 @@ the vendor interface instead. See docs/transport.md.
One sendmsg per message (header and body in one segment train, NODELAY set)
and reads straight into the reusable receive buffer, so the steady state does
not allocate on the wire.
not allocate on the wire. Over the cable, frames can go as UDP datagrams
instead (use_datagrams, protocol.DATAGRAM_MAGIC); everything else stays here.
"""
from __future__ import annotations
import logging
import socket
from collections.abc import Iterator
from jetlink.transport.base import LinkError, StreamTransport, udc_speed, usb_link_info
from jetlink import protocol as P
from jetlink.transport.base import LinkError, StreamTransport, advance, take, udc_speed, usb_link_info
log = logging.getLogger('jetlink.tcp')
DEFAULT_PORT = 5599
# The comma's end of the USB network link a phone dials (jetlink-root.sh gadget --ios).
@@ -32,6 +38,9 @@ class TcpTransport(StreamTransport):
self.sock = sock
self._timeout: float | None = -1.0 # force the first settimeout
_tune(sock)
# (socket connected to the server's frame port, its token); see use_datagrams
self._udp: tuple[socket.socket, int] | None = None
self._drops_at = _softnet_dropped()
def on_the_cable(self) -> bool:
"""Is either end the comma's cable address? Then this is a phone's USB
@@ -45,6 +54,54 @@ class TcpTransport(StreamTransport):
def link_info(self) -> dict:
return usb_link_info('cable', udc_speed()) if self.on_the_cable() else {'kind': 'tcp'}
def net_drops(self) -> int:
"""Every CPU's receive backlog drops since this link came up
(/proc/net/softnet_stat): a receive core starved of time shows here
before anywhere else. -1 where it cannot be read."""
now = _softnet_dropped()
return -1 if now < 0 or self._drops_at < 0 else now - self._drops_at
# -- frames as datagrams ---------------------------------------------------
def use_datagrams(self, port: int, token: int) -> bool:
"""Send frames the caller can do without (send_datagrams) to the peer's
UDP `port` from now on, behind the server's `token`: what its HELLO_RESP
offers over the cable. False, and nothing changes, anywhere else: off the
cable a lost datagram has more than a USB link between it and the phone.
Blocking: the 4 MB send buffer takes a frame whole."""
self.stop_datagrams()
if not self.on_the_cable():
return False
try:
udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
udp.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 4 << 20)
udp.connect((self.sock.getpeername()[0], port))
except OSError as e:
log.warning("jetlink: no frame datagrams to port %d (%s); frames stay on TCP", port, e)
return False
self._udp = (udp, token)
return True
def stop_datagrams(self) -> None:
udp, self._udp = self._udp, None
if udp is not None:
udp[0].close()
@property
def datagrams(self) -> bool:
return self._udp is not None
def send_datagrams(self, msg_type: int, seq: int, parts=(), flags: int = 0) -> None:
"""The message as `datagrams`, one sendmsg each, once use_datagrams took
an offer. A send the kernel refuses (the phone's server gone) fails the
link, as a refused send on the stream does."""
udp, token = self._udp
try:
for piece in datagrams(self._frame(msg_type, seq, parts, flags), token, seq):
udp.sendmsg(piece)
except OSError as e:
raise LinkError(f"frame datagrams failed: {e}") from e
@classmethod
def connect(cls, host: str, port: int = DEFAULT_PORT, timeout: float = 5.0) -> TcpTransport:
return cls(socket.create_connection((host, port), timeout=timeout))
@@ -57,16 +114,11 @@ class TcpTransport(StreamTransport):
srv.listen(backlog)
return srv
@classmethod
def accept(cls, srv: socket.socket) -> tuple[TcpTransport, tuple]:
conn, addr = srv.accept()
return cls(conn), addr
@classmethod
def listen_once(cls, host: str = '0.0.0.0', port: int = DEFAULT_PORT,
timeout: float | None = None) -> tuple[TcpTransport, tuple]:
"""Take exactly one incoming connection and stop listening: a phone that
dials us, for the bench and parity scripts run from a Mac."""
dials us, for the benchmark and parity scripts run from a Mac."""
srv = cls.listen(host, port)
try:
srv.settimeout(timeout)
@@ -109,6 +161,7 @@ class TcpTransport(StreamTransport):
return n
def close(self) -> None:
self.stop_datagrams()
# shut down first: a close alone keeps the connection up while another
# process holds a copy of the socket (the comma's gadget owner holds the
# phone's dial), and the peer hears nothing until that copy goes too
@@ -119,6 +172,26 @@ class TcpTransport(StreamTransport):
pass
def _softnet_dropped(path: str = '/proc/net/softnet_stat') -> int:
"""The kernel's receive backlog drops, all CPUs: the second column, in hex."""
try:
with open(path) as f:
return sum(int(line.split()[1], 16) for line in f if line.strip())
except (OSError, ValueError, IndexError):
return -1
def datagrams(bufs: list[memoryview], token: int, seq: int) -> Iterator[list]:
"""A message's stream bytes `bufs` as protocol.datagram_pieces, each its
header and views into `bufs`. The header's buffer is reused: send or copy
each datagram before taking the next."""
total = sum(b.nbytes for b in bufs)
header = bytearray(P.DATAGRAM_HEADER_SIZE)
for offset, size in P.datagram_pieces(total):
P.pack_datagram_header_into(header, token, seq, offset, total)
yield [header, *take(advance(bufs, offset), size)]
def _tune(sock: socket.socket) -> None:
# NODELAY is the one that matters: without it the header and the body can be
# split across an RTT. Guarded anyway; a transport must not die in setsockopt.
@@ -1,71 +0,0 @@
"""
Copyright (c) 2026-, Zeph Leggett.
This file is part of jetlink and is licensed under the MIT License.
See the LICENSE file in the root directory for more details.
"""
from __future__ import annotations
import threading
import time
from jetlink.transport.priority import background_thread
class WriteWatchdog:
"""One worker per link, with cancellation serialized against expiry.
Once expiry wins, the link cannot be armed again. The callback runs outside
the lock: unbinding a broken USB controller must not block disarm().
"""
def __init__(self, abort):
self._abort = abort
self._cv = threading.Condition()
self._deadline = None
self._expired = False
self._closed = False
self.thread = threading.Thread(target=self._run, name='jetlink-write-guard', daemon=True)
self.thread.start()
def arm(self, budget: float) -> bool:
with self._cv:
if self._expired or self._closed:
return False
if self._deadline is not None:
raise RuntimeError('concurrent writes on one link')
self._deadline = time.monotonic() + budget
self._cv.notify()
return True
def disarm(self) -> bool:
with self._cv:
self._deadline = None
self._cv.notify()
return not self._expired and not self._closed
def close(self) -> None:
with self._cv:
self._closed = True
self._deadline = None
self._cv.notify()
def _run(self) -> None:
# This inherits the creator's policy and pin, which in modeld is the frame
# loop's SCHED_FIFO 54 on one core.
background_thread()
with self._cv:
while not self._closed:
if self._deadline is None:
self._cv.wait()
continue
remaining = self._deadline - time.monotonic()
if remaining > 0:
self._cv.wait(remaining)
continue
self._expired = True
self._deadline = None
break
else:
return
self._abort()
+5
View File
@@ -24,11 +24,16 @@ dev = ["pytest>=7", "ruff", "onnx>=1.16"]
[tool.setuptools.packages.find]
include = ["jetlink*"]
# The root script the comma runs (jetlink/comma/root.py), so a wheel has it too
[tool.setuptools.package-data]
"jetlink.comma" = ["jetlink-root.sh"]
[tool.setuptools.dynamic]
version = { attr = "jetlink.__version__" }
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = ["real_aio: uses Linux AIO itself, not tests/aio_fakes.FakeAio"]
# The fork's rule set (sunnypilot's pyproject.toml), so code moves between the
# two without reformatting, with two differences the fork does not allow:
-631
View File
@@ -1,631 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2026-, Zeph Leggett.
# This file is part of jetlink and is licensed under the MIT License.
#
# Everything jetlink does as root on the comma, in one place. The owner runs it
# through jetlink/comma/root.py, which is sudo -n and a timeout:
#
# sudo scripts/comma/jetlink-root.sh gadget # the gadget for a Jetson or a Mac
# sudo scripts/comma/jetlink-root.sh gadget --ios # the gadget for an iPhone
# sudo scripts/comma/jetlink-root.sh net # after a bind, iOS only: address, DHCP
# sudo scripts/comma/jetlink-root.sh check # what is there now
# sudo scripts/comma/jetlink-root.sh teardown
# sudo scripts/comma/jetlink-root.sh port hold|off # the USB-C port held as the device, or let go
# sudo scripts/comma/jetlink-root.sh port device|reset # ask the far end to host over USB PD, or reset PD
# sudo scripts/comma/jetlink-root.sh port source # ask the far end for the source role: the comma charges it
# sudo scripts/comma/jetlink-root.sh udc apply|restore # the USB device controller kept a device, or stock
# sudo scripts/comma/jetlink-root.sh udc start|stop # its device side turned on, or off
# sudo scripts/comma/jetlink-root.sh vm apply|restore # the link's VM tuning, or the stock values
# sudo scripts/comma/jetlink-root.sh draw off|on # no current drawn from the port (iOS), or the charger's own
#
# For the comma four and the comma 3X only. Both are SDM845 on the same AGNOS
# kernel (4.9, dwc3 at a600000.dwc3), with configfs, FunctionFS and NCM built
# in and no modules to load.
# The 3X is assumed from the kernel it shares with the four; only the four has been on the bench.
#
# gadget: the USB gadget, chosen by the comma's Jetlink setting. The
# comma is the USB device and the host runs the model; docs/transport.md says
# why. For a Jetson or a Mac (USB), the FunctionFS vendor interface alone. For
# an iPhone (iOS, with --ios), a composite: the vendor interface first, so it
# stays interface 0, and a CDC-NCM network interface after it, since an iPhone
# app can only use the network: the phone gets 192.168.60.x by DHCP from the
# dnsmasq this script starts on the gadget's netdev, and dials the comma at
# 192.168.60.1:5599.
#
# It does not bind the UDC: a FunctionFS gadget cannot attach to a controller
# until its descriptors are written, and the owner, which opens ep0, writes
# them and binds. The NCM function rides on that bind, and its netdev exists
# only from the first bind on, so the network is set up by net, which the owner
# runs after each bind.
#
# On failure the reason is left in $STATUS_FILE as well as on stderr, so the
# openpilot side can say why the link is unavailable. net reports in
# $NET_STATUS_FILE; it never fails the gadget.
set -euo pipefail
GADGET=/sys/kernel/config/usb_gadget/jetlink
FFS_MOUNT=/dev/ffs-jetlink
FFS_NAME=jetlink
CONFIGFS=/sys/kernel/config
# who openpilot runs as: the owner opens the endpoints and binds the UDC as it
OPENPILOT_USER=comma
# tmpfs on purpose: per-boot state, and the comma's flash is precious
STATUS_FILE=/dev/shm/jetlink-gadget
NET_STATUS_FILE=/dev/shm/jetlink-net
# pid.codes test allocation; get a real PID before distributing this
VID=0x1209
PID=0x0001
NET_IF=usb0 # the function name suffix only; see net_ifname for the netdev
# NCM batches packets, which a 460 KB frame benefits from
NET_FN=ncm.$NET_IF
COMMA_ADDR=192.168.60.1
COMMA_PREFIX=24
# The whole subnet and short leases: the comma's 4.9 kernel gives the host a new
# random MAC every bind, so each bind is a new DHCP client. With 8 addresses and
# an hour's lease, eight rebinds in an hour left the next host without one.
DHCP_RANGE=192.168.60.2,192.168.60.254,10m
DNSMASQ_PID=/dev/shm/jetlink-dnsmasq.pid
DNSMASQ_IF=/dev/shm/jetlink-dnsmasq.if
DNSMASQ_LEASES=/dev/shm/jetlink-usb0.leases
# port: the charger's DISABLE_POWER_ROLE_SWITCH voter on the PMI8998, the one
# role lever that holds across plugs, and the policy engine's own USB PD
# requests; jetlink/comma/port.py says when each is used
POWER_ROLE_VOTER=${JETLINK_POWER_ROLE_VOTER:-/sys/kernel/debug/pmic-votable/DISABLE_POWER_ROLE_SWITCH}
USBPD=${JETLINK_USBPD:-/sys/class/usbpd/usbpd0}
DUAL_ROLE=${JETLINK_DUAL_ROLE:-/sys/class/dual_role_usb/otg_default}
# udc: the dwc3 glue for the port's controller (usb0, ssusb@a600000) and the
# policy engine's parameters. Both have a usb_compliance_mode, and each gates
# one place only: the policy engine's turns the device side on at every sink
# attach, not just when the charger detection read a USB port (SDP, CDP or
# floating lines); the glue's keeps dwc3 from turning it off again when the
# lines read floating and no host enumerated it in 10 s. An Apple port connects
# its data lines only after USB PD, and at boot no gadget is bound for 10 s.
UDC_GLUE=${JETLINK_UDC_GLUE:-/sys/devices/platform/soc/a600000.ssusb}
PE_PARAMS=${JETLINK_PE_PARAMS:-/sys/module/policy_engine/parameters}
USB_PSY=${JETLINK_USB_PSY:-/sys/class/power_supply/usb}
# draw: the charger's USB_ICL voter, the input current limit on the port. As
# the sink the charger draws up to 900 mA from whatever powers the port, though
# the comma runs on its own supply. An iPhone powers what it plugs into with
# little current; under that draw its supply sags, the charger's weak-charger
# and reverse-boost handlers cut and restore the input in a loop, and the phone
# never sees a device. Forced to 0 the input is suspended: the port still reads
# present and the roles still settle, and those handlers stand down at 25 mA or
# less. As the source the kernel votes the input to 0 itself.
USB_ICL_VOTER=${JETLINK_USB_ICL_VOTER:-/sys/kernel/debug/pmic-votable/USB_ICL}
# vm: loggerd's dirty pages pile up until the kernel reclaims them
# synchronously, right while a FunctionFS transfer allocates its buffer: gadget
# reads stalled 200-350 ms and the big model fell back. Capping dirty memory
# keeps that reclaim cheap. System-wide, since the gadget read shares the
# kernel with every writer.
# Not vm.min_free_kbytes: a 128 MB floor takes about three times that out of
# MemAvailable, 360 MB on a 3.6 GB comma, and openpilot's LOW MEMORY alert
# reads MemTotal-MemAvailable against 90 %. Drives at 80 % showed 90 and
# alerted. The caps alone are not yet re-measured against the stall.
# And the socket buffer caps, for the iPhone's TCP link: transport/tcp.py asks
# for 4 MB, which turns autotuning off, and the kernel clamps it to these, 224
# KB on AGNOS and so 448 KB of buffer. A 393 KB frame in 1448-byte segments does
# not fit, so the send waited on the phone's ACKs: 6 to 50 ms, following its
# round trip. With 4 MB the frame goes in one write and the send took ~4 ms
# (a tester's comma, 2026-10-04). Only a socket that asks gets more; one set up
# before the apply keeps the old cap until the phone reconnects.
VM_SYSCTLS=(vm.dirty_bytes=16777216 vm.dirty_background_bytes=8388608
net.core.wmem_max=4194304 net.core.rmem_max=4194304)
PROC_SYS=${JETLINK_PROC_SYS:-/proc/sys}
# the stock values to write back, one key=value a line, recorded by the first
# apply and dropped by restore
SYSCTL_PREV=${JETLINK_SYSCTL_PREV:-/dev/shm/jetlink-sysctl-prev}
usage() {
echo "usage: $0 gadget [--ios] | net | check | teardown | port hold|off|device|reset|source|sink | udc apply|restore|start|stop | vm apply|restore | draw off|on" >&2
exit 2
}
status() {
# best effort: a device with no /dev/shm still gets the stderr line
{ echo "$1" > "$STATUS_FILE" && chmod 0644 "$STATUS_FILE"; } 2>/dev/null || true
}
net_status() {
{ echo "$1" > "$NET_STATUS_FILE" && chmod 0644 "$NET_STATUS_FILE"; } 2>/dev/null || true
}
fail() {
echo "jetlink: $1" >&2
status "error: $1"
exit 1
}
# -- the gadget's network, iOS only -------------------------------------------
net_present() {
[[ -d "$GADGET/functions/$NET_FN" ]]
}
dnsmasq_alive() {
local pid
pid=$(cat "$DNSMASQ_PID" 2>/dev/null || true)
[[ -n "$pid" ]] && kill -0 "$pid" 2>/dev/null
}
# The interface the kernel gave the network function. The function is named
# ncm.usb0 but the netdev is not usb0: the modem already holds that name on a
# comma, so ours comes up as usb1 or later, and the number can change from one
# bind to the next. u_ether records the real name in the function's ifname,
# readable only while the gadget is bound.
net_ifname() {
local name
name=$(cat "$GADGET/functions/$NET_FN/ifname" 2>/dev/null || true)
[[ -n "$name" && -d "/sys/class/net/$name" ]] || return 1
echo "$name"
}
# The comma's end of the cable network. Idempotent, and never fatal. The owner
# runs it through net once it has bound the UDC and the interface has appeared.
net_up() {
local dev why
if ! dev=$(net_ifname); then
net_status "error: no netdev yet; it appears when the owner binds the UDC (then run net)"
echo "$NET_FN present, its netdev not yet created (appears at bind); run net after binding" >&2
return 0
fi
# NetworkManager manages every device on AGNOS and would DHCP on it itself
nmcli dev set "$dev" managed no >/dev/null 2>&1 || true
if ! ip addr replace "$COMMA_ADDR/$COMMA_PREFIX" dev "$dev" 2>/dev/null; then
why="could not set $COMMA_ADDR/$COMMA_PREFIX on $dev"
net_status "error: $why"; echo "jetlink: $why" >&2
return 0
fi
if ! ip link set "$dev" up 2>/dev/null; then
why="could not bring $dev up"
net_status "error: $why"; echo "jetlink: $why" >&2
return 0
fi
# Steer receive processing onto the big cores: the comma's little cores add
# milliseconds to a 460 KB frame.
if [[ -w "/sys/class/net/$dev/queues/rx-0/rps_cpus" ]]; then
echo f0 > "/sys/class/net/$dev/queues/rx-0/rps_cpus" 2>/dev/null || true
fi
# DHCP for the phone, and only that: no router (option 3) and no DNS (option 6),
# so the phone keeps its default route over Wi-Fi. No DNS service (--port=0).
# dnsmasq binds the interface by name, so a netdev that came back under a new
# name after a rebind needs a fresh dnsmasq: the running one is on a ghost.
if dnsmasq_alive && [[ "$(cat "$DNSMASQ_IF" 2>/dev/null || true)" != "$dev" ]]; then
kill "$(cat "$DNSMASQ_PID")" 2>/dev/null || true
sleep 0.2
fi
if ! dnsmasq_alive; then
rm -f "$DNSMASQ_PID" 2>/dev/null || true
if ! dnsmasq --conf-file=/dev/null --bind-interfaces --interface="$dev" \
--except-interface=lo --port=0 --dhcp-range="$DHCP_RANGE" \
--dhcp-option=3 --dhcp-option=6 --dhcp-leasefile="$DNSMASQ_LEASES" \
--pid-file="$DNSMASQ_PID" 2>/dev/null; then
why="dnsmasq would not start on $dev"
net_status "error: $why"; echo "jetlink: $why" >&2
return 0
fi
echo "$dev" > "$DNSMASQ_IF"
fi
net_status "ok $COMMA_ADDR $dev"
echo "$dev (ncm) at $COMMA_ADDR/$COMMA_PREFIX, DHCP $DHCP_RANGE"
return 0
}
net_down() {
local pid
pid=$(cat "$DNSMASQ_PID" 2>/dev/null || true)
if [[ -n "$pid" ]]; then
kill "$pid" 2>/dev/null || true
fi
rm -f "$DNSMASQ_PID" 2>/dev/null || true
}
# The network function and its DHCP server, gone: for teardown, and for a USB
# gadget left with one by an iOS boot. Unlinking it force-unbinds the UDC.
net_remove() {
local f
net_down
for f in "$GADGET"/configs/c.1/*."$NET_IF"; do
if [[ -L "$f" ]]; then rm -f "$f" 2>/dev/null || true; fi
done
for f in "$GADGET"/functions/*."$NET_IF"; do
if [[ -d "$f" ]]; then rmdir "$f" 2>/dev/null || true; fi
done
}
# -- subcommands ----------------------------------------------------------------
cmd_gadget() {
local ios=0 udcs other owner bound serial uid gid
case "${1:-}" in
"") ;;
--ios) ios=1 ;;
*) usage ;;
esac
[[ $EUID -eq 0 ]] || fail "jetlink-root.sh gadget must run as root"
# set -e alone exits without going through fail, leaving last boot's "ok" in
# $STATUS_FILE for the openpilot side to read.
trap 'fail "line $LINENO: $BASH_COMMAND failed"' ERR
mountpoint -q "$CONFIGFS" || mount -t configfs none "$CONFIGFS" 2>/dev/null || true
mountpoint -q "$CONFIGFS" || fail "no configfs at $CONFIGFS; this kernel cannot configure a USB gadget"
# absent means this AGNOS build has no CONFIG_USB_LIBCOMPOSITE, which nothing
# in userspace can fix
[[ -d "$CONFIGFS/usb_gadget" ]] || fail "kernel has no USB gadget support (CONFIG_USB_LIBCOMPOSITE); jetlink needs an AGNOS build that has it"
# No FunctionFS preflight on purpose: the kernel registers the functionfs
# filesystem only while some ffs.* function exists, so /proc/filesystems never
# lists it on a cold boot. The mkdir, mount and ep0 checks below test it in use.
# a gadget needs a device controller
shopt -s nullglob
udcs=("/sys/class/udc"/*)
shopt -u nullglob
[[ ${#udcs[@]} -gt 0 ]] || fail "no USB device controller in /sys/class/udc; this device cannot act as a USB gadget"
# refuse to fight another gadget for the controller rather than unbinding it
for other in "$CONFIGFS"/usb_gadget/*/UDC; do
if [[ -e "$other" ]]; then
owner=$(basename "$(dirname "$other")")
bound=$(cat "$other" 2>/dev/null || true)
if [[ "$owner" != "jetlink" && -n "$bound" ]]; then
fail "USB gadget '$owner' already holds the device controller ($bound); tear it down first"
fi
fi
done
mkdir -p "$GADGET" || fail "could not create the gadget at $GADGET"
cd "$GADGET"
echo "$VID" > idVendor
echo "$PID" > idProduct
echo 0x0320 > bcdUSB # 3.2: advertise SuperSpeed
if [[ $ios -eq 1 ]]; then
# its own bcdDevice, so hosts that cache descriptors by VID/PID/bcdDevice
# (macOS, Windows) fetch the composite ones rather than the plain gadget's
echo 0x0101 > bcdDevice
# Miscellaneous / Common Class / IAD: the composite device class, which tells
# a host to bind a driver per interface association (the vendor interface
# for jetlink, CDC-NCM for the network) rather than one for the whole device
echo 0xEF > bDeviceClass
echo 0x02 > bDeviceSubClass
echo 0x01 > bDeviceProtocol
else
# the plain gadget, as it has always been: class per interface
echo 0x0100 > bcdDevice
echo 0x00 > bDeviceClass
echo 0x00 > bDeviceSubClass
echo 0x00 > bDeviceProtocol
fi
# The device tree carries a serial on some commas and not others; any stable
# string will do.
serial=$({ tr -d '\0' < /proc/device-tree/serial-number; } 2>/dev/null || cat /etc/machine-id 2>/dev/null || echo 0001)
[[ -n "$serial" ]] || serial=0001
mkdir -p strings/0x409
echo "zoompilot" > strings/0x409/manufacturer
echo "jetlink" > strings/0x409/product
echo "$serial" > strings/0x409/serialnumber
mkdir -p configs/c.1/strings/0x409
echo "jetlink inference link" > configs/c.1/strings/0x409/configuration
# self-powered, and as little as the spec allows: the Jetson has its own 12 V feed
echo 0xC0 > configs/c.1/bmAttributes
echo 8 > configs/c.1/MaxPower
# the mkdir instantiates the function and registers functionfs, so a kernel
# genuinely without it fails here
mkdir -p "functions/ffs.$FFS_NAME" ||
fail "kernel has no ffs gadget function (CONFIG_USB_CONFIGFS_F_FS); jetlink cannot present its endpoints"
# Link once: this is re-run on every deploy, and unlinking a function from a bound
# config force-unbinds the UDC, so an unconditional ln -sf drops a live link.
# Linked before the network function so it is interface 0: hosts that open the
# vendor interface by number depend on that.
[[ -L "configs/c.1/ffs.$FFS_NAME" ]] ||
ln -s "$GADGET/functions/ffs.$FFS_NAME" "configs/c.1/ffs.$FFS_NAME" ||
fail "could not link ffs.$FFS_NAME into configs/c.1"
# The network interface, for an iPhone only. A USB gadget left with one from an
# iOS boot loses it here: unlinking it force-unbinds the UDC, which is why the
# owner switches only while parked. The 4.9 kernel picks the interface's MAC
# addresses itself and refuses them from configfs; DHCP makes that harmless.
if [[ $ios -eq 0 ]]; then
if net_present; then net_remove; fi
else
mkdir -p "functions/$NET_FN" || fail "could not create the $NET_FN gadget function"
# after ffs, so it takes the next interface numbers
[[ -L "configs/c.1/$NET_FN" ]] ||
ln -s "$GADGET/functions/$NET_FN" "configs/c.1/$NET_FN" ||
fail "could not link $NET_FN into configs/c.1"
fi
mkdir -p "$FFS_MOUNT"
# Owned by the user openpilot runs as: on a root-only mount the owner and
# modeld cannot open the endpoints, and Path.exists() raises rather than
# returning False.
uid=$(id -u "$OPENPILOT_USER")
gid=$(id -g "$OPENPILOT_USER")
mountpoint -q "$FFS_MOUNT" || mount -t functionfs -o "uid=$uid,gid=$gid" "$FFS_NAME" "$FFS_MOUNT" ||
fail "could not mount functionfs at $FFS_MOUNT"
# the check that proves the chain: ep0 is what the owner opens to write the
# descriptors and bind the controller
[[ -e "$FFS_MOUNT/ep0" ]] || fail "functionfs mounted at $FFS_MOUNT but has no ep0"
# the owner binds the UDC as the openpilot user, so hand it that one attribute
chown "$OPENPILOT_USER" "$GADGET/UDC" 2>/dev/null || true
status ok
echo "gadget ready at $GADGET"
echo "functionfs mounted at $FFS_MOUNT"
if [[ $ios -eq 1 ]]; then
echo "network function: $NET_FN (after ffs.$FFS_NAME in configs/c.1)"
# its netdev appears at the owner's bind, and net sets it up then
rm -f "$NET_STATUS_FILE" 2>/dev/null || true
else
net_status "net: off"
fi
echo "available UDCs: ${udcs[*]##*/}"
echo "the owner writes the descriptors and binds the UDC"
}
cmd_net() {
[[ $EUID -eq 0 ]] || fail "jetlink-root.sh net must run as root"
[[ -d "$GADGET" ]] || { net_status "error: no gadget"; fail "no gadget at $GADGET; run gadget first"; }
net_up
}
cmd_teardown() {
local f linked=0
net_remove
if [[ -d "$GADGET" ]]; then
echo "" > "$GADGET/UDC" 2>/dev/null || true
rm -f "$GADGET/configs/c.1/ffs.$FFS_NAME" 2>/dev/null || true
rmdir "$GADGET/configs/c.1/strings/0x409" 2>/dev/null || true
# a config with a function still linked cannot go, and trying is a
# configfs error worth not making
for f in "$GADGET"/configs/c.1/*; do
if [[ -L "$f" ]]; then linked=1; fi
done
if [[ $linked -eq 0 ]]; then
rmdir "$GADGET/configs/c.1" 2>/dev/null || true
else
echo "jetlink: configs/c.1 still has a function linked; left in place" >&2
fi
rmdir "$GADGET/functions/ffs.$FFS_NAME" 2>/dev/null || true
rmdir "$GADGET/strings/0x409" 2>/dev/null || true
rmdir "$GADGET" 2>/dev/null || true
fi
# A plain umount can block or segfault on a FunctionFS instance whose owner died
# with endpoints open; lazy-detach unhooks it now and lets the kernel finish.
umount -l "$FFS_MOUNT" 2>/dev/null || umount "$FFS_MOUNT" 2>/dev/null || true
rmdir "$FFS_MOUNT" 2>/dev/null || true
status "error: gadget torn down"
net_status "error: gadget torn down"
echo "jetlink gadget torn down"
}
cmd_check() {
local u g dev udcs
[[ $EUID -eq 0 ]] || { echo "run check as root (sudo)" >&2; exit 1; }
echo "kernel: $(uname -r)"
if mountpoint -q "$CONFIGFS" && [[ -d "$CONFIGFS/usb_gadget" ]]; then
echo "configfs USB gadgets: yes"
else
echo "configfs USB gadgets: NO (no $CONFIGFS/usb_gadget)"
fi
shopt -s nullglob
udcs=(/sys/class/udc/*)
shopt -u nullglob
for u in "${udcs[@]}"; do
# current_speed is the negotiated bus speed: super-speed is USB 3, and a
# 460 KB frame is ~1 ms there against ~11 ms at high-speed (USB 2). The
# owner logs it on every configured edge, since nothing in this script
# runs after enumeration.
echo "device controller: $(basename "$u"), state $(cat "$u/state" 2>/dev/null || echo unknown), speed $(cat "$u/current_speed" 2>/dev/null || echo unknown)"
done
[[ ${#udcs[@]} -gt 0 ]] || echo "device controller: NONE"
for g in "$CONFIGFS"/usb_gadget/*/; do
[[ -d "$g" ]] || continue
echo "gadget $(basename "$g"): bound to '$(cat "$g/UDC" 2>/dev/null)'"
done
echo "gadget status: $(cat "$STATUS_FILE" 2>/dev/null || echo none)"
# A phone plugged straight into the comma negotiates power and the comma may
# end up sourcing it, which reboots the comma. Through a hub the comma sinks.
# On a C-to-C cable the comma can come out the host instead; port hold fixes that.
if [[ -d "$USBPD" ]]; then
echo "USB-C port: power role $(cat "$USBPD/current_pr" 2>/dev/null || echo unknown), data role $(cat "$USBPD/current_dr" 2>/dev/null || echo unknown), USB PD contract $(cat "$USBPD/contract" 2>/dev/null || echo unknown), Type-C $(cat "$USB_PSY/typec_mode" 2>/dev/null || echo unknown)"
fi
if [[ "$(cat "$POWER_ROLE_VOTER/force_active" 2>/dev/null || true)" == 1 ]]; then
echo "USB-C port: held as the device (port hold)"
fi
if [[ "$(cat "$USB_ICL_VOTER/force_active" 2>/dev/null || true)" == 1 ]]; then
echo "USB-C port: no current drawn from it (draw off)"
fi
if [[ -d "$UDC_GLUE" ]]; then
echo "USB device controller: $(cat "$UDC_GLUE/mode" 2>/dev/null || echo unknown), charger detection $(cat "$USB_PSY/real_type" 2>/dev/null || echo unknown), kept a device $(cat "$PE_PARAMS/usb_compliance_mode" 2>/dev/null || echo '?')/$(cat "$UDC_GLUE/usb_compliance_mode" 2>/dev/null || echo '?')"
fi
if ! net_present; then
echo "network function: none (the USB gadget, or no gadget)"
return 0
fi
echo "network function: $NET_FN"
if dev=$(net_ifname); then
echo "$dev: $(cat "/sys/class/net/$dev/operstate" 2>/dev/null || echo unknown), $(ip -4 -o addr show dev "$dev" 2>/dev/null | awk '{print $4}' | tr '\n' ' ')"
else
echo "netdev: absent (it appears when the owner binds the UDC)"
fi
echo "network status: $(cat "$NET_STATUS_FILE" 2>/dev/null || echo unknown)"
if dnsmasq_alive; then echo "dnsmasq: running"; else echo "dnsmasq: not running"; fi
}
# The comma's USB-C port, for a link that runs over USB. hold keeps the port at
# sink, which makes the far end the host; off is dual role, as AGNOS boots it.
# device asks the far end over USB PD to take the host role (a DR_Swap): for a
# far end that powers the comma and still came out the device, which hold
# cannot change. reset is a USB PD hard reset, which puts both ends back to
# the roles their power gives them: a sink is the device. source asks a far end
# that powers the comma for the source role (a PR_Swap), which leaves the data
# roles as they are: an iPhone that hosts the comma stays the host and charges
# from it. The voter gates it, so port off comes first. sink is the swap back,
# for a phone whose link went down once it charged.
cmd_port() {
case "${1:-}" in
hold) force_voter "$POWER_ROLE_VOTER" 1 "to hold the port" || exit 1 ;;
# letting go applies the voters' own result, which is dual role
off) release_voter "$POWER_ROLE_VOTER" || exit 1 ;;
# the kernel sends the DR_Swap and waits 100 ms for it; a refusal, or PD not
# ready yet, is a failed write
device) put device "$DUAL_ROLE/data_role" "the far end did not take the host role ($DUAL_ROLE/data_role)" || exit 1 ;;
reset) put 1 "$USBPD/hard_reset" "could not reset USB PD ($USBPD/hard_reset)" || exit 1 ;;
# the kernel sends the PR_Swap and waits up to 2 s for it; only with a USB PD
# contract, so a write before one, or a refusal, fails
source) put source "$DUAL_ROLE/power_role" "the far end did not give up the source role ($DUAL_ROLE/power_role)" || exit 1 ;;
sink) put sink "$DUAL_ROLE/power_role" "the far end did not take the source role back ($DUAL_ROLE/power_role)" || exit 1 ;;
*) usage ;;
esac
}
# The port's USB device controller, while the link is on. apply keeps it a
# device whatever the charger detection made of the far end's data lines, and
# restore puts the stock behaviour back; see UDC_GLUE. start turns the device
# side on now, for a host that powers the port while it is off, and stop turns
# it off again once that host is gone.
cmd_udc() {
case "${1:-}" in
apply) udc_compliance Y || exit 1 ;;
restore) udc_compliance N || exit 1 ;;
start) put peripheral "$UDC_GLUE/mode" "could not start the USB device controller ($UDC_GLUE/mode)" || exit 1 ;;
stop) put none "$UDC_GLUE/mode" "could not stop the USB device controller ($UDC_GLUE/mode)" || exit 1 ;;
*) usage ;;
esac
}
# Both knobs, each on its own, so one the kernel lacks does not keep the other.
udc_compliance() {
local failed=0 knob
for knob in "$PE_PARAMS/usb_compliance_mode" "$UDC_GLUE/usb_compliance_mode"; do
put "$1" "$knob" "could not set $knob" || failed=1
done
return $failed
}
# One value into one kernel file; a line on stderr, with the kernel's reason,
# and a failure when the kernel refuses it. Not fail(): that is the gadget's record.
put() {
local err
if ! err=$( { echo "$1" > "$2"; } 2>&1 ); then
echo "jetlink: $3${err:+: ${err##*: }}" >&2
return 1
fi
}
# A charger voter under debugfs forced to a value, and let go: force_val first,
# since forcing applies whatever force_val holds at that moment.
force_voter() {
{ echo "$2" > "$1/force_val" && echo 1 > "$1/force_active"; } 2>/dev/null ||
{ echo "jetlink: could not force $1 $3" >&2; return 1; }
}
release_voter() {
{ echo 0 > "$1/force_active" && echo 0 > "$1/force_val"; } 2>/dev/null ||
{ echo "jetlink: could not release $1" >&2; return 1; }
}
# One key per write, so a value the kernel rejects does not take the rest with it.
sysctl_write() {
put "$2" "$PROC_SYS/${1//.//}" "could not set $1=$2"
}
# Applied while the link is on, so a device with the link off runs stock
# values. Only restore undoes them, never an exit: a process that restored on
# exit and stopped at ignition would hand every drive the stock values. A
# reboot resets them.
vm_apply() {
local pair key value rec="" failed=0
if [[ ! -e "$SYSCTL_PREV" ]]; then
for pair in "${VM_SYSCTLS[@]}"; do
key=${pair%%=*}
value=""
{ read -r value < "$PROC_SYS/${key//.//}"; } 2>/dev/null || true
if [[ "$value" == 0 && "$key" == *_bytes ]]; then
# Stock AGNOS runs the dirty limits in ratio mode, so the *_bytes keys
# read 0, and the kernel silently drops a 0 written back to one.
# Writing the ratio key is what zeroes the bytes key, so that is the
# one to put back.
key=${key%_bytes}_ratio
value=""
{ read -r value < "$PROC_SYS/${key//.//}"; } 2>/dev/null || true
fi
if [[ -n "$value" ]]; then
rec+="$key=$value"$'\n'
else
echo "jetlink: could not read $key" >&2
fi
done
if [[ -n "$rec" ]]; then
{ printf '%s' "$rec" > "$SYSCTL_PREV" && chmod 0644 "$SYSCTL_PREV"; } 2>/dev/null ||
echo "jetlink: could not record the previous sysctls in $SYSCTL_PREV" >&2
fi
fi
for pair in "${VM_SYSCTLS[@]}"; do
sysctl_write "${pair%%=*}" "${pair#*=}" || failed=1
done
return $failed
}
# Writes the record back line by line: a vm or net.core key and a number,
# nothing else.
vm_restore() {
local key value failed=0
[[ -e "$SYSCTL_PREV" ]] || return 0
while IFS='=' read -r key value; do
if [[ "$key" =~ ^(vm|net\.core)\.[a-z_]+$ && "$value" =~ ^[0-9]+$ ]]; then
sysctl_write "$key" "$value" || failed=1
else
echo "jetlink: not restoring '$key=$value' from $SYSCTL_PREV" >&2
failed=1
fi
done < "$SYSCTL_PREV"
rm -f "$SYSCTL_PREV" 2>/dev/null || true
return $failed
}
cmd_vm() {
case "${1:-}" in
apply) vm_apply || exit 1 ;;
restore) vm_restore || exit 1 ;;
*) usage ;;
esac
}
# The port's input current while the link is iOS; see USB_ICL_VOTER. off forces
# the limit to 0 and on gives the charger its own limit back. Like udc and vm,
# undone only by on, never at an exit; a reboot clears it.
cmd_draw() {
case "${1:-}" in
off) force_voter "$USB_ICL_VOTER" 0 "to stop drawing from the port" || exit 1 ;;
on) release_voter "$USB_ICL_VOTER" || exit 1 ;;
*) usage ;;
esac
}
cmd=${1:-}
if [[ $# -gt 0 ]]; then shift; fi
case "$cmd" in
gadget) cmd_gadget "$@" ;;
net) cmd_net ;;
check) cmd_check ;;
teardown) cmd_teardown ;;
port) cmd_port "$@" ;;
udc) cmd_udc "$@" ;;
vm) cmd_vm "$@" ;;
draw) cmd_draw "$@" ;;
*) usage ;;
esac
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
exec "${ROOT_DIR}/scripts/host_tool_runner.sh" jotpluggler "$@"
+62 -5
View File
@@ -4,6 +4,18 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
source "$DIR/launch_env.sh"
if [ -f "$DIR/scripts/branch-migration.json" ]; then
python3 "$DIR/scripts/branch_migration.py" --repo "$DIR" || echo "Branch migration deferred; keeping installed software."
fi
function run_agnos_updater {
if python3 -c "import openpilot.system.ui.updater"; then
python3 -m openpilot.system.ui.updater "$@"
else
"$DIR/openpilot/common/hardware/comma/updater" "$@"
fi
}
function agnos_init {
if [ "${AGNOS_UPDATE_POLICY:-auto}" = "retain" ] && [ "$(< /VERSION)" != "$AGNOS_VERSION" ]; then
echo "This StarPilot build retains AGNOS $AGNOS_VERSION; installed OS does not match. No OS update was attempted."
@@ -22,6 +34,13 @@ function agnos_init {
sudo chgrp gpu /dev/adsprpc-smd /dev/ion /dev/kgsl-3d0
sudo chmod 660 /dev/adsprpc-smd /dev/ion /dev/kgsl-3d0
local sound_node
for sound_node in /dev/snd/*C*; do
[ -c "$sound_node" ] || continue
sudo chgrp audio "$sound_node"
sudo chmod 660 "$sound_node"
done
# Check if AGNOS update is required
if [ "$(< /VERSION)" != "$AGNOS_VERSION" ]; then
AGNOS_PY="$DIR/openpilot/common/hardware/comma/agnos.py"
@@ -30,7 +49,7 @@ function agnos_init {
sudo reboot
fi
while true; do
"$DIR/openpilot/common/hardware/comma/updater" "$AGNOS_PY" "$MANIFEST"
run_agnos_updater "$AGNOS_PY" "$MANIFEST"
done
fi
@@ -57,6 +76,42 @@ EOF
fi
}
function update_is_ready {
[ -f "$1" ] && [ ! -L "$1" ]
}
# A validated legacy return records the OS it was staged against. Check it on
# every boot before swapping trees, including manual reboots.
# Keep this in sync with TRUSTED_LEGACY_RELEASES in updated.py.
TRUSTED_LEGACY_STARPILOT_COMMIT="c2e5e469ee8fefc3cffb514dc2e1a1fb82a421d6"
TRUSTED_LEGACY_STABLE_MIGRATION="0b2061df8d2a931feaf34943e3460510d160f99e"
function trusted_legacy_commit {
[ "$1" = "$TRUSTED_LEGACY_STARPILOT_COMMIT" ] || [ "$1" = "$TRUSTED_LEGACY_STABLE_MIGRATION" ]
}
function staged_os_is_compatible {
local staged="$1" marker="$1/.git/starpilot-retain-agnos" commit
commit="$(git -C "$staged" rev-parse --verify 'HEAD^{commit}')" || return 1
if trusted_legacy_commit "$commit"; then
[ -f "$marker" ] && [ -s "$marker" ] && [ ! -L "$marker" ] && [ -r /VERSION ] && [ "$(cat "$marker")" = "$(< /VERSION)" ]
else
[ ! -e "$marker" ] && [ ! -L "$marker" ]
fi
}
function reset_update_os_environment {
unset AGNOS_VERSION AGNOS_ACCEPTED_VERSIONS
}
function maybe_activate_legacy_agnos {
local repo="$1" verifier="$2" manifest="$3" commit
commit="$(git -C "$repo" rev-parse --verify 'HEAD^{commit}')" || return 1
if ! trusted_legacy_commit "$commit" && [ ! -L "$manifest" ]; then
"$verifier" --verify "$manifest" && sudo reboot
fi
}
function launch {
# Remove orphaned git lock if it exists on boot
[ -f "$DIR/.git/index.lock" ] && rm -f "$DIR/.git/index.lock"
@@ -75,8 +130,10 @@ function launch {
if [ $? -eq 0 ]; then
echo "${DIR} has been modified, skipping overlay update installation"
else
if [ -f "${STAGING_ROOT}/finalized/.overlay_consistent" ]; then
if [ ! -d /data/safe_staging/old_openpilot ]; then
if update_is_ready "${STAGING_ROOT}/finalized/.overlay_consistent"; then
if ! staged_os_is_compatible "${STAGING_ROOT}/finalized"; then
echo "Staged update requires a different or unverified AGNOS version; skipping installation."
elif [ ! -d /data/safe_staging/old_openpilot ]; then
echo "Valid overlay update found, installing"
LAUNCHER_LOCATION="${BASH_SOURCE[0]}"
@@ -84,10 +141,10 @@ function launch {
mv "${STAGING_ROOT}/finalized" "$DIR"
cd "$DIR"
# releases before the openpilot/ move can't swap AGNOS on newer AGNOS, use ours
[ ! -L system/hardware/tici/agnos.json ] && /data/safe_staging/old_openpilot/openpilot/common/hardware/comma/agnos.py --verify system/hardware/tici/agnos.json && sudo reboot
maybe_activate_legacy_agnos "$DIR" /data/safe_staging/old_openpilot/openpilot/common/hardware/comma/agnos.py system/hardware/tici/agnos.json
echo "Restarting launch script ${LAUNCHER_LOCATION}"
unset AGNOS_VERSION
reset_update_os_environment
exec "${LAUNCHER_LOCATION}"
else
echo "openpilot backup found, not updating"
+21 -1
View File
@@ -1,5 +1,10 @@
#!/usr/bin/env bash
# Device Params must not depend on the platform used to compile native libraries.
if [ -f /AGNOS ] && [ -z "${PARAMS_ROOT:-}" ]; then
export PARAMS_ROOT="/data/params"
fi
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
@@ -21,9 +26,24 @@ fi
export QCOM_PRIORITY=12
if [ -z "$AGNOS_VERSION" ]; then
export AGNOS_VERSION="19.8.1"
export AGNOS_VERSION="20.6.1"
fi
# Legacy stagers defer flashing; agnos_init still requires AGNOS_VERSION before manager startup.
export AGNOS_ACCEPTED_VERSIONS="$AGNOS_VERSION"
if [ -r /VERSION ]; then
export AGNOS_ACCEPTED_VERSIONS="$AGNOS_VERSION $(</VERSION)"
fi
export AGNOS_UPDATE_POLICY="auto"
# C3 selects its complete matching firmware chain in the AGNOS manifest loader.
# Unknown hardware retains its installed OS.
if [ -f /AGNOS ] || [ -e /sys/firmware/devicetree/base/model ]; then
case "$(tr -d '\0' 2>/dev/null < /sys/firmware/devicetree/base/model)" in
"comma tici"|"comma tizi"|"comma mici") ;;
*) export AGNOS_UPDATE_POLICY="retain" ;;
esac
fi
export STAGING_ROOT="/data/safe_staging"
+11 -1
View File
@@ -10,7 +10,12 @@ $Go.import("pfeifer.dev/mapd/cereal/custom");
# DO rename the structs
# DON'T change the identifier (e.g. @0x81c2f05a394cf4af)
struct CustomReserved0 @0x81c2f05a394cf4af {
struct StarPilotCarControl @0x81c2f05a394cf4af {
# The first three fields are pointer slots mapd does not read.
hudControl @0 :AnyPointer;
steeringLimitInfo @1 :AnyPointer;
navigation @2 :AnyPointer;
phoneGps @3 :StarPilotCarState.Gps; # sourceMonoTime is comma receive time minus the phone's fix age
}
struct CustomReserved1 @0xaedffd8f31e7b55d {
@@ -286,6 +291,11 @@ struct MapdOut @0xa4f1eb3323f5f582 {
computedMonoTime @31 :UInt64; # Computation boot-time nanoseconds, not send time.
sourceGeneration @32 :UInt64;
producerSession @33 :UInt64; # Random nonzero process session.
# Data-only preview from the same qualified GPS fix; no controller smoothing.
previewSpeedLimit @34 :Float32;
previewDistance @35 :Float32;
previewBoundaryId @36 :Text;
previewWayId @37 :Int64;
enum SampleStatus {
unknown @0;
+456 -334
View File
@@ -9,69 +9,137 @@ import (
math "math"
)
type CustomReserved0 capnp.Struct
type StarPilotCarControl capnp.Struct
// CustomReserved0_TypeID is the unique identifier for the type CustomReserved0.
const CustomReserved0_TypeID = 0x81c2f05a394cf4af
// StarPilotCarControl_TypeID is the unique identifier for the type StarPilotCarControl.
const StarPilotCarControl_TypeID = 0x81c2f05a394cf4af
func NewCustomReserved0(s *capnp.Segment) (CustomReserved0, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0})
return CustomReserved0(st), err
func NewStarPilotCarControl(s *capnp.Segment) (StarPilotCarControl, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 4})
return StarPilotCarControl(st), err
}
func NewRootCustomReserved0(s *capnp.Segment) (CustomReserved0, error) {
st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0})
return CustomReserved0(st), err
func NewRootStarPilotCarControl(s *capnp.Segment) (StarPilotCarControl, error) {
st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 4})
return StarPilotCarControl(st), err
}
func ReadRootCustomReserved0(msg *capnp.Message) (CustomReserved0, error) {
func ReadRootStarPilotCarControl(msg *capnp.Message) (StarPilotCarControl, error) {
root, err := msg.Root()
return CustomReserved0(root.Struct()), err
return StarPilotCarControl(root.Struct()), err
}
func (s CustomReserved0) String() string {
func (s StarPilotCarControl) String() string {
str, _ := text.Marshal(0x81c2f05a394cf4af, capnp.Struct(s))
return str
}
func (s CustomReserved0) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr {
func (s StarPilotCarControl) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr {
return capnp.Struct(s).EncodeAsPtr(seg)
}
func (CustomReserved0) DecodeFromPtr(p capnp.Ptr) CustomReserved0 {
return CustomReserved0(capnp.Struct{}.DecodeFromPtr(p))
func (StarPilotCarControl) DecodeFromPtr(p capnp.Ptr) StarPilotCarControl {
return StarPilotCarControl(capnp.Struct{}.DecodeFromPtr(p))
}
func (s CustomReserved0) ToPtr() capnp.Ptr {
func (s StarPilotCarControl) ToPtr() capnp.Ptr {
return capnp.Struct(s).ToPtr()
}
func (s CustomReserved0) IsValid() bool {
func (s StarPilotCarControl) IsValid() bool {
return capnp.Struct(s).IsValid()
}
func (s CustomReserved0) Message() *capnp.Message {
func (s StarPilotCarControl) Message() *capnp.Message {
return capnp.Struct(s).Message()
}
func (s CustomReserved0) Segment() *capnp.Segment {
func (s StarPilotCarControl) Segment() *capnp.Segment {
return capnp.Struct(s).Segment()
}
// CustomReserved0_List is a list of CustomReserved0.
type CustomReserved0_List = capnp.StructList[CustomReserved0]
// NewCustomReserved0 creates a new list of CustomReserved0.
func NewCustomReserved0_List(s *capnp.Segment, sz int32) (CustomReserved0_List, error) {
l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}, sz)
return capnp.StructList[CustomReserved0](l), err
func (s StarPilotCarControl) HudControl() (capnp.Ptr, error) {
return capnp.Struct(s).Ptr(0)
}
// CustomReserved0_Future is a wrapper for a CustomReserved0 promised by a client call.
type CustomReserved0_Future struct{ *capnp.Future }
func (s StarPilotCarControl) HasHudControl() bool {
return capnp.Struct(s).HasPtr(0)
}
func (f CustomReserved0_Future) Struct() (CustomReserved0, error) {
func (s StarPilotCarControl) SetHudControl(v capnp.Ptr) error {
return capnp.Struct(s).SetPtr(0, v)
}
func (s StarPilotCarControl) SteeringLimitInfo() (capnp.Ptr, error) {
return capnp.Struct(s).Ptr(1)
}
func (s StarPilotCarControl) HasSteeringLimitInfo() bool {
return capnp.Struct(s).HasPtr(1)
}
func (s StarPilotCarControl) SetSteeringLimitInfo(v capnp.Ptr) error {
return capnp.Struct(s).SetPtr(1, v)
}
func (s StarPilotCarControl) Navigation() (capnp.Ptr, error) {
return capnp.Struct(s).Ptr(2)
}
func (s StarPilotCarControl) HasNavigation() bool {
return capnp.Struct(s).HasPtr(2)
}
func (s StarPilotCarControl) SetNavigation(v capnp.Ptr) error {
return capnp.Struct(s).SetPtr(2, v)
}
func (s StarPilotCarControl) PhoneGps() (StarPilotCarState_Gps, error) {
p, err := capnp.Struct(s).Ptr(3)
return StarPilotCarState_Gps(p.Struct()), err
}
func (s StarPilotCarControl) HasPhoneGps() bool {
return capnp.Struct(s).HasPtr(3)
}
func (s StarPilotCarControl) SetPhoneGps(v StarPilotCarState_Gps) error {
return capnp.Struct(s).SetPtr(3, capnp.Struct(v).ToPtr())
}
// NewPhoneGps sets the phoneGps field to a newly
// allocated StarPilotCarState_Gps struct, preferring placement in s's segment.
func (s StarPilotCarControl) NewPhoneGps() (StarPilotCarState_Gps, error) {
ss, err := NewStarPilotCarState_Gps(capnp.Struct(s).Segment())
if err != nil {
return StarPilotCarState_Gps{}, err
}
err = capnp.Struct(s).SetPtr(3, capnp.Struct(ss).ToPtr())
return ss, err
}
// StarPilotCarControl_List is a list of StarPilotCarControl.
type StarPilotCarControl_List = capnp.StructList[StarPilotCarControl]
// NewStarPilotCarControl creates a new list of StarPilotCarControl.
func NewStarPilotCarControl_List(s *capnp.Segment, sz int32) (StarPilotCarControl_List, error) {
l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 4}, sz)
return capnp.StructList[StarPilotCarControl](l), err
}
// StarPilotCarControl_Future is a wrapper for a StarPilotCarControl promised by a client call.
type StarPilotCarControl_Future struct{ *capnp.Future }
func (f StarPilotCarControl_Future) Struct() (StarPilotCarControl, error) {
p, err := f.Future.Ptr()
return CustomReserved0(p.Struct()), err
return StarPilotCarControl(p.Struct()), err
}
func (p StarPilotCarControl_Future) HudControl() *capnp.Future {
return p.Future.Field(0, nil)
}
func (p StarPilotCarControl_Future) SteeringLimitInfo() *capnp.Future {
return p.Future.Field(1, nil)
}
func (p StarPilotCarControl_Future) Navigation() *capnp.Future {
return p.Future.Field(2, nil)
}
func (p StarPilotCarControl_Future) PhoneGps() StarPilotCarState_Gps_Future {
return StarPilotCarState_Gps_Future{Future: p.Future.Field(3, nil)}
}
type CustomReserved1 capnp.Struct
@@ -2819,12 +2887,12 @@ type MapdOut capnp.Struct
const MapdOut_TypeID = 0xa4f1eb3323f5f582
func NewMapdOut(s *capnp.Segment) (MapdOut, error) {
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 112, PointerCount: 6})
st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 128, PointerCount: 7})
return MapdOut(st), err
}
func NewRootMapdOut(s *capnp.Segment) (MapdOut, error) {
st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 112, PointerCount: 6})
st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 128, PointerCount: 7})
return MapdOut(st), err
}
@@ -3192,12 +3260,54 @@ func (s MapdOut) SetProducerSession(v uint64) {
capnp.Struct(s).SetUint64(104, v)
}
func (s MapdOut) PreviewSpeedLimit() float32 {
return math.Float32frombits(capnp.Struct(s).Uint32(76))
}
func (s MapdOut) SetPreviewSpeedLimit(v float32) {
capnp.Struct(s).SetUint32(76, math.Float32bits(v))
}
func (s MapdOut) PreviewDistance() float32 {
return math.Float32frombits(capnp.Struct(s).Uint32(112))
}
func (s MapdOut) SetPreviewDistance(v float32) {
capnp.Struct(s).SetUint32(112, math.Float32bits(v))
}
func (s MapdOut) PreviewBoundaryId() (string, error) {
p, err := capnp.Struct(s).Ptr(6)
return p.Text(), err
}
func (s MapdOut) HasPreviewBoundaryId() bool {
return capnp.Struct(s).HasPtr(6)
}
func (s MapdOut) PreviewBoundaryIdBytes() ([]byte, error) {
p, err := capnp.Struct(s).Ptr(6)
return p.TextBytes(), err
}
func (s MapdOut) SetPreviewBoundaryId(v string) error {
return capnp.Struct(s).SetText(6, v)
}
func (s MapdOut) PreviewWayId() int64 {
return int64(capnp.Struct(s).Uint64(120))
}
func (s MapdOut) SetPreviewWayId(v int64) {
capnp.Struct(s).SetUint64(120, uint64(v))
}
// MapdOut_List is a list of MapdOut.
type MapdOut_List = capnp.StructList[MapdOut]
// NewMapdOut creates a new list of MapdOut.
func NewMapdOut_List(s *capnp.Segment, sz int32) (MapdOut_List, error) {
l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 112, PointerCount: 6}, sz)
l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 128, PointerCount: 7}, sz)
return capnp.StructList[MapdOut](l), err
}
@@ -3327,306 +3437,318 @@ func NewMapdOut_GpsSource_List(s *capnp.Segment, sz int32) (MapdOut_GpsSource_Li
return capnp.NewEnumList[MapdOut_GpsSource](s, sz)
}
const schema_b526ba661d550a59 = "x\xda\x94z\x0d\x90T\xd5\x95\xff9\xef\xf5L\xcf'" +
"M\xf3\x1a\x01\x01\xdb!\x928\xc41\xc0\xc8?\x0eh" +
"\x86\xa1g@\xa8\xeea\xde<>\x1c\x94\xaa\xdc\xe9w" +
"\xa7\xe7\xc1\x9b\xf7\x9a\xf7^\xcfLSX \x81*\xf4" +
"\x8f\x15\xcdj\x82)\xd9\xf8\x81\xb5\x9a\x95\x84du\x8b" +
"XX\x0b\x14\xa9B\x17\xaa4\xa5)c\xcc\xfaQ\xd9" +
"\xd2d\xb5\x8cY\xad5\xd9X\xbdu\xee\xed\xaf\xf9\x88" +
"8E\xd5t\xf7\xef\x9cw\xee\xb9\xe7\x9e{\xee\xf9\xdd" +
"\xc7r6\x7fmhE\xf3?\x8d\x81bdkjj" +
"\x0b\xd1\xdd\x03\xef:\xc1O\x0e@t!\x16\x06\x1a\xb6" +
".\x1ez\xfe\xab\xcfA(\x0c\xd0\xfe\x8b5;P\xbb" +
"\xbc&\x0cj\xe1\xa7\x9f$;v\xfc\xe9\xfc\xdd\xd3h" +
"=MZ/\x08\xad\xdb\x13\xe7\xbf;\xf8\xd5\x1f\x1d\x86" +
"\xe8B\xa5\xa2\x05\xd8\xfe\xf0\x9aM\xa8\x9d\\#\xd5\xdd" +
"\x10`\xa1\xed\xc5\xdc\xed?^p\xdf\x03\xa0\xb7a}" +
"\xe1\xbc\xf3o\x8d\xdb.\xdc\xf9\xdfP\x83\xa4\xb3t\xed" +
"\xbd\xa8\xdd\xba\x96\xbev\xac}K\x01,\xfc\xe3\xd7?" +
"\xcaY{w|\x1f\xa2_Q\x0a\x07?\xfd\xf4+\xed" +
"\xff\xf5\xf1\x09\xb2\xbc'q\x10\xb5\xc3\x890\x80vw" +
"\xe2\x07\x80\x859\xcfb&s\xf1\xf2#\xd3x\xfaJ" +
"b\x10\xb5\xffL\x90\xa7m\xbf\x8d\xab\xdd\xe1\xe1\xc7\xa6" +
"\xd1:\x97\xd8\x81\xdakB\xcbV\xdb\xd7~6X\xfb" +
"\x04\xe8\x0b\xb1J\xadF\xe8\xfd\x8c\xf4~\x99\x90\x8fl" +
"G\xc0\x8a_\xfaB\x9cU\xa5^K:\xabz\xaeF" +
"\xad\xa7\xe7k\x00\xed\xacg,\x0cX\xe8N\x9c}\xe9" +
"\xe4[O<9%Z\x7fH\x1dD\xed\xf3\x14\xcd\xe9" +
"/\xa9o\x02\x16\xb6\x9e\xd0\x7fs\xc3\xe8\xe5'\xa7\xf1" +
"\xf6\xf3\xd4\x0e\xd4\xa2\xbd\xe4\xedO~\x9b~\xe8\xff?" +
"\xf5\xd1?O\xb1\xf7aju\xc5\xdef\xc0\xc2\xce\xe7" +
"\xde[\xf1\xdd\xcf\xdf\xfa\xc94\xf6\x9a{w\xa0\xd6\"" +
"\xecu\xbe\xf5\xc7\xbbR\xd7n?5\xed\xa8\x83\xa5Q" +
"/b\xb2\xc5J;\xa7\xa7\xd1\xfa\x90|C\xa15|" +
"\xe6\x1f\x1e4\xd6t\xbf0\x8d\xd6\xef\xc8\xd6\xc7)\xd2" +
":\xa4\xde\xf46\xbf\xe5\xba\xf3\xd3h]&\xadw\x84" +
"\xd6G\xff\xf2\xadWn\xbeu\xd7\xc5\xc9\xab\xa2\x90\xde" +
"\x0b\xa99\xa8]\xa6\xb9\xb6\xbf\x98\x8a\xd3\xaa\xac\x1e\xd8" +
"\x9e\xb5_\xfb\xd1\xbfO7t/\x0d-\x1c|\xf9\xe0" +
"\xa3\x99\xff}\xe3\xfb\x97\xa7\x1b\x9a\xb4\xde\x11Z\x8b/" +
"\xa4\xdf|38\xf8\xca\x94\x10\xbf\xd0\xbb\x0e\xb5\xcb\xbd" +
"b\xd8^\x91\x0c\x1d\x1dg\x1e\xbbt\xef\xff\xfc\x9a\xbc" +
"T'o\xac\xcd\x9bP\xbb\xbc\x99\x16\xe4\xc5\xcd\xef\x01" +
"\x16V%\xbb\xbfsl\xfb\xf7\xdf\x98f\xf4\x93};" +
"P;\xd7G\xa3w|\xe7\xa5\x1f\xfe\xa0\xe6\x07\xffA" +
"&\x95Ij\xc7\xfb\xd6\xa1v\xb2\x8fL>\xdd7\x06" +
"X\xb8\xfe\x95_\x7ftC\xcf\xb3\x7f\x9e\xb2c\x9a\xf5" +
"]\xa8\xb5\xe8\xa4\xb9X\xcf\x00V6\xdfD\xb3r+" +
"n$\xed\x9d\xfa<\x80v\xae\x87)m\x17\x1c?\xbe" +
"\xb1\xfe\x83\xab>\x99\xc6\xd7\x91\x81\x1d\xa8\xdd=@\xbe" +
">\x11\xca~\xbe\xe6\xd0}\x7f\x99Fk'i\xed\x11" +
"Z\xcb\xde_\xda\xfb\xde\x9d\xdf\xfa\xeb\x94x\xa6\x06\x06" +
"Qc\x03\xe4\xe4\xce\x81\xfd\x80\x85\xc7\xfd\xbe\x8b/\xed" +
"|\xe2\xaf\x93\x9d\x14\x8b~|\xe0 j?\x1b\x10\xe1" +
"\x1a\x10\xd1\x8f\xfe\xeb\xd8\x91\x0f\xbb\x06\xff6\xcd\xf0m" +
"w\x0c\xa2\xd6u\x07\x0d\xbf\xff\xd8\xa9\xf7\x8ccG\x0a" +
"\x933I\xcc|\xf1\x1d\xcf\xa3\xb6\xea\x0era\xc5\x1d" +
"?\x85\xc2\xdf\xfd\xf7P!\xcd=\xce\xeco\xa4C9" +
"?pG\xbe\x91\x16\x1f7\xa6Y\xd6\xc9\xaeN\x88\x1f" +
"\xfd\xdc\xe7\xde(W\xcd\x9b\xfa\x10g\xa2\xbf\xfcJ\xfa" +
")\x9657:\xd9\\\xb0%\x9f\xe5\x00}\x88\xfa\x19" +
"T\x00\xb46e\x13\x00\xce\xd2Z\x95\x9f\x03`Dk" +
"U\x1e\x07\xc0\xd9Z\xab\xf2c\x00\x8cj\xad\xcay\x00" +
"\x9c\xa3\xb5*o\x00`\xa3\xd6\xa6\x0c\x02\xa0\xa6\xb5*" +
"/\x01`Lk\x13\x9f\xa8\xadP\xf6\x02\xa0\xa2\xb5)" +
"\xbb\x00p\xae\xd6*~_\xa5-U\xfe\x08\x80\xf3\xb4" +
"V\xe5W\x008_kS\xde\x05\xc0\x05\xda\x0a\xf1\xfb" +
"jm\x95\xf2C\x00\\\xa8\xad\x12\xe3.\xd2V\x09{" +
"\x8b\xb5\x0e\xf1\xfb\x1a\xadC\xf8\xa5\x16\x7f\x87\xb4\x0e\xe1" +
"O\\\xeb\x10v\xaf\xd5n\x15\xf6Z\xda\xbb\x94\xd5\x08" +
"\x805\xdaF\xe5y\x00\xac\xd56\x0a\x07\x9a\xb5\x1ee" +
"\x07\x006i]\xc2\xb1%\xda\xad\xe2\xc1\xafh]\xc2" +
"\xf0u\xc5\xcf\xa5\xed]\xca\x1c2\xd0\xa0mT\xee\x05" +
"\xc0\xafj\x1b\x95?\x03\xe0\xd7\xdaS\xca\x12\x12\\\xaf" +
"m\x15!hm\x1fP\x14\x02\x96\xb5\xef\x94_\xbe\xae" +
"1\xe5{\x00x\x83\xc6\xc4\xa3m\x1a\x13\xc1\x0b\x17\x7f" +
"\xd7iL9\x08\x80\xf5\xdaN\xf1y\xa36@>\x14" +
"Lw\xcc\xb1]f\x02@\xc1\xe7\xc1\x16\xe6e8\x06" +
"I\x16p\x8f\xd9\xf1\xaet\x9a\xdb\x84\x1bY\xceML" +
"Z#V\xb0yh(\xec\xf3`\x12\x9ap\x9dH\xe0" +
"\xb9B9\xc5\xb2\x89\\\x8d7\xca\x85<\xe1:$\x00" +
"\x9f\x07\xdb,\xdfr\x9dDn\x82H\x95\x0f%\xddL" +
"\x92CxT\x8e'4\x15\xa9*|\"\x97\xba\xa4\x8f" +
"\xd5\xb2\x94\xe5H\xf16\x80\x82\xc7i&\x06\x87\xce " +
"\xb0\x9c\x8c_\xf0\xd9(7x\x10@D\xfe\xe4A\x8f" +
"\xc3\x06m\xe8\x94\xc3O6\xb6\xd5\xe7B\xce\x8dHI" +
",\xa6\xa2L\x90e9G\xb3<{E\xcc\xbeJ\x1a" +
".>y\x9bk\x9bI\x85\xf9\x81\xc1\xb9#TI\x13" +
"\x83\xaa(\x0bt\x13W\xbd\xdd\x93\xc1\xaet\xb8\x18x" +
"\x81*\x12\xddb\x8d\xf0\xcdCC>\x0fd \xba\xf9" +
"\x10\xcb\xa1\x1d$\x99\xc3\xb7[a3\x18.\xbb\x8c\xa5" +
"\xb8\xc5E\xe0\x0a\x14\x18R\xc7\x9c\x1dPD\xac0\x05" +
"\x84\xd0~\x9evkFF\xb8crSH\x9c\x8cO" +
"ke\xd8\xeeX\xb7;\xe6\xacw\xbd^>.\x1dH" +
"Fh\xb2\x95\xb9o\xcdN\x90Z\xe1\xa2\x94\xe6n\xa8" +
"\xa59\x07\xdb\x87-\x9b'\x86\x99\x93\xb1\x9c\x8c\xc1;" +
"\xa5\xba\x18\xbd\x8f{>Z~\xc0\x9d\x80\x04r\xd9\xd2" +
"\xccIs\xbb\xdb\x85N\x99\x9b\xc5\xf4\xd8\xe4\x83\xea:" +
"\xc5\x1f\x86\x0b\x91\x9c\x97\xe6bQ\xc7\x03\xee)\x0e\xb3" +
"\xcba\x9e\x90\x8eB\x8c%q<9a\x0e2{\xfb" +
"<+\xeezV\x90/\xe3\xaa4CN\xf3~\xbe'" +
"gy\xdc\xa7\xdd\x90\xc5\xa0\xc0\xe830\xb2X\x1aM" +
".G\x9f\xc7}_\xd9\xc0\xfc-nWQc\xc2x" +
"]\xe6\xae\x9c\xafR\xf8\xe5jVkUb'@%" +
"\xa8L\x85V\xddUsAy\x88z1\xc4\xe6Q\xee" +
"y\x96\xc9+\x8a\xb4j\x09\xd71\xad\xc0r'\x07\xa3" +
"\xb4\x03\x8daf\xbac\x09\xe6\x19\x01\x0bPDO@" +
"8\x96rMno[)\xa7R\xc46d\xfd\xa4\x9b" +
"f\x112H\xf0&\xdfu\xfa\x90\x05\xc3\xebm\x97\x15" +
"g-\xb0Z\x16\x0co\xe1\xe3\xc2\x05\x01\xb0`x\x9d" +
"[=d\xd1\x14Y\xa2\xf5\x88x\x0e\xb3\xcb\x87E\xcd" +
"4\x87\x85\x110\xaf\xcf\xb2\xdd\xa0\xe8,\xbfqC\xd6" +
"\x97\x87\xc6Mj\x08 \x84t\xe0\xe2^\x00\xe3NT" +
"\xd1\x18F\x05\xa3\x881$\x9c\xe3&\x00\xc3$<K" +
"\xb8\xa2\xc4\xc4A3\x82\xfd\x00\x86M\xf88\xe1\xaa\x1a" +
"C\x15@\xcb\x09\xfd\x80\xf0\x03\x84\x87\xeab\x18\x02\xd0" +
"\xee\xc2\x95\x00\xc68\xe1\x87\x08\xaf\xa9\x8fa\x0d\xf5\xef" +
"\xb8\x03\xc08@\xf8Q\xc2k\x1bbX\x0b\xa0\xdd\x83" +
"?\x040\x8e\x12~\x8c\xf0pc\x8c\x0eh\xed!\xbc" +
"\x17\xc08F\xf8\x09\xc2\xeb\x9abX\x07\xa0=&\xf4" +
"O\x10~\x8a\xf0\xfa\xe6\x18\xd6\x03h'\xd1\x030\x9e" +
"!\xfc4\xe1\x0d\xe1\x186\x00h\xcf\xe1\xe3\x00\xc6i" +
"\xc2/\xa0\x82-\x8dJ\x0c\x1b\x01\xb4s\xb8\x1a\xc08" +
"C\xf8ET\x10\x9bb\xd8\x04\xa0\xfd\x12\x97\x01\x18g" +
"\x09~\x13\x15,\xf8.m\x99\x94\x0b\x9d\x8eKi\x85" +
"\xf5\xa0`=`\xc1f\x81\x15\xe4L\x0et\xbc\x82\x82" +
"\x8d\x84\xb9N\x86@@^\xc6\x98=E/\xee\x8bm" +
"\xd4\x00\x0a6\x00\x16\x069\xf3,'\xd3\x0d*\xcf\x94" +
"\xc1a\xd7\xb3\xf6\xbaN\x80\xcc\xeeJ\xa7s\x1eS\xd3" +
"\xf9\xb2p\x94{\x81\x95f6JQ:O\x07\xe0D" +
"k]X\x14uW[\xf5e\xa5LC\\\xc8\xcax" +
"\xce\xb1\xc6\xc5\xec\xfc\x80\x8ddS\x96\x1d\xb6-\x1fk" +
"@\xc1\x1a\xc0\xcea\xe6\xaf\xb7\xc6\x11AA\x04\x8c\x8c" +
"\xf6\xf6t\xe3,\xc0>\x15\x85\x81Y\x80_\x98\x96\xd4" +
"\xc3l\xce\x057\x1al$ksJ\xcc\x9c/\x92r" +
">%X\xb4k\x1d5\"\xd1\x8e\x95\xd4\x87DW\xd0" +
"\xa9\xafF\xdb\x08\x0cE\x97R/P\x13m\xd9\x05\xb0" +
"?\xe7\xecv\xdc1'\xee\xb8\x1b\xb2~\xc1q\x13\xee" +
"(\xf7\x18\xa8\x19\xbe\xdfqS,H\x0f\x17F\xe8/" +
"7{\xa1\xd3\x95%\xa4\x08$AV\xe1/\xdd\x99\x85" +
"\xcd\x15+g\xd8\xcau|\x99V\x8e\xf61\x9d\x1a\x9b" +
"\xd5\\ \"P\xda\x96\xd1\x87\xef\x05\xd0\x1fQQ\x7f" +
"\xaa\xb2'\xa3On\x02\xd0O\xa8\xa8\x9f\xaal\xc8\xe8" +
"\xc9e\x00\xfaS*\xea\x17*\xbb1z\x8e4\xcf\xaa" +
"\xa8_R\x10Cb'F_<\x08\xa0_TQ\x7f" +
"\x95\xb6!\x8am\x18}e\x10@\x7fYE\xfdM\x05" +
"\xcb\x9d\x0c\xf6yn\x86\xea$\xb5\x90\x95f\x1c\x10g" +
"S\xd2\x94\x8e8\xea\xc7@\xc1&\xc0H\x96\x05\xc3\xa5" +
"\x1c\x98]aC\x80\"\x1b\xb2\xae/**\x08{e" +
"bS\xb4g\xbbn\xb6\x9f\x05\x1c\xbbh\x013\xbc\x92" +
"\xbb%\x09\x84S\x96SFKAU\xff^n\xa9\xb9" +
"@\xaf\xc3\xeak\x84\xfa]U\x0c\xa9\xbe\xbfPJ=" +
"\x88P\xf2\x156d}\x83\xf65 \xd7\x8f\x94+\xe3" +
"\xd3\xea:\xaa,*U\x16\xb5\xaa2\x9eT\xa9R<" +
"E\xf8\xb3jUe\xfc\x99J\x15\xf0\x14\xe1gT\x05" +
"\xb1X\x18\x7f\xa1R\xa1;M\xf0\x05R\x0f\xa1,\x8c" +
"\xe7T*\xbcg\x09\xbfDx\x8d\"\x0b\xe3\x8b\xea\xf3" +
"\x00\xc6%\xc2_'\xbcV\x95\x85\xf151\xec\xcb\x84" +
"\xbfIx8$\x0b\xe3o\x84\xfd\xd7\x09\xff=\xe1u" +
"\xaa,\x8c\xef\xa8T\x18\x7fO\xf8\x9f\x08\xaf\x0f\xc9\xc2" +
"\xf8\xa1J\x85\xf1\x03\xc2?#\xbc\xa1F\x16\xc6O\xd5" +
"\xef\x01\x18\x9f\x11\x1e\x0a)\x18m\xac\x95\x85\x11C\xbf" +
"\x020\xeaB*\x1a1\xc2\x9b\xde\x96\x951\x1a\"\x7f" +
"\x9a\x08\x9fOx\xf3\xe2\x186\x03hsCT\xf0g" +
"\x13\xbe\x88\xf0Y\xef\xc4p\x16\x80\xb6 D~\xce'" +
"\xfc:\xc2#u1\x8c\x00h-\xa1\x97\x00\x8c\xeb\x09" +
"\xbf\x89\xf0\xd9\xf51\x9cM4,D\xf1YN\xf8-" +
"\x84G\x1bb\x18\x05\xd0:B4\xaf[\x08\xbf\x8d\xf0" +
"9\x91\x18\xce\x01\xd0zB\x83\x00F7\xe1}\x84k" +
"\x8d1\xd4\x00\xb4T\xe8\xe7\x00F\x1f\xe1w\x12\x1ek" +
"\x8aa\x0c@\x1b\x08\xd1\x81r'\xe1\xc3\x84\xcfm\x8e" +
"\xe1\\:\xf8B\x14\x1f\x93\xf0,\xe1W-\x8a\xe1U" +
"t\xf0\x09\xfd,\xe1\xfb\x08\x9f\xf7n\x0c\xe7\x01hy" +
"\xe1\xcf>\xc2\x8f\x10>\x7fq\x0c\xe7\x03h\x87C\xbb" +
"\x00\x8cC\x84\xdfO\xf8\x82\xba\x18.\x00\xd0\xee\x13\xf1" +
"9B\xf8\x83\x84_]\x13\xc3\xab\x01\xb4\x07\x84\x9f\x0f" +
"\x12\xfe(\xe1\x0b\xaf\x89\xe1B\x00\xed\xb8\xf0\xe7\x11\xc2" +
"\x9f\"|Q<\x86\x8b\x00\xb4'E<O\x10~\x8a" +
"\xf0\xc5\xd7\xc5p1\xa5g\x88\x0e\xe8g\x08?M\xf8" +
"5\x0d1\xbc\x86\x0e>\x11\x9fg\x09?Kx\xbc1" +
"\x86q\x00\xed\x051\xaf\xb3\x84_\"\xfc\xda\xa6\x18^" +
"Ky(\xf0K\x84\xbfNxKs\x0c[(\x0fC" +
"\x07\x01\x8cW\x09\x7f;\xa4\xe0\xfe1\x96\xefe#\xbc" +
"T\x0a:\xc7X\xbe\x9f\x0f\x95~\x16<\x97\x99$\xaf" +
"\xaa\x16\xf2\xd8IZ#\xa0ZAy[;\xc5&\x18" +
":e\xcb5E\x80\x12\xef\xb6:\xfd\x80\xda\xdb\x92B" +
"\xe70\xdb\xcb<\xb3l\x9d\xf4oc{\x19\xa8\xd3\x80" +
"\xe8\x99\xdd\x16=\xafV\x0c\x14\x989j\xf9\xae\x97\x87" +
"\xb81\xe1$\xa6\x87\xba\xccQ\x0bI(]\x98\"S" +
"J\xb2\xa2\xdd4V\x1cs\x1d\xbe\x9d\xe5K\x07e\xdc" +
"f\x0e\xf7\xb1\x16\x14\xac\x05,\x04\x96\xcd\x93D\x1bU" +
"n\x96T\xca\x91Q\xac\xc0\xc8e2\xdc\x0f\xb8)\x8c" +
"W\x9d\xe8~Q\x00\x9d\xe6Dw\xb9\x1fX#TH" +
"\xcd~\x97\x99\xdb-S\x0d\x86\xcbBZ\x07\xeab!" +
"\xcc\xc7\x03\x8cT\xee\x0f\x011\x02X0\xadbT\xd7" +
"{\xee\xc8v\x96O\xc4\xb9CM\x7f\xb9\xc7(\x12O" +
",1\xcf*\x8fF\x88/y\xa3|r\xfc\xc6X\xde" +
"\xe06O#\x15\x7fyc\x81\x91\xca5Pq\xe4\xd2" +
"\x9c\xd1\x92\x9d{P\x1d\x90a+3<\xc6\xf2\x09\x88" +
"\xd8\xcc\xf71R\xb9\x94\x93O\xc7\xc7X~\xa3Yj" +
"M\x0a\xe9b\xf3>\x89\xabT2O\x14\xfem\x1c\xe2" +
"\x1eM\x07\xc3\xa0`\xb8\x18\x1d\xeaD@\xcd\xd1 \xe5" +
"\x93\xa3\xe8b\xa6r@`\xa4r\x94T\xa4)\xd7q" +
"\xb7@\xb8\xba!L\xbb#\xd9\\\xc0M\x142\x8bv" +
"@Y&\xbb\xc8\x0d\x1c\x1d\xee1y2\x96eY\xcf" +
"5si\xee\xa1\xc1}\xf2\xb1\"\xf9\xc2^\xbfLU" +
"$\xbd\x15\xd1\xa6\x96\xa2N4\x09\xd1\xd5\xa2\xa9\xaa_" +
"\x07@\xbb'\xb0\xd2\xfb\xb3\xdcKs'\x98IO\xb3" +
"\xaa\xba\xa7\x99\xee\xf8\xa5\xbcKt\xbaN\xc0\xc7E?" +
"\xd3$\x06_,;\xba\xb9\xcbDG\xd7\xbc\x0e`\xff" +
"\x90\xc7\xf9\x18\xcbG\xd2V\x90/ur3\xf1d\xc5" +
"\x8c\xba\xb1\xb0\xb9b\xa67q\xdf\x9c\xe9\x00\xabf\xfa" +
"\xc0\x8a+\x05S\xdc\xf5\xa1Cq\x8c\x95\xfb\xc2\xbb\xa8" +
"\xdb\x1bWQ?T\xd5\x17\xde\xbd\x12@\xdf\xa7\xa2~" +
"DA,\xb6\x85\x87\x97\x00\xe8\x07T\xd4\x8fR[8" +
"[\xb6\x85\xf7\xd0\xd3\x87T\xd4\xef\xaf4\"\xd1\xfb\xa8" +
"W<\xaa\xa2~L\xc1H\x90\xcfR\x8a\x97\xdf\xed\x14" +
"w\xd9\x10\xb1\xd5\xd2\xbe\x0e\xfb\x81W\xee\xfc\x06]\xd7" +
".\xef\xd6]E\xe2Z]\xecg\x12\x93\xe53\x0db" +
"\xfb\x95\x1e\xb8\xadX?\xa8z\x88\xfdp\xb3\x88\xcec" +
"2%\x1f\xde$R\xf2\xa1]\x82d<\xb0R\x90\x8c" +
"{\xfa\x05\xc98L*\xb5\xd1\xbb\x06\x010\x1c\xcd\x13" +
"X\x17\xcdy\xb4S\xa3{\xe8\xb9\x86\xe8\x08=\xd7\x18" +
"\xb5\xe8\xa3)\xcaI\xb39\xca\xaa\xc8Ia\xc4\x0d\\" +
"o\x8c\xe5\x01\xa0\xf2=\x92\xb4\x9c\xdd\xf1\xc0\xcb9\xbb" +
"\x0b\xe2o\xd2r\x00w\xef\xcfz\xd6\x08\xf3\xf2\x85\xe2" +
"g\x12\xc2\x96\xb3\xbb\xe0s*j\xcc\x03\xccW\xbe\xc7" +
"\xf3d\xa3\x10\x10\xf1c\x9e0_\xfe.\xcc\x17rN" +
"\x9a\xe6lAd\xc8\xe2f\xc1\xe3\xbeer*\xff\x16" +
"\xb3\x0b\xb65j9\x19\xea\x7f=\xce\x83+\xd2\x14Z" +
"\xd2>\xd7r\x02yy0\xbb\x9c\x8d\x8cR\xe7\xdb*" +
"\xeavU6Z\xfd\x00\xfa\xb0\x8az@\xcdqH\xa6" +
"\xe3\x1e\x02\xb3*\xea\xfb(\x1dkd:\xe6\xf7V\x92" +
"\xf9K\x13\xe8t\xce\x1beA\xce\x83\xcaA[\x08\xe4" +
"\x05&\x87N\xdb\xa5\x922\x85+|\x89\x1d\xdf\xfee" +
"\x08[_\x89\xc9\x88\xd2Z\x8eC+\xc5\xe1z\x15\xf5" +
"\x9b\xaa\xe2\xb0\x82\xa6\xbc\\E\xfd\x96\x99\xcc\xee\x0a\x0e" +
"\x10q\x16tE\\\xdd\x89\xd5\x10\xf1m]&\x12\xba" +
"E&\xf4\xe2M\"\xa1\x17,\x01\x888\xae\xc3\x0b\x16" +
"\x9d\xe5\x0e\xb3)Q\xf8x\xf9{8\xcd\xbc/\x1cr" +
"\xc2\x15R$`\x01\xd7CX\xf5>7\x8aK\xc2\x1b" +
"\xb2\xbe~\xa0\xcc\x9a\xf6\xa8\xd4\xf6f\x89F\xec\xabf" +
"MyAk\xf6\x11~\xa4\x9a5\x1dV\xa9-=D" +
"\xf8\xfd\x84\xab(i\xd3}\xea\xe3\x00\xc6\xfd\x84?\"" +
"h\x93*i\xd3\xc3\xc2\xfe1\xc2O\x08\xda\x14\x92\xb4" +
"\xe91\x95\xda\xd2G\x09\x7fF\xd0\xa6\x1aI\x9b\x9e\x16" +
"v\x9e!\xfc\xb4\xa0M\xb5\x926=\xa7\x9e\x9f@\xcb" +
"\xea\xc2\x926\x9d\x13\xac\xef\x0c\xe1\x17\x05m\xaa\x93\xb4" +
"\xe9\x97\x82f] \xfceA\x9b\xea%m\xba,X" +
"_\x85\xae56H\xda\xf4\x9a\xf0\xf3U\xc2\xdf&\xbc" +
"\xa9Q\xd2\xa6\xdf\x09\x9a\xf56\xe1\x1f\x10\xde\xdc$i" +
"\xd3\x1fTj\xdb\xdf'\xfc\x13\xc2g5K\xda\xf4\xb1" +
"\xa0q\x9f\xa8*\xf6\x0b\xd64K\xb2\xa6\xcf\xc5\xb0\x7f" +
"#\xf5:\xc1\x9a\"\x925\xd5\x88.?D\xdd\xf9l" +
"\xc1\x9afK\xd6\xd4,XD\x85\xad\xcd\x89J\xd64" +
"7\xf4\xfc\x04V\xa6\xa9\x925\xb5\x84\xc8\xcd\xeb\x08_" +
".X\xd3\x1c\xc9\x9a\xda\x84\x9d\x1b\x08\xbfY\xb0&M" +
"\xb2\xa6UB\xfff\xc2\xbb\x05k\x8aI\xd6\xd4%X" +
"M\x85\x95\xcd\x9b+YSJ\xd8I\x12~\xbb`M" +
"WI\xd6\xb4U\xb0\x8b-\x84\x7f[\xb0\xa6y\x925" +
"\xed\x14l\xb0\xc2\xd6\xae^+Y\x13\x17\xe3\x0e\x13\x1e" +
"\x08\xd6\xd4%Y\xd3\x1ea\xa7\xc2\xd6\x16\xad\x93\xac)" +
"/\xf0q\xc2\x0f\x09\xd6\x94\x90\xac\xe9n\x81\x1f \xfc" +
"\xa8`M\xdd\x925\xdd#\xfc,\xb35\x8cK\xd2\xf4" +
"@h\x09\x80q\x94\xe0c!\x05\xc5}\xb6\xdd\xe7q" +
"\x88\xf8~U\xf7\xca\xec1\x96\xf77;X|\x1b\xd4" +
"\xd3)^qT\x14\x06=\xb6\x9b'\xad\x0c\x84\x87\x03" +
"\xbf\x8c\x9a\xcc\x1f\x1et\x99\x87f\xd5\xcdv\xb9\xa6\x99" +
"|\xda\xb1\xca\x0d\xbc\xb8\xe1\xe6&L\x95$]'C" +
"\xd2\xf0t\xcf)\xdb\xb8\x97/iT?\xbf\x9f\xa7\xdd" +
"\x0d\x9cy\xe5'\x86\\/\xcd\x13.\x03\xd5\x0f\xca\xa0" +
"\xe5\xf71o7\xd1\x82\xca\xc0Y\x96\xf3y\x92\x05\x10" +
"\xa1\xc9O\x82]\x07E\xf5\xb3\x1c\x86v\x15\x01r\xbd" +
"`\x03g\x80\x95\xf1\x02\x8f\x0d\x0dY\xe9\x14\xba\xa6|" +
"GTM\x102\xcc7\x02\x96\xde]=\xee\x88kr" +
"\x9a\x05L\x98\xa8,l}\x1e\xc4\xf9\x17.RW\xa7" +
"m\xbbc\xd5\x11\xaa,G\xe0f\x0d+\x83N\x99\xc5" +
"\xc9\x17-S\x8dJ<\xe9b)\x9e8Y\xb6\x8dc" +
")\xde\x93\x9e\xcdr\x93\xd9)6\x0e\xf1~\x9e\xe1\xce" +
"D\\\xc4\xad+\x1dX\xa3\xbc2\xe1\x80\xfb6K$" +
"z\xa0\xd3\xc9\xb0L\x95\xa9\xa2\xa0\x1b-\x9f\x0b\x11N" +
"\x91\xf5\xa2\x1bty#\xd5\x09#\xb2\xf96\x9ap\xc2" +
"\xcbY~\xd5@\"\xf7\xa6\x95ds\xb6\xcf\xbb\x1c\x13" +
"\xe2\x1bl\xcb\xe4%<\x9c\xc9\xfa8\xbbr`\x14\xef" +
"\xfcfp.\xdf<\xc3\xce\xfd\xff]I\x7f{\x91\x95" +
"\x0aR\x1a\xceg\xc5)*\xbb\x94U\xb2-l\xeb\x17" +
"\xa7h\xab<E\x97n\x12ma\xcb2\x80\xfd\xe9\x9c" +
"\xe7\x11i\xcaz\xdc\xb4\xd2\x01\x074\x0bY\xd7\xf7\xad" +
"A\x9b\x97\xceV\xc7\x14\xbb 2\xc4,\xfb\x8a\x17\xe1" +
"\xdd\xc5+\xd7\xf2\x8d\xeb\xa4k\xe0\xd5\x00\xfa\x83*\xea" +
"\x8fV5\x16\xc7\xfb\xab\xee\x86\x15\x94\xae?\xb9\xa3\xea" +
"nXUd\x83u\xf2 \x80\xfe\x8c\x8a\xfa\xe9\xca5" +
"\xf0s\xf4\xf4\xb3*\xea/W]\x03_&\xc5K*" +
"\xea\xef+\xd8\xc9DvMJW\x9b\xe6Z\xc9\x1d7" +
"`\xf6z\xcb\x06\x95\xfbX\x07\x0a\xd6A\xd5\xf517" +
"\xd7[6\xf7\xa1,\xb1\x8b\xef\xad\x00\xfd\xd2-qS" +
"\xf1MAI\x84\xdd<`\x96\xedC\xe5\x1a\xb9\xfc\x1f" +
"6\x8a\xd7\xc83!\x06\x13\xb2\xe0J\xc1/\xbdV\xeb" +
"\xee\x94>\x08\xeaZ^\x83\x1ej\xee\xbaU\xd4\xfb\x14" +
",-A\x8a\xa2\x9dTQ\xbf\xbdj\x09\xb6R\x10\xb7" +
"\xa8\xa8\x7f[\xa9\x9ar\x15\x15\x9aY\xd4\xfe/\x00\x00" +
"\xff\xff\x00\xd1\x99X"
const schema_b526ba661d550a59 = "x\xda\x94zkp\x1c\xd5\x95\xff9\xdd3\x1a==" +
"\x1a\xdf1\xd8\x92\xc5\xd8\xc6\xc2\xc8A\xc4F\xf8\x1f\xe4" +
"\xe0\x08Y2\xb6U#\xacV\xdb\x16v\xe1\xaa\\M" +
"_\xcd\xb4\xdd\xea\x1ew\xf7H\x1a\x17.\x1b\xc7T\x01" +
"\x7f\xa8@6\x0f'\x156<LU\x92\x85\x84\xcd\xc2" +
"\x96\x97\"\xb5\x84\"U\x86\xc5U\x90\x0a\xa9<\xc8\xe2" +
"\xe4\x0bI\x96\x14\x9b,\xa9\xcdfC\xf5\xd6\xb9=\x8f" +
"\xd6#\x18}\xf1\xa8\x7f\xe7\xf4\xb9\xe7\x9e{\xee\xb9\xe7" +
"w\xdb[N\xb6\xdc\x16\xdb\xda\x96o\x05E{8\xde" +
"\x10\xa4\x8e\x1d\xfa\xb5\xed\x7f\xe74\xa4:18\xd4|" +
"\xa0k\xea\x85\xeb\x9e\x87X\x02\xa0oM\xc3ad\xbd" +
"\x0d\x09P\x83\xef~\x90\xed?\xfc\x9f/\xdf3_+" +
".\xd5\x9a\x1aN \xebjH\x00\xb05\x0d\xef\x02\x06" +
"w\x0e\xbd\xfc\xf9\xc9\xeb\xbeq/\xa4:\x95\xba2`" +
"\x1f&F\x90\xadJ\xd0K\xa9\x84\x13\x03\x0cz_-" +
"\xdd\xf9\xed5\x0f=\x02Z/6\x05/\xdb\xff\xdar" +
"\xf0\x95\xbb\xfe\x0b\xe2H:\x0f\xb5<\x80\xec\xa9\x16\xfa" +
"\xf3\xf1\x96w\x14\xc0\xe0\xef?\xf1~\xc9<q\xf8\xcb" +
"\x90\xbaV\x09\xce\xfc\xe9O\xd7\xf6\xfd\xc7\x1f\xce\x93\xe5" +
"\x9f\xad8\x83\xec\xf7+\xc8\x87\xdf\xae\xf8\x0a`\xb0\xf2" +
"9\xcc\xe7/^\xfa\xfa\x12\xd3\xeaON\"\x1bM\xd2" +
"\xb4z\x7f\x91Q\x87\x13\x85\xc7\x97\xd0\xeaI\x1eF\xb6" +
"CjYj\xdfm\x7f\x9elx\x12\xb4N\\4\xfb" +
"5\xa4\xd7\x9b\x0c_\x99@\xc0\xba_Z'\xb6G\xd4" +
"\xe5\xbc\x1fm\xef@\xf6L\xfb&\x80\xbeW\xdb'\x1a" +
"\x01\x83\xe1\xa1\x97^{\xe6\x9d'\x9fZ\x14\xadC\x1d" +
"g\x90Mw\xd0\x9c\xcc\x8eO\x01\x06\x07\xcek?\xbb" +
"a\xe6\xd2SKx;\xddq\x18\xd9=\x1d\xe4\xedw" +
"~\x91\xfb\xd2\xff\xff\xe6\xfb\xff\xb0\xc8\xde\x91\x8e\xedu" +
"{\xfb\x00\x83#\xcf\xbf\xbb\xf5\xf3\x1f\xbe\xf3\x9d%\xec" +
"\x9d${\x8fH{\x03\xef\xfc\xee\xe4\xe8\xba\x89g\x97" +
"\x1cu\xb2:\xeaE\xcc\xae7s\xf6\x85%\xb4\x8e\x90" +
"\xad\xe3R\xab\xf0\xe2\xdf}Q\xff\xf4\xf0\xf7\x97\xd0\x1a" +
"%[\\j\x9dUo\xbe,n\xdd\xf8\xf2\x12Z;" +
"HK\x93Z\xef\xff\xd3g\xde\xbce\xc7\xd1\x8b\x0bW" +
"E!\xbd\xde\x8e\x95\xc8vt\xc8\xe5\xee\xc8\xd0\xaal" +
"?4Q\xb4\xde\xfa\xc6\xbf-5t'\x0d\xddIF" +
"\xdf8\xf3X\xfe\x7f\x7f\xfe\xe5KK\x0dMZ\x9a\xd4" +
"\xeaz%\xf7\xf6\xdb\xfe\x997\x17\x85\xb8\xb7s'\xb2" +
"\x1d\x9dr\xd8N\x99\x0c\xfd\xfd/>\xfe\xfa\x03\xff\xfd" +
"\x13\xf2R]\x98bkG\x90\xedXK\x0b\xd2\xbf\x96" +
"6\xce\xb6\xec\xf0\xe7\xceM|\xf9\xe7K\x8c\xde\xd5u" +
"\x18\xd9\xd6.\x1a\xbd\xffs\xaf}\xed+\xf1\xaf\xfc;" +
"\x99T\x16\xa8\xb5u\xedD\xd6\xd5%\xf7b\xd7,`" +
"p\xfd\x9b?y\xff\x86]\xcf\xfdq\xd1\x8e9\xd9u" +
"\x14\xd9#R\xf3\xa1\xae<`}\xf3\xcd7\x1bn\xc5" +
"\x7f!\xedK]W\x03\xf4\xbd\xd5\x95H\x00\x06k\x1e" +
"}to\xd3{W}\xb0\x84\xaf\xbf\xec>\x8c\xec\x0f" +
"\xdd\xe4\xeb\x93\xb1\xe2\x87\x9f>\xfb\xd0\xff,\xa1u\x89" +
"\xb4~%\xb56\xff\xa6\xfb\x8ew\xef\xfa\xcc_\x16\xc5" +
"\xf3\xfb\xdd\x93\xc8\xde\xec&'/u\x9f\x02\x0c\x9e\xf0" +
"\xc6.\xbev\xe4\xc9\xbf,tR.z\xdbug\x90" +
"\xad\xbfN\x86\xeb:\x19\xfd\xd4?\xcf\xde\xf7\xfb\xc1\xc9" +
"\xbf.1\xfc\xa3\x9b&\x91\xfd\xe3&\x1a\xfe\xd4\xb9g" +
"\xdf\xd5\xcf\xdd\x17,\xcc\xa4\xb0\x08mz\x01\xd9S\x9b" +
"\xc8\x85\xc77}\x17z\x83\x9cp\x05\xb7>\x99\x8b\x95" +
"<\xdf\x99\xfedN\xfe\xdc\x98\xe3E\xbb\xb8}H>" +
"\x8c\x0bO\xb83B5n\x1eC\xfcH}\xdd\xe7\xee" +
"\x98i9\xfe\x10w\x87\x06\x1c\xdbw\x1dk\x0cQk" +
"Wc\x001\x04H\xf1\xc3\x00\xdagU\xd4,\x05S" +
"\x88i$\xd0\xfc\x02\x80f\xa9\xa8\xcd)\x98R\x944" +
"*\x00\xa9\x12i\xfa*j\xa7\x15L\xa9j\x1aU\x80" +
"\xd4\xc9\x11\x00\xedn\x15\xb5\xfb\x14\x0c\x0a%c\x88\xc6" +
"\x00\xd5\xb1p%(\xb8\x120\xf0|!\\\xd3\xcec" +
"\xd6\x9c6\xfd\xbd\xf6\x14:5\x99\xcdg\xcc<\xf7M" +
"P\x1d\xbb\x06\x16\x0b\x8e-v\x17=\x00\xc0\xf6z\x01" +
"\x07\xc4v\xf8\xe8\xd9\x8e\xf2\xa2\xb1\xd7.\x96\xfc\xfd\xe5" +
"\xa2\x00\xa0\x89\xbeH\xae\xb3^e\x04\x00W\xb0\x1e\xe5" +
"{\x00\x98d=\xca\x13d\x9c\xf5(\xdf\x06\xc0\x14\xeb" +
"Q^\x06\xc0\x95\xacG\xf99\x00\xb6\xb0^e\x12\x00" +
"\x19\xebQ^\x03\xc04\xeb\x95\xbf\xc8\xb6*'\x00P" +
"a\xbd\xcaQ\x00\\\xc5z\xe4\xf3U\xac[\xf9\x1d\x00" +
"^\xcdz\x94\x1f\x01\xe0j\xd6\xab\xfc\x1a\x00\xd7\xb0\xad" +
"\xf2\xb9\x83mS\xbe\x06\x80\x9dl\x9b\x1cw-\xdb&" +
"\xedu\xb1~\xf9|\x0d\xeb\x97~\xa9\x95\xe7\x18\xeb\x97" +
"\xfedX\xbf\xb4\xbb\x8e\xed\x90\xf6\xd6\xf7\x0d*\xdb\x11" +
"\x00\xe3l\xaf\xf2\x02\x006\xb0\xbd\xd2\x816\xb6K9" +
"\x0c\x80\xadlP:\xb6\x81\xed\x90/^\xcb\x06\xa5\xe1" +
"\x8d\x95\xdf\xee\xbeAe%\x19hf{\x95\x07\x00\xf0" +
":\xb6W\xf9#\x00n\xea\x1bU6\x90\xe0zv@" +
"\x86\xa0\xa7\xef\x90\xa2\x10\xb0\xb9\xefH\xf8\xc7'\x18W" +
"\xbe\x00\x8070._\xede\\\x06/Qynd" +
"\\9\x03\x80M\xec\x88\xfc\xbd\x91\x1d\"\x1f\x02\xc3\x99" +
"\xb5-\x87\x1b\x00\x10x\xc2\xdf\xcf\xdd\xbc@?\xcb}" +
"\xe1r+3\x98\xcb\x09\x8bp\xbd(\x84\x11\xa6\xc8\xbe" +
"\xa9\xa9\x84'\xfc\x05\xe8\x90c'){\x09\x1e\xe5\xc5" +
"\xa1R\xdc\x9d\x11R>\x14\xa65x\xc2?hz\xa6" +
"c\x0f\x95\xe6\x89\xd4\xf0\xa5\xac\x93\xcf\x0aH\xcc\x84\xe3" +
"IM%T\x95>\x91K\x83\xa1\x8fQ\xd9\xa8i\x87" +
"\xe2\x83\x00\x81+h&\xba\x80\x01\xdf7\xed\xbc\x17x" +
"|F\xe8\xc2\xf7!\x19>\x0a\x7f\x97\xcd'-\x18\x08" +
"\x87_h\xec\x80'\xa4\\\xe8\xc9\xaaXNE\x99'" +
"+\x0a\x81Fm\xf6\x8a\x9c}D\x9a\xa8\xbc\xb9\xc7\xb1" +
"\x8c\xac\xc2=_\x17\xc2\x96\xaa\xa4\x89~$\xca\x12\x1d" +
"\x11\xaa{l!8\x98KT\x02/Q%D\xf7\x9b" +
"\xd3b\xdf\xd4\x94'\xfc0\x10\xc3b\x8a\x97\xd0\xf2\xb3" +
"\xdc\x16\x13f\xc2\xf0\x0b5\x97\xb1\x1a\xb7\x8c\x0c\\@" +
"\x81!u,Y>E\xc4LP@\x08\x1d\x179'" +
">=-lC\x18Rb\xe7=Z+\xddrf\x87" +
"\x9dY\xfbv\xc7\xbdC\xcc\x85\x0ed\x934\xd9\xfa\xdc" +
"\x0f\x14\xe7I\xcdDEJs\xd7\xd5\xea\x9c\xfd\x89\x82" +
"i\x89\xa1\x02\xb7\xf3\xa6\x9d\xd7\xc5@\xa8.G\x1f\x13" +
"\xae\x87\xa6\xe7\x0b\xdb'A\xb8l9n\xe7\x845\xec" +
"\xc0@\x98\x9b\x95\xf4\x18\xf1\xa8\x0eU\x1et\x07\x92%" +
"7'\xe4\xa2\xce\xf9\xc2Uln\xd5\xc2</\x1d\xa5" +
"\x18\xab\xe2Lv\xde\x1c\xc2\xec\x1ds\xcd\x8c\xe3\x9a~" +
"\xb9\x86\xab\xa1\x19rZ\x8c\x8b\xe3%\xd3\x15\x1e\xed\x86" +
"\"\xfa\x01\xa7__/bu\xb4p9\xc6\\\xe1y" +
"\xcan\xee\xedw\x06+\x1a\xf3\xc6\x1b4\x8e\x96<\x95" +
"\xc2\x1f\xaefT\xab\x1e;\x09*~}*\xb4\xea\x8e" +
"Z\xf2kC4\xc9!\xf6\xcd\x08\xd75\x0dQW\xa4" +
"U\x1brl\xc3\xf4Mga0\xaa;P/p\xc3" +
"\x99\x1d\xe2\xae\xees\x1fe\xf4$\x84\xb3\xa3\x8e!\xac" +
"\x837\x85S\xa9`\xbb\x8b^\xd6\xc9\xf1$\x19$x" +
"\xc4s\xec1\xe4~\xe1v\xcb\xe1\x95YK\xac\x81\xfb" +
"\x85\xfdbN\xba \x01\xee\x17v:\xd1!+\xa6\xc8" +
"\x12\xadG\xd2\xb5\xb9U;,\xe2W8\x1a\xc9Yq" +
"\xa3<s\xe8\xd0\xb8\xb9z:\xb2#x\x02@\xbf\x0b" +
"U\xd4\x0bX? \x99\xc0\x11\x00\xdd \xbc\x88\xf53" +
"\x92M\xe38\x80n\x11>\x87\xf5c\x92\x95\xa4\xbeO" +
"\xf8i\xc2c\x8di\x8c\x01\xb0\x93x\x13\x80>G\xf8" +
"Y\xc2\xe3Mi\x8c\x03\xb0{\xf00\x80~\x9a\xf0\x07" +
"\x09ohNc\x03\x00\xbb\x1f\xbf\x06\xa0?H\xf89" +
"\xc2\x13-ij\"\xd8\x97\xf0\x01\x00\xfd\x1c\xe1\xe7\x09" +
"olMc#u\x14R\xff<\xe1\xcf\x12\xde\xd4\x96" +
"\xc6&\x00\xf6\x0c\xba\x00\xfa\xd3\x84_ \xbc9\x91\xc6" +
"f\x00\xf6<>\x01\xa0_ \xfc\x15Tp}\x8b\x92" +
"\xc6\x16\x00\xf6\x03\xdc\x0e\xa0\xbfH\xf8ET\x10[\xd3" +
"\xd8\x0a\xc0~\x88\x9b\x01\xf4\x97\x08~\x1b\x15\x0c<\x87" +
"\xb6\xcc\xa8\x03\x03\xb6Ci\x85M\xa0`\x13``q" +
"\xdf\xf4K\x86\xa03\xbd\x05\x14l!\xcc\xb1\xf3\x04\x02" +
"\x8a\x1a\xc6\xadEz\x19On\xa3fP\xb0\x190\x98" +
"\x14\x9c\xba\x89aPE\xbe\x06\x16\x1c\xd7<\xe1\xd8>" +
"rk0\x97+\xb9\\\xcd\x95k\xc2\x19\xe1\xfaf\x8e" +
"[\x18\x8are:\x00\xe7[\x1b\xc4\x8ah8j\xd5" +
"\x0b+e\x0e2RV\xc3K\xb69'g\xe7\xf9|" +
"\xba8jZ\x09\xcb\xf40\x0e\x0a\xc6\x01\x07\x0a\xdc\xbb" +
"\xdd\x9cC\x04\x05\x1109s\xc7\xaea\\\x018\xa6" +
"\xa24\xb0\"\xd2\xc3\xc4\xffF\x0f\xb3\xaf\xe4\xdf\xa8\xf3" +
"\xe9\xa2%(1K\x9eL\xca\xd5\xb2\x09\x1b\xdcI\x8d" +
"H\xaa\xff&\xeaCR[\xe9\xd4WS\xbd\x04\xc6R" +
"\xdd\xd4\x0b\xc4S\xeb\x8f\x02\x9c*\xd9\xc7lg\xd6\xce" +
"\xd8\xce\xee\xa2\x17\xd8\xce\x903#\\\x0ej^\x9c\xb2" +
"\x9dQ\xee\xe7\x0a\xc14\xfd+\x8c;`\xc0\x09KH" +
"\x05\xc8BX\x85?v\x1f\x9a0\xb6\xdet\xa5Ft" +
"A\xe3\xda\x7f%}\x0a\x03\xedc:5\xf6\xa9%_" +
"F\xa0\xd6\xb4~\xf5\x01\x00\xed\xeb*j\xdf\x8c4\xad" +
"OQ+z^E\xed\xd9H\xd3\xfa\xccf\x00\xed\x9b" +
"*j\xafD\x9a\xd6\x1f\x90\xe6K*j\xaf+\x881" +
"\xb9\x13S\xaf\x9e\x01\xd0.\xaa\xa8\xfd\x98\xb6!\xcam" +
"\x98zs\x12@{CE\xedm\x05k\x9d\x0c\x8e\xb9" +
"N\x9e\xea\xa4\xecOk\x84\xa1\xd2\x9fz\xd5#\x8e\xfa" +
"1P\xb0\x150Y\xe4~\xa1\x9a\x03\xedu\xc6\x06(" +
"\xb3\xa1\xe8x\xb2\xa2\x86\xfdn\x8d|U\xecY\x8eS" +
"\x1c\xe7\xbe\xc0AZ\xc0\xbc\xa8\xe7nU\x02\x89Q\xd3" +
"\xae\xa1\xd5\xa0\xaa\x7f+\xb7\xd4\x92\xaf5b\xf4\xaa\xa3" +
"\xe9h\x84\xc55\x8d\x07\xd5\xd4\x83$%_\xb0\xbb\xe8" +
"\xe9\xb4\xaf\x01\x85v\xaeV\x19\xd7\xc4v\x02\xe8\xe9\x98" +
"\x8a\xfa\xbaX\xa42v\xc5\xa8R\xac&|c,R" +
"\x19\xd7\xc7\xa8\x02\xae#\xfc\x86\x98\x82X)\x8c=1" +
"*t\xd7\x13|3\xa9\xc70,\x8c[cTx\xb7" +
"\x10~+\xe1q%,\x8c\xfd\xb1\x17\x00\xf4[\x09\xdf" +
"Cx\x83\x1a\x16\xc6]r\xd8\xdb\x08\xcf\x12\x9e\x88\x85" +
"\x85q\xaf\xb4\xbf\x87\xf0\xfd\x847\xaaaa\xd4bT" +
"\x18\xf7\x13\xfeY\xc2\x9bbaa<\x12\xa3\xc2x\x17" +
"\xe1\x05\xc2\x9b\xe3aa\x14\xb1/\x00\xe8\x05\xc2}\xc2" +
"[\x1a\xc2\xc2x<\xf6#*\xe0\x84\x9f%\xbc\xf5r" +
"X\x19\xef\x91\xfe\xdcM\xf8}\x84\xb7u\xa5\xb1\x0d\x80" +
"\xdd\x1b\xa3\x82\x7f\x9a\xf0\x07\x09_\xf1\xab4\xae\xa0\xc2" +
".\xfd\xbc\x8f\xf0/\x12\x9elLc\x12\x80=\x12{" +
"\x8d\x0a;\xe1\xe7\x09ooJc;\x15v\x19\x9f\xc7" +
"\x08\x7f\x9a\xf0Ts\x1aS\x00\xec[r^O\x13~" +
"\x81\xf0\x95\xc94\xae\xa4\xc2\x1e\x9b\x04\xd0\x9f#\xfc%" +
"\xc2YK\x1a\x19\x00\xfb~\xec{T\xc1\x09\x7f\x9d\xf0" +
"tk\x1a\xd3\x00\xec\xd5\x18\x1d(\xaf\x13\xfeS\xc2W" +
"\xb5\xa5q\x15\x00{K\xc6\xe7\xc7\x84_&\xfc\xaa\xb5" +
"i\xbc\x0a\x80\xfdR\xea_&\xfc=\xc2\xaf\xfeu\x1a" +
"\xaf\x06`\xbf\x95\xfe\xbcG\xf8\x9f\x09_\xdd\x95\xc6\xd5" +
"\x00\xecO\xb1\xa3\x00\xfa\x071\x15\xc7\xe3\x0a\xa6\xd64" +
"\xa6q\x0d\x00\xfbP\x86\xe7\xcf\xa4\x1e#\xbc#\x9e\xc6" +
"\x0e\x00\x86qr3\x16WQo'\xbc\xf3\x9a4v" +
"\x02\xb0\xb68\xb9\xd3J\xf8j\xc2\xd7f\xd2\xb8\x16\x80" +
"\xad\x8aS8\xd3\x84\xaf#\xbckc\x1a\xbb(;\xe3" +
"t>\xaf%\xfcz\xc2\xafiN\xe35\x00\xac;N" +
"\xe1\xd9H\xf8\x16\xc23-i\xcc\x10q\x8c\xd3\xb4\xb6" +
"\x10~+\xe1\xebZ\xd3\xb8\x8e\xd2P\xe2\xb7\x12\xbe\x87" +
"\xf0\xf5mi\\Oi\x18?\x03\xa0\x0f\x13>F\xf8" +
"\x06\x96\xc6\x0d\x00l4N\xe93F\xf8]\x84_\xbb" +
"6\x8d\xd7\x02\xb0CR\xffN\xc2\x0d\xc276\xa4q" +
"#\x00\xe3R\xdf \xbcHxw2\x8d\xdd\xd4_\xc4" +
")l\x16\xe1sq\x05O\xcd\xf2\xf2\x1d|ZT+" +
"\xcd\xc0,/\x8f\x8b\xa9\xeac\xe0:\xdc y\xa4\x18" +
"\x85\xa7Z\xd6\x9c\x06\xd5\xf4kU\xc3\xae\xf4\xd80\x10" +
"vt\x8b\x04\x18\xe2\xc3\xe6\x80\xe7S\xf7\\U\x18(" +
"\xf0\x13\xdc5j\xd6I\x7f\x0f?\xc1A]\x02D\xd7" +
"\x186\xe9}\xb5n \xe0\xc6\x8c\xe99n\x192\xfa" +
"\xbc\x83\x9e^\x1a4fL$a\xe8\xc2\"\x99R\x95" +
"U\xec\xe6\xb0\xee\x98c\x8b\x09^\xae\x9e\xc3\x19\x8b\xdb" +
"\xc2\xc3\x06P\xb0\x010\xf0MKd\x89\x95\xaa\xc2\xa8" +
"\xaa\xd4\"\xa3\x98\xbe^\xca\xe7\x85\xe7\x0bC\x1a\x8f4" +
"\x0c^E\x00\x03\xc6|w\x85\xe7\x9b\xd3T\xa7\x8dq" +
"\x87\x1b\x13\xa6\xa1\xfa\x85\x9a\x90\xd6\x81\x9adH\x889" +
"\x1f\x93\xf5+T@L\x02\x06\x86Y\x89\xea\xed\xae3" +
"=\xc1\xcbC\x19a\x13\xa7\xa8\xb50\x15^\x8bUb" +
"\x1b\xf1h\x9a\xe8\x98;#\x16\xc6o\x96\x97ua\x89" +
"\x1c\xd2\xd9\x12^\x88`\xb2~\x13V\x19\xb9:g4" +
"Cb\xe0G\x03R0\xf3\x85Y^\x1e\x82\xa4\xc5=" +
"\x0f\x93\xf5{\xc9\xf0\xed\xcc,/\xef5\xaa\x9dO\x90" +
"\xabp\x83\x05T\xa8\x9ey\xf2\\9( \xe3\xd2t" +
"0\x01\x0a&*\xd1\xa1F\x07\xd4\x12\x0dR;\x98*" +
".\xe6\xeb\xe7\x0f&\xeb'U]:\xea\xd8\xce~H" +
"D\xfb\xcd\x9c3],\xf9\xc2@)3i\x07\xd4d" +
"a\x93\xba[\xa0-\\\x1e\x1e\xbc5Y\xd1u\x8cR" +
"N\xb8\xa8\x0b\x8f|\x8cJ\xc4\x8c)fu\xac3\xed" +
"Z\xa8+\xb2a\xac,#,\x94\xecD\xa7d\x1b\xdc" +
"-\xef\xc5\xfa\xae\xa8\xc8& 9?\x8a\x1f\xc5Yj" +
"\x94+\xa4\xe9rY\xa95j\x94\xcdNj\xbbl\x0e" +
"\x9bv\x02\xd06\xf5\xcd\xdc\xa9\xa2ps\xc2\xf6\x97\xd3" +
"\x9bm\x8b\xf6fK\xb5\x11\x94\xe0\xf22Q\xcc\xc9\xbe" +
"\xacU\x0e\xde\x15v\xa6\xab6\xcb\xce\xb4m'\xc0\xa9" +
")W\x88Y^N\xe6L\xbf\\\xedH\x97\xe3\xc9\xd6" +
"eu\x95\x09c\xeb\xcd\xcblC?\xb5\xdc\x01\xb6-" +
"\xf7\x85\xadW\x0a\xa6\xbc\xb3D\x9b\xe2\x98\xae\xf5\xb7'" +
"\xa9k\x9dSQ;\x1b\xe9o\xef\xb9\xa9~\xd5\x8a\x95" +
"\xf6\xf6\xde\x0d\x00\xdai\x15\xb5\x07\xa9\xbdm\x0f\xdb\xdb" +
"\xfb\xe9\xed\xb3*j\x0f\xd7\x1b\xaa\xd4C\xd4\xf3>\xa8" +
"\xa2vN\xc1\xa4_.\xd2^\xaa}G\xabl\xe7)" +
"b\xdd\xd5\xdcMx\xbe[\xeb`'\x1d\xc7\xaa\x95\x85" +
"\xa3\x15\x02\x1e=U\x96\x13\x93-\xcb\x0db\xdf\x95^" +
"\xd8S)TT\xa6\xe4~\xb8EF\xe7\xf10%\xbf" +
":\"S\xf2KG%Yz\xe4&I\x96\xee\x1f\x97" +
"d\xe9^RiH\x9d\x9c\x04\xc0D\xaaL`c\xaa" +
"\xe4RIH\x1d\xa7\xf7\x9aS\xd3\xf4^K\xca\xa4\x9f" +
"\xd6\x94 \xcd\xb6\x14\x8f\x90\xac`\xda\xf1\x1dw\x96\x97" +
"\x01\xa0\xfew2k\xda\xc72\xbe[\xb2\x8f\x05\xf2\xdf" +
"\xaci\x03\x1e;Ut\xcdi\xee\x96\x83\xcao\x16\x12" +
"\xa6},\xf0\x04UO\xee\x02\x96\xeb\x7fg\xcad#" +
"\xf0\x89\xc0rW\x9a\xaf\xfd-\xcd\x07%;Gs6" +
"!9e\x0a#p\x85g\x1a\x82\xce\x19\x93[\x81e" +
"\xce\x98v\x9e\xfaxW\x08\xff\x8at\x8b\x96t\xcc1" +
"m?\xbc\x04\x89|\"\x18Y\xea\x13\xc18\x80VP" +
"Q\xf3\xa9\xc9\x8f\x85\xe9x\x9c\xc0\xa2\x8a\xda\xdd\x94\x8e" +
"\xf10\x1d\xcb'\xea\xc9\xfc\xb1/\x02r%w\x86\xfb" +
"%\x17\xea'z\xe0\x87\x17\xb1\x02\x06,\x87J\xca\"" +
"\xce\xf31v|\xdf\xc7!\x9ecUF&Kk-" +
"\x0e=\x14\x87\xebU\xd4n\x8e\xc4a+My\x8b\x8a" +
"\xda\xad\xcb\x99\xdd\x15\x1c\xd8W\xf2o\x94\xb4K^A" +
"\xca\xd5\x90\xf1\xed\xd9,\x13z}\x98\xd0]#2\xa1" +
"\xd7l\x00H\xda\x8e-\x02\x93\x9a\x06\x9b[\x94(b" +
"\xae\xf6w\"\xc7\xdd\x8f\xfd\x95HO\xfa\xdc\x17Z\x0c" +
"#\xdf\xceS\xb8!\xb1\xbb\xe8i\xa7k\xec\xef\xb8J" +
"}hQUQ\xbf[\x8d\xb0\xbf\xb2J\xf4\xecn\xc2" +
"\xefS#\xec\xef^\x95\xfa\xeb\xb3\x84?L\xb8\x8a!" +
"\xfd{H}\x02@\x7f\x98\xf0\xaf\x13\x1eSC\xfa\xf7" +
"Ui\xff\x1c\xe1\xe7\x09\x8f\xc7B\xfa\xf7\xb8J\xfd\xf2" +
"c\x84?MxC<\xa4\x7f\xdf\x92v\x9e&\xfc\x02" +
"\xe1\x89\x86\x90\xfe=\xaf\xbe\x0c\xa0_ \xfc\x15\xc2\x1b" +
"\x13!\xfd\xfb\x81J\xec\xf5E\xc2/\x12\xde\xd4\x18\xd2" +
"\xbf\x1f\xaa\xc4\x1b^!\xfc\x0d\xc2\x9b\x9bB\xfawI" +
"%\xf6\xfa:\xe1?%\xbc\xa59\xa4\x7foI?\x7f" +
"L\xf8e\xc2[[B\xfa\xf7K\x95\xfa\xf7\xcb\x84\xbf" +
"Gx[kH\xff~\xab\x12\xff\xf8\x0d\xe1\x1f\x10\xbe" +
"\xa2-\xa4\x7f\x7fP\x89&}\xa0\xaa8.\xd9\xdf\x8a" +
"\x90\xfd}(\x87\xfd+\xa97J\xf6\x97\x0c\xd9_\\" +
"\xb2\xb9\x18\xd1\xa4v\xc9\xfe\xdaC\xf6\xd7&\xd9Y+" +
"\xe1\xab%\xfbK\x85\xeco\x95d\xcduR\xce\xd4\x90" +
"\xfd\xad\x97\xacv#\xe1[$\xfb[\x19\xb2\xbf^i" +
"\xe7\x06\xc2o\x91\xec\x8f\x85\xeco\x9b\xd4\xbf\x85\xf0a" +
"\xc9\xfe\xd2!\xfb\x1b\x94,r\x98\xf01\xc9\xfeV\x85" +
"\xecoT\xda\xc9\x12~\xa7d\x7fW\x85\xec\xef@\xec" +
"\xcc<\xf6\xbd\xe6\xea\x90\xfe\x1d\x91\xac\xb6\xce\xbe;n" +
"\x0b\xe9\xdfB\xf6\xdd9\x18\xd2\xbf\xe3\xd2N\x91\xf0\xbb" +
"\x09_\xbb3\xa4\x7fe\x89\xd7Yy\xd7PH\xff\xee" +
"\x91x\x9d}_3\x1c\xd2\xbf\xfb\xa5\x9f5\xf6\x8d\x99" +
"\x90\xfd=\x12\xdb\x00\xa0?H\xf0\xb9\x98\x82\xf2^\xde" +
"\x1as\x05$=/\xd2&sk\x96\x97\xbd}6V" +
"\xbej\xed\x1a\x90\x9fj\xea\x0a\x93.?&\xb2f\x1e" +
"\x12\x05\xdf\xab\xa1\x06\xf7\x0a\x93\x0ew\xd1\x88\xdc\xd0\xd7" +
"j\x9a!\x96\x1c\xab\xc6\x14\xe4M\xbd0`\xb1$\xeb" +
"\xd8y\x92&\x96zO9(\xdcrU#\xfa\xfe)" +
"\x91sv\x0b\xee\xd6\xde\x98r\xdc\x9c\x18r8\xa8\x9e" +
"_\x03Mo\x8c\xbb\xc7\x88\x7f\xd4\x07.\xf2\x92'\xb2" +
"\xdc\x87$M~\x01\xec\xd8(\xab\x9fis\xb4\"L" +
"\xcbq\xfd\xdd\x82\x03\xd6\xc7\xf3]>5e\xe6F\xd1" +
"1\xc2o]Q&\x92\xe7\x9e\xee\xf3\xdc\xb1\xe8\xb8\xd3" +
"\x8e!h\x160o\xa2aa\x1bs!#>r\x91" +
"\x06\x07,\xcb\x99\x8dF\xa8\xbe\x1c\xbeS\xd4\xcd<\xda" +
"5\xba\x18~0Zl4\xc4\xb3\x0eV\xe3\x89\x0be" +
"\x07\x05V\xe3\xbd\xe0\xdd\xa20\xb85\xca\xe7 3." +
"\xf2\xc2\x9e\x8f\xcb\xb8\x0d\xe6|sF\xd4'\xec\x0b\xcf" +
"\xe2CC\xbb`\xc0\xce\xf3|\xc4TE@\xfcCH" +
"\x11.\x92\xdd\x81\x8e?\xe8NG\x13Ff\xf3\x1e\x9a" +
"\xf0\x90[2\xbd\xc8@2\xf7\x96\x94\x14K\x96'\x06" +
"m\x032\xbb-\xd3\x10U<\x91/z\xcb\xfcV\xbf" +
"\xe0\\\xbee\x99\x9d\xfb\xff\xbb\x92\xfeD\x85\xfeJ\xf6" +
"\x9b(\x17\xe5)\x1av)\xdb\xc2\xb6\xb0w\\\x9e\xa2" +
"=\xe1)\xda=\"\xdb\xc2\xf5\x9b\x01N\xe5J\xaeK" +
"\xa4\xa9\xe8\x0a\xc3\xcc\xf9\x02\xd0\x08\x8a\x8e\xe7\x99\x93\x96" +
"\xa8\x9e\xad\xb6!wAr\x8a\x9b\xd6\x15/\xf4\x87+" +
"W\xc7\xb5\x9b\xe3\x05\xd7\xd9\xdb\x01\xb4/\xaa\xa8=\x16" +
"i,\x1e\x1d\x8f\xdcq+\x18\xba\xfe\xd4\xe1\xc8\x1d\xb7" +
"\xaa\x84\x0d\xd63g\x00\xb4\xa7U\xd4.\xd4\xaf\xb3\x9f" +
"\xa7\xb7\x9fSQ{#r\x9d}\x89\x14_WQ\xfb" +
"\x8d\x82\x03\\f\xd7\x82t\xb5h\xae\xf5\xdcq|n" +
"\xddnZ\xa0\x0a\x0f\x1bA\xc1F\x88\\\x83\x0b\xe3v" +
"\xd3\x12\x1e\xd4$V\xe5\xfb\x1b\xa0W\xbd\xedn\xad|" +
"\xf1\xa8\x8apX\xf8\xdc\xb4<\xa8_\x87\xd7\xfesL" +
"\xe5:|9\xc4`^\x16\\)\xf8\xd5\xcf\x83\xc3\x03" +
"\xa1\x0f\x92\xba\xd6\xd6`\x175w\xc3*jc\x0aV" +
"\x97`\x94\xa2\x9dUQ\xbb3\xb2\x04\x07(\x88\xfbU" +
"\xd4>\xabD\xa6\x1c\xa1B\xcb\x8b\xda\xff\x05\x00\x00\xff" +
"\xff1<\xb37"
func RegisterSchema(reg *schemas.Registry) {
reg.Register(&schemas.Schema{
+113 -13
View File
@@ -1,8 +1,11 @@
package cereal
import (
"encoding/json"
"log/slog"
"math"
"os"
"regexp"
"capnproto.org/go/capnp/v3"
"pfeifer.dev/mapd/cereal/custom"
@@ -15,6 +18,8 @@ const (
externalFixMaxAge = 500_000_000 // 10 Hz source: 500 ms
internalFixMaxAge = 2_000_000_000 // 1 Hz source: 2 s
carFixMaxAge = 2_500_000_000 // Optional CAN observation: 2.5 s
phoneFixMaxAge = 10_000_000_000 // Companion app in the background sends sparsely: 10 s
gpsModeRefresh = 1_000_000_000 // Galaxy navigation setting reread interval
maxHorizontalAccuracy = 50.0 // input sanity ceiling, not road-match qualification
maxClockPairSkew = 1_000_000 // an interrupted pair cannot date a source event
maxClockOffsetDrift = 1_000_000 // a larger BOOTTIME/MONOTONIC step fences queued fixes
@@ -39,8 +44,53 @@ const (
GpsSourceInternal
GpsSourceExternal
GpsSourceCar
GpsSourcePhone
)
// Galaxy navigation's GPS source setting: backup uses the phone only without
// comma or car GPS, comma never uses it, phone prefers it whenever it has a fix.
const (
GpsModeBackup = "backup"
GpsModeComma = "comma"
GpsModePhone = "phone"
)
var storagePrefix = regexp.MustCompile(`^[A-Za-z0-9_-]{1,64}$`)
func navigationSettingsPath() string {
prefix := os.Getenv("OPENPILOT_PREFIX")
if prefix == "" {
return "/data/starpilot/navigation/settings.json"
}
if !storagePrefix.MatchString(prefix) {
return ""
}
return "/data/starpilot-" + prefix + "/navigation/settings.json"
}
// ReadGpsMode returns the saved choice, or backup when it is missing or invalid.
func ReadGpsMode() string {
path := navigationSettingsPath()
if path == "" {
return GpsModeBackup
}
raw, err := os.ReadFile(path)
if err != nil || len(raw) > 1<<20 {
return GpsModeBackup
}
var settings struct {
GpsSource string `json:"gpsSource"`
}
if json.Unmarshal(raw, &settings) != nil {
return GpsModeBackup
}
switch settings.GpsSource {
case GpsModeComma, GpsModePhone:
return settings.GpsSource
}
return GpsModeBackup
}
type GpsSample struct {
Location log.GpsLocationData
Source GpsSource
@@ -60,7 +110,12 @@ type GpsSub struct {
gpsLocation Subscriber[log.GpsLocationData]
gpsLocationExternal Subscriber[log.GpsLocationData]
carGps *Subscriber[custom.StarPilotCarState_Gps]
phoneGps *Subscriber[custom.StarPilotCarState_Gps]
car gpsCandidate
phone gpsCandidate
mode func() string
modeValue string
modeReadAt uint64
internal gpsCandidate
external gpsCandidate
selected GpsSource
@@ -83,6 +138,8 @@ func GpsFixFreshAt(source GpsSource, fixMonoTime, now uint64) bool {
return now-fixMonoTime <= externalFixMaxAge
case GpsSourceCar:
return now-fixMonoTime <= carFixMaxAge
case GpsSourcePhone:
return now-fixMonoTime <= phoneFixMaxAge
case GpsSourceInternal:
return now-fixMonoTime <= internalFixMaxAge
default:
@@ -134,6 +191,35 @@ func (s *GpsSub) clearCandidates() {
s.internal = gpsCandidate{}
s.external = gpsCandidate{}
s.car = gpsCandidate{}
s.phone = gpsCandidate{}
}
func (s *GpsSub) gpsMode(now uint64) string {
if s.modeValue == "" || now < s.modeReadAt || now-s.modeReadAt >= gpsModeRefresh {
read := s.mode
if read == nil {
read = ReadGpsMode
}
s.modeValue, s.modeReadAt = read(), now
}
return s.modeValue
}
// updateWrapped admits a StarPilotCarState.Gps-shaped fix dated by its own source time.
func (c *gpsCandidate) updateWrapped(event DecodedEvent[custom.StarPilotCarState_Gps], sensor log.GpsLocationData_SensorSource,
clock clockSample, barrierMono, maxAge uint64) bool {
sourceTime := event.Value.SourceMonoTime()
if sourceTime == 0 || sourceTime > event.LogMonoTime || event.LogMonoTime > clock.monoAfter {
return false
}
location, err := carGpsLocation(event.Value)
if err != nil {
return false
}
location.SetSource(sensor)
valid := event.Valid && !math.IsNaN(float64(location.Speed())) && !math.IsInf(float64(location.Speed()), 0) && location.Speed() >= 0 &&
!math.IsNaN(location.Altitude()) && !math.IsInf(location.Altitude(), 0)
return c.updateWithAge(DecodedEvent[log.GpsLocationData]{Value: location, Valid: valid, LogMonoTime: sourceTime}, clock, barrierMono, maxAge)
}
func (s *GpsSub) clockReady(clock clockSample) bool {
@@ -166,7 +252,7 @@ func (s *GpsSub) ReadSample() (sample GpsSample, success bool) {
clock = s.clock()
}
ready := s.clockReady(clock)
internalNew, externalNew, carNew := false, false, false
internalNew, externalNew, carNew, phoneNew := false, false, false, false
if event, ok := s.gpsLocation.ReadEvent(); ok && ready {
internalNew = s.internal.update(event, clock, s.barrierMono)
}
@@ -176,23 +262,29 @@ func (s *GpsSub) ReadSample() (sample GpsSample, success bool) {
if s.carGps != nil {
if event, ok := s.carGps.ReadEvent(); ok && ready {
sourceTime := event.Value.SourceMonoTime()
if sourceTime > 0 && sourceTime <= event.LogMonoTime && event.LogMonoTime <= clock.monoAfter {
location, err := carGpsLocation(event.Value)
if err == nil {
carNew = s.car.updateWithAge(DecodedEvent[log.GpsLocationData]{Value: location, Valid: event.Valid && !math.IsNaN(float64(location.Speed())) && !math.IsInf(float64(location.Speed()), 0) && location.Speed() >= 0 && !math.IsNaN(location.Altitude()) && !math.IsInf(location.Altitude(), 0), LogMonoTime: sourceTime}, clock, s.barrierMono, carFixMaxAge)
}
}
carNew = s.car.updateWrapped(event, log.GpsLocationData_SensorSource_car, clock, s.barrierMono, carFixMaxAge)
}
}
if s.phoneGps != nil {
if event, ok := s.phoneGps.ReadEvent(); ok && ready {
// The enum has no phone value; android is the closest.
phoneNew = s.phone.updateWrapped(event, log.GpsLocationData_SensorSource_android, clock, s.barrierMono, phoneFixMaxAge)
}
}
mode := s.gpsMode(clock.boot)
phoneFresh := ready && mode != GpsModeComma && GpsFixFreshAt(GpsSourcePhone, s.phone.fixMonoTime, clock.boot)
source := GpsSourceNone
if ready && GpsFixFreshAt(GpsSourceExternal, s.external.fixMonoTime, clock.boot) {
if phoneFresh && mode == GpsModePhone {
source = GpsSourcePhone
} else if ready && GpsFixFreshAt(GpsSourceExternal, s.external.fixMonoTime, clock.boot) {
source = GpsSourceExternal
} else if ready && GpsFixFreshAt(GpsSourceInternal, s.internal.fixMonoTime, clock.boot) {
source = GpsSourceInternal
} else if ready && GpsFixFreshAt(GpsSourceCar, s.car.fixMonoTime, clock.boot) {
source = GpsSourceCar
} else if phoneFresh {
source = GpsSourcePhone
}
sample.SourceChanged = source != s.selected
if sample.SourceChanged {
@@ -215,6 +307,10 @@ func (s *GpsSub) ReadSample() (sample GpsSample, success bool) {
sample.Location = s.car.location
sample.FixMonoTime = s.car.fixMonoTime
sample.NewFix = carNew
case GpsSourcePhone:
sample.Location = s.phone.location
sample.FixMonoTime = s.phone.fixMonoTime
sample.NewFix = phoneNew
default:
return sample, false
}
@@ -234,24 +330,28 @@ func (s *GpsSub) Close() {
if s.carGps != nil {
s.carGps.Sub.Msgq.Close()
}
if s.phoneGps != nil {
s.phoneGps.Sub.Msgq.Close()
}
}
func GetGpsSub() (gpsSub GpsSub) {
return GpsSub{
carGps: optionalCarGpsSubscriber(),
carGps: optionalWrappedGpsSubscriber("starpilotCarState", CarGpsReader),
phoneGps: optionalWrappedGpsSubscriber("starpilotNavigation", PhoneGpsReader),
gpsLocation: NewSubscriber("gpsLocation", GpsLocationReader, true, ms.Settings.SubscriberSettings.ShadowGpsLocation),
gpsLocationExternal: NewSubscriber("gpsLocationExternal", GpsLocationExternalReader, true, ms.Settings.SubscriberSettings.ShadowGpsLocationExternal),
}
}
func optionalCarGpsSubscriber() (subscriber *Subscriber[custom.StarPilotCarState_Gps]) {
func optionalWrappedGpsSubscriber(service string, reader func(log.Event) (custom.StarPilotCarState_Gps, error)) (subscriber *Subscriber[custom.StarPilotCarState_Gps]) {
defer func() {
if recover() != nil {
subscriber = nil
slog.Warn("Optional car GPS subscriber unavailable")
slog.Warn("Optional GPS subscriber unavailable", "service", service)
}
}()
value := NewSubscriber("starpilotCarState", CarGpsReader, true, false)
value := NewSubscriber(service, reader, true, false)
return &value
}
+1 -1
View File
@@ -2623,7 +2623,7 @@ struct Event {
# DO change the name of the field and struct
# DON'T change the ID (e.g. @107)
# DON'T change which struct it points to
customReserved0 @107 :Custom.CustomReserved0;
starpilotNavigation @107 :Custom.StarPilotCarControl;
customReserved1 @108 :Custom.CustomReserved1;
starpilotCarState @109 :Custom.StarPilotCarState;
customReserved3 @110 :Custom.CustomReserved3;
File diff suppressed because it is too large Load Diff
+125
View File
@@ -0,0 +1,125 @@
package cereal
import (
"capnproto.org/go/capnp/v3"
"pfeifer.dev/mapd/cereal/custom"
"pfeifer.dev/mapd/cereal/log"
"testing"
)
func phoneGpsWire(t *testing.T, source, envelope uint64) []byte {
t.Helper()
message, segment, err := capnp.NewMessage(capnp.SingleSegment(nil))
if err != nil {
t.Fatal(err)
}
event, err := log.NewRootEvent(segment)
if err != nil {
t.Fatal(err)
}
event.SetLogMonoTime(envelope)
event.SetValid(true)
navigation, err := event.NewStarpilotNavigation()
if err != nil {
t.Fatal(err)
}
gps, err := navigation.NewPhoneGps()
if err != nil {
t.Fatal(err)
}
gps.SetSourceMonoTime(source)
gps.SetHasFix(true)
gps.SetLatitude(41)
gps.SetLongitude(-111)
gps.SetAltitude(100)
gps.SetSpeed(12)
gps.SetBearingDeg(90)
gps.SetHorizontalAccuracy(5)
gps.SetVerticalAccuracy(5)
gps.SetBearingAccuracyDeg(10)
gps.SetSpeedAccuracy(1)
raw, err := message.Marshal()
if err != nil {
t.Fatal(err)
}
return raw
}
func attachPhone(s *GpsSub, mode *string) *[][]byte {
queue := [][]byte{}
s.phoneGps = &Subscriber[custom.StarPilotCarState_Gps]{reader: PhoneGpsReader, maxBytes: 250 * 1024, readBytes: func() []byte {
if len(queue) == 0 {
return nil
}
value := queue[0]
queue = queue[1:]
return value
}}
s.mode = func() string { return *mode }
return &queue
}
func TestPhoneGpsFollowsTheGalaxySetting(t *testing.T) {
now := uint64(10_000_000_000)
mode := GpsModeBackup
s, internal, _ := testGpsSub(&now)
car := attachCar(s)
phone := attachPhone(s, &mode)
*phone = append(*phone, phoneGpsWire(t, now-300_000_000, now))
sample, ok := s.ReadSample()
if !ok || sample.Source != GpsSourcePhone || sample.FixMonoTime != now-300_000_000 || sample.Location.Longitude() != -111 {
t.Fatalf("backup without comma or car GPS: %+v %v", sample, ok)
}
*car = append(*car, carGpsWire(t, now-1, now, true, true))
if sample, ok = s.ReadSample(); !ok || sample.Source != GpsSourceCar {
t.Fatal("car ranks above the phone in backup")
}
*internal = append(*internal, gpsWire(t, GpsSourceInternal, now, true, true, 1, 2, 5))
if sample, ok = s.ReadSample(); !ok || sample.Source != GpsSourceInternal {
t.Fatal("comma ranks above the phone in backup")
}
mode = GpsModePhone
now += gpsModeRefresh
*phone = append(*phone, phoneGpsWire(t, now-100_000_000, now))
*internal = append(*internal, gpsWire(t, GpsSourceInternal, now, true, true, 1, 2, 5))
if sample, ok = s.ReadSample(); !ok || sample.Source != GpsSourcePhone {
t.Fatal("prefer phone")
}
now += phoneFixMaxAge
*internal = append(*internal, gpsWire(t, GpsSourceInternal, now, true, true, 1, 2, 5))
if sample, ok = s.ReadSample(); !ok || sample.Source != GpsSourceInternal {
t.Fatal("prefer phone falls back to comma once the phone fix expires")
}
mode = GpsModeComma
now += gpsModeRefresh
*phone = append(*phone, phoneGpsWire(t, now, now))
if sample, ok = s.ReadSample(); !ok || sample.Source != GpsSourceInternal {
t.Fatal("comma and car only keeps comma GPS")
}
now += internalFixMaxAge + 1
*phone = append(*phone, phoneGpsWire(t, now, now))
if _, ok = s.ReadSample(); ok {
t.Fatal("comma and car only must never use the phone")
}
}
func TestPhoneGpsModeIsRereadAtMostOnceASecond(t *testing.T) {
now := uint64(10_000_000_000)
reads := 0
s, _, _ := testGpsSub(&now)
s.mode = func() string { reads++; return GpsModeBackup }
s.ReadSample()
now += gpsModeRefresh - 1
s.ReadSample()
if reads != 1 {
t.Fatalf("mode reread early: %d", reads)
}
now++
s.ReadSample()
if reads != 2 {
t.Fatalf("mode not reread: %d", reads)
}
}
+8
View File
@@ -45,3 +45,11 @@ func CarGpsReader(evt log.Event) (custom.StarPilotCarState_Gps, error) {
}
return state.Gps()
}
func PhoneGpsReader(evt log.Event) (custom.StarPilotCarState_Gps, error) {
navigation, err := evt.StarpilotNavigation()
if err != nil {
return custom.StarPilotCarState_Gps{}, err
}
return navigation.PhoneGps()
}
+1
View File
@@ -0,0 +1 @@
{"description":"Synthetic Go-produced v2 current-road and data-only preview fixture; no real road data.","event_base64":"AAAAACQAAAAAAAAAAgABAADyBSoBAAAAjwAAAAAAAAAAAAAAEAAHAAAAoEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIABQABAAAAAAAAAAIAAAAAAHBBgAELJwEAAAAA8gUqAQAAAAEAAAAAAAAAKQAAAAAAAAAAAHBCAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAoCAABhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhAAAAAAAAAAA="}
+52 -2
View File
@@ -1,7 +1,6 @@
package cereal
import (
"bytes"
"capnproto.org/go/capnp/v3"
"encoding/base64"
"encoding/json"
@@ -61,7 +60,58 @@ func TestMapdV1HostWireFixture(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if !bytes.Equal(raw, expected) {
actualMessage, err := capnp.Unmarshal(raw)
if err != nil {
t.Fatal(err)
}
oldMessage, err := capnp.Unmarshal(expected)
if err != nil {
t.Fatal(err)
}
actualRoot, err := actualMessage.Root()
if err != nil {
t.Fatal(err)
}
oldRoot, err := oldMessage.Root()
if err != nil {
t.Fatal(err)
}
// Appended default fields can enlarge storage without changing old values.
equal, err := capnp.Equal(actualRoot, oldRoot)
if err != nil || !equal {
t.Fatal("provider wire differs from shared host fixture; review both schemas")
}
}
func TestPreviewHostWireFixture(t *testing.T) {
data, err := os.ReadFile("testdata/mapd_preview_wire.json")
if err != nil {
t.Fatal(err)
}
var fixture struct {
EventBase64 string `json:"event_base64"`
}
if err := json.Unmarshal(data, &fixture); err != nil {
t.Fatal(err)
}
raw, err := base64.StdEncoding.DecodeString(fixture.EventBase64)
if err != nil {
t.Fatal(err)
}
msg, err := capnp.Unmarshal(raw)
if err != nil {
t.Fatal(err)
}
event, err := log.ReadRootEvent(msg)
if err != nil {
t.Fatal(err)
}
out, err := event.MapdOut()
if err != nil {
t.Fatal(err)
}
boundary, err := out.PreviewBoundaryId()
if err != nil || !event.Valid() || out.SampleVersion() != 2 || out.SpeedLimit() != 20 || out.PreviewSpeedLimit() != 15 || out.PreviewDistance() != 60 || len(boundary) != 64 || out.PreviewWayId() != 2 {
t.Fatal("provider preview differs from shared host fixture")
}
}
+82
View File
@@ -0,0 +1,82 @@
package main
import (
"crypto/sha256"
"fmt"
"math"
"pfeifer.dev/mapd/cereal/custom"
"pfeifer.dev/mapd/maps"
)
const previewHorizonM = 500
const previewMaxWays = 64
type LimitPreview struct {
Speed float32
Distance float32
BoundaryID string
WayID int64
}
// A preview follows only a unique legal continuation, never a guessed turn.
func (s *State) previewLimit() LimitPreview {
if !s.ShadowOnly || s.SnapshotID == "" || s.CurrentWay.SelectionType != custom.WaySelectionType_current || s.MatchedLimitMps <= 0 {
return LimitPreview{}
}
way, forward, position := s.CurrentWay.Way, s.CurrentWay.OnWay.IsForward, s.Position
distance := float32(0)
seen := map[int64]bool{way.Id(): true}
for range previewMaxWays {
_, end := way.GetStartEnd(forward)
if distance+position.DistanceTo(end) > previewHorizonM {
return LimitPreview{}
}
segment, found, err := way.DistanceToNode(position, forward, end)
if err != nil || !found || segment < 0 || math.IsNaN(float64(segment)) || math.IsInf(float64(segment), 0) {
return LimitPreview{}
}
distance += segment
box := s.Data.OverlapBox()
if distance <= 0 || distance > previewHorizonM || !box.PosInside(end) {
return LimitPreview{}
}
matches, err := way.MatchingWays(&s.Data, end)
if err != nil {
return LimitPreview{}
}
legal := map[int64]maps.Way{}
for _, next := range matches {
first, last := next.GetStartEnd(true)
if first.Equals(last) && !next.OneWay() {
return LimitPreview{} // A two-way loop has two possible entry directions.
}
if next.Id() > 0 && (next.IsForwardFrom(end) || !next.OneWay()) {
legal[next.Id()] = next
}
}
if len(legal) != 1 {
return LimitPreview{}
}
var next maps.Way
for _, candidate := range legal {
next = candidate
}
if seen[next.Id()] {
return LimitPreview{}
}
nextForward := next.IsForwardFrom(end)
road := CurrentWay{Way: next, OnWay: maps.OnWayResult{IsForward: nextForward}}
speed := road.EffectiveMaxSpeed()
if speed <= 0 || math.IsNaN(speed) || math.IsInf(speed, 0) || speed > math.MaxFloat32 {
return LimitPreview{}
}
if math.Abs(speed-float64(s.MatchedLimitMps)) > .02 {
key := fmt.Sprintf("%s:%d:%d:%t:%.7f:%.7f", s.SnapshotID, way.Id(), next.Id(), nextForward, end.Lat(), end.Lon())
return LimitPreview{float32(speed), distance, fmt.Sprintf("%x", sha256.Sum256([]byte(key))), next.Id()}
}
seen[next.Id()] = true
way, forward, position = next, nextForward, end
}
return LimitPreview{}
}
+200
View File
@@ -0,0 +1,200 @@
package main
import (
"crypto/sha256"
"fmt"
"math"
"os"
"path/filepath"
"strings"
"testing"
"time"
"capnproto.org/go/capnp/v3"
"pfeifer.dev/mapd/cereal"
"pfeifer.dev/mapd/cereal/custom"
"pfeifer.dev/mapd/cereal/offline"
"pfeifer.dev/mapd/maps"
m "pfeifer.dev/mapd/math"
)
func previewState(t *testing.T, specs []syntheticWay, index int, forward bool, latitude float64) State {
t.Helper()
tile := packedRoadTile(t, specs)
return State{ShadowOnly: true, SnapshotID: "verified-snapshot", Data: tile,
Position: m.NewPosition(latitude, -97.9), MatchedLimitMps: float32(specs[index].speed),
CurrentWay: CurrentWay{Way: tile.Ways.At(index), OnWay: maps.OnWayResult{IsForward: forward}, SelectionType: custom.WaySelectionType_current}}
}
func previewRoads() []syntheticWay {
return []syntheticWay{
{1, 20, 35.1, -97.9, 35.101, -97.9, false, 2},
{2, 20, 35.101, -97.9, 35.102, -97.9, false, 2},
{3, 10, 35.102, -97.9, 35.103, -97.9, false, 2},
}
}
func TestPreviewRawDistanceAndStableBoundaryAcrossApproachWays(t *testing.T) {
s := previewState(t, previewRoads(), 0, true, 35.1005)
a := s.previewLimit()
s = previewState(t, previewRoads(), 1, true, 35.1015)
b := s.previewLimit()
if a.Speed != 10 || a.WayID != 3 || a.BoundaryID == "" || a.BoundaryID != b.BoundaryID || math.Abs(float64(a.Distance-b.Distance)-111.2) > 1 {
t.Fatalf("unexpected road preview: %+v %+v", a, b)
}
s.Position = m.NewPosition(35.1014, -97.9)
if s.previewLimit().Distance <= b.Distance {
t.Fatal("raw distance was held at a previous minimum")
}
s.SnapshotID = "changed-snapshot"
if s.previewLimit().BoundaryID == b.BoundaryID {
t.Fatal("boundary identity survived a different snapshot")
}
}
func TestPreviewDirectionUnknownLimitsBranchesAndHorizon(t *testing.T) {
s := previewState(t, previewRoads(), 2, false, 35.1025)
if p := s.previewLimit(); p.Speed != 20 || p.WayID != 2 || p.Distance <= 0 {
t.Fatalf("reverse traversal failed: %+v", p)
}
for _, mode := range []string{"branch", "unknown", "oneway", "horizon", "unqualified", "unverified"} {
t.Run(mode, func(t *testing.T) {
roads := previewRoads()
index, forward, latitude := 0, true, 35.1005
switch mode {
case "branch":
roads = append(roads, syntheticWay{4, 30, 35.101, -97.9, 35.102, -97.899, false, 2})
case "unknown":
roads[1].speed = 0
case "oneway":
roads[1].oneWay = true
index, forward, latitude = 2, false, 35.1025
case "horizon":
roads[0].lat1 = 35.09
latitude = 35.091
}
s := previewState(t, roads, index, forward, latitude)
if mode == "unqualified" {
s.CurrentWay.SelectionType = custom.WaySelectionType_possible
}
if mode == "unverified" {
s.SnapshotID = ""
}
if p := s.previewLimit(); p != (LimitPreview{}) {
t.Fatalf("uncertain preview escaped: %+v", p)
}
})
}
}
func TestPreviewClosedWayRequiresOneLegalDirection(t *testing.T) {
for _, tc := range []struct {
name string
oneWay, branch, wantPreview bool
}{
{"one-way loop", true, false, true},
{"two-way loop", false, false, false},
{"two-way loop plus continuation", false, true, false},
} {
t.Run(tc.name, func(t *testing.T) {
roads := []syntheticWay{
{1, 20, 35.1, -97.9, 35.101, -97.9, true, 2},
{2, 10, 35.101, -97.9, 35.102, -97.9, tc.oneWay, 2},
}
if tc.branch {
roads = append(roads, syntheticWay{3, 15, 35.101, -97.9, 35.102, -97.899, false, 2})
}
decoded, err := capnp.UnmarshalPacked(packedRoadTileBytes(t, roads))
if err != nil {
t.Fatal(err)
}
root, err := decoded.Root()
if err != nil {
t.Fatal(err)
}
msg, _, err := capnp.NewMessage(capnp.SingleSegment(nil))
if err != nil {
t.Fatal(err)
}
if err := msg.SetRoot(root); err != nil {
t.Fatal(err)
}
raw, err := offline.ReadRootOffline(msg)
if err != nil {
t.Fatal(err)
}
ways, err := raw.Ways()
if err != nil {
t.Fatal(err)
}
loop := ways.At(1)
loop.SetMaxLon(-97.898)
nodes, err := loop.NewNodes(4)
if err != nil {
t.Fatal(err)
}
for i, p := range [][2]float64{{35.101, -97.9}, {35.102, -97.9}, {35.102, -97.899}, {35.101, -97.9}} {
nodes.At(i).SetLatitude(p[0])
nodes.At(i).SetLongitude(p[1])
}
data, err := msg.MarshalPacked()
if err != nil {
t.Fatal(err)
}
tile := maps.ReadOffline(data)
if !tile.Loaded {
t.Fatal("closed road tile rejected")
}
s := State{ShadowOnly: true, SnapshotID: "verified-snapshot", Data: tile,
Position: m.NewPosition(35.1005, -97.9), MatchedLimitMps: 20,
CurrentWay: CurrentWay{Way: tile.Ways.At(0), OnWay: maps.OnWayResult{IsForward: true}, SelectionType: custom.WaySelectionType_current}}
p := s.previewLimit()
if tc.wantPreview {
if p.Speed != 10 || p.WayID != 2 || p.Distance <= 0 || p.BoundaryID == "" {
t.Fatalf("legal loop preview missing: %+v", p)
}
} else if p != (LimitPreview{}) {
t.Fatalf("ambiguous loop produced a preview: %+v", p)
}
})
}
}
func TestShadowPreviewSharesFixFreshnessWithoutControlOutputs(t *testing.T) {
roads := []syntheticWay{{1, 20, 35.149, -97.9, 35.151, -97.9, false, 2}, {2, 10, 35.151, -97.9, 35.153, -97.9, false, 2}}
data := packedRoadTileBytes(t, roads)
id := strings.Repeat("a", 64)
dir := filepath.Join(t.TempDir(), id)
area := maps.Area{Box: m.Box{MinPos: m.NewPosition(35, -98), MaxPos: m.NewPosition(35.25, -97.75)}}
path := maps.GenerateBoundsFileName(area, maps.OfflineSettings{OutputDirectory: dir})
if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
t.Fatal(err)
}
if err := os.WriteFile(path, data, 0644); err != nil {
t.Fatal(err)
}
rel, err := filepath.Rel(dir, path)
if err != nil {
t.Fatal(err)
}
load := maps.SnapshotLoader(dir, maps.SnapshotReceipt{Tiles: []maps.SnapshotTile{{Path: rel, Size: int64(len(data)), SHA256: fmt.Sprintf("%x", sha256.Sum256(data))}}})
s := State{ShadowOnly: true, SnapshotID: id}
s.Init()
boot := uint64(10_100_000_000)
s.bootNow = func() uint64 { return boot }
sample := syntheticSample(t, cereal.GpsSourceExternal, 10_000_000_000, 1, true, true)
s.ProcessGps(sample, true, load, time.Unix(0, 0))
sample.SourceChanged, sample.FixMonoTime = false, 10_050_000_000
s.ProcessGps(sample, true, load, time.Unix(0, 1))
event, output := decodedOutput(t, &s)
boundary, _ := output.PreviewBoundaryId()
if !event.Valid() || output.SpeedLimit() != 20 || output.PreviewSpeedLimit() != 10 || boundary == "" || output.PreviewDistance() <= 0 || output.NextSpeedLimit() != 0 || output.SuggestedSpeed() != 0 {
t.Fatalf("shadow preview: valid=%v status=%v way=%v limit=%v preview=%+v", event.Valid(), output.RoadStatus(), output.WaySelectionType(), output.SpeedLimit(), s.LimitPreview)
}
boot = 10_600_000_000
event, output = decodedOutput(t, &s)
boundary, _ = output.PreviewBoundaryId()
if event.Valid() || output.PreviewSpeedLimit() != 0 || boundary != "" {
t.Fatal("expired GPS retained an upcoming limit")
}
}
+1 -1
View File
@@ -78,7 +78,7 @@ func runSnapshotManagedPrepareContext(ctx context.Context, args []string, client
encoder := json.NewEncoder(output)
id, err := maps.FetchAndAdmitSnapshot(ctx, maps.FetchOptions{
AdmitOptions: maps.AdmitOptions{Root: filepath.Clean(*root), Bounds: region.Bounds, Overlap: .001,
SourceRevision: sourceRevision, UpstreamRevision: upstreamRevision, SourceDigest: sourceDigest},
SourceRevision: sourceRevision, UpstreamRevision: upstreamRevision, SourceDigest: sourceDigest, AddToCurrent: true},
MaxBytes: *maxTransfer, MaxNewDiskBytes: *maxDisk, PrepareOnly: true,
Progress: func(p maps.FetchProgress) error { return encoder.Encode(p) },
}, client)
+47
View File
@@ -114,6 +114,53 @@ func TestManagedSnapshotCatalogPrepareSelect(t *testing.T) {
}
}
func TestManagedSnapshotCLIAddsSecondRegion(t *testing.T) {
root := t.TempDir()
bodies := make(map[string][]byte)
for _, token := range []string{"nation.CY", "nation.BN"} {
region, err := maps.ResolveManagedRegion(token)
if err != nil || region.Groups != 1 {
t.Fatalf("one-group fixture: %+v %v", region, err)
}
path := "/offline/" + strconv.Itoa(int(region.Bounds[0])) + "/" + strconv.Itoa(int(region.Bounds[1])) + ".tar.gz"
bodies[path] = managedFixtureArchive(t, region.Bounds)
}
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
body, ok := bodies[r.URL.Path]
if !ok {
w.WriteHeader(http.StatusNotFound)
return
}
_, _ = w.Write(body)
}))
defer server.Close()
client := &http.Client{Transport: fixedOriginTestTransport{server}}
previous := ""
for i, token := range []string{"nation.CY", "nation.BN"} {
var output bytes.Buffer
args := []string{"--offline-root", root, "--region", token, "--max-transfer-bytes", "1048576", "--max-new-disk-bytes", "16777216"}
if err := runSnapshotManagedPrepareContext(context.Background(), args, client, &output); err != nil {
t.Fatal(err)
}
decoder := json.NewDecoder(&output)
var last struct{ Generation string }
for decoder.More() {
if err := decoder.Decode(&last); err != nil {
t.Fatal(err)
}
}
if err := runSnapshotSelectContext(context.Background(), []string{"--offline-root", root, "--generation", last.Generation,
"--expected-current", previous}, &bytes.Buffer{}); err != nil {
t.Fatal(err)
}
_, receipt, err := maps.ResolveSnapshot(root)
if err != nil || len(receipt.Tiles) != 64*(i+1) || len(receipt.Inputs) != i+1 {
t.Fatalf("CLI replaced existing region: %+v %v", receipt, err)
}
previous = last.Generation
}
}
func TestManagedSnapshotRejectsSymlinkedAncestorAndInvalidToken(t *testing.T) {
base := t.TempDir()
real := filepath.Join(base, "real")
+4 -3
View File
@@ -9,7 +9,7 @@ import (
"pfeifer.dev/mapd/settings"
)
const MaxManagedGroups = 64
const MaxManagedGroups = maxSnapshotTiles / 64
type ManagedRegion struct {
Token string `json:"token"`
@@ -65,8 +65,9 @@ func BundledManagedRegions() ([]ManagedRegion, error) {
if err != nil {
return nil, err
}
result := make([]ManagedRegion, 0, 229)
for _, group := range []string{"nation", "us_state"} {
result := make([]ManagedRegion, 0, 252)
// Russian district rectangles follow Geofabrik extract envelopes, split at ±180°.
for _, group := range []string{"nation", "us_state", "ca_province", "ru_district"} {
for key, data := range menu[group] {
if key == "" || strings.Contains(key, ".") || data.FullName == "" {
return nil, errors.New("invalid bundled region")
+56 -5
View File
@@ -1,13 +1,17 @@
package maps
import "testing"
import (
"testing"
"pfeifer.dev/mapd/settings"
)
func TestBundledManagedRegionCoverage(t *testing.T) {
regions, err := BundledManagedRegions()
if err != nil {
t.Fatal(err)
}
if len(regions) != 229 {
if len(regions) != 252 {
t.Fatalf("bundled catalog changed: %d", len(regions))
}
available := 0
@@ -19,18 +23,65 @@ func TestBundledManagedRegionCoverage(t *testing.T) {
}
}
}
if available != 199 {
if available != 248 {
t.Fatalf("review supported-region count changed: %d", available)
}
for token, groups := range map[string]int{"us_state.CA": 36, "us_state.TX": 56, "us_state.IL": 12} {
for token, groups := range map[string]int{"us_state.CA": 36, "us_state.TX": 56, "us_state.IL": 12, "nation.CA": 765, "nation.JP": 72, "nation.US": 390} {
region, err := ResolveManagedRegion(token)
if err != nil || region.Groups != groups {
t.Fatalf("%s: %+v %v", token, region, err)
}
}
for _, token := range []string{"us_state.AK", "nation.FJ", "nation.RU", "nation.AQ", "nation.US", "nation.CA", "us_state.CA.extra", "nation."} {
for _, token := range []string{"us_state.AK", "nation.FJ", "nation.RU", "nation.AQ", "us_state.CA.extra", "nation."} {
if _, err := ResolveManagedRegion(token); err == nil {
t.Fatalf("unsupported region %s accepted", token)
}
}
}
func TestRussianDistrictCoverage(t *testing.T) {
for token, want := range map[string]struct {
bounds [4]float64
groups int
}{
"central": {[4]float64{48, 30, 60, 48}, 54},
"moscow": {[4]float64{54, 36, 58, 40}, 4},
"far-east": {[4]float64{36, 104, 84, 180}, 912},
"far-east-dateline": {[4]float64{62, -180, 74, -168}, 36},
} {
region, err := ResolveManagedRegion("ru_district." + token)
if err != nil || region.Bounds != want.bounds || region.Groups != want.groups {
t.Fatalf("%s: %+v %v", token, region, err)
}
}
}
// Province coverage comes from the pinned Geofabrik extract envelopes. Every
// envelope must survive outward grid alignment without losing any edge.
func TestCanadianProvinceCoverage(t *testing.T) {
menu, err := settings.BundledDownloadMenu()
if err != nil {
t.Fatal(err)
}
if len(menu["ca_province"]) != 13 {
t.Fatal("expected ten provinces and three territories")
}
for key, data := range menu["ca_province"] {
region, err := ResolveManagedRegion("ca_province." + key)
if err != nil || !region.Available {
t.Fatalf("%s unavailable: %v", key, err)
}
b := data.BoundingBox
if region.Bounds[0] > b.MinLat || region.Bounds[1] > b.MinLon || region.Bounds[2] < b.MaxLat || region.Bounds[3] < b.MaxLon {
t.Fatalf("coverage clipped: %s", key)
}
if region.Groups >= 765 {
t.Fatalf("province not smaller than Canada: %s", key)
}
}
for _, token := range []string{"ca_province.CA", "ca_province.ON.extra", "ca_province."} {
if _, err := ResolveManagedRegion(token); err == nil {
t.Fatalf("unknown token accepted: %s", token)
}
}
}
+12 -1
View File
@@ -11,6 +11,7 @@ import (
"os"
"reflect"
"runtime"
"slices"
"strconv"
"strings"
"syscall"
@@ -162,7 +163,6 @@ func GenerateOffline(s OfflineSettings) error {
MaxSpeedBackward: ParseMaxSpeed(tags["maxspeed:backward"]),
MaxSpeedAdvisory: ParseMaxSpeed(tags["maxspeed:advisory"]),
Lanes: uint8(lanes),
OneWay: tags["oneway"] == "yes",
Id: int64(way.ID),
HighwayClass: HighwayClassFromTag(tags["highway"]),
@@ -191,6 +191,17 @@ func GenerateOffline(s OfflineSettings) error {
tmpWay.Nodes[i].Latitude = n.Lat
tmpWay.Nodes[i].Longitude = n.Lon
}
switch tags["oneway"] {
case "yes", "1":
tmpWay.OneWay = true
case "-1":
tmpWay.OneWay = true
slices.Reverse(tmpWay.Nodes)
tmpWay.MaxSpeedForward, tmpWay.MaxSpeedBackward = tmpWay.MaxSpeedBackward, tmpWay.MaxSpeedForward
tmpWay.MaxSpeedForwardConditional, tmpWay.MaxSpeedBackwardConditional = tmpWay.MaxSpeedBackwardConditional, tmpWay.MaxSpeedForwardConditional
case "":
tmpWay.OneWay = tags["junction"] == "roundabout" || tags["highway"] == "motorway"
}
tmpWay.Box.MinPos = m.NewPosition(minLat, minLon)
tmpWay.Box.MaxPos = m.NewPosition(maxLat, maxLon)
scannedWays = append(scannedWays, tmpWay)
+78
View File
@@ -0,0 +1,78 @@
package maps
import (
"math"
"os"
"path/filepath"
"testing"
m "pfeifer.dev/mapd/math"
)
func TestGeneratorPreservesFixedOneWayDirectionAndSpeedTags(t *testing.T) {
for _, tc := range []struct {
name, oneWay, highway, junction string
wantOneWay, reverse bool
}{
{"ordinary", "", "residential", "", false, false},
{"yes", "yes", "residential", "", true, false},
{"numeric", "1", "residential", "", true, false},
{"reverse", "-1", "residential", "", true, true},
{"roundabout", "", "residential", "roundabout", true, false},
{"motorway", "", "motorway", "", true, false},
{"roundabout explicit no", "no", "residential", "roundabout", false, false},
{"roundabout explicit zero", "0", "residential", "roundabout", false, false},
{"motorway explicit no", "no", "motorway", "", false, false},
{"motorway explicit zero", "0", "motorway", "", false, false},
{"motorway link", "", "motorway_link", "", false, false},
{"reversible", "reversible", "residential", "roundabout", false, false},
{"alternating", "alternating", "motorway", "", false, false},
} {
t.Run(tc.name, func(t *testing.T) {
forwardRule, backwardRule := "15 @ (Mo-Fr 08:00-09:00)", "25 @ (Sa 10:00-11:00)"
tags := []string{"highway", tc.highway, "maxspeed", "30 mph",
"maxspeed:forward", "10", "maxspeed:backward", "20",
"maxspeed:forward:conditional", forwardRule, "maxspeed:backward:conditional", backwardRule}
if tc.oneWay != "" {
tags = append(tags, "oneway", tc.oneWay)
}
if tc.junction != "" {
tags = append(tags, "junction", tc.junction)
}
root := t.TempDir()
pbf := filepath.Join(root, "road.osm.pbf")
if err := os.WriteFile(pbf, syntheticPBF(tags...), 0600); err != nil {
t.Fatal(err)
}
output := filepath.Join(root, "tiles")
if err := GenerateOffline(OfflineSettings{InputFile: pbf, OutputDirectory: output, Overlap: .001,
Box: m.Box{MinPos: m.NewPosition(35, -98), MaxPos: m.NewPosition(35.25, -97.75)}}); err != nil {
t.Fatal(err)
}
tile, err := FindWaysAroundPositionIn(m.NewPosition(35.15, -97.9), output)
if err != nil || !tile.Loaded || tile.Ways.Len() != 1 {
t.Fatalf("generated road not loaded: %v", err)
}
way := tile.Ways.At(0)
if way.Nodes.Len() != 2 {
t.Fatalf("generated road has %d nodes", way.Nodes.Len())
}
first, last := 35.1, 35.2
forwardSpeed, backwardSpeed := 10./3.6, 20./3.6
if tc.reverse {
first, last = last, first
forwardSpeed, backwardSpeed = backwardSpeed, forwardSpeed
forwardRule, backwardRule = backwardRule, forwardRule
}
firstNode, lastNode := way.Nodes.At(0), way.Nodes.At(1)
if way.Id() != 42 || way.OneWay() != tc.wantOneWay ||
math.Abs(firstNode.Lat()-first) > 1e-9 || math.Abs(lastNode.Lat()-last) > 1e-9 ||
math.Abs(way.MaxSpeed()-13.4112) > 1e-6 ||
math.Abs(way.MaxSpeedForward()-forwardSpeed) > 1e-5 || math.Abs(way.MaxSpeedBackward()-backwardSpeed) > 1e-5 ||
way.ConditionalMaxSpeedRaw(true) != forwardRule || way.ConditionalMaxSpeedRaw(false) != backwardRule {
t.Fatalf("generated road lost direction or speed metadata: oneWay=%v forward=%v backward=%v",
way.OneWay(), way.MaxSpeedForward(), way.MaxSpeedBackward())
}
})
}
}
+2
View File
@@ -178,6 +178,8 @@ type Offline struct {
overlap u.Curry[float64]
grid *wayGrid // padded way boxes by cell, see way_index.go
endpoints map[m.Position][]int32 // way indices by first/last node
wayBoxes []m.Box // per-way bounding box, by way index
wayLanes []uint8 // per-way lane tag, by way index
}
func (o *Offline) _box() m.Box {
+13 -3
View File
@@ -74,6 +74,7 @@ type AdmitOptions struct {
SourceDigest string
Now func() time.Time
Budget *SnapshotDiskBudget
AddToCurrent bool
}
func expectedSnapshotTiles(bounds [4]float64) ([]string, error) {
@@ -364,14 +365,14 @@ func verifySnapshot(root, id string) (string, SnapshotReceipt, error) {
receipt.Attribution != attribution || receipt.SourceVerified || len(receipt.Inputs) == 0 {
return "", empty, errors.New("receipt identity or contract invalid")
}
if (receipt.SourceKind != "local-pbf" && receipt.SourceKind != "provided-group-archives") ||
if (receipt.SourceKind != "local-pbf" && receipt.SourceKind != "provided-group-archives" && receipt.SourceKind != "combined-group-archives") ||
math.IsNaN(receipt.Overlap) || math.IsInf(receipt.Overlap, 0) || receipt.Overlap < 0 || receipt.Overlap >= 0.25 ||
receipt.GeneratedUnix <= 0 || len(receipt.SourceRevision) == 0 || len(receipt.SourceRevision) > 128 ||
len(receipt.UpstreamRevision) == 0 || len(receipt.UpstreamRevision) > 128 ||
len(receipt.SourceDigest) == 0 || len(receipt.SourceDigest) > 128 {
return "", empty, errors.New("receipt metadata invalid")
}
expected, err := expectedSnapshotTiles(receipt.Bounds)
expected, err := receiptSnapshotTiles(receipt)
if err != nil || len(receipt.Tiles) != len(expected) {
return "", empty, errors.New("receipt cell coverage invalid")
}
@@ -625,6 +626,15 @@ func admitSnapshot(ctx context.Context, o AdmitOptions, selectNow bool) (string,
if err != nil {
return "", err
}
if o.AddToCurrent {
if err := addSelectedSnapshot(ctx, o.Root, stage, &receipt); err != nil {
return "", err
}
expected, err = receiptSnapshotTiles(receipt)
if err != nil {
return "", err
}
}
data, err := json.Marshal(receipt)
if err != nil || len(data) > maxReceiptBytes {
return "", errors.New("receipt exceeds finite limit")
@@ -715,7 +725,7 @@ func SelectPreparedSnapshot(ctx context.Context, root, id, expectedCurrent strin
if err != nil {
return err
}
expected, err := expectedSnapshotTiles(receipt.Bounds)
expected, err := receiptSnapshotTiles(receipt)
if err != nil {
return err
}
+137
View File
@@ -0,0 +1,137 @@
package maps
import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
"sort"
"strconv"
"strings"
)
// Combined snapshots declare only the archive groups actually downloaded,
// rather than treating the rectangle between separate regions as covered.
func receiptSnapshotTiles(receipt SnapshotReceipt) ([]string, error) {
if receipt.SourceKind != "combined-group-archives" {
return expectedSnapshotTiles(receipt.Bounds)
}
if len(receipt.Inputs) == 0 || len(receipt.Inputs) > MaxManagedGroups {
return nil, errors.New("combined snapshot exceeds finite group budget")
}
var extent [4]float64
expected := make([]string, 0, len(receipt.Inputs)*64)
previous := ""
for i, input := range receipt.Inputs {
parts := strings.Split(input.Name, "/")
if len(parts) != 2 || !strings.HasSuffix(parts[1], ".tar.gz") || i > 0 && input.Name <= previous {
return nil, errors.New("combined archive inputs are not unique and ordered")
}
lat, latErr := strconv.Atoi(parts[0])
lon, lonErr := strconv.Atoi(strings.TrimSuffix(parts[1], ".tar.gz"))
if latErr != nil || lonErr != nil || lat < -90 || lat > 88 || lon < -180 || lon > 178 ||
lat%2 != 0 || lon%2 != 0 || input.Name != fmt.Sprintf("%d/%d.tar.gz", lat, lon) {
return nil, errors.New("combined archive group is invalid")
}
bounds := [4]float64{float64(lat), float64(lon), float64(lat + 2), float64(lon + 2)}
tiles, err := expectedSnapshotTiles(bounds)
if err != nil {
return nil, err
}
expected = append(expected, tiles...)
if i == 0 {
extent = bounds
} else {
extent = unionSnapshotBounds(extent, bounds)
}
previous = input.Name
}
if extent != receipt.Bounds {
return nil, errors.New("combined snapshot extent does not match its groups")
}
sort.Strings(expected)
return expected, nil
}
func unionSnapshotBounds(a, b [4]float64) [4]float64 {
for i := 0; i < 2; i++ {
if b[i] < a[i] {
a[i] = b[i]
}
if b[i+2] > a[i+2] {
a[i+2] = b[i+2]
}
}
return a
}
func addSelectedSnapshot(ctx context.Context, root, stage string, receipt *SnapshotReceipt) error {
if _, err := os.Lstat(filepath.Join(root, "current.json")); os.IsNotExist(err) {
return nil
} else if err != nil {
return err
}
dir, saved, err := ResolveSnapshot(root)
if err != nil {
return err
}
if receipt.SourceKind != "provided-group-archives" ||
(saved.SourceKind != "provided-group-archives" && saved.SourceKind != "combined-group-archives") ||
saved.Overlap != receipt.Overlap {
return errors.New("saved snapshot cannot be combined with this download")
}
inputs := make(map[string]SnapshotInput, len(saved.Inputs)+len(receipt.Inputs))
for _, input := range saved.Inputs {
inputs[input.Name] = input
}
for _, input := range receipt.Inputs {
inputs[input.Name] = input
}
receipt.Inputs = make([]SnapshotInput, 0, len(inputs))
for _, input := range inputs {
receipt.Inputs = append(receipt.Inputs, input)
}
sort.Slice(receipt.Inputs, func(i, j int) bool { return receipt.Inputs[i].Name < receipt.Inputs[j].Name })
receipt.SourceKind = "combined-group-archives"
receipt.Bounds = unionSnapshotBounds(saved.Bounds, receipt.Bounds)
expected, err := receiptSnapshotTiles(*receipt)
if err != nil {
return err
}
declared := make(map[string]SnapshotTile, len(saved.Tiles)+len(receipt.Tiles))
for _, tile := range receipt.Tiles {
declared[tile.Path] = tile
}
for _, tile := range saved.Tiles {
if err := ctx.Err(); err != nil {
return err
}
if _, updated := declared[tile.Path]; updated {
continue
}
source, err := snapshotTilePath(dir, tile.Path)
if err != nil {
return err
}
target := filepath.Join(stage, tile.Path)
if err := os.MkdirAll(filepath.Dir(target), 0o700); err != nil {
return err
}
if err := os.Link(source, target); err != nil {
return err
}
declared[tile.Path] = tile
}
tiles, err := inspectSnapshotTiles(stage, receipt.Overlap, expected)
if err != nil {
return err
}
for _, tile := range tiles {
if tile != declared[tile.Path] {
return errors.New("saved snapshot tile changed while adding coverage")
}
}
receipt.Tiles = tiles
return ctx.Err()
}
+180
View File
@@ -0,0 +1,180 @@
package maps
import (
"bytes"
"context"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"strings"
"testing"
m "pfeifer.dev/mapd/math"
)
func TestManagedDownloadsAccumulateCoverage(t *testing.T) {
root := t.TempDir()
archives := map[string][]byte{
"/offline/0/0.tar.gz": snapshotGroupArchive(t, 0, 0),
"/offline/0/8.tar.gz": snapshotGroupArchive(t, 0, 8),
"/offline/-4/-8.tar.gz": snapshotGroupArchive(t, -4, -8),
}
var requests []string
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
requests = append(requests, r.URL.Path)
body, ok := archives[r.URL.Path]
if !ok {
w.WriteHeader(http.StatusNotFound)
return
}
_, _ = w.Write(body)
}))
defer server.Close()
client := &http.Client{Transport: localArchiveTransport{server}}
prepare := func(bounds [4]float64) string {
t.Helper()
o := fetchOptions(root, bounds, 1<<20)
o.AddToCurrent, o.PrepareOnly, o.MaxNewDiskBytes = true, true, 16<<20
id, err := FetchAndAdmitSnapshot(context.Background(), o, client)
if err != nil {
t.Fatal(err)
}
return id
}
first := prepare([4]float64{0, 0, 2, 2})
if err := SelectPreparedSnapshot(context.Background(), root, first, ""); err != nil {
t.Fatal(err)
}
oldDir, oldReceipt, err := ResolveSnapshot(root)
if err != nil || oldReceipt.SourceKind != "provided-group-archives" || len(oldReceipt.Tiles) != 64 {
t.Fatalf("legacy first snapshot: %+v %v", oldReceipt, err)
}
second := prepare([4]float64{0, 8, 2, 10})
selected, _, err := ResolveSnapshot(root)
if err != nil || filepath.Base(selected) != first {
t.Fatalf("preparation replaced the active map: %s %v", selected, err)
}
if err := SelectPreparedSnapshot(context.Background(), root, second, ""); err == nil {
t.Fatal("combined snapshot bypassed selection conflict")
}
if err := SelectPreparedSnapshot(context.Background(), root, second, first); err != nil {
t.Fatal(err)
}
dir, receipt, err := ResolveSnapshot(root)
if err != nil || len(receipt.Tiles) != 128 || len(receipt.Inputs) != 2 {
t.Fatalf("second region did not preserve first: %+v %v", receipt, err)
}
loader := SnapshotLoader(dir, receipt)
for _, lon := range []float64{.1, 8.1} {
if _, err := loader(m.NewPosition(.1, lon)); err != nil {
t.Fatalf("downloaded region missing at %f: %v", lon, err)
}
}
if _, err := loader(m.NewPosition(.1, 4.1)); err == nil {
t.Fatal("gap between downloads incorrectly claimed as covered")
}
a, err := os.Stat(filepath.Join(oldDir, oldReceipt.Tiles[0].Path))
if err != nil {
t.Fatal(err)
}
b, err := os.Stat(filepath.Join(dir, oldReceipt.Tiles[0].Path))
if err != nil || !os.SameFile(a, b) {
t.Fatalf("saved tile was duplicated instead of reused: %v", err)
}
third := prepare([4]float64{-4, -8, -2, -6})
if err := SelectPreparedSnapshot(context.Background(), root, third, second); err != nil {
t.Fatal(err)
}
// Refresh an overlapping group without duplicating its cells or losing others.
archives["/offline/0/8.tar.gz"][4] = 1
refreshed := prepare([4]float64{0, 8, 2, 10})
if err := SelectPreparedSnapshot(context.Background(), root, refreshed, third); err != nil {
t.Fatal(err)
}
dir, receipt, err = ResolveSnapshot(root)
if err != nil || len(receipt.Tiles) != 192 || len(receipt.Inputs) != 3 {
t.Fatalf("overlapping refresh changed union size: %+v %v", receipt, err)
}
loader = SnapshotLoader(dir, receipt)
for _, pos := range [][2]float64{{.1, .1}, {.1, 8.1}, {-3.9, -7.9}} {
if _, err := loader(m.NewPosition(pos[0], pos[1])); err != nil {
t.Fatal(err)
}
}
if strings.Join(requests, ",") != "/offline/0/0.tar.gz,/offline/0/8.tar.gz,/offline/-4/-8.tar.gz,/offline/0/8.tar.gz" {
t.Fatalf("old coverage was downloaded again: %v", requests)
}
before, err := os.ReadFile(filepath.Join(root, "current.json"))
if err != nil {
t.Fatal(err)
}
for _, failure := range []string{"http", "canceled", "budget", "corrupt", "symlink"} {
t.Run(failure, func(t *testing.T) {
o := fetchOptions(root, [4]float64{0, 0, 2, 2}, 1<<20)
o.AddToCurrent, o.PrepareOnly, o.MaxNewDiskBytes = true, true, 16<<20
ctx := context.Background()
switch failure {
case "http":
o.Bounds = [4]float64{0, 20, 2, 22}
case "canceled":
var cancel context.CancelFunc
ctx, cancel = context.WithCancel(ctx)
cancel()
case "budget":
o.MaxNewDiskBytes = 1
case "corrupt", "symlink":
path := filepath.Join(dir, receipt.Tiles[0].Path)
original, err := os.ReadFile(path)
if err != nil {
t.Fatal(err)
}
if failure == "corrupt" {
err = os.WriteFile(path, []byte("corrupt"), 0o600)
} else {
err = os.Rename(path, path+".original")
if err == nil {
err = os.Symlink(path+".original", path)
}
}
if err != nil {
t.Fatal(err)
}
defer func() {
if failure == "symlink" {
_ = os.Remove(path)
_ = os.Rename(path+".original", path)
} else {
_ = os.WriteFile(path, original, 0o600)
}
}()
}
if _, err := FetchAndAdmitSnapshot(ctx, o, client); err == nil {
t.Fatal("invalid addition succeeded")
}
after, err := os.ReadFile(filepath.Join(root, "current.json"))
if err != nil || !bytes.Equal(before, after) {
t.Fatalf("failed addition changed selection: %v", err)
}
})
}
}
func TestCombinedSnapshotRejectsMalformedCoverage(t *testing.T) {
for _, name := range []string{"../0.tar.gz", "0/0/0.tar.gz", "0/01.tar.gz", "1/0.tar.gz", "90/0.tar.gz", "0/180.tar.gz"} {
_, err := receiptSnapshotTiles(SnapshotReceipt{SourceKind: "combined-group-archives", Inputs: []SnapshotInput{{Name: name}}})
if err == nil {
t.Fatalf("invalid combined input accepted: %s", name)
}
}
for _, inputs := range [][]SnapshotInput{{{Name: "0/0.tar.gz"}, {Name: "0/0.tar.gz"}},
{{Name: "0/8.tar.gz"}, {Name: "0/0.tar.gz"}}, make([]SnapshotInput, MaxManagedGroups+1)} {
if _, err := receiptSnapshotTiles(SnapshotReceipt{SourceKind: "combined-group-archives", Inputs: inputs}); err == nil {
t.Fatal("duplicate, unsorted or oversized combined coverage accepted")
}
}
if _, err := receiptSnapshotTiles(SnapshotReceipt{SourceKind: "combined-group-archives", Bounds: [4]float64{0, 0, 2, 10},
Inputs: []SnapshotInput{{Name: "0/0.tar.gz"}}}); err == nil {
t.Fatal("incorrect coverage extent accepted")
}
}
+12 -4
View File
@@ -309,17 +309,25 @@ func pbfBlock(kind string, raw []byte) []byte {
data = append(data, header...)
return append(data, blob...)
}
func syntheticPBF() []byte {
func syntheticPBF(tags ...string) []byte {
header := pbfBytesField(nil, 4, []byte("OsmSchema-V0.6"))
header = pbfBytesField(header, 5, []byte("LocationsOnWays"))
if len(tags) == 0 {
tags = []string{"highway", "residential", "maxspeed", "30 mph"}
}
var table []byte
for _, value := range []string{"", "highway", "residential", "maxspeed", "30 mph"} {
for _, value := range append([]string{""}, tags...) {
table = pbfBytesField(table, 1, []byte(value))
}
var keys, values []uint64
for i := 0; i < len(tags); i += 2 {
keys = append(keys, uint64(i+1))
values = append(values, uint64(i+2))
}
var way []byte
way = pbfVarintField(way, 1, 42)
way = pbfBytesField(way, 2, pbfPacked(1, 3))
way = pbfBytesField(way, 3, pbfPacked(2, 4))
way = pbfBytesField(way, 2, pbfPacked(keys...))
way = pbfBytesField(way, 3, pbfPacked(values...))
way = pbfBytesField(way, 8, pbfPacked(protowire.EncodeZigZag(1), protowire.EncodeZigZag(1)))
way = pbfBytesField(way, 9, pbfPacked(protowire.EncodeZigZag(351000000), protowire.EncodeZigZag(1000000)))
way = pbfBytesField(way, 10, pbfPacked(protowire.EncodeZigZag(-979000000), protowire.EncodeZigZag(0)))
+43 -8
View File
@@ -149,8 +149,12 @@ func (w *Way) IsForwardFrom(matchNode m.Position) bool {
return true
}
lastNode := w.Nodes.At(w.Nodes.Len()-1)
return !lastNode.Equals(matchNode)
lastNode := w.Nodes.At(w.Nodes.Len() - 1)
if lastNode.Equals(matchNode) {
// A closed one-way can be entered at its repeated endpoint in stored order.
return w.OneWay() && matchNode.Equals(w.Nodes.At(0))
}
return true
}
func IsForward(lineStart m.Position, lineEnd m.Position, bearing float64) bool {
@@ -348,14 +352,19 @@ func (w *Way) OnWay(location log.GpsLocationData, distanceMultiplier float32) (O
res.OnWay = false
return res, nil
}
max_dist := MatchDistance(location, w.Width(), distanceMultiplier)
if !MayBeWithin(box, pos, max_dist) {
// No point of the way can be close enough; skip the per-segment
// distance. The result is the same OnWay=false the scan would give.
res.OnWay = false
return res, nil
}
d, err := w.DistanceFrom(pos)
res.Distance = d
if err != nil {
res.OnWay = false
return res, errors.Wrap(err, "could not get distance to way")
}
max_dist := max(location.HorizontalAccuracy(), 5) + w.Width()
max_dist *= distanceMultiplier
if d.Distance < max_dist {
res.OnWay = true
@@ -369,6 +378,33 @@ func (w *Way) OnWay(location log.GpsLocationData, distanceMultiplier float32) (O
return res, nil
}
// MatchDistance is the distance from a way, in metres, within which OnWay
// accepts a fix: the fix's accuracy (at least 5 m) plus the road width,
// scaled by the caller's multiplier.
func MatchDistance(location log.GpsLocationData, width float32, distanceMultiplier float32) float32 {
return (max(location.HorizontalAccuracy(), 5) + width) * distanceMultiplier
}
// MayBeWithin is false only when every point of box is at least maxDist
// metres from pos by DistanceTo's haversine. Validated way nodes, and so
// every segment point DistanceFrom measures to, lie inside the way's box.
// The pads are twice the bound: the haversine distance is at least R*dLat
// and at least (2/pi)*R*cos(maxLat)*dLon.
func MayBeWithin(box m.Box, pos m.Position, maxDist float32) bool {
dist := float64(maxDist)
latPad := 2 * dist / ms.R * ms.TO_DEGREES
maxLat := max(math.Abs(box.MinPos.Lat()), math.Abs(box.MaxPos.Lat()), math.Abs(pos.Lat()))
if !(maxLat < 89) {
return true // too close to a pole for the longitude bound; measure instead
}
lonPad := 2 * dist / (ms.R * math.Cos(maxLat*ms.TO_RADIANS)) * ms.TO_DEGREES
padded := m.Box{
MinPos: m.NewPosition(box.MinPos.Lat()-latPad, box.MinPos.Lon()-lonPad),
MaxPos: m.NewPosition(box.MaxPos.Lat()+latPad, box.MaxPos.Lon()+lonPad),
}
return padded.PosInside(pos)
}
func (w *Way) BearingAlignment(location log.GpsLocationData) (float32, error) {
pos := m.NewPosition(location.Latitude(), location.Longitude())
d, err := w.DistanceFrom(pos)
@@ -399,7 +435,7 @@ func (w *Way) DistanceFrom(pos m.Position) (DistanceResult, error) {
minIdx := 0
for i := 0; i < w.Nodes.Len()-1; i++ {
nodeStart := w.Nodes.At(i)
nodeEnd := w.Nodes.At(i+1)
nodeEnd := w.Nodes.At(i + 1)
line := m.Line{Start: nodeStart, End: nodeEnd}
linePosition := line.NearestPosition(pos)
distance := pos.DistanceTo(linePosition.Pos)
@@ -415,7 +451,7 @@ func (w *Way) DistanceFrom(pos m.Position) (DistanceResult, error) {
onWayDistance := minNodeStart.DistanceTo(minLinePosition.Pos)
for i := range minIdx {
nodeStart := w.Nodes.At(i)
nodeEnd := w.Nodes.At(i+1)
nodeEnd := w.Nodes.At(i + 1)
onWayDistance += nodeStart.DistanceTo(nodeEnd)
}
@@ -459,8 +495,7 @@ func (w *Way) MatchingWays(offlineMaps *Offline, matchNode m.Position) ([]Way, e
continue
}
box := way.Box()
if box.Equals(w.Box()) {
if way.Id() == w.Id() {
continue
}
+45
View File
@@ -55,3 +55,48 @@ func TestBearingAlignmentIsAnUndirectedNonnegativePenalty(t *testing.T) {
}
}
}
func TestWayEntryDirectionForOpenAndClosedWays(t *testing.T) {
start, end := m.NewPosition(35.15, -97.9), m.NewPosition(35.151, -97.9)
for _, tc := range []struct {
name string
closed, oneWay, fromEnd, wantForward bool
}{
{"open start", false, true, false, true},
{"open end", false, true, true, false},
{"closed one-way", true, true, false, true},
{"closed two-way", true, false, false, false},
} {
t.Run(tc.name, func(t *testing.T) {
_, seg, err := capnp.NewMessage(capnp.SingleSegment(nil))
if err != nil {
t.Fatal(err)
}
raw, err := offline.NewRootWay(seg)
if err != nil {
t.Fatal(err)
}
raw.SetOneWay(tc.oneWay)
positions := []m.Position{start, end}
if tc.closed {
positions = append(positions, start)
}
nodes, err := raw.NewNodes(int32(len(positions)))
if err != nil {
t.Fatal(err)
}
for i, p := range positions {
nodes.At(i).SetLatitude(p.Lat())
nodes.At(i).SetLongitude(p.Lon())
}
from := start
if tc.fromEnd {
from = end
}
way := NewWay(raw)
if got := way.IsForwardFrom(from); got != tc.wantForward {
t.Fatalf("entry direction: got %v want %v", got, tc.wantForward)
}
})
}
}
+22
View File
@@ -3,7 +3,9 @@ package maps
import (
"math"
"pfeifer.dev/mapd/cereal/log"
m "pfeifer.dev/mapd/math"
ms "pfeifer.dev/mapd/settings"
)
// Dense tiles hold hundreds of thousands of ways. The road matcher used to
@@ -73,10 +75,12 @@ func buildWayGrid(tile m.Box, ways []m.Box) *wayGrid {
func (o *Offline) buildWayIndexes() {
count := o.Ways.Len()
boxes := make([]m.Box, count)
lanes := make([]uint8, count)
o.endpoints = make(map[m.Position][]int32)
for i := range count {
raw := o.waysRaw.At(i)
boxes[i] = m.Box{MinPos: m.NewPosition(raw.MinLat(), raw.MinLon()), MaxPos: m.NewPosition(raw.MaxLat(), raw.MaxLon())}
lanes[i] = raw.Lanes()
nodes, err := raw.Nodes()
if err != nil || nodes.Len() < 2 {
continue
@@ -90,6 +94,24 @@ func (o *Offline) buildWayIndexes() {
}
}
o.grid = buildWayGrid(o.Box(), boxes)
o.wayBoxes, o.wayLanes = boxes, lanes
}
// WayMayMatch is false only when way i cannot pass OnWay(location,
// distanceMultiplier): the same box and match distance OnWay uses, read from
// the index so a candidate that cannot match is never decoded. true when the
// tile has no index.
func (o *Offline) WayMayMatch(i int, location log.GpsLocationData, distanceMultiplier float32) bool {
if i < 0 || i >= len(o.wayBoxes) {
return true
}
lanes := o.wayLanes[i]
if lanes == 0 {
lanes = 2
}
width := float32(lanes) * ms.Settings.DefaultLaneWidth // as Way.Width
return MayBeWithin(o.wayBoxes[i], m.NewPosition(location.Latitude(), location.Longitude()),
MatchDistance(location, width, distanceMultiplier))
}
// WaysNear returns the indices, in tile order, of every way whose padded box
+7 -1
View File
@@ -24,7 +24,7 @@ type syntheticWay struct {
// The actual offline Capnp representation is packed, decoded, and passed to
// State; tests do not mock GetCurrentWay or BuildMessage.
func packedRoadTile(tb testing.TB, specs []syntheticWay) maps.Offline {
func packedRoadTileBytes(tb testing.TB, specs []syntheticWay) []byte {
tb.Helper()
msg, seg, err := capnp.NewMessage(capnp.SingleSegment(nil))
if err != nil {
@@ -65,6 +65,12 @@ func packedRoadTile(tb testing.TB, specs []syntheticWay) maps.Offline {
if err != nil {
tb.Fatal(err)
}
return data
}
func packedRoadTile(tb testing.TB, specs []syntheticWay) maps.Offline {
tb.Helper()
data := packedRoadTileBytes(tb, specs)
parsed := maps.ReadOffline(data)
if !parsed.Loaded {
tb.Fatal("packed tile rejected")
+24
View File
@@ -0,0 +1,24 @@
# Canadian download regions
The `ca_province` catalog covers all ten provinces and three territories.
Bounds are the envelopes of Geofabrik's Canada subregion extract polygons,
retrieved from https://download.geofabrik.de/index-v1.json on 2026-11-18.
The index SHA-256 was `076fb6d5d0df3efae47af91a8e24ff69d84da05872107958f99341a16a04da22`.
These are deliberately conservative extract envelopes (including coastal
coverage), not claims of precise administrative borders. Mapd rounds them
outward onto its existing two-degree archive grid from
https://map-data.pfeifer.dev/offline/. This uses existing provider archives,
not Geofabrik PBF downloads. Availability in the catalog means bounded, valid
coverage; it does not guarantee every live archive is currently reachable.
`nation.CA` and its existing bounds are unchanged for saved-selection
compatibility. Its legacy northern extent is 73.23 degrees; northern territory
choices cover their own full extract envelopes beyond that legacy extent.
Existing downloaded generations are not removed or migrated by this change.
The usual parked, transfer-budget, verification and atomic selection rules
remain in force. A missing archive leaves the previous selection intact.
The new embedded catalog requires a rebuilt Mapd provider and manifest. The
Galaxy UI only presents province choices returned by that installed provider,
so an older package continues to present its old catalog without invented
or unusable province buttons.
+1
View File
@@ -61,6 +61,7 @@ var ServiceQueueSize = map[string]int64{
"selfdriveState": QUEUE_SIZE_SMALL,
"gpsLocation": QUEUE_SIZE_SMALL,
"starpilotCarState": QUEUE_SIZE_SMALL,
"starpilotNavigation": QUEUE_SIZE_MEDIUM,
"gpsLocationExternal": QUEUE_SIZE_SMALL,
"liveLocationKalman": QUEUE_SIZE_SMALL,
"gpsNMEA": QUEUE_SIZE_SMALL,
+211
View File
@@ -2064,5 +2064,216 @@
"max_lat": -14.157381542325423
}
}
},
"ca_province": {
"AB": {
"full_name": "Alberta",
"bounding_box": {
"min_lon": -120.0043,
"min_lat": 48.99251,
"max_lon": -110.0018,
"max_lat": 60.00254
}
},
"BC": {
"full_name": "British Columbia",
"bounding_box": {
"min_lon": -141.7761,
"min_lat": 46.41459,
"max_lon": -114.049,
"max_lat": 60.00678
}
},
"MB": {
"full_name": "Manitoba",
"bounding_box": {
"min_lon": -102.014,
"min_lat": 48.99056,
"max_lon": -88.12183,
"max_lat": 60.00845
}
},
"NB": {
"full_name": "New Brunswick",
"bounding_box": {
"min_lon": -69.05975,
"min_lat": 44.19205,
"max_lon": -62.88575,
"max_lat": 48.38075
}
},
"NL": {
"full_name": "Newfoundland and Labrador",
"bounding_box": {
"min_lon": -67.87079,
"min_lat": 44.45787,
"max_lon": -44.17684,
"max_lat": 60.50864
}
},
"NT": {
"full_name": "Northwest Territories",
"bounding_box": {
"min_lon": -136.6974,
"min_lat": 59.9896,
"max_lon": -101.976,
"max_lat": 81.65483
}
},
"NS": {
"full_name": "Nova Scotia",
"bounding_box": {
"min_lon": -67.24728,
"min_lat": 42.10691,
"max_lon": -58.22593,
"max_lat": 47.89793
}
},
"NU": {
"full_name": "Nunavut",
"bounding_box": {
"min_lon": -120.737,
"min_lat": 51.1268,
"max_lon": -53.26943,
"max_lat": 84.95198
}
},
"ON": {
"full_name": "Ontario",
"bounding_box": {
"min_lon": -95.15965,
"min_lat": 41.66009,
"max_lon": -74.30998,
"max_lat": 57.50826
}
},
"PE": {
"full_name": "Prince Edward Island",
"bounding_box": {
"min_lon": -64.60236,
"min_lat": 45.82497,
"max_lon": -61.24878,
"max_lat": 47.68573
}
},
"QC": {
"full_name": "Quebec",
"bounding_box": {
"min_lon": -79.8404,
"min_lat": 44.98552,
"max_lon": -57.08908,
"max_lat": 62.6262
}
},
"SK": {
"full_name": "Saskatchewan",
"bounding_box": {
"min_lon": -110.0069,
"min_lat": 48.9876,
"max_lon": -101.3614,
"max_lat": 60.00052
}
},
"YT": {
"full_name": "Yukon",
"bounding_box": {
"min_lon": -141.2389,
"min_lat": 59.99739,
"max_lon": -123.8021,
"max_lat": 70.16293
}
}
},
"ru_district": {
"central": {
"full_name": "Russia - Central Federal District",
"bounding_box": {
"min_lon": 30.6998,
"min_lat": 49.5045,
"max_lon": 47.6702,
"max_lat": 59.6533
}
},
"far-east": {
"full_name": "Russia - Far Eastern Federal District (main area)",
"bounding_box": {
"min_lon": 105.4219,
"min_lat": 37.3466,
"max_lon": 180,
"max_lat": 82.0002
}
},
"far-east-dateline": {
"full_name": "Russia - Far Eastern Federal District (across the date line)",
"bounding_box": {
"min_lon": -180,
"min_lat": 62.2613,
"max_lon": -168.6841,
"max_lat": 72.2393
}
},
"moscow": {
"full_name": "Russia - Moscow area",
"bounding_box": {
"min_lon": 36,
"min_lat": 54,
"max_lon": 40,
"max_lat": 58
}
},
"north-caucasus": {
"full_name": "Russia - North Caucasus Federal District",
"bounding_box": {
"min_lon": 40.6726,
"min_lat": 41.1355,
"max_lon": 48.8645,
"max_lat": 46.2391
}
},
"northwestern": {
"full_name": "Russia - Northwestern Federal District",
"bounding_box": {
"min_lon": 19.4084,
"min_lat": 54.3128,
"max_lon": 72.6248,
"max_lat": 82.5456
}
},
"siberian": {
"full_name": "Russia - Siberian Federal District",
"bounding_box": {
"min_lon": 70.2748,
"min_lat": 49.021,
"max_lon": 147.7133,
"max_lat": 81.8875
}
},
"southern": {
"full_name": "Russia - Southern Federal District",
"bounding_box": {
"min_lon": 36.5232,
"min_lat": 43.1896,
"max_lon": 49.9367,
"max_lat": 51.2554
}
},
"ural": {
"full_name": "Russia - Ural Federal District",
"bounding_box": {
"min_lon": 57.0426,
"min_lat": 51.8264,
"max_lon": 86.0952,
"max_lat": 75.011
}
},
"volga": {
"full_name": "Russia - Volga Federal District",
"bounding_box": {
"min_lon": 41.7211,
"min_lat": 49.751,
"max_lon": 61.7337,
"max_lat": 61.7197
}
}
}
}
+23 -2
View File
@@ -46,6 +46,7 @@ type State struct {
SourceGeneration uint64
ProducerSession uint64
MatchedLimitMps float32
LimitPreview LimitPreview
lastMapLoadAttempt time.Time
bootNow func() uint64
// The fix the current road result was computed from. The loop runs at
@@ -90,6 +91,7 @@ func (s *State) clearRoadDerived() {
s.TargetVelocities = nil
s.MapCurveSpeed = 0
s.MatchedLimitMps = 0
s.LimitPreview = LimitPreview{}
s.NextHazard.Reset()
s.NextAdvisorySpeed.Reset()
s.clearSpeedLimitEvidence()
@@ -104,6 +106,18 @@ func (s *State) ResetRoadEvidence() {
s.lastMapLoadAttempt = time.Time{}
}
// expireRoadEvidence drops everything derived from an expired fix but keeps
// the verified tile. A dense tile can take longer to load than the fix TTL;
// discarding it here made every following fix reload it, so the loop never
// published a match (~600 ms per load, ~60 % CPU, in Las Vegas 2026-10-15).
// Tile currency is still checked every loop by invalidateChangedTile.
func (s *State) expireRoadEvidence() {
s.clearRoadDerived()
s.roadFixMonoTime = 0
s.Position = m.Position{}
s.DistanceSinceLastPosition = 0
}
func (s *State) invalidateChangedTile() bool {
if s.Data.Loaded && !s.Data.SourceCurrentFor(s.SnapshotID) {
s.ResetRoadEvidence()
@@ -129,7 +143,7 @@ func (s *State) ExpireGpsEvidence() {
func (s *State) expireGpsEvidenceAt(now uint64) {
if !cereal.GpsFixFreshAt(cereal.GpsSource(s.GpsSource), s.GpsMonoTime, now) && s.RoadStatus != custom.MapdOut_SampleStatus_noGps {
s.ResetRoadEvidence()
s.expireRoadEvidence()
s.RoadStatus = custom.MapdOut_SampleStatus_noGps
}
}
@@ -164,7 +178,7 @@ func (s *State) ProcessGps(sample cereal.GpsSample, success bool, load MapLoader
pos := m.PosFromLocation(location)
s.Position = pos
// Unknown CAN direction or speed uncertainty cannot create confident road evidence.
if sample.Source == cereal.GpsSourceCar && (math.IsNaN(float64(location.BearingAccuracyDeg())) || math.IsInf(float64(location.BearingAccuracyDeg()), 0) || location.BearingAccuracyDeg() <= 0 || location.BearingAccuracyDeg() >= 180 || math.IsNaN(float64(location.SpeedAccuracy())) || math.IsInf(float64(location.SpeedAccuracy()), 0) || location.SpeedAccuracy() >= 100) {
if (sample.Source == cereal.GpsSourceCar || sample.Source == cereal.GpsSourcePhone) && (math.IsNaN(float64(location.BearingAccuracyDeg())) || math.IsInf(float64(location.BearingAccuracyDeg()), 0) || location.BearingAccuracyDeg() <= 0 || location.BearingAccuracyDeg() >= 180 || math.IsNaN(float64(location.SpeedAccuracy())) || math.IsInf(float64(location.SpeedAccuracy()), 0) || location.SpeedAccuracy() >= 100) {
s.clearRoadDerived()
s.roadFixMonoTime = 0
s.RoadStatus = custom.MapdOut_SampleStatus_noMatch
@@ -243,6 +257,7 @@ func (s *State) ProcessGps(sample cereal.GpsSample, success bool, load MapLoader
s.MatchedLimitMps = float32(limit)
s.RoadStatus = custom.MapdOut_SampleStatus_matchedLimit
}
s.LimitPreview = s.previewLimit()
}
func (s *State) SuggestedSpeed() float32 {
@@ -349,6 +364,12 @@ func (s *State) buildMessageAt(now uint64) (*capnp.Message, error) {
output.SetRoadName(s.CurrentWay.Way.Name())
output.SetSpeedLimit(s.MatchedLimitMps)
if s.LimitPreview.BoundaryID != "" {
output.SetPreviewSpeedLimit(s.LimitPreview.Speed)
output.SetPreviewDistance(s.LimitPreview.Distance)
output.SetPreviewBoundaryId(s.LimitPreview.BoundaryID)
output.SetPreviewWayId(s.LimitPreview.WayID)
}
output.SetConditionalSpeedLimit(s.CurrentWay.ConditionalMaxSpeedRaw())
+14 -2
View File
@@ -298,8 +298,8 @@ func TestSlowTileLoadExpiresGpsBeforePublication(t *testing.T) {
return tile, nil
}, time.Unix(0, 0))
event, out := decodedOutput(t, &s)
if event.Valid() || event.LogMonoTime() != boot || out.RoadStatus() != custom.MapdOut_SampleStatus_noGps || out.GpsMonoTime() != fix || out.GpsSource() != custom.MapdOut_GpsSource_external || out.SourceGeneration() != 7 || out.ProducerSession() == 0 || out.SpeedLimit() != 0 || out.WayId() != 0 || s.DistanceSinceLastPosition != 0 || s.Data.Loaded {
t.Fatalf("slow loader published stale road: valid=%v status=%v source=%v gps=%d generation=%d limit=%f", event.Valid(), out.RoadStatus(), out.GpsSource(), out.GpsMonoTime(), out.SourceGeneration(), out.SpeedLimit())
if event.Valid() || event.LogMonoTime() != boot || out.RoadStatus() != custom.MapdOut_SampleStatus_noGps || out.GpsMonoTime() != fix || out.GpsSource() != custom.MapdOut_GpsSource_external || out.SourceGeneration() != 7 || out.ProducerSession() == 0 || out.SpeedLimit() != 0 || out.WayId() != 0 || s.DistanceSinceLastPosition != 0 || !s.Data.Loaded {
t.Fatalf("slow loader published stale road or dropped the verified tile: valid=%v status=%v source=%v gps=%d generation=%d limit=%f", event.Valid(), out.RoadStatus(), out.GpsSource(), out.GpsMonoTime(), out.SourceGeneration(), out.SpeedLimit())
}
_, seg, err := capnp.NewMessage(capnp.SingleSegment(nil))
if err != nil {
@@ -320,6 +320,18 @@ func TestSlowTileLoadExpiresGpsBeforePublication(t *testing.T) {
if err != nil || path.Len() != 0 || extOut.HasPosition() {
t.Fatal("expired road leaked into extended output")
}
// The next fresh fix matches on the kept tile without loading it again.
next := syntheticSample(t, cereal.GpsSourceExternal, boot+50_000_000, 7, false, true)
boot = next.FixMonoTime + 100_000_000
s.ProcessGps(next, true, func(m.Position) (maps.Offline, error) {
t.Fatal("expired fix discarded the verified tile; the next fix reloaded it")
return maps.Offline{}, nil
}, time.Unix(1, 0))
event, out = decodedOutput(t, &s)
if !event.Valid() || out.RoadStatus() != custom.MapdOut_SampleStatus_matchedLimit || out.GpsMonoTime() != next.FixMonoTime {
t.Fatalf("fresh fix after a slow load did not match: status=%v valid=%v", out.RoadStatus(), event.Valid())
}
}
func TestDelayedSerializationRechecksOriginalFixAge(t *testing.T) {
+2 -3
View File
@@ -192,10 +192,9 @@ func (s *MsgqSubscriber) Read() []byte {
if err != nil {
panic("Msgq Flush Error")
}
start := int64(readPointer.Position) + 8
result := make([]byte, size)
for i := range size {
result[i] = s.Msgq.Data[int64(readPointer.Position)+8+i]
}
copy(result, s.Msgq.Data[start:start+size])
err = s.Msgq.Mem.Flush()
if err != nil {
panic("Msgq Flush Error")
+3
View File
@@ -82,6 +82,9 @@ func plausibleLoadedWays(offlineMaps *maps.Offline, location log.GpsLocationData
if indexed {
i = int(candidates[c])
}
if !offlineMaps.WayMayMatch(i, location, 2) {
continue
}
way := offlineMaps.Ways.At(i)
if way.Id() <= 0 || way.Nodes.Len() < 2 {
continue
+54
View File
@@ -10,6 +10,7 @@ import (
"pfeifer.dev/mapd/cereal/log"
"pfeifer.dev/mapd/maps"
m "pfeifer.dev/mapd/math"
ms "pfeifer.dev/mapd/settings"
)
// denseStreetSpecs lays out a city grid of short blocks plus two long
@@ -184,3 +185,56 @@ func BenchmarkPlausibleWaysDenseTile(b *testing.B) {
}
})
}
// referenceOnWay is OnWay's decision without the match-distance prefilter:
// the 0.01 degree box, then the measured distance.
func referenceOnWay(way *maps.Way, location log.GpsLocationData, multiplier float32) bool {
pos := m.NewPosition(location.Latitude(), location.Longitude())
box := way.Box()
oversized := box.Overlap(0.01)
if !oversized.PosInside(pos) {
return false
}
d, err := way.DistanceFrom(pos)
if err != nil || !(d.Distance < maps.MatchDistance(location, way.Width(), multiplier)) {
return false
}
return maps.IsForward(d.LineStart, d.LineEnd, float64(location.BearingDeg())) || !way.OneWay()
}
// Fixes are scattered around way nodes out to a few match distances, with
// accuracies from 0 to 400 m, so many land just inside or outside the bound.
func TestMatchPrefilterIsExact(t *testing.T) {
tile := packedRoadTile(t, denseStreetSpecs(40))
random := rand.New(rand.NewSource(11))
near, accepted := 0, 0
for range 20000 {
index := random.Intn(tile.Ways.Len())
way := tile.Ways.At(index)
node := way.Nodes.At(random.Intn(way.Nodes.Len()))
accuracy := []float32{0, 3, 5, 12, 40, 400}[random.Intn(6)]
reach := float64(accuracy+30) * 3 / ms.R * ms.TO_DEGREES
lat := node.Lat() + (random.Float64()*2-1)*reach
lon := node.Lon() + (random.Float64()*2-1)*reach
location := gpsAt(t, lat, lon, random.Float64()*359)
location.SetHorizontalAccuracy(accuracy)
for _, multiplier := range []float32{2, way.DistanceMultiplier()} {
want := referenceOnWay(&way, location, multiplier)
got, err := way.OnWay(location, multiplier)
if (err == nil && got.OnWay) != want {
t.Fatalf("way %d at %f,%f accuracy %v x%v: prefiltered %v, reference %v",
way.Id(), lat, lon, accuracy, multiplier, got.OnWay, want)
}
if want && !tile.WayMayMatch(index, location, multiplier) {
t.Fatalf("index prefilter rejected way %d that matches at %f,%f", way.Id(), lat, lon)
}
if want {
accepted++
}
near++
}
}
if accepted == 0 || accepted == near {
t.Fatalf("samples did not straddle the bound: %d of %d matched", accepted, near)
}
}
+1
View File
@@ -0,0 +1 @@
* text=auto eol=lf
+3 -6
View File
@@ -6,10 +6,6 @@ on:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/master' && github.ref || github.run_id }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
test:
name: ./test.sh
@@ -17,8 +13,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ['macos-latest', 'ubuntu-latest']
os: ['macos-latest', 'ubuntu-latest', 'ubuntu-24.04-arm']
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- run: ./test.sh
timeout-minutes: 1
+48
View File
@@ -0,0 +1,48 @@
name: wheels
on:
pull_request:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest]
steps:
- uses: actions/checkout@v7
- uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1
- uses: actions/setup-python@v7
with:
python-version: '3.11'
- name: Build source distribution
run: |
python -m pip install build
python -m build --sdist --outdir wheelhouse
- uses: actions/upload-artifact@v7
with:
name: dist-${{ matrix.os }}
path: wheelhouse/*
if-no-files-found: error
publish:
if: github.event_name == 'release'
needs: build
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/download-artifact@v8
with:
pattern: dist-*
merge-multiple: true
path: dist
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
password: ${{ secrets.PYPI_PAT }}
+7 -2
View File
@@ -10,11 +10,16 @@ __pycache__
*.a
uv.lock
catch2/
msgq.egg-info/
*.egg-info/
/build/
/dist/
test_runner
libmessaging.*
libmessaging_shared.*
.sconsign.dblite
.mypy_cache/
.mypy_cache/
/msgq/_ipc.pyi
/msgq/visionipc/_visionipc.pyi
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) comma.ai contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Some files were not shown because too many files have changed in this diff Show More