From 2dc0647a7961dbd2eeadc81dc4655eeb56445f82 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Sun, 15 Nov 2026 21:34:46 -0600 Subject: [PATCH] Qualify Model Lab tests across runtimes --- openpilot/starpilot/models/tests/test_laboratory_identity.py | 1 + openpilot/starpilot/models/tests/test_laboratory_layout.py | 4 ++-- openpilot/starpilot/models/tests/test_laboratory_replay.py | 5 ++++- prebuilt.json | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openpilot/starpilot/models/tests/test_laboratory_identity.py b/openpilot/starpilot/models/tests/test_laboratory_identity.py index 8bf98fcb69..553412222e 100644 --- a/openpilot/starpilot/models/tests/test_laboratory_identity.py +++ b/openpilot/starpilot/models/tests/test_laboratory_identity.py @@ -79,6 +79,7 @@ class TestLaboratoryIdentity(unittest.TestCase): pair = LaboratoryPair.__new__(LaboratoryPair) pair.failed = False pair._last_outputs = None + pair._layout_cache = None pair.lateral = Mock(spec_set=['last_warp']) pair.longitudinal = Mock(spec_set=['last_warp']) pair.lateral.last_warp = pair.longitudinal.last_warp = object() diff --git a/openpilot/starpilot/models/tests/test_laboratory_layout.py b/openpilot/starpilot/models/tests/test_laboratory_layout.py index c1244c0bee..567c1648e0 100644 --- a/openpilot/starpilot/models/tests/test_laboratory_layout.py +++ b/openpilot/starpilot/models/tests/test_laboratory_layout.py @@ -47,13 +47,13 @@ class TestWeakLayout(unittest.TestCase): view = base[2:8] with installed(cache): first = view.uop.buffer.ensure_allocated() - np.testing.assert_array_equal(first.numpy(), np.arange(2, 8, dtype=np.float32)) + np.testing.assert_array_equal(np.frombuffer(first.as_memoryview(), dtype=np.float32), np.arange(2, 8, dtype=np.float32)) storage = base.uop.base.buffer storage.deallocate() storage.allocate(opaque=np.arange(16, dtype=np.float32) + 100) second = view.uop.buffer.ensure_allocated() self.assertIsNot(first, second) - np.testing.assert_array_equal(second.numpy(), np.arange(2, 8, dtype=np.float32) + 100) + np.testing.assert_array_equal(np.frombuffer(second.as_memoryview(), dtype=np.float32), np.arange(2, 8, dtype=np.float32) + 100) def test_noncontiguous_buffers_still_refuse(self): cache = WeakLayoutMemo(ORIGINAL) diff --git a/openpilot/starpilot/models/tests/test_laboratory_replay.py b/openpilot/starpilot/models/tests/test_laboratory_replay.py index 683c7758af..900ffa3591 100644 --- a/openpilot/starpilot/models/tests/test_laboratory_replay.py +++ b/openpilot/starpilot/models/tests/test_laboratory_replay.py @@ -183,7 +183,10 @@ class TestAdmittedReplay(unittest.TestCase): def test_replaced_capture_linear_invalidates_bindings(self): x, jit, replay = self.ready() from tinygrad.engine import jit as module - jit.captured._linear = jit.captured._linear.replace(tag='replacement') + original = jit.captured._linear + jit.captured._linear = original.replace(src=(*original.src, *original.src)) + self.assertIsNot(jit.captured._linear, original) + jit.captured.__dict__.pop('linear', None) with patch.object(module, '_prepare_jit_inputs', wraps=module._prepare_jit_inputs) as prepare: np.testing.assert_array_equal(replay(x=x).numpy(), np.arange(8) + 1) self.assertGreaterEqual(prepare.call_count, 1) diff --git a/prebuilt.json b/prebuilt.json index 9c27a8da36..f9d349b715 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "937dc2b7cfa4df121866fa9c428c3fd1d6b6a23e93dab766a924e812dac67bc8", "schema_version": 1} +{"protected_inventory_sha256": "658cfbe1c701ab044b6c283f88aa5af931ceeda63ef3858648da08971aeede85", "schema_version": 1}