mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 03:13:44 +08:00
Bundle Crumbly Cheddar as the Default Model
This commit is contained in:
+11
-11
@@ -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/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
|
||||
!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/
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"bytes": 86370601,
|
||||
"sha256": "77a61c43cbd093f93626817a0b8c290116a01d562396bd2d18988308740e7c08",
|
||||
"parts": [
|
||||
{
|
||||
"bytes": 47185920,
|
||||
"sha256": "5b85284422fdb9d3e51e97067010d26328e9396b196ef5df46eb831d4ceb2b3e"
|
||||
},
|
||||
{
|
||||
"bytes": 39184681,
|
||||
"sha256": "61496b0e1ee7dbce31c02ffdc39cc3c273335b8d0b7196b72ad157f1fbb07c87"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"bytes": 86376298,
|
||||
"sha256": "e72274cbb666f1e81c4750de8593c7d9409e13751339f9fd3e74febd36bc96bd",
|
||||
"parts": [
|
||||
{
|
||||
"bytes": 47185920,
|
||||
"sha256": "c35d5872ec6b212c4e7da6812145ec9e349e3c1242652fa90d787e9efff84346"
|
||||
},
|
||||
{
|
||||
"bytes": 39190378,
|
||||
"sha256": "8576ceb0852ce52dc6658a876f71a4c88d0755f0322629d61d33fc22c71d2b5e"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1248,6 +1248,23 @@
|
||||
},
|
||||
"source_url": "https://github.com/commaai/openpilot/commit/b3ab22efe1be5d6c0ad46503f0985b26f8b7a36f",
|
||||
"version": "v16"
|
||||
},
|
||||
{
|
||||
"artifact_chunk_count": 0,
|
||||
"artifact_format": "tinygrad_single_v1_arena",
|
||||
"artifact_sha256": "77a61c43cbd093f93626817a0b8c290116a01d562396bd2d18988308740e7c08",
|
||||
"artifact_size": 86370601,
|
||||
"community_favorite": false,
|
||||
"id": "ch3",
|
||||
"model_size": "small",
|
||||
"name": "Crumbly Cheddar",
|
||||
"released": "2026-11-24",
|
||||
"series": "OP Series",
|
||||
"source_sha256": {
|
||||
"ch3_driving_supercombo.onnx": "962396e7909556af6a9c7bfb7ad6db01a8d2c8da0760379eb71efda004cb3548"
|
||||
},
|
||||
"source_url": "https://github.com/commaai/openpilot/commit/8892f177ea11a9e20e5afba4cb88802b161eaf49",
|
||||
"version": "v16"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ from pathlib import Path
|
||||
|
||||
|
||||
BUNDLED_CURRENT = "bundled-current"
|
||||
DEFAULT_SMALL = "cheddar"
|
||||
DEFAULT_SMALL_SHA256 = "e72274cbb666f1e81c4750de8593c7d9409e13751339f9fd3e74febd36bc96bd"
|
||||
DEFAULT_SMALL_SIZE = 86376298
|
||||
DEFAULT_SMALL = "ch3"
|
||||
DEFAULT_SMALL_SHA256 = "77a61c43cbd093f93626817a0b8c290116a01d562396bd2d18988308740e7c08"
|
||||
DEFAULT_SMALL_SIZE = 86370601
|
||||
GENERATION = "v26"
|
||||
COMPILER_REVISION = "9d0446a4ba8a532c8b674fb6ad795af015cd9dcf"
|
||||
ARTIFACT_ABI = "tinygrad_single_v1_arena"
|
||||
@@ -32,9 +32,9 @@ class ModelEntry:
|
||||
BUNDLED = (
|
||||
ModelEntry(
|
||||
model_id=BUNDLED_CURRENT,
|
||||
name="Cheddar",
|
||||
name="Crumbly Cheddar",
|
||||
source_sha256=DEFAULT_SMALL_SHA256,
|
||||
source_path="openpilot/selfdrive/modeld/models/cheddar_driving_tinygrad.pkl",
|
||||
source_path="openpilot/selfdrive/modeld/models/ch3_driving_tinygrad.pkl",
|
||||
compiler_revision="9d0446a4ba8a532c8b674fb6ad795af015cd9dcf",
|
||||
artifact_abi=ARTIFACT_ABI,
|
||||
selectable=True,
|
||||
@@ -45,7 +45,7 @@ BUNDLED = (
|
||||
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/cheddar_driving_tinygrad.pkl" if m["id"] == DEFAULT_SMALL else "",
|
||||
source_path="openpilot/selfdrive/modeld/models/ch3_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"])
|
||||
|
||||
@@ -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 Cheddar is missing or corrupt; reinstall the validated model package")
|
||||
raise ModelError("Shipped Crumbly 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,
|
||||
|
||||
@@ -26,7 +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"))
|
||||
self.assertEqual((entry.model_id, entry.name, entry.version), ("ch3", "Crumbly Cheddar", "v16"))
|
||||
with self.assertRaises(ValueError):
|
||||
resolve_selection("unknown-model")
|
||||
with self.assertRaises(ValueError):
|
||||
|
||||
@@ -59,7 +59,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/cheddar_driving_tinygrad.pkl')
|
||||
package_file(source, self.root / 'shipped/ch3_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)
|
||||
@@ -706,18 +706,18 @@ class ModelManagerTest(unittest.TestCase):
|
||||
|
||||
def test_randomizer_avoids_repeat_ignores_favorites_and_respects_exclusions(self):
|
||||
self.install_fixture('gwm8223')
|
||||
self.install_fixture('cheddar')
|
||||
self.install_fixture(DEFAULT_SMALL)
|
||||
self.manager.action('preferences', {'randomizer': True, 'userFavorites': ['gwm8223'],
|
||||
'blacklistedModels': ['gwm8223', BUNDLED_CURRENT]})
|
||||
self.assertEqual(randomize_next_start(False, root=self.root)['small'], 'cheddar')
|
||||
self.assertEqual(randomize_next_start(False, root=self.root)['small'], 'cheddar')
|
||||
self.assertEqual(randomize_next_start(False, root=self.root)['small'], DEFAULT_SMALL)
|
||||
self.assertEqual(randomize_next_start(False, root=self.root)['small'], DEFAULT_SMALL)
|
||||
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('cheddar', seen)
|
||||
self.assertNotIn(DEFAULT_SMALL, seen)
|
||||
self.assertIn('gwm8223', seen)
|
||||
self.assertEqual(seen, ['gwm8223'])
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@ def test_unset_small_loads_shipped_cheddar_with_v16_parser(tmp_path, monkeypatch
|
||||
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 == "cheddar"
|
||||
assert selected.small_id == "ch3"
|
||||
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"])
|
||||
@pytest.mark.parametrize("selection", [BUNDLED_CURRENT, "gwm8223", "cheddar"])
|
||||
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 / "cheddar.pkl"
|
||||
@@ -33,7 +33,7 @@ def test_legacy_alias_and_missing_selected_artifact_use_cheddar_only(tmp_path, m
|
||||
|
||||
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 Cheddar is missing or corrupt"):
|
||||
with pytest.raises(manager.ModelError, match="Shipped Crumbly Cheddar is missing or corrupt"):
|
||||
manager.resolve_runtime(False, root=tmp_path)
|
||||
|
||||
|
||||
@@ -62,12 +62,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 / "cheddar_driving_tinygrad.pkl"
|
||||
destination = tmp_path / "ch3_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 / "cheddar_driving_tinygrad.pkl.chunk01of01"
|
||||
part = tmp_path / "ch3_driving_tinygrad.pkl.chunk01of01"
|
||||
if damage == "bytes":
|
||||
part.write_bytes(b"x" * len(data))
|
||||
elif damage == "missing":
|
||||
@@ -83,7 +83,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 / "cheddar_driving_tinygrad.pkl")
|
||||
package_file(source, shipped / "ch3_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))
|
||||
|
||||
@@ -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("cheddar", "Cheddar", installed=True, selectable=True, builtin=True),
|
||||
"models": [model("ch3", "Crumbly 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]
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "b74987cb734f9e8cdec342507f9bd132436d284e0a983e1ef122b210d967b972", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "a92f934595842bc577779700469fab73c4074948b3a6039f90aa4ff0141c55e4", "schema_version": 1}
|
||||
|
||||
@@ -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', 'cheddar_driving_tinygrad.pkl'):
|
||||
for name in ('dmonitoring_model_tinygrad.pkl', 'ch3_driving_tinygrad.pkl'):
|
||||
source = (_chunk_owner.materialize_file_chunked(args.source / name)
|
||||
if name == 'cheddar_driving_tinygrad.pkl' else args.source / name)
|
||||
if name == 'ch3_driving_tinygrad.pkl' else args.source / name)
|
||||
package_file(source, args.destination / name)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -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', 'cheddar_driving_tinygrad.pkl')
|
||||
publishable = [name + suffix for name in ('dmonitoring_model_tinygrad.pkl', 'ch3_driving_tinygrad.pkl')
|
||||
for suffix in ('.chunk01of02', '.chunk01of100', '.chunk100of100', '.chunk1024of1024', '.chunkmanifest', '.chunksha256')]
|
||||
ignored = ['cheddar_driving_tinygrad.pkl', 'cheddar_driving_tinygrad.pkl.unchunked', 'driving_tinygrad.pkl', 'dmonitoring_model_tinygrad.pkl', 'driving_tinygrad.pkl.unchunked',
|
||||
ignored = ['ch3_driving_tinygrad.pkl', 'ch3_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]:
|
||||
|
||||
@@ -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 / 'cheddar_driving_tinygrad.pkl'
|
||||
rdf.write_bytes(b'verified cheddar')
|
||||
rdf = source / 'ch3_driving_tinygrad.pkl'
|
||||
rdf.write_bytes(b'verified crumbly 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 cheddar')
|
||||
self.assertEqual(parts.materialize_file_chunked(destination / rdf.name).read_bytes(), b'verified crumbly cheddar')
|
||||
self.assertEqual({path.name for path in destination.glob('*.chunkmanifest')},
|
||||
{dm.name + '.chunkmanifest', rdf.name + '.chunkmanifest'})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user