Skip to content

121. The commoner text opcode points at another program's string, and it names the activities

Section 120 gets from a key to an activity. What was still missing is the other end: which of the strings a page draws is that activity's name. Chasing it turned up something larger, which is that two thirds of a config's drawn text had never been read at all, and the reason nobody noticed is instructive.

Opcode 4 draws a string that lives somewhere else

docs/config-format.md has recorded since section 40 that screen opcode 4 is "2 position bytes, u24, draw the glyph string at that address". Nothing followed the pointer. screenStrings, drawnCodes and textCoverage all read opcode 5, the inline form, and ignored opcode 4 entirely.

It is the commoner of the two by two to one. Across the corpus:

opcode 4 instructions distinct targets
h700_config 1800 265
one_config 1701 225
h525_config 1053 179
arch8_config_c 986 208
h600_config 880 201
h525_safemode_ahcm 117 56
h600_safemode_gspm 9 5

12052 in total. The closure is that there is no exception: every one of them lands on the glyph payload of an opcode 5 instruction somewhere in another reachable program, three bytes past that instruction's start. So a string is stored once, inline, by whichever program draws it that way, and every other program that wants it names those bytes. The distinct target count against the instruction count is the same fact from the other side: one_config draws 1701 referenced strings out of 225 stored ones.

Why nobody noticed is the part worth keeping. The byte accounting reached 100.0% with zero overlaps on every container, and it did so because the referenced bytes were already claimed, by the base slot 11 program that carries them inline. Nothing was missing, so nothing pointed at the gap. And a comment in packages/codec/src/screen.ts said in as many words that opcode 2 "is the only screen instruction naming a place outside its own program", which is exactly the sentence that would have prompted somebody to check. It is corrected in place.

The consequences for the numbers are large. make text now reads 170922 drawn glyphs where it read 65456 before, and 23419 draws of which 15742 are references. Every sample still reads at 100.0%, which is the check that the reference reading is right rather than merely bigger: 12052 addresses that all resolved to readable text in the container's own alphabet would be an unlikely accident. Two glyphs in the whole corpus remain unread, as before.

Three smaller facts came with it:

  • The run is terminated exactly as opcode 5's is, and a code with bit 7 set takes a second byte. Sharing that rule is not tidiness: since every target is an inline payload, a different terminator here would mean two readings of the same bytes.
  • A referenced run may be empty. Nine references in each arch 8 config name a zero length string, a blank label drawn at a position, and a reader that treated an empty run as a failure would report those as unreadable.
  • The bytes are shared, so a writer that edits a string in place changes every draw that names it. Same family as the shared infrared duration blocks of section 61, and it belongs with the other writer rails.

Which activity a name belongs to

With opcode 4 read, the activity pages come out with as many labels as they have activities, and the attribution follows without any geometry.

An activity's action lists also carry opcode 0x7E, which enters a base slot 6 mode. Those modes' own pages draw the activity's name, because a remote entering an activity says which one it entered. So the page's string that relates to one of those strings is that activity's label.

"Relates to" is containment either way rather than equality, and the Harmony 700 is why. Its menu label is the name plus a qualifier and its splash screen is a verb plus the name, so the two share the name and neither equals it. On the Harmony 600 the relation is exact: the mode's own title is the menu label, and the splash is that title with an eight letter word and a space in front.

Two filters turn a set of candidates into a function, and both were found by having them fail:

  • Chrome. A page's title and footer relate to every activity's modes, because every activity's screens carry the same boilerplate. A key several activities of a page claim is therefore chrome. That alone leaves a page with only one activity holding its own footer as a rival, so the second rule is that a key another activity page of the same mode draws identically is chrome too.
  • One label, one activity, which is a constraint to propagate rather than a preference. On the arch 8 pages two of three activities resolve on their own and the third is then the only claimant left on what the other two gave up.

What counts as one label needed three attempts, and each failure named a real layout. Keying on the row merged arch 8's two columns, which put two activities' labels at one y. Keying on the position split the 525's selected and unselected copies of one label, drawn twice on a row at two x values. The key that works is page, row and text: same row and same text is one label however often it is drawn, and two columns differ because their words do.

That named 23 of the corpus's 35 activities, and arch 14 completely, 13 of 13. Corrected on 12 August 2026, section 124: containment either way is too loose where an activity's chain enters the mode that lists the devices, so a string the modes say exactly beats one they only contain, and a label the menu wraps onto a second row is looked for once nothing on one row resolves. That took the figure to 41 of 50 with arch 8, arch 9 and arch 14 complete, and section 125 finished it: the corpus is 50 of 50 and arch 12 is named from the touch hit map rather than from a string rule at all.

Arch 12 names almost none, and that is a proof

This heading is superseded by section 125 and the argument under it is not. A Harmony One resolves nothing from a string rule where it has more than one activity to tell apart, and the reason is structural rather than a shortfall in the method. The heading here read "Arch 12 names none" until section 124 counted the two single activity configs that do resolve, where there is nothing to tell apart and the filters have no work to do.

Its activity mode does not repeat the name its menu draws. And its scan codes cannot stand in for position, which is demonstrable from one container: the three activity pages of one_config bind activities on scans {50,51,52}, {50,48,49} and {48,49}, while all three draw their labels on the same rows, 57, 111 and 165. If a scan code named a row then code 48 would name one row on page 46 and a different one on page 47, and so would 49. No assignment satisfies both.

So the One needs base slot 17's touch hit map, and section 45 already says why that is the right shape for it: nine page shapes, a rectangle per page carrying the key code a hit reports. The One is the only touch model here, packages/usb/src/models.ts, and it is the only architecture where the scan code is not a physical key. CLAUDE.md's proposed route was therefore right for arch 12 and wrong as a general route, and the correction was right that it is no route at all for a 525.

Section 125 took that route and the One is complete, 11 of 11: the mode page's spare lead byte is the index into base slot 17, so the map is stated by the container and nothing has to be inferred from what the modes say. This subsection stands as the argument for why a string rule cannot do it, which is still true.

The remaining five, four on arch 8 and one on arch 9, failed for a duller reason: a short generic word inside a longer label satisfies containment, leaving two candidates where one is wanted. That diagnosis was right and section 124 acted on it: the longer label is a device's name, every activity's chain reaches the mode that lists the devices, so every activity said it. All five resolve now, and the arch 9 one turned out to be a different problem again, a label wrapped onto a second row.

Where it landed

packages/codec/src/inventory.ts holds activityNames, which returns the activity, its page, its scan codes, the modes it enters and, where it resolves, the label and where on the screen it is drawn. packages/codec/src/text.ts gained referencedStringAddress and glyphRunAt, and screenStrings marks a referenced draw with referencedFrom so a writer can tell a shared string from an owned one.


Section 120 | the archive | section 122. Section 121 of the findings archive, which is frozen; the reference holds the current answer. The archive on GitHub.