Repository navigation
Description
What the unit does when you connect
When a client connects, the Quad Cortex says nothing about its current state at first. About nine or ten seconds after the handshake, it sends all of it at once: which preset is loaded, which scene is active, whether that preset has unsaved edits, and where it sits in the setlist. The whole lot arrives inside about ten milliseconds.
The repo calls that one delivery the "connect burst". The model layer listens for it and fills its cache from it, which is what makes the first read free: by the time you ask which preset is loaded, the answer is usually already there and nothing goes to the device.
What fails
Two hardware tests check that the cache really did get filled:
tests/hardware/test_model_state.py::test_the_connect_burst_warms_the_cachetests/hardware/test_preset_surface.py::test_the_burst_delivered_every_entry_the_preset_surface_reads
Both fail now and then with this:
AssertionError: the burst delivered nothing for preset
assert {}
That means the cache slot for the loaded preset was still empty when the test looked. The unit's serial number and firmware WERE in the cache, because connect() reads those before the handshake. Only the four state entries were missing: preset, scene, dirty and loaded.
It is not caused by a code change
I saw this on 2026-09-09 on the branch docs/operation-coverage-per-profile. That branch changes thirteen lines of Markdown in docs/protocol.md and nothing else, so it cannot affect what the unit sends.
- First full run on that commit: 2 failed, 93 passed.
- The same two tests on unmodified
main: both pass. - The same two tests again on the same commit: both pass, twice.
- Second full run on the same commit: 95 passed, 0 failed.
Same unit and same session throughout: Quad Cortex, CorOS 4.0.1, app_fw d14e.
Why it is awkward to fix
The test cannot tell two different things apart. Either the unit never sent its state, or it sent it after the test stopped waiting. Both look identical from where the test stands.
The tests are right to assert that something arrived. The docstring says so plainly: the assertion exists "to keep this from passing on a run where the burst delivered nothing at all." Without it, a run where nothing arrived would look like a pass. So the assertion should stay.
What could change is how the test waits. Right now it waits a fixed length of time and then checks. If it instead waited for the four entries to fill, with a deadline, a slow delivery would pass and a genuinely missing one would still fail. That separates the two cases.
If it turns out the unit sometimes really does send nothing, that is a fact about the device and belongs in docs/protocol.md. It is not a number to loosen until the test stops complaining.
What I did not check
The failures came straight after four create_local_backup calls and two full hardware suite runs, so the unit had been working hard. I did not test whether that is related. Worth trying a cold connect before changing the test.
Not blocking anything
Both pull requests open today, #47 and #56, have a clean full hardware run recorded on their final commit.
Activity
[-]Two hardware tests depend on the connect burst arriving, and it sometimes does not[/-][+]Two hardware tests fail when the unit is slow to send its state after connecting[/+]