Restore FLM capture for the qualified paired-model producer

This commit is contained in:
firestar5683
2026-11-12 01:31:40 +00:00
parent a9821f4741
commit 9c8c8361bd
4 changed files with 45 additions and 19 deletions
+29 -8
View File
@@ -6,11 +6,20 @@ on:
paths:
- 'openpilot/starpilot/flm/**'
- 'openpilot/starpilot/lateral/**'
- 'openpilot/starpilot/aol/**'
- 'openpilot/starpilot/galaxy/web/js/flm*.js'
- 'openpilot/starpilot/galaxy/tests/test_flm*.mjs'
- 'openpilot/selfdrive/controls/lib/latcontrol*'
- 'openpilot/selfdrive/controls/controlsd.py'
- 'openpilot/system/manager/process_config.py'
- 'openpilot/selfdrive/modeld/**'
- 'openpilot/system/camerad/cameras/**'
- 'openpilot/system/sensord/**'
- 'openpilot/selfdrive/locationd/**'
- 'msgq_repo/msgq/visionipc/**'
- 'rednose_repo/rednose/helpers/**'
- 'openpilot/starpilot/models/laboratory_runner.py'
- 'openpilot/starpilot/models/tests/test_laboratory_runner.py'
- '.github/workflows/flm-offroad.yaml'
- 'pyproject.toml'
- 'uv.lock'
@@ -57,14 +66,24 @@ jobs:
- name: Build native dependencies
timeout-minutes: 10
run: scons
- name: Test offroad recommendations, storage, startup and rollback contracts
- name: Test producer capture, clocks, offroad recommendations, startup and rollback
timeout-minutes: 3
run: >-
tools/op.sh test
openpilot/starpilot/flm/tests/test_offroad_backend.py
openpilot/starpilot/flm/tests/test_offroad_coordinate_policy.py
openpilot/starpilot/flm/tests/test_offroad_equal_native_output.py
--json-output ci-results/flm-offroad.json
run: |
tools/op.sh test \
openpilot/starpilot/flm/tests/test_offroad_backend.py \
openpilot/starpilot/flm/tests/test_offroad_coordinate_policy.py \
openpilot/starpilot/flm/tests/test_offroad_equal_native_output.py \
--json-output ci-results/flm-offroad.json
.venv/bin/python -m pytest -q --import-mode=importlib \
openpilot/starpilot/flm/tests/test_upstream_producer_transport.py \
openpilot/starpilot/flm/tests/test_clock_resolution_budget.py \
openpilot/starpilot/flm/tests/test_consumption_join_clocks.py \
openpilot/starpilot/flm/tests/test_control_source_clock_recovery.py \
openpilot/starpilot/flm/tests/test_drain_receipt_clock.py \
openpilot/starpilot/flm/tests/test_event_admission_clock.py \
openpilot/starpilot/models/tests/test_laboratory_runner.py \
openpilot/starpilot/aol/tests/test_source_expiry_native_off.py \
--junitxml=ci-results/flm-producer.xml
- name: Test completed-drive and steering-result presentation
timeout-minutes: 1
run: |
@@ -75,5 +94,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: flm-offroad-contracts
path: ci-results/flm-offroad.json
path: |
ci-results/flm-offroad.json
ci-results/flm-producer.xml
if-no-files-found: warn
@@ -18,7 +18,7 @@ PRODUCER_SOURCE_HASHES = (
('openpilot', 'system/camerad/cameras/spectra.cc', '4fa26c17f0fb792a4ab6815657beccddee1d641faa2fd02e5aa7393f717a2f3a'),
('openpilot', 'system/camerad/cameras/camera_qcom2.cc', 'b34c24c9984a0ac086f7b961cb7ff09d0501231da50aaad0e676bb3dc3f2edd9'),
('openpilot', 'system/camerad/cameras/camera_common.cc', 'bd9a416a6ee21047b4deec6df04276d8717cd92fe14de43f3e9daff86b62bb8f'),
('openpilot', 'selfdrive/modeld/modeld.py', 'fd9ebaeab48436d0b536a81c74693fa1ffac43eb95a51ad9eeb7b50fd662e56e'),
('openpilot', 'selfdrive/modeld/modeld.py', '5ecc6ba7c3b275843ecbd69bd08aa61c41f0bc2320b77c6328046e4cf34663b6'),
('openpilot', 'selfdrive/modeld/fill_model_msg.py', 'b3916c34d1073d0c26a7a8adc51e7b148f63a1ac68b388226170fd0f8b8b56b4'),
('openpilot', 'system/sensord/sensord.py', '7c79ab07d775622a43001e5a9b9ccc9a7bafb065940185849b33eefc2fd26420'),
('openpilot', 'system/sensord/sensors/lsm6ds3_gyro.py', '3e561f3d8572e1477c9b4b810c7570837d51e81c5672fe21ec67a68cae00dd92'),
@@ -9,7 +9,7 @@ from openpilot.starpilot.flm import producer_clock_equivalence as clock
APPROVED = {
'selfdrive/modeld/modeld.py': 'fd9ebaeab48436d0b536a81c74693fa1ffac43eb95a51ad9eeb7b50fd662e56e',
'selfdrive/modeld/modeld.py': '5ecc6ba7c3b275843ecbd69bd08aa61c41f0bc2320b77c6328046e4cf34663b6',
'visionipc/visionipc_py.cc': '6c131c4f5eccb9f822f1aaae63733f26b1427c52340b61c9cdaf6cd4aee2f89d',
'visionipc/visionipc_server.cc': 'a4325a5171eacb931eb271d06a992d2f27216040df113d92099f62cdfa67d81a',
'visionipc/visionipc_client.cc': 'd142cd60eedabfc581e9770fcd6f0ca81b762ba9dbc608b54dd20a27a317a52d',
@@ -24,15 +24,15 @@ def test_exact_installed_upstream_closure_is_checked_before_contract():
assert contract.proof_sha256 == clock.CLOSURE_SHA256
@pytest.mark.parametrize('relative', tuple(APPROVED))
def test_unapproved_change_to_each_new_producer_fails_closed(monkeypatch, relative):
@pytest.mark.parametrize('package,relative,expected', clock.PRODUCER_SOURCE_HASHES)
def test_unapproved_change_to_each_producer_fails_closed(monkeypatch, package, relative, expected):
original = Path.read_bytes
reached = []
def changed(path):
body = original(path)
if path.as_posix().endswith(relative):
if path.as_posix().endswith('/' + package + '/' + relative):
reached.append(path)
assert hashlib.sha256(body).hexdigest() == APPROVED[relative]
assert hashlib.sha256(body).hexdigest() == expected
return body + b'\n'
return body
monkeypatch.setattr(Path, 'read_bytes', changed)
@@ -69,7 +69,8 @@ def test_actual_live_collector_startup_uses_installed_producer_contract():
assert not collector.ready and collector.live_tracking is None
def test_changed_model_producer_still_blocks_actual_live_collector(monkeypatch):
@pytest.mark.parametrize('package,relative,expected', clock.PRODUCER_SOURCE_HASHES)
def test_changed_producer_still_blocks_actual_live_collector(monkeypatch, package, relative, expected):
from types import SimpleNamespace
from openpilot.starpilot.flm.fullrate_collector import FullrateCollector
from openpilot.starpilot.flm.source_plant_runtime import start_original_capture
@@ -77,12 +78,16 @@ def test_changed_model_producer_still_blocks_actual_live_collector(monkeypatch):
original = Path.read_bytes
def changed(path):
body = original(path)
return body + b'\n' if path.as_posix().endswith('selfdrive/modeld/modeld.py') else body
if path.as_posix().endswith('/' + package + '/' + relative):
assert hashlib.sha256(body).hexdigest() == expected
return body + b'\n'
return body
monkeypatch.setattr(Path, 'read_bytes', changed)
enabled = []
adapter = SimpleNamespace(enable_original_context_capture=lambda: enabled.append(True),
current_physical_valid=False, last_physical_ns=0, source_plant_clock=None)
current_physical_valid=True, last_physical_ns=100, source_plant_clock=None)
collector = FullrateCollector(adapter)
collector.last_qualified_response = 100
assert not start_original_capture(collector)
assert enabled == []
assert adapter.source_plant_capture_error == 'original_source_clock_contract_unavailable'
@@ -91,7 +96,7 @@ def test_changed_model_producer_still_blocks_actual_live_collector(monkeypatch):
from openpilot.starpilot.flm.source_observation_report import refusal_report
error = refusal_report(collector)['lastException']
assert error['type'] == 'ValueError'
assert 'openpilot/selfdrive/modeld/modeld.py' in error['message']
assert package + '/' + relative in error['message']
def test_actual_daemon_reports_startup_source_refusal_without_issuing_a_trial(monkeypatch):
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "b485ba6b64ae5f545477cf3f64dd7b856edbda042375ffa229a4b950506d22ee", "schema_version": 1}
{"protected_inventory_sha256": "b4c37b7d922927a59de27943c19f8577e0ba8e7cfe9908f4627a0d155ac22bde", "schema_version": 1}