mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-20 09:12:05 +08:00
Merge remote-tracking branch 'commaai/openpilot/master' into sync-priv-20231016
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
<!-- Please copy and paste the relevant template -->
|
||||
|
||||
<!--- ***** Template: Fingerprint *****
|
||||
|
||||
**Car**
|
||||
Which car (make, model, year) this fingerprint is for
|
||||
|
||||
**Route**
|
||||
A route with the fingerprint
|
||||
|
||||
-->
|
||||
|
||||
<!--- ***** Template: Car bug fix *****
|
||||
|
||||
**Description** [](A description of the bug and the fix. Also link any relevant issues.)
|
||||
|
||||
@@ -628,9 +628,16 @@ tinygrad_repo/extra/onnx.py
|
||||
tinygrad_repo/extra/onnx_ops.py
|
||||
tinygrad_repo/extra/thneed.py
|
||||
tinygrad_repo/extra/utils.py
|
||||
tinygrad_repo/tinygrad/codegen/ast.py
|
||||
tinygrad_repo/tinygrad/codegen/gpu.py
|
||||
tinygrad_repo/tinygrad/codegen/kernel.py
|
||||
tinygrad_repo/tinygrad/codegen/linearizer.py
|
||||
tinygrad_repo/tinygrad/codegen/optimizer.py
|
||||
tinygrad_repo/tinygrad/features/image.py
|
||||
tinygrad_repo/tinygrad/nn/*
|
||||
tinygrad_repo/tinygrad/renderer/cstyle.py
|
||||
tinygrad_repo/tinygrad/renderer/opencl.py
|
||||
tinygrad_repo/tinygrad/runtime/lib.py
|
||||
tinygrad_repo/tinygrad/runtime/ops_cpu.py
|
||||
tinygrad_repo/tinygrad/runtime/ops_disk.py
|
||||
tinygrad_repo/tinygrad/runtime/ops_gpu.py
|
||||
tinygrad_repo/tinygrad/shape/*
|
||||
tinygrad_repo/tinygrad/*.py
|
||||
|
||||
@@ -1009,6 +1009,7 @@ FW_VERSIONS = {
|
||||
b'\x0230A10000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'\x0230A11000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'\x0230ZN4000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'\x0230ZN5000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'\x03312K7000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203402\x00\x00\x00\x00',
|
||||
b'\x03312M3000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203402\x00\x00\x00\x00',
|
||||
b'\x03312N6000\x00\x00\x00\x00\x00\x00\x00\x00A0202000\x00\x00\x00\x00\x00\x00\x00\x00895231203202\x00\x00\x00\x00',
|
||||
@@ -1064,6 +1065,7 @@ FW_VERSIONS = {
|
||||
b'\x01F152612B91\x00\x00\x00\x00\x00\x00',
|
||||
b'\x01F15260A070\x00\x00\x00\x00\x00\x00',
|
||||
b'\x01F152676250\x00\x00\x00\x00\x00\x00',
|
||||
b'\x01F152602470\x00\x00\x00\x00\x00\x00',
|
||||
b'F152612590\x00\x00\x00\x00\x00\x00',
|
||||
b'F152612691\x00\x00\x00\x00\x00\x00',
|
||||
b'F152612692\x00\x00\x00\x00\x00\x00',
|
||||
|
||||
@@ -727,12 +727,14 @@ FW_VERSIONS = {
|
||||
CAR.PASSAT_NMS: {
|
||||
(Ecu.engine, 0x7e0, None): [
|
||||
b'\xf1\x8706K906016C \xf1\x899609',
|
||||
b'\xf1\x8706K906016E \xf1\x899830',
|
||||
b'\xf1\x8706K906016G \xf1\x891124',
|
||||
b'\xf1\x8706K906071BJ\xf1\x894891',
|
||||
],
|
||||
(Ecu.transmission, 0x7e1, None): [
|
||||
b'\xf1\x8709G927158AB\xf1\x893318',
|
||||
b'\xf1\x8709G927158BD\xf1\x893121',
|
||||
b'\xf1\x8709G927158DK\xf1\x893594',
|
||||
b'\xf1\x8709G927158FQ\xf1\x893745',
|
||||
],
|
||||
(Ecu.srs, 0x715, None): [
|
||||
|
||||
@@ -1106,10 +1106,10 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = {
|
||||
if __name__ == '__main__':
|
||||
# print all alerts by type and priority
|
||||
from cereal.services import SERVICE_LIST
|
||||
from collections import defaultdict, OrderedDict
|
||||
from collections import defaultdict
|
||||
|
||||
event_names = {v: k for k, v in EventName.schema.enumerants.items()}
|
||||
alerts_by_type: Dict[str, Dict[int, List[str]]] = defaultdict(lambda: defaultdict(list))
|
||||
alerts_by_type: Dict[str, Dict[Priority, List[str]]] = defaultdict(lambda: defaultdict(list))
|
||||
|
||||
CP = car.CarParams.new_message()
|
||||
CS = car.CarState.new_message()
|
||||
@@ -1119,18 +1119,14 @@ if __name__ == '__main__':
|
||||
for et, alert in alerts.items():
|
||||
if callable(alert):
|
||||
alert = alert(CP, CS, sm, False, 1)
|
||||
priority = alert.priority
|
||||
alerts_by_type[et][priority].append(event_names[i])
|
||||
alerts_by_type[et][alert.priority].append(event_names[i])
|
||||
|
||||
all_alerts = {}
|
||||
all_alerts: Dict[str, List[tuple[Priority, List[str]]]] = {}
|
||||
for et, priority_alerts in alerts_by_type.items():
|
||||
all_alerts[et] = OrderedDict([
|
||||
(str(priority), l)
|
||||
for priority, l in sorted(priority_alerts.items(), key=lambda x: -int(x[0]))
|
||||
])
|
||||
all_alerts[et] = sorted(priority_alerts.items(), key=lambda x: x[0], reverse=True)
|
||||
|
||||
for status, evs in sorted(all_alerts.items(), key=lambda x: x[0]):
|
||||
print(f"**** {status} ****")
|
||||
for p, alert_list in evs.items():
|
||||
print(f" {p}:")
|
||||
for p, alert_list in evs:
|
||||
print(f" {repr(p)}:")
|
||||
print(" ", ', '.join(alert_list), "\n")
|
||||
|
||||
@@ -56,7 +56,7 @@ lenvCython.Program('models/driving_pyx.so', 'models/driving_pyx.pyx', LIBS=[driv
|
||||
if arch == "larch64" or GetOption('pc_thneed'):
|
||||
fn = File("models/supercombo").abspath
|
||||
|
||||
tinygrad_opts = ["NATIVE_EXPLOG=1", "VALIDHACKS=1", "OPTLOCAL=1", "IMAGE=2", "GPU=1", "ENABLE_METHOD_CACHE=1"]
|
||||
tinygrad_opts = ["NOLOCALS=1", "IMAGE=2", "GPU=1"]
|
||||
if not GetOption('pc_thneed'):
|
||||
# use FLOAT16 on device for speed + don't cache the CL kernels for space
|
||||
tinygrad_opts += ["FLOAT16=1", "PYOPENCL_NO_CACHE=1"]
|
||||
|
||||
@@ -91,42 +91,40 @@ def compare_logs(log1, log2, ignore_fields=None, ignore_msgs=None, tolerance=Non
|
||||
|
||||
|
||||
def format_diff(results, log_paths, ref_commit):
|
||||
diff1, diff2 = "", ""
|
||||
diff2 += f"***** tested against commit {ref_commit} *****\n"
|
||||
diff_short, diff_long = "", ""
|
||||
diff_long += f"***** tested against commit {ref_commit} *****\n"
|
||||
|
||||
failed = False
|
||||
for segment, result in list(results.items()):
|
||||
diff1 += f"***** results for segment {segment} *****\n"
|
||||
diff2 += f"***** differences for segment {segment} *****\n"
|
||||
diff_short += f"***** results for segment {segment} *****\n"
|
||||
diff_long += f"***** differences for segment {segment} *****\n"
|
||||
|
||||
for proc, diff in list(result.items()):
|
||||
# long diff
|
||||
diff2 += f"*** process: {proc} ***\n"
|
||||
diff2 += f"\tref: {log_paths[segment][proc]['ref']}\n"
|
||||
diff2 += f"\tnew: {log_paths[segment][proc]['new']}\n\n"
|
||||
diff_long += f"*** process: {proc} ***\n"
|
||||
diff_long += f"\tref: {log_paths[segment][proc]['ref']}\n"
|
||||
diff_long += f"\tnew: {log_paths[segment][proc]['new']}\n\n"
|
||||
|
||||
# short diff
|
||||
diff1 += f" {proc}\n"
|
||||
diff_short += f" {proc}\n"
|
||||
if isinstance(diff, str):
|
||||
diff1 += f" ref: {log_paths[segment][proc]['ref']}\n"
|
||||
diff1 += f" new: {log_paths[segment][proc]['new']}\n\n"
|
||||
diff1 += f" {diff}\n"
|
||||
diff_short += f" ref: {log_paths[segment][proc]['ref']}\n"
|
||||
diff_short += f" new: {log_paths[segment][proc]['new']}\n\n"
|
||||
diff_short += f" {diff}\n"
|
||||
failed = True
|
||||
elif len(diff):
|
||||
diff1 += f" ref: {log_paths[segment][proc]['ref']}\n"
|
||||
diff1 += f" new: {log_paths[segment][proc]['new']}\n\n"
|
||||
diff_short += f" ref: {log_paths[segment][proc]['ref']}\n"
|
||||
diff_short += f" new: {log_paths[segment][proc]['new']}\n\n"
|
||||
|
||||
cnt: Dict[str, int] = {}
|
||||
for d in diff:
|
||||
diff2 += f"\t{str(d)}\n"
|
||||
diff_long += f"\t{str(d)}\n"
|
||||
|
||||
k = str(d[1])
|
||||
cnt[k] = 1 if k not in cnt else cnt[k] + 1
|
||||
|
||||
for k, v in sorted(cnt.items()):
|
||||
diff1 += f" {k}: {v}\n"
|
||||
diff_short += f" {k}: {v}\n"
|
||||
failed = True
|
||||
return diff1, diff2, failed
|
||||
return diff_short, diff_long, failed
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -135,7 +133,7 @@ if __name__ == "__main__":
|
||||
ignore_fields = sys.argv[3:] or ["logMonoTime", "controlsState.startMonoTime", "controlsState.cumLagMs"]
|
||||
results = {"segment": {"proc": compare_logs(log1, log2, ignore_fields)}}
|
||||
log_paths = {"segment": {"proc": {"ref": sys.argv[1], "new": sys.argv[2]}}}
|
||||
diff1, diff2, failed = format_diff(results, log_paths, None)
|
||||
diff_short, diff_long, failed = format_diff(results, log_paths, None)
|
||||
|
||||
print(diff2)
|
||||
print(diff1)
|
||||
print(diff_long)
|
||||
print(diff_short)
|
||||
|
||||
@@ -212,13 +212,13 @@ if __name__ == "__main__":
|
||||
results: Any = {TEST_ROUTE: {}}
|
||||
log_paths: Any = {TEST_ROUTE: {"models": {'ref': BASE_URL + log_fn, 'new': log_fn}}}
|
||||
results[TEST_ROUTE]["models"] = compare_logs(cmp_log, log_msgs, tolerance=tolerance, ignore_fields=ignore)
|
||||
diff1, diff2, failed = format_diff(results, log_paths, ref_commit)
|
||||
diff_short, diff_long, failed = format_diff(results, log_paths, ref_commit)
|
||||
|
||||
print(diff2)
|
||||
print(diff_long)
|
||||
print('-------------\n'*5)
|
||||
print(diff1)
|
||||
print(diff_short)
|
||||
with open("model_diff.txt", "w") as f:
|
||||
f.write(diff2)
|
||||
f.write(diff_long)
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
failed = True
|
||||
|
||||
@@ -1 +1 @@
|
||||
ed2d58ec217fafb7b6b8f5e27ec622acd9e734f4
|
||||
f851c7e7f90eff828a59444d20fac5df8cd7ae0c
|
||||
|
||||
@@ -61,7 +61,7 @@ segments = [
|
||||
]
|
||||
|
||||
# dashcamOnly makes don't need to be tested until a full port is done
|
||||
excluded_interfaces = ["mock", "mazda", "tesla"]
|
||||
excluded_interfaces = ["mock", "tesla"]
|
||||
|
||||
BASE_URL = "https://commadataci.blob.core.windows.net/openpilotci/"
|
||||
REF_COMMIT_FN = os.path.join(PROC_REPLAY_DIR, "ref_commit")
|
||||
@@ -207,11 +207,11 @@ if __name__ == "__main__":
|
||||
if not args.upload_only:
|
||||
results[segment][proc] = result
|
||||
|
||||
diff1, diff2, failed = format_diff(results, log_paths, ref_commit)
|
||||
diff_short, diff_long, failed = format_diff(results, log_paths, ref_commit)
|
||||
if not upload:
|
||||
with open(os.path.join(PROC_REPLAY_DIR, "diff.txt"), "w") as f:
|
||||
f.write(diff2)
|
||||
print(diff1)
|
||||
f.write(diff_long)
|
||||
print(diff_short)
|
||||
|
||||
if failed:
|
||||
print("TEST FAILED")
|
||||
|
||||
+1
-1
Submodule tinygrad_repo updated: d8dda2af3a...5a4a62ecae
+2
-2
@@ -116,9 +116,9 @@ def ui_thread(addr):
|
||||
if yuv_img_raw is None or not yuv_img_raw.data.any():
|
||||
continue
|
||||
|
||||
imgff = np.frombuffer(yuv_img_raw.data, dtype=np.uint8).reshape((vipc_client.height * 3 // 2, vipc_client.width))
|
||||
imgff = np.frombuffer(yuv_img_raw.data, dtype=np.uint8).reshape((len(yuv_img_raw.data) // vipc_client.stride, vipc_client.stride))
|
||||
num_px = vipc_client.width * vipc_client.height
|
||||
bgr = cv2.cvtColor(imgff, cv2.COLOR_YUV2RGB_NV12)
|
||||
bgr = cv2.cvtColor(imgff[:vipc_client.height * 3 // 2, :vipc_client.width], cv2.COLOR_YUV2RGB_NV12)
|
||||
|
||||
zoom_matrix = _BB_TO_FULL_FRAME[num_px]
|
||||
cv2.warpAffine(bgr, zoom_matrix[:2], (img.shape[1], img.shape[0]), dst=img, flags=cv2.WARP_INVERSE_MAP)
|
||||
|
||||
Reference in New Issue
Block a user