diff --git a/.gitignore b/.gitignore index 312d125f85..1b6b95b4ed 100644 --- a/.gitignore +++ b/.gitignore @@ -126,17 +126,17 @@ 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/cheddar_driving_tinygrad.pkl.chunk[0-9][0-9]of[0-9][0-9] +!openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk[0-9][0-9]of[0-9][0-9][0-9] +!openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk[0-9][0-9]of[0-9][0-9][0-9][0-9] +!openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk[0-9][0-9][0-9]of[0-9][0-9] +!openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk[0-9][0-9][0-9]of[0-9][0-9][0-9] +!openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk[0-9][0-9][0-9]of[0-9][0-9][0-9][0-9] +!openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk[0-9][0-9][0-9][0-9]of[0-9][0-9] +!openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk[0-9][0-9][0-9][0-9]of[0-9][0-9][0-9] +!openpilot/selfdrive/modeld/models/cheddar_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/cheddar_driving_tinygrad.pkl.chunkmanifest +!openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunksha256 # Jetlink editable-install metadata. /jetlink_repo/jetlink.egg-info/ diff --git a/openpilot/selfdrive/modeld/modeld.py b/openpilot/selfdrive/modeld/modeld.py old mode 100755 new mode 100644 index 8ecea74ae6..c8e926a7ae --- a/openpilot/selfdrive/modeld/modeld.py +++ b/openpilot/selfdrive/modeld/modeld.py @@ -393,11 +393,11 @@ def main(demo=False): selection.small_id, selection.small_sha256, coherent_warp=coherent_warp) return selected, prepared, False except Exception: - cloudlog.exception("selected small model load failed, using shipped RDFv4") + cloudlog.exception("selected small model load failed, using shipped Cheddar") from openpilot.starpilot.models.manager import shipped_default path = shipped_default() if path is None: - raise RuntimeError("Shipped RDFv4 is missing or corrupt") + raise RuntimeError("Shipped Cheddar is missing or corrupt") fallback, prepared = load_verified_model(cam_w, cam_h, path, BY_ID[DEFAULT_SMALL].version, False, DEFAULT_SMALL, DEFAULT_SMALL_SHA256, coherent_warp=coherent_warp) diff --git a/openpilot/selfdrive/modeld/models/README.md b/openpilot/selfdrive/modeld/models/README.md index 0055a0f1e3..2295e65a5a 100644 --- a/openpilot/selfdrive/modeld/models/README.md +++ b/openpilot/selfdrive/modeld/models/README.md @@ -1,2 +1,4 @@ ## Neural networks in openpilot To view the architecture of the ONNX networks, you can use [netron](https://netron.app/) + +The bundled default driving model is Cheddar (v16). Its published v26 compiled artifact is packaged as verified numbered parts; RDFv4 remains an optional download. diff --git a/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk01of03 b/openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk01of02 similarity index 79% rename from openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk01of03 rename to openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk01of02 index 190e70cabe..f84c67d4f0 100644 Binary files a/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk01of03 and b/openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk01of02 differ diff --git a/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk02of03 b/openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk02of02 similarity index 69% rename from openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk02of03 rename to openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk02of02 index 6b53962814..81deef7a34 100644 Binary files a/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk02of03 and b/openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunk02of02 differ diff --git a/openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunkmanifest b/openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunkmanifest new file mode 100644 index 0000000000..d8263ee986 --- /dev/null +++ b/openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunkmanifest @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunksha256 b/openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunksha256 new file mode 100644 index 0000000000..66ab4483b8 --- /dev/null +++ b/openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl.chunksha256 @@ -0,0 +1,14 @@ +{ + "bytes": 86376298, + "sha256": "e72274cbb666f1e81c4750de8593c7d9409e13751339f9fd3e74febd36bc96bd", + "parts": [ + { + "bytes": 47185920, + "sha256": "c35d5872ec6b212c4e7da6812145ec9e349e3c1242652fa90d787e9efff84346" + }, + { + "bytes": 39190378, + "sha256": "8576ceb0852ce52dc6658a876f71a4c88d0755f0322629d61d33fc22c71d2b5e" + } + ] +} diff --git a/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk03of03 b/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk03of03 deleted file mode 100644 index a6ae382b5d..0000000000 Binary files a/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunk03of03 and /dev/null differ diff --git a/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunkmanifest b/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunkmanifest deleted file mode 100644 index e440e5c842..0000000000 --- a/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunkmanifest +++ /dev/null @@ -1 +0,0 @@ -3 \ No newline at end of file diff --git a/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunksha256 b/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunksha256 deleted file mode 100644 index 0c861ade46..0000000000 --- a/openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl.chunksha256 +++ /dev/null @@ -1,18 +0,0 @@ -{ - "bytes": 125895084, - "sha256": "e23f65b3790a2092348024603966717506c2ad1fae10b4312bdfe1f2b932df61", - "parts": [ - { - "bytes": 47185920, - "sha256": "268527c074b659a76c495d91afac8aee21e12100cc0191daa116f0db633b9165" - }, - { - "bytes": 47185920, - "sha256": "8622fdec72524dbc80c744fa17b92edea59d5889f0e1c4d02d3e4e8d44521d2b" - }, - { - "bytes": 31523244, - "sha256": "9cff2854787bf48fd7fd0f64a4a243a0011ed76cc3c09fb3399c0d3d9661d1d1" - } - ] -} diff --git a/openpilot/starpilot/models/catalog-v26.json b/openpilot/starpilot/models/catalog-v26.json index 60cbe1acb7..7a2e8c766a 100644 --- a/openpilot/starpilot/models/catalog-v26.json +++ b/openpilot/starpilot/models/catalog-v26.json @@ -1231,6 +1231,23 @@ "artifact_sha256": "397e0a555c66143b2507b45a55e24a8d638634ad2f40abaa857a857226b20b0c", "artifact_size": 804589195, "artifact_chunk_count": 18 + }, + { + "artifact_chunk_count": 0, + "artifact_format": "tinygrad_single_v1_arena", + "artifact_sha256": "e72274cbb666f1e81c4750de8593c7d9409e13751339f9fd3e74febd36bc96bd", + "artifact_size": 86376298, + "community_favorite": false, + "id": "cheddar", + "model_size": "small", + "name": "Cheddar", + "released": "2026-11-17", + "series": "OP Series", + "source_sha256": { + "cheddar_driving_supercombo.onnx": "350a47ea36e554fb71634c7361b2c2a2a3da07ecb211a4c6cff3d2c3013d1d82" + }, + "source_url": "https://github.com/commaai/openpilot/commit/b3ab22efe1be5d6c0ad46503f0985b26f8b7a36f", + "version": "v16" } ] } diff --git a/openpilot/starpilot/models/catalog.py b/openpilot/starpilot/models/catalog.py index 6cc9cc06b8..e82bce675a 100644 --- a/openpilot/starpilot/models/catalog.py +++ b/openpilot/starpilot/models/catalog.py @@ -7,9 +7,9 @@ from pathlib import Path BUNDLED_CURRENT = "bundled-current" -DEFAULT_SMALL = "rdf43" -DEFAULT_SMALL_SHA256 = "e23f65b3790a2092348024603966717506c2ad1fae10b4312bdfe1f2b932df61" -DEFAULT_SMALL_SIZE = 125895084 +DEFAULT_SMALL = "cheddar" +DEFAULT_SMALL_SHA256 = "e72274cbb666f1e81c4750de8593c7d9409e13751339f9fd3e74febd36bc96bd" +DEFAULT_SMALL_SIZE = 86376298 GENERATION = "v26" COMPILER_REVISION = "9d0446a4ba8a532c8b674fb6ad795af015cd9dcf" ARTIFACT_ABI = "tinygrad_single_v1_arena" @@ -32,20 +32,20 @@ class ModelEntry: BUNDLED = ( ModelEntry( model_id=BUNDLED_CURRENT, - name="Regret Driven Framework V4", + name="Cheddar", source_sha256=DEFAULT_SMALL_SHA256, - source_path="openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl", + source_path="openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl", compiler_revision="9d0446a4ba8a532c8b674fb6ad795af015cd9dcf", artifact_abi=ARTIFACT_ABI, selectable=True, - version="v15", + version="v16", ), ) CATALOG = BUNDLED + tuple(ModelEntry( model_id=m["id"], name=m["name"], source_sha256=DEFAULT_SMALL_SHA256 if m["id"] == DEFAULT_SMALL else "", - source_path="openpilot/selfdrive/modeld/models/rdf43_driving_tinygrad.pkl" if m["id"] == DEFAULT_SMALL else "", + source_path="openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl" if m["id"] == DEFAULT_SMALL else "", compiler_revision=COMPILER_REVISION, artifact_abi=ARTIFACT_ABI, selectable=True, version=m["version"], uses_external_gpu=bool(m.get("uses_external_gpu", False)), ) for m in json.loads(CATALOG_PATH.read_text())["models"]) diff --git a/openpilot/starpilot/models/manager.py b/openpilot/starpilot/models/manager.py index 7451aad136..51efaa6eb0 100644 --- a/openpilot/starpilot/models/manager.py +++ b/openpilot/starpilot/models/manager.py @@ -343,7 +343,7 @@ def resolve_runtime(chestnut_available: bool, *, root: Path = ROOT, randomize: b shipped = True small_path = shipped_default() if small_path is None: - raise ModelError("Shipped RDFv4 is missing or corrupt; reinstall the validated model package") + raise ModelError("Shipped Cheddar is missing or corrupt; reinstall the validated model package") big_path = verified_artifact(big, entries, root) if big not in ("", BUNDLED_CURRENT) and chestnut_available else None allow_big = chestnut_available and big_path is not None return RuntimeSelection(small, small_path, entries[small]["version"], big, big_path, diff --git a/openpilot/starpilot/models/tests/test_catalog_status.py b/openpilot/starpilot/models/tests/test_catalog_status.py index 7266955f8d..dc49fa3506 100644 --- a/openpilot/starpilot/models/tests/test_catalog_status.py +++ b/openpilot/starpilot/models/tests/test_catalog_status.py @@ -26,6 +26,7 @@ class TestModelCatalogStatus(unittest.TestCase): digest.update(block) self.assertEqual(digest.hexdigest(), entry.source_sha256) self.assertEqual(resolve_selection("rdf43").version, "v15") + self.assertEqual((entry.model_id, entry.name, entry.version), ("cheddar", "Cheddar", "v16")) with self.assertRaises(ValueError): resolve_selection("unknown-model") with self.assertRaises(ValueError): diff --git a/openpilot/starpilot/models/tests/test_manager.py b/openpilot/starpilot/models/tests/test_manager.py index 0f532eabcc..a8fb327f9d 100644 --- a/openpilot/starpilot/models/tests/test_manager.py +++ b/openpilot/starpilot/models/tests/test_manager.py @@ -57,7 +57,7 @@ class ModelManagerTest(unittest.TestCase): from openpilot.common.file_chunker import package_file source = self.root / 'shipped-source.pkl' source.write_bytes(self.data) - package_file(source, self.root / 'shipped/rdf43_driving_tinygrad.pkl') + package_file(source, self.root / 'shipped/cheddar_driving_tinygrad.pkl') source.unlink() for attribute, value in (('DEFAULT_SMALL_SHA256', hashlib.sha256(self.data).hexdigest()), ('DEFAULT_SMALL_SIZE', len(self.data))): identity = patch('openpilot.starpilot.models.manager.' + attribute, value) @@ -670,18 +670,18 @@ class ModelManagerTest(unittest.TestCase): def test_randomizer_avoids_repeat_ignores_favorites_and_respects_exclusions(self): self.install_fixture('gwm8223') - self.install_fixture('rdf43') + self.install_fixture('cheddar') self.manager.action('preferences', {'randomizer': True, 'userFavorites': ['gwm8223'], 'blacklistedModels': ['gwm8223', BUNDLED_CURRENT]}) - self.assertEqual(randomize_next_start(False, root=self.root)['small'], 'rdf43') - self.assertEqual(randomize_next_start(False, root=self.root)['small'], 'rdf43') + self.assertEqual(randomize_next_start(False, root=self.root)['small'], 'cheddar') + self.assertEqual(randomize_next_start(False, root=self.root)['small'], 'cheddar') self.manager.action('preferences', {'blacklistedModels': []}) seen = [] def choose(options): seen.extend(options) return options[0] randomize_next_start(False, root=self.root, chooser=choose) - self.assertNotIn('rdf43', seen) + self.assertNotIn('cheddar', seen) self.assertIn('gwm8223', seen) self.assertEqual(seen, ['gwm8223']) diff --git a/openpilot/starpilot/models/tests/test_modeld_startup_fallback.py b/openpilot/starpilot/models/tests/test_modeld_startup_fallback.py index f0a1960c4b..84da174da7 100644 --- a/openpilot/starpilot/models/tests/test_modeld_startup_fallback.py +++ b/openpilot/starpilot/models/tests/test_modeld_startup_fallback.py @@ -404,11 +404,11 @@ def test_failed_selected_small_uses_only_verified_rdf_or_refuses_startup(monkeyp if fallback_failure is None: assert env['load_small']() == (rdf, 'rdf-prepared', True) else: - with pytest.raises(RuntimeError, match='Shipped RDFv4' if fallback_failure == 'missing' else 'RDF failed'): + with pytest.raises(RuntimeError, match='Shipped Cheddar' if fallback_failure == 'missing' else 'RDF failed'): env['load_small']() stock.assert_not_called() if fallback_failure != 'missing': - assert loader.call_args.args == (1928, 1208, shipped, 'v15', False, DEFAULT_SMALL, DEFAULT_SMALL_SHA256) + assert loader.call_args.args == (1928, 1208, shipped, 'v16', False, DEFAULT_SMALL, DEFAULT_SMALL_SHA256) @pytest.mark.parametrize("opened", [("QCOM",), ("QCOM", "AMD")]) diff --git a/openpilot/starpilot/models/tests/test_shipped_default.py b/openpilot/starpilot/models/tests/test_shipped_default.py index 84196f7a01..a8ef7c5aba 100644 --- a/openpilot/starpilot/models/tests/test_shipped_default.py +++ b/openpilot/starpilot/models/tests/test_shipped_default.py @@ -7,23 +7,23 @@ from openpilot.starpilot.models import manager from openpilot.starpilot.models.catalog import BUNDLED_CURRENT, DEFAULT_SMALL, DEFAULT_SMALL_SHA256 -def test_unset_small_loads_shipped_rdf_v4_with_v15_parser(tmp_path, monkeypatch): +def test_unset_small_loads_shipped_cheddar_with_v16_parser(tmp_path, monkeypatch): artifact = tmp_path / "shipped.pkl" artifact.write_bytes(b"verified fixture") monkeypatch.setattr(manager, "shipped_default", lambda: artifact) selected = manager.resolve_runtime(False, root=tmp_path) assert manager.preferences(tmp_path)["small"] == DEFAULT_SMALL - assert selected.small_id == "rdf43" - assert selected.small_version == "v15" + assert selected.small_id == "cheddar" + assert selected.small_version == "v16" assert selected.small_path == artifact assert selected.small_sha256 == DEFAULT_SMALL_SHA256 assert not selected.allow_big @pytest.mark.parametrize("selection", [BUNDLED_CURRENT, "gwm8223"]) -def test_legacy_alias_and_missing_selected_artifact_use_rdf_only(tmp_path, monkeypatch, selection): +def test_legacy_alias_and_missing_selected_artifact_use_cheddar_only(tmp_path, monkeypatch, selection): manager.atomic_json(tmp_path / "preferences.json", {"small": selection}) - path = tmp_path / "rdf.pkl" + path = tmp_path / "cheddar.pkl" monkeypatch.setattr(manager, "shipped_default", lambda: path) selected = manager.resolve_runtime(False, root=tmp_path) assert selected.small_id == DEFAULT_SMALL and selected.small_path == path @@ -32,7 +32,7 @@ def test_legacy_alias_and_missing_selected_artifact_use_rdf_only(tmp_path, monke def test_missing_or_corrupt_only_shipped_model_refuses_startup(tmp_path, monkeypatch): monkeypatch.setattr(manager, "shipped_default", lambda: None) - with pytest.raises(manager.ModelError, match="Shipped RDFv4 is missing or corrupt"): + with pytest.raises(manager.ModelError, match="Shipped Cheddar is missing or corrupt"): manager.resolve_runtime(False, root=tmp_path) @@ -46,7 +46,7 @@ def test_big_default_disabled_and_explicit_download_preserved(tmp_path): def test_verified_download_precedes_shipped_default(tmp_path, monkeypatch): path = tmp_path / "download.pkl" - monkeypatch.setattr(manager, "catalog", lambda _: {DEFAULT_SMALL: {"artifact_sha256": "download-hash", "version": "v15"}}) + monkeypatch.setattr(manager, "catalog", lambda _: {DEFAULT_SMALL: {"artifact_sha256": "download-hash", "version": "v16"}}) monkeypatch.setattr(manager, "verified_artifact", lambda *args: path) def unexpected_shipped_default(): raise AssertionError("download replaced") @@ -61,12 +61,12 @@ def test_shipped_parts_require_pinned_hash_and_size(tmp_path, monkeypatch, damag data = b"small isolated compiled artifact fixture" source = tmp_path / "source.pkl" source.write_bytes(data) - destination = tmp_path / "rdf43_driving_tinygrad.pkl" + destination = tmp_path / "cheddar_driving_tinygrad.pkl" package_file(source, destination) monkeypatch.setattr(manager, "SHIPPED_MODELS", tmp_path) monkeypatch.setattr(manager, "DEFAULT_SMALL_SHA256", hashlib.sha256(data).hexdigest()) monkeypatch.setattr(manager, "DEFAULT_SMALL_SIZE", len(data) + (damage == "size")) - part = tmp_path / "rdf43_driving_tinygrad.pkl.chunk01of01" + part = tmp_path / "cheddar_driving_tinygrad.pkl.chunk01of01" if damage == "bytes": part.write_bytes(b"x" * len(data)) elif damage == "missing": @@ -82,7 +82,7 @@ def test_shipped_default_is_verified_asynchronously_in_menu(tmp_path, monkeypatc source = tmp_path / "source.pkl" source.write_bytes(data) shipped = tmp_path / "shipped" - package_file(source, shipped / "rdf43_driving_tinygrad.pkl") + package_file(source, shipped / "cheddar_driving_tinygrad.pkl") monkeypatch.setattr(manager, "SHIPPED_MODELS", shipped) monkeypatch.setattr(manager, "DEFAULT_SMALL_SHA256", hashlib.sha256(data).hexdigest()) monkeypatch.setattr(manager, "DEFAULT_SMALL_SIZE", len(data)) diff --git a/openpilot/starpilot/ui/preview_shell.py b/openpilot/starpilot/ui/preview_shell.py index d9a345c6f0..134d54637d 100644 --- a/openpilot/starpilot/ui/preview_shell.py +++ b/openpilot/starpilot/ui/preview_shell.py @@ -52,7 +52,7 @@ def reference_models_page(scene: str) -> FeatureSettingsState: "activeSmallModel": "rdf4", "activeBigModel": "", "randomizer": False, "summary": {"installed": 2, "total": 101}, "capabilities": dict.fromkeys(("select", "download", "downloadAll", "cancel", "refresh", "favorites", "delete", "randomizer", "exclusions"), True), - "models": [model("rdf4", "Regret Driven Framework V4 👀📡", installed=True, selectable=True, builtin=True), + "models": [model("cheddar", "Cheddar", installed=True, selectable=True, builtin=True), model("wd40", "WD40", installed=True, selectable=True, userFavorite=True, communityFavorite=True), model("tr16", "TR16 👀📡"), model("cinque", "Cinque Terre", requiresGpu=True)]} page = {"settings_models": "models", "settings_models_catalog": "models:catalog", "settings_models_pick": "models:pick:small"}[scene] diff --git a/prebuilt.json b/prebuilt.json index 83659f6055..d7d9b154e8 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "d1bd56cb111125ce6e5bc63f68980be91787b4c2cb7ecf742a06b223bb4dd71b", "schema_version": 1} +{"protected_inventory_sha256": "94b70fb10cc353703b1af34aa5cf5ff1499ec764ca48b4361ae06ca949bf1724", "schema_version": 1} diff --git a/scripts/model_source_map_v26.json b/scripts/model_source_map_v26.json index 186143b25c..57ba5ecd63 100644 --- a/scripts/model_source_map_v26.json +++ b/scripts/model_source_map_v26.json @@ -491,5 +491,10 @@ "mountaindewv1": { "source_id": "mountaindewv1", "input_format": "supercombo" + }, + "cheddar": { + "source_id": "cheddar", + "input_format": "supercombo", + "ref": "b3ab22efe1be5d6c0ad46503f0985b26f8b7a36f" } } diff --git a/tools/laptop_device_build/package_model_chunks.py b/tools/laptop_device_build/package_model_chunks.py index d236cea081..348042b7d4 100644 --- a/tools/laptop_device_build/package_model_chunks.py +++ b/tools/laptop_device_build/package_model_chunks.py @@ -16,9 +16,9 @@ def main(): parser.add_argument('--source', type=Path, required=True) parser.add_argument('--destination', type=Path, required=True) args = parser.parse_args() - for name in ('dmonitoring_model_tinygrad.pkl', 'rdf43_driving_tinygrad.pkl'): + for name in ('dmonitoring_model_tinygrad.pkl', 'cheddar_driving_tinygrad.pkl'): source = (_chunk_owner.materialize_file_chunked(args.source / name) - if name == 'rdf43_driving_tinygrad.pkl' else args.source / name) + if name == 'cheddar_driving_tinygrad.pkl' else args.source / name) package_file(source, args.destination / name) if __name__ == '__main__': diff --git a/tools/laptop_device_build/tests/test_model_artifact_git_policy.py b/tools/laptop_device_build/tests/test_model_artifact_git_policy.py index eb73aff46a..16f9516c1f 100644 --- a/tools/laptop_device_build/tests/test_model_artifact_git_policy.py +++ b/tools/laptop_device_build/tests/test_model_artifact_git_policy.py @@ -14,9 +14,9 @@ class TestModelArtifactGitPolicy(unittest.TestCase): for name in ('.gitignore', '.gitattributes'): (root / name).write_bytes((ROOT / name).read_bytes()) base = 'openpilot/selfdrive/modeld/models/' - publishable = [name + suffix for name in ('dmonitoring_model_tinygrad.pkl', 'rdf43_driving_tinygrad.pkl') + publishable = [name + suffix for name in ('dmonitoring_model_tinygrad.pkl', 'cheddar_driving_tinygrad.pkl') for suffix in ('.chunk01of02', '.chunk01of100', '.chunk100of100', '.chunk1024of1024', '.chunkmanifest', '.chunksha256')] - ignored = ['rdf43_driving_tinygrad.pkl', 'rdf43_driving_tinygrad.pkl.unchunked', 'driving_tinygrad.pkl', 'dmonitoring_model_tinygrad.pkl', 'driving_tinygrad.pkl.unchunked', + ignored = ['cheddar_driving_tinygrad.pkl', 'cheddar_driving_tinygrad.pkl.unchunked', 'driving_tinygrad.pkl', 'dmonitoring_model_tinygrad.pkl', 'driving_tinygrad.pkl.unchunked', 'driving_tinygrad.pkl.chunk01of02', 'big_driving_tinygrad.pkl', 'big_driving_tinygrad.pkl.chunk01of02', 'driving_tinygrad.pkl.chunkNOTESof02', 'other_driving_tinygrad.pkl.chunk01of02'] for name, expected in [(n, False) for n in publishable] + [(n, True) for n in ignored]: diff --git a/tools/laptop_device_build/tests/test_model_parts.py b/tools/laptop_device_build/tests/test_model_parts.py index d0e841c510..237ae13d9e 100644 --- a/tools/laptop_device_build/tests/test_model_parts.py +++ b/tools/laptop_device_build/tests/test_model_parts.py @@ -42,7 +42,7 @@ class TestModelParts(unittest.TestCase): f.seek(1017) self.assertEqual(f.read(), self.data[1017:]) - def test_release_package_contains_only_rdf_and_fresh_driver_monitoring(self): + def test_release_package_contains_only_cheddar_and_fresh_driver_monitoring(self): from tools.laptop_device_build import package_model_chunks source, destination = self.root / 'source', self.root / 'release' @@ -51,15 +51,15 @@ class TestModelParts(unittest.TestCase): dm.write_bytes(b'old dm') parts.package_file(dm, dm) dm.write_bytes(b'new dm') - rdf = source / 'rdf43_driving_tinygrad.pkl' - rdf.write_bytes(b'verified rdf') + rdf = source / 'cheddar_driving_tinygrad.pkl' + rdf.write_bytes(b'verified cheddar') parts.package_file(rdf, rdf) rdf.unlink() (source / 'driving_tinygrad.pkl').write_bytes(b'obsolete stock') with patch.object(sys, 'argv', ['package-models', '--source', str(source), '--destination', str(destination)]): package_model_chunks.main() self.assertEqual(parts.materialize_file_chunked(destination / dm.name).read_bytes(), b'new dm') - self.assertEqual(parts.materialize_file_chunked(destination / rdf.name).read_bytes(), b'verified rdf') + self.assertEqual(parts.materialize_file_chunked(destination / rdf.name).read_bytes(), b'verified cheddar') self.assertEqual({path.name for path in destination.glob('*.chunkmanifest')}, {dm.name + '.chunkmanifest', rdf.name + '.chunkmanifest'}) @@ -140,12 +140,18 @@ class TestModelParts(unittest.TestCase): f.seek(251) return f.read(19) modules = {'tinygrad': types.SimpleNamespace(Context=lambda **kwargs: contextlib.nullcontext()), - 'tinygrad_repo.examples.openpilot.helpers': types.SimpleNamespace(load_pickle=load_pickle)} + 'tinygrad_repo.examples.openpilot.helpers': types.SimpleNamespace(load_pickle=load_pickle), + 'openpilot.starpilot.models.runtime_bridge.runtime': types.SimpleNamespace( + selected_legacy=lambda: True, load_oob=lambda path, chestnut: load_pickle(path, out_of_band=True))} with patch.object(parts, 'CHUNK_SIZE', 256), patch.dict(sys.modules, modules): resolved = namespace['modeld_pkl_path'](False) self.assertTrue(resolved.is_file()) # actual receipt capture happens after this resolver self.assertEqual(namespace['load_oob'](self.target), self.data[251:270]) self.assertEqual(captured, [resolved]) + with patch.object(modules['openpilot.starpilot.models.runtime_bridge.runtime'], 'selected_legacy', return_value=False): + with self.assertRaisesRegex(RuntimeError, 'Prepare the model runtime'): + namespace['load_oob'](self.target) + self.assertEqual(captured, [resolved]) self.assertFalse((self.target.parent / 'big_driving_tinygrad.pkl').exists()) def test_tracked_package_takes_priority_over_stale_canonical_output(self):