Record that no overlay app runs: the copy lands, the jump never happens

Measured by polling the PC over QMP every 30 ms, finer than the model's own 100 ms probe. After launching Tetris the overlay at 0x20000280 holds Tetris's code byte for byte, so the loader's copy is correct and aligned; the earlier claim in this session that it was shifted by one byte was my own parsing dropping the first value. But 172 PC samples over 4.5 s and 64 more over 2 s were all inside firmware flash at 0x08013260, a wait loop, and none landed in the overlay. A 16-byte app that calls nothing behaves identically, and Breakout's header is field-for-field the shape of ours, so neither the app's code nor its header is the reason. The failure is upstream of the app, which makes the earlier 'Tetris runs' note stale: per this file's own rule it is treated as unverified until it reproduces.

Also carries the CI-fix branch merge and a regression test for _edit_flash creating its working-copy directory (its fixture image has to be a real size: slot 0 sits at 0x102000).
This commit is contained in:
mckero committed 2026-10-02 09:45:33 +08:00
1 parent c0c2c3230e
commit fa0f4e7f23
3 files changed
+70

No files matched your search

+28
View File
@@ -8,6 +8,7 @@ import subprocess
import tempfile
import time
import unittest
from unittest import mock
import uvk5_image
# Flask is the one thing the fast suite needs from pip, so it is not always there.
@@ -1167,3 +1168,30 @@ class TestAppsFrontEnd(unittest.TestCase):
self.assertNotIn("navigator.serial", self.page)
self.assertNotIn("getUserMedia", self.page)
self.assertNotIn("AudioContext", self.page)
class TestWorkingCopyDirectory(unittest.TestCase):
"""_edit_flash must create its working-copy directory, not assume it exists.
On the machine this was written on work/firmware/ already existed, so the missing
makedirs() was invisible; a fresh checkout (CI) fails with FileNotFoundError on the
first install. Found by the copilot/fix-github-actions-unit-job branch.
"""
def test_the_working_copy_directory_is_created(self):
directory = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, directory, True)
flash = os.path.join(directory, "flash.img")
with open(flash, "wb") as fh:
fh.write(b"\xff" * (2 * 1024 * 1024))
slot = FlashSlot(flash)
missing = os.path.join(directory, "not", "created", "yet")
app = webui.create_app(None, frame_addr=0x1000, status_addr=0x2000, flash=slot)
with mock.patch.object(webui, "upload_dir", return_value=missing):
client = app.test_client()
import uvk5_apps
blob = uvk5_apps.build(b"\x01" * 32, "Beam", "1.0")
r = client.post("/api/apps/0", data=blob)
self.assertEqual(r.status_code, 200, r.get_data(as_text=True)[:200])
self.assertTrue(os.path.isdir(missing), "the working-copy directory was not created")
self.assertTrue(os.path.exists(os.path.join(missing, "flash-current.img")))