* param to control stock vs sp ui * init styles * SP Toggles * Lint * optimizations * sp raylib preview * fix callback * fix ui preview * dialog txt * compare vs what used to be done before InputDialog * introducing ui_state_sp for py * raylib: input dialog * raylib: SP Toggles * raylib: SP Panels * raylib: Option Control * init * param to control stock vs sp ui * better * tree dialog, progress bar widget cool stuff * merge origin raylib toggles * tree dialog * less trees for the planet * the heck * add ui_update callback * save the trees we got icons * Update process.py * yesssssssssss * utilize ON_COLOR constant form op system * Revert "add ui_update callback" This reverts commit 4da32cc0097434aab0aa6a3c35465eabb23c8958. * # Conflicts: # system/ui/sunnypilot/widgets/list_view.py # system/ui/sunnypilot/widgets/option_control.py * Merge remote-tracking branch 'openpilot/master' into nov-19-sync * ui: `GuiApplicationExt` * add to readme * scroller_tici :) * use gui_app.sunnypilot_ui() * # Conflicts: # selfdrive/ui/layouts/main.py # selfdrive/ui/sunnypilot/layouts/settings/cruise.py # selfdrive/ui/sunnypilot/layouts/settings/display.py # selfdrive/ui/sunnypilot/layouts/settings/models.py # selfdrive/ui/sunnypilot/layouts/settings/navigation.py # selfdrive/ui/sunnypilot/layouts/settings/osm.py # selfdrive/ui/sunnypilot/layouts/settings/steering.py # selfdrive/ui/sunnypilot/layouts/settings/sunnylink.py # selfdrive/ui/sunnypilot/layouts/settings/trips.py # selfdrive/ui/sunnypilot/layouts/settings/vehicle.py # selfdrive/ui/sunnypilot/layouts/settings/visuals.py # system/ui/sunnypilot/widgets/option_control.py * init value * Remove 'sunnypilot_ui' Removed 'sunnypilot_ui' parameter from params_keys.h * Update raylib_screenshots.py Removed the parameter setting for 'sunnypilot_ui' in the test. * easier to see * Update progress_bar.py * try something * adjust placement * more simple * smoothing updating components * ui: fuzzy search helper * ui_state_sp * description! * fuzzy af searching * better tree. fully dynamic and stuff * rm * rearrange * license * idk how maybe the merge * more indent * more indent * cleanup * temporaily revert ui_state_sp * only show if fav_param is used in the call * conditional for mypy * mypy * conditional for mypy * str concatenation to reduce line len * level * sunny's new x,y makes this even easier! * refreshing half a second seems legit. * loathing loathing, unadulterated loathing, i loathe it all * loathing loathing, unadulterated loathing, i loathe it all * # Conflicts: # system/ui/sunnypilot/lib/styles.py # system/ui/sunnypilot/widgets/tree_dialog.py * Update models.py * Change BUTTON_DISABLED_BG_COLOR to a lighter shade * I think this is it * Update tree_dialog.py * Update models.py * Update models.py * oops, angry f string * bool * Update ui_state.py * Update ui_state.py * wtf where'd the end quote go lol * some * more * quick test * Revert "quick test" This reverts commit fb97afa54c2b94129e772a23a789059adf01f609. * try this out * use sp's * cap * how weird? --------- Co-authored-by: nayan <nayan8teen@gmail.com> Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Model Selector Version Compatibility
This document explains the version compatibility mechanism used by the Model Selector system, and the rationale behind certain version constraints and JSON file management strategies.
Overview
The Model Selector is responsible for selecting and validating model bundles based on their metadata and version constraints. Each model bundle is distributed via a JSON file and includes a minimumSelectorVersion field indicating the minimum selector version required to load it.
To ensure robust compatibility and prevent mismatches between model expectations and selector capabilities, the selector enforces two version boundaries:
REQUIRED_MIN_SELECTOR_VERSION: the oldest selector version we support.CURRENT_SELECTOR_VERSION: the current version of the selector logic.
Version Compatibility Check
A model bundle is considered compatible if:
REQUIRED_MIN_SELECTOR_VERSION <= bundle["minimumSelectorVersion"] <= CURRENT_SELECTOR_VERSION
This ensures:
- Old bundles are rejected if they rely on deprecated selector behavior.
- Future bundles are ignored if they expect logic that the current selector doesn't yet implement.
Handling Breaking Changes
When a deep change in selector behavior requires all models to be recompiled (e.g., due to a major architectural update), we:
- Create a new JSON file (e.g., from
models_v4.jsontomodels_v5.json). - Assign updated
minimumSelectorVersionvalues in the new bundles.
This allows older selector versions to continue using the previous JSON file, while newer versions point to the new one, preventing cross-contamination.
Why REQUIRED_MIN_SELECTOR_VERSION Still Matters
Despite using new JSON files to isolate breaking changes, REQUIRED_MIN_SELECTOR_VERSION plays a critical role:
1. Cached Bundle Validation
Model bundles are cached locally (e.g., in-memory or on disk). A user might have previously loaded a now-invalid bundle from an older JSON file.
REQUIRED_MIN_SELECTOR_VERSION prevents the selector from reloading or trusting that stale cached bundle, even if the original JSON is gone.
2. Explicit Deprecation Boundary
By raising REQUIRED_MIN_SELECTOR_VERSION, we declare older bundles officially unsupported, even if they technically still exist in a legacy JSON file.
3. Avoiding Race Conditions
Some clients may have intermittent access to updated JSONs. The runtime check ensures version compatibility is enforced independently of external file state.
Summary
| Component | Purpose |
|---|---|
minimumSelectorVersion |
Declares the minimum selector version required to load a model bundle |
REQUIRED_MIN_SELECTOR_VERSION |
Prevents loading bundles that are too old (e.g., from stale cache) |
CURRENT_SELECTOR_VERSION |
Prevents loading bundles that are too new or forward-incompatible |
| JSON file renaming | Isolates bundles by selector generation to handle full recompiles |
This layered strategy ensures safe evolution of the model selection system while maintaining backward compatibility and runtime protection against stale or incompatible bundles.