Skip to content

239. Two constants in the composer were per config, and the second one blocks phase 9

Phase 9 of docs/adding-a-device.md is one command: put an appliance from Logitech's catalogue on the spare Harmony One, press its button, watch the appliance answer. The composition it uses was built and proved in phases 6 and 7 against one configuration, one_config, and running it against a second one for the first time refuted two things it had been carrying as constants.

The device mode marker is a different variable in every configuration

A device list row is three instructions: beep, enter the device's mode, and write 1 into the state variable that marks the remote as being in device mode. The composer wrote 0x98, which is 0x80 | 24, because that is what one_config writes.

It is 24 in exactly one of the fourteen configurations here that carry a device list.

marker
one_config 24
the spare's own configuration, 30 August 25
the compile before it 26
the two calibration configs and the phase 7 pair 27
the spare before its first sync, and one_config_unprogrammed 30
the spare after that sync 31
the three protocol campaign compiles 31, 32, 33

Eight distinct values, and the same remote's two reads either side of one sync differ by one, so this is not even stable per unit. The variable is unnamed in the name tree in all fourteen, so there is nothing to look it up by, and its offset from CurrentActivityState is not constant either: 20 plus 4 on one_config and 20 plus 5 on the spare.

What is stable is that a configuration's own rows all write the same one. So deviceModeMarker takes the majority over every row shaped list, which is a reading off the file rather than a number carried in the code. With the constant in place the spare's configuration reported that it had no device list at all, which is the failure mode worth naming: a hardcoded operand does not report a mismatch, it reports an absence.

The device list is one layout, three rows to a page, and a page is chosen by its hit map

Corrected in place on 1 September 2026, the same day it was written, after Danny said he had never seen the device list change shape. He was right and the first version of this section was wrong. It said the device list had two layout families and that seven devices is where it switches, on the strength of one_config using lead bytes 12 and 13 where the fifteen device compiles use 4 and 5.

The lead byte is a zero based index into that configuration's own hit map table, section 125. So 12 in one file and 4 in another are indices into different tables and were never comparable. Every one of those pages offers the same six areas, 48, 49, 50, 51, 46, 47: three device rows on the lowest scans, then the left of the two buttons below the display, then the two rectangles either side of it. This said the fourth was the page flip until section 275 corrected it: a Harmony One turns a list's pages with the two buttons beside the display, no page binds those, and the fourth rectangle runs opcode 0x72, a state value lookup.

There is one layout. A device list page binds exactly its hit page's area count minus three, on every device list page of every arch 12 configuration here, and a menu's pages are full except the last:

pages
one device 1
three devices 3
four devices 3, 1
five devices 3, 2
six devices 3, 3
nine devices 3, 3, 3, 1
fifteen devices 3, 3, 3, 3, 3

So a partly filled page is a smaller hit page rather than a different design, and a seventh device on the spare Harmony One is a third page holding one row. That is a much smaller job than the relayout this section first claimed, and the spare's configuration already carries hit pages offering the one row set, so the third page reuses one exactly as the device's own page reuses the six slot layout.

A third constant went the same way as the marker. The composer matched a menu's last page with lead === 13 and stamped lead = 12 on it, which is one_config's two row and three row hit pages. Those indices are per config too: the spare's three row page is 12 by coincidence and its two row pages are 15, 16, 17 and more. A page is matched on the areas its hit page offers now, and the page it becomes is taken from the same menu's own earlier page, since a configuration carries several hit pages offering the three row set and a search finds one of them rather than the one this menu is drawn against.

What this says about the method

All three defects are the same shape and none could have been found by more care on one sample. The composer's own docstring says it is "calibrated on a config with five", which was honest and was read as a note about the device count when it was also a note about every operand in the file. A constant lifted from one configuration is a hypothesis about all of them, and the corpus is what tests it: the marker table above took one pass over fourteen containers.

And the correction has a second lesson, which is about the reply rather than the code. The layout claim was reported to Danny before it had a test, and he refuted it from having used these remotes for years. What made it wrong was comparing a number across two files without asking what the number indexes, which is this repository's own oldest trap in a new place: docs/config-format.md says a group index is not portable between architectures and a mode page's hit index is not portable between configurations for the same reason. The measurement that settles it, rows against hit page areas, is one line and was not run.

What would falsify it

A Harmony One configuration whose device list rows write two different variables, which would make the majority the wrong reading. Or a mode page whose lead byte goes with a row count the table above does not give it.

Where it lands

  • deviceModeMarker, in packages/codec/src/compose.ts when this was written and in inventory.ts since section 240 made the inventory its second caller, and the refusal beside the composer.
  • packages/codec/bin/compose-device.ts, which is phase 9's tool: a device out of the catalogue into a configuration, with every reader check and the erase block count printed.
  • packages/codec/test/compose.test.ts: the marker table, the lead table, and the refusal that proves the spare gets past the marker and stops at the layout.

Section 238 | the archive | section 240. Section 239 of the findings archive, which is frozen; the reference holds the current answer. The archive on GitHub.