Skip to content

Commit 5999079

Browse files
sunnyhaibinsshaneadeebshihadehYassineYousfi
authored
Sync: commaai/openpilot:mastersunnypilot/sunnypilot:master (commaai#1583)
* comma four: fix missing WiFi show_event (commaai#36858) * can't do this * can do this * comma four: rm duplicate wifi show_event * comma four: fix WiFi panel not starting at the top (commaai#36859) * fix * fix * NavWidget: disable nav bar for vertical scrollers (commaai#36857) * disable nav bar vert scroller * cmt * ui: improve network sort (commaai#36855) * better sort * clean up * comma four: reset WiFi SSID scroll on show (commaai#36861) reset scroll * WifiUi: fix infinite wraps (commaai#36863) * fix infinite wrap * fix selection * Revert "fix selection" This reverts commit 555c579. * revert * revert * revert * revert * cleaner * cleaner * mypy!! * WifiUi: remove delayed network panel open (commaai#36865) not used * comma four: fix WiFi scroll to (commaai#36864) * fix selection * stash * Revert "stash" This reverts commit d04ed66. * clean up * clean up * move * fix * WifiUi: pause updates while user is scrolling (commaai#36866) * pause updates while user is scrolling * clean up * WifiUi: pause updates while user is interacting (commaai#36868) int not scroll * Widget: implement layout function (commaai#36869) * we can implement layout to fix flashing * reorder * fix faster than normal snap and reduce duplicate calculations * yes * comma four: follow current network (commaai#36862) * stay * whoops * whoops * fix * fix div by z * we can implement layout to fix flashing * Revert "we can implement layout to fix flashing" This reverts commit 7278a1e. * random * clean up * wtf * rev * smooth * we can implement layout to fix flashing * snap looks so much better * fix * rev * better name * cmt * less random * even less random * simpler * cmt * clean up * clean up * clean up * GuiScrollPanel2: fix possible crash (commaai#36870) fix crash * WifiUi: tweak unselected button size (commaai#36871) looks too spaces * rm dead unlog_ci_segment.py * joystickd: add cruise control resume (commaai#36876) * Add cruise control resume logic based on conditions * simple * bump opendbc (commaai#36878) * bump * update docs * bump * gotta go fast * sensord: remove last of dual IMU support (commaai#36881) * Toyota: prevent roll in ICE after pressing resume while wanting to stay stopped (commaai#36877) * bump * only show alert when user can leave standstill * cmt * stash * bump * bump to master * test_onroad: absolute memory usage test (commaai#36885) * test_onroad: absolute memory usage test * show msgq size * reduce a little * bump msgq * Revert "bump msgq" This reverts commit 683d0ae. * Reduce pub-sub memory usage by 10x (commaai#36884) less mem * four: hide untoggleable toggles (commaai#36890) * hide toggles * enabled is redundant * bump msgq (commaai#36891) * bump msgq * update prefix * ui: generic hold gesture (commaai#36893) * generic * fix * use in home * clean up * rm * clean up * four: simpler steer saturated alert (commaai#36894) * looks good * fix * cleanup * test_onroad: relax memory threshold (commaai#36895) * Update RELEASES.md for version 0.10.3 * Update RELEASES.md * ui: override default interactive timeout (commaai#36898) * impl * fix one place * don't need in setup * fix onboarding * need here too * ui: default text color 90% white (commaai#36899) default 90% * onboarding: fixup DM RHD detection (commaai#36900) * helper * fix * use it * prop * bigger box * huh * comma four: simpler DM onboarding (commaai#36896) * rm confirm mode * kinda works * how * disabled * do this * do this * wait * here * something * fade in * 4s * clean up * copy * help * 30deg center * stuff * reset_interactive_timeout * rm * simple * simple * copy * 1.5x * smooth opacity * power off slider * fix * new icons and gradient and rounded * final check * fix * how the hell did this work * clean up * clean up * flip * cmt * uh yeah * remove this * revert this * lint * 45 * clean up * fix * no show time * question * rm * no use * () * lint * call * ui: fix not showing networks if viewing right after startup * Fix tici DM dialog memory leak (commaai#36790) * not finished * no * debug * clean up * clean up * Revert "ui: generic hold gesture (commaai#36893)" This reverts commit 9768109. * setup: go back to main page once connected (commaai#36902) * call * break * print * fix * rm * debug * fix * yeah ideally wifiui has no clue about this * clean up * clean up * clean up * only need this * cu * rm * fix * CI: tmp disable macOS due to brew bug (commaai#36906) * need update? * try this * x * just disable it * lil more release notes --------- Co-authored-by: Shane Smiskol <[email protected]> Co-authored-by: Adeeb Shihadeh <[email protected]> Co-authored-by: YassineYousfi <[email protected]>
2 parents a1d0f6a + 2458a6d commit 5999079

File tree

45 files changed

+725
-468
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+725
-468
lines changed

.github/workflows/tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ jobs:
107107

108108
build_mac:
109109
name: build macOS
110+
if: false # tmp disable due to brew install not working
110111
runs-on: ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-macos-8x14' || 'macos-latest' }}
111112
steps:
112113
- uses: actions/checkout@v4

RELEASES.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
Version 0.10.3 (2025-12-10)
1+
Version 0.10.3 (2025-12-17)
22
========================
3+
* New driving model #36249
4+
* New temporal policy architecture
5+
* New on-policy training physics noise model
6+
* New driver monitoring model #36409
7+
* Trained on a new dataset, including comma four data
8+
* Improved inter-process communication memory efficiency
39

410
Version 0.10.2 (2025-11-19)
511
========================

cereal/log.capnp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,13 +2524,10 @@ struct Event {
25242524
controlsState @7 :ControlsState;
25252525
selfdriveState @130 :SelfdriveState;
25262526
gyroscope @99 :SensorEventData;
2527-
gyroscope2 @100 :SensorEventData;
25282527
accelerometer @98 :SensorEventData;
2529-
accelerometer2 @101 :SensorEventData;
25302528
magnetometer @95 :SensorEventData;
25312529
lightSensor @96 :SensorEventData;
25322530
temperatureSensor @97 :SensorEventData;
2533-
temperatureSensor2 @123 :SensorEventData;
25342531
pandaStates @81 :List(PandaState);
25352532
peripheralState @80 :PeripheralState;
25362533
radarState @13 :RadarState;
@@ -2693,5 +2690,8 @@ struct Event {
26932690
liveLocationKalman @72 :LiveLocationKalman;
26942691
liveTracksDEPRECATED @16 :List(LiveTracksDEPRECATED);
26952692
onroadEventsDEPRECATED @68: List(Car.OnroadEventDEPRECATED);
2693+
gyroscope2DEPRECATED @100 :SensorEventData;
2694+
accelerometer2DEPRECATED @101 :SensorEventData;
2695+
temperatureSensor2DEPRECATED @123 :SensorEventData;
26962696
}
26972697
}

cereal/messaging/__init__.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from msgq.ipc_pyx import Context, Poller, SubSocket, PubSocket, SocketEventHandle, toggle_fake_events, \
33
set_fake_prefix, get_fake_prefix, delete_fake_prefix, wait_for_one_event
44
from msgq.ipc_pyx import MultiplePublishersError, IpcError
5-
from msgq import fake_event_handle, pub_sock, sub_sock, drain_sock_raw
5+
from msgq import fake_event_handle, drain_sock_raw
66
import msgq
77

88
import os
@@ -18,6 +18,20 @@
1818
NO_TRAVERSAL_LIMIT = 2**64-1
1919

2020

21+
def pub_sock(endpoint: str) -> PubSocket:
22+
service = SERVICE_LIST.get(endpoint)
23+
segment_size = service.queue_size if service else 0
24+
return msgq.pub_sock(endpoint, segment_size)
25+
26+
27+
def sub_sock(endpoint: str, poller: Optional[Poller] = None, addr: str = "127.0.0.1",
28+
conflate: bool = False, timeout: Optional[int] = None) -> SubSocket:
29+
service = SERVICE_LIST.get(endpoint)
30+
segment_size = service.queue_size if service else 0
31+
return msgq.sub_sock(endpoint, poller=poller, addr=addr, conflate=conflate,
32+
timeout=timeout, segment_size=segment_size)
33+
34+
2135
def reset_context():
2236
msgq.context = Context()
2337

cereal/messaging/socketmaster.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ SubMaster::SubMaster(const std::vector<const char *> &service_list, const std::v
5050
assert(services.count(std::string(name)) > 0);
5151

5252
service serv = services.at(std::string(name));
53-
SubSocket *socket = SubSocket::create(message_context.context(), name, address ? address : "127.0.0.1", true);
53+
SubSocket *socket = SubSocket::create(message_context.context(), name, address ? address : "127.0.0.1", true, true, serv.queue_size);
5454
assert(socket != 0);
5555
bool is_polled = inList(poll, name) || poll.empty();
5656
if (is_polled) poller_->registerSocket(socket);
@@ -187,7 +187,8 @@ SubMaster::~SubMaster() {
187187
PubMaster::PubMaster(const std::vector<const char *> &service_list) {
188188
for (auto name : service_list) {
189189
assert(services.count(name) > 0);
190-
PubSocket *socket = PubSocket::create(message_context.context(), name);
190+
service serv = services.at(std::string(name));
191+
PubSocket *socket = PubSocket::create(message_context.context(), name, true, serv.queue_size);
191192
assert(socket);
192193
sockets_[name] = socket;
193194
}

cereal/services.py

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,44 @@
11
#!/usr/bin/env python3
2+
from enum import IntEnum
23
from typing import Optional
34

45

6+
# TODO: this should be automatically determined using the capnp schema
7+
class QueueSize(IntEnum):
8+
BIG = 10 * 1024 * 1024 # 10MB - video frames, large AI outputs
9+
MEDIUM = 2 * 1024 * 1024 # 2MB - high freq (CAN), livestream
10+
SMALL = 250 * 1024 # 250KB - most services
11+
12+
513
class Service:
6-
def __init__(self, should_log: bool, frequency: float, decimation: Optional[int] = None):
14+
def __init__(self, should_log: bool, frequency: float, decimation: Optional[int] = None,
15+
queue_size: QueueSize = QueueSize.SMALL):
716
self.should_log = should_log
817
self.frequency = frequency
918
self.decimation = decimation
19+
self.queue_size = queue_size
1020

1121

1222
_services: dict[str, tuple] = {
1323
# service: (should_log, frequency, qlog decimation (optional))
1424
# note: the "EncodeIdx" packets will still be in the log
1525
"gyroscope": (True, 104., 104),
16-
"gyroscope2": (True, 100., 100),
1726
"accelerometer": (True, 104., 104),
18-
"accelerometer2": (True, 100., 100),
1927
"magnetometer": (True, 25.),
2028
"lightSensor": (True, 100., 100),
2129
"temperatureSensor": (True, 2., 200),
22-
"temperatureSensor2": (True, 2., 200),
2330
"gpsNMEA": (True, 9.),
2431
"deviceState": (True, 2., 1),
2532
"touch": (True, 20., 1),
26-
"can": (True, 100., 2053), # decimation gives ~3 msgs in a full segment
27-
"controlsState": (True, 100., 10),
33+
"can": (True, 100., 2053, QueueSize.BIG), # decimation gives ~3 msgs in a full segment
34+
"controlsState": (True, 100., 10, QueueSize.MEDIUM),
2835
"selfdriveState": (True, 100., 10),
2936
"pandaStates": (True, 10., 1),
3037
"peripheralState": (True, 2., 1),
3138
"radarState": (True, 20., 5),
3239
"roadEncodeIdx": (False, 20., 1),
3340
"liveTracks": (True, 20.),
34-
"sendcan": (True, 100., 139),
41+
"sendcan": (True, 100., 139, QueueSize.MEDIUM),
3542
"logMessage": (True, 0.),
3643
"errorLogMessage": (True, 0., 1),
3744
"liveCalibration": (True, 4., 4),
@@ -43,7 +50,7 @@ def __init__(self, should_log: bool, frequency: float, decimation: Optional[int]
4350
"carOutput": (True, 100., 10),
4451
"longitudinalPlan": (True, 20., 10),
4552
"driverAssistance": (True, 20., 20),
46-
"procLog": (True, 0.5, 15),
53+
"procLog": (True, 0.5, 15, QueueSize.BIG),
4754
"gpsLocationExternal": (True, 10., 10),
4855
"gpsLocation": (True, 1., 1),
4956
"ubloxGnss": (True, 10.),
@@ -65,7 +72,7 @@ def __init__(self, should_log: bool, frequency: float, decimation: Optional[int]
6572
"wideRoadEncodeIdx": (False, 20., 1),
6673
"wideRoadCameraState": (True, 20., 20),
6774
"drivingModelData": (True, 20., 10),
68-
"modelV2": (True, 20.),
75+
"modelV2": (True, 20., None, QueueSize.BIG),
6976
"managerState": (True, 2., 1),
7077
"uploaderState": (True, 0., 1),
7178
"navInstruction": (True, 1., 10),
@@ -77,6 +84,10 @@ def __init__(self, should_log: bool, frequency: float, decimation: Optional[int]
7784
"rawAudioData": (False, 20.),
7885
"bookmarkButton": (True, 0., 1),
7986
"audioFeedback": (True, 0., 1),
87+
"roadEncodeData": (False, 20., None, QueueSize.BIG),
88+
"driverEncodeData": (False, 20., None, QueueSize.BIG),
89+
"wideRoadEncodeData": (False, 20., None, QueueSize.BIG),
90+
"qRoadEncodeData": (False, 20., None, QueueSize.BIG),
8091

8192
# sunnypilot
8293
"modelManagerSP": (False, 1., 1),
@@ -95,16 +106,12 @@ def __init__(self, should_log: bool, frequency: float, decimation: Optional[int]
95106
"uiDebug": (True, 0., 1),
96107
"testJoystick": (True, 0.),
97108
"alertDebug": (True, 20., 5),
98-
"roadEncodeData": (False, 20.),
99-
"driverEncodeData": (False, 20.),
100-
"wideRoadEncodeData": (False, 20.),
101-
"qRoadEncodeData": (False, 20.),
102109
"livestreamWideRoadEncodeIdx": (False, 20.),
103110
"livestreamRoadEncodeIdx": (False, 20.),
104111
"livestreamDriverEncodeIdx": (False, 20.),
105-
"livestreamWideRoadEncodeData": (False, 20.),
106-
"livestreamRoadEncodeData": (False, 20.),
107-
"livestreamDriverEncodeData": (False, 20.),
112+
"livestreamWideRoadEncodeData": (False, 20., None, QueueSize.MEDIUM),
113+
"livestreamRoadEncodeData": (False, 20., None, QueueSize.MEDIUM),
114+
"livestreamDriverEncodeData": (False, 20., None, QueueSize.MEDIUM),
108115
"customReservedRawData0": (True, 0.),
109116
"customReservedRawData1": (True, 0.),
110117
"customReservedRawData2": (True, 0.),
@@ -122,13 +129,13 @@ def build_header():
122129
h += "#include <map>\n"
123130
h += "#include <string>\n"
124131

125-
h += "struct service { std::string name; bool should_log; float frequency; int decimation; };\n"
132+
h += "struct service { std::string name; bool should_log; float frequency; int decimation; size_t queue_size; };\n"
126133
h += "static std::map<std::string, service> services = {\n"
127134
for k, v in SERVICE_LIST.items():
128135
should_log = "true" if v.should_log else "false"
129136
decimation = -1 if v.decimation is None else v.decimation
130-
h += ' { "%s", {"%s", %s, %f, %d}},\n' % \
131-
(k, k, should_log, v.frequency, decimation)
137+
h += ' { "%s", {"%s", %s, %f, %d, %d}},\n' % \
138+
(k, k, should_log, v.frequency, decimation, v.queue_size)
132139
h += "};\n"
133140

134141
h += "#endif\n"

common/prefix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class OpenpilotPrefix:
1212
def __init__(self, prefix: str = None, create_dirs_on_enter: bool = True, clean_dirs_on_exit: bool = True, shared_download_cache: bool = False):
1313
self.prefix = prefix if prefix else str(uuid.uuid4().hex[0:15])
14-
self.msgq_path = os.path.join(Paths.shm_path(), self.prefix)
14+
self.msgq_path = os.path.join(Paths.shm_path(), "msgq_" + self.prefix)
1515
self.create_dirs_on_enter = create_dirs_on_enter
1616
self.clean_dirs_on_exit = clean_dirs_on_exit
1717
self.shared_download_cache = shared_download_cache

0 commit comments

Comments
 (0)