147. What a length change moves, counted: 140272 addresses, and growth has a price per place¶
edit.ts refuses to change the length of anything, and its docstring gives the reason as a list of
consequences: a picture's position is implied by everything before it, base slot 15's group lengths
are demanded by the firmware, a relocation moves everything above it. Those were true and none of
them was a number. This is the survey, made on 21 August 2026, and it is a read only instrument:
packages/codec/src/growth.ts, make growth, packages/codec/test/growth.test.ts.
Nothing here writes to a remote, and nothing here changes a container. Two tests build a modified copy in memory because a control has to.
The two populations, and the difference is the whole point¶
A position in a container is either stated, meaning some field holds its flash address, or implied, meaning nothing does. A stated position is mechanical: a relocation rewrites the field. An implied one cannot be rewritten and cannot be checked, so getting it wrong produces a file that parses and means something else.
The implied set is derived rather than listed, which is what makes it exhaustive. Every claim
coverage.ts makes is a structure this codec can see; every entry in the census is an address this
codec can read; a claim whose start no address names is implied by construction. A reader added
tomorrow therefore joins one population or the other without anybody deciding, and IMPLIED_BY has
to say why nothing states it, per owner, or the report names the owner as unexplained.
Corpus wide, over the nineteen containers and 10242346 bytes:
| count | |
|---|---|
| addresses stated | 140272 |
| of those, naming flash outside the container | 38, two per container, base slot 2's log area |
| of those, landing inside a structure rather than on its first byte | 16740 |
| addresses named by more than one field | 18751 |
| implied positions | 71267 |
The 71267 break into three kinds, and they cost different things:
| kind | count | what places it |
|---|---|---|
| frame | 76 | the container's own arithmetic: the header, the section table, the end marker, the trailer. Four per container and nothing a writer can get wrong |
| packed | 3017 | it sits immediately after a structure of a different kind. 3005 are section 69's mode page list copies, 12 are base slot 15's group 9 continuation, section 103 |
| chain | 68174 | the byte after the previous element of a run. 68172 are screen program instructions and 2 are the arch 9 (Harmony 525) safe mode pictures nothing addresses |
The frame count is exactly four per container, and the key table is deliberately not among them: it looks like a fifth, because nothing points at the four bytes after the end marker, and it is base slot 6's first mode record, section 52, so the mode table names it like any other mode.
Growth has no price. It has a price per place¶
The cost of making room at an offset is the number of addresses naming something at or above it, and that is monotonic in the offset, so "how expensive is a length change" has no answer and "where is it cheap" has one. Three places, per container, as pointer rewrites:
| at the first byte of content | at the bottom of the picture bank | just below the trailer | |
|---|---|---|---|
one_config (arch 12) |
12043 | 1091 | 0 |
h600_config (arch 14) |
17435 | 501 | 0 |
h700_config (arch 14) |
27102 | 893 | 0 |
h525_config (arch 9) |
4808 | 1114 | 0 |
arch8_config_a (arch 8) |
5505 | 980 | 0 |
h525_safemode_ahcm (arch 9) |
951 | 344 | 0 |
The first column is an identity rather than a measurement: it is the container's address count less two, on all nineteen, because the only addresses that do not name something above the first content byte are base slot 2's pair naming flash above the container.
The third column is the finding. Appending to a container costs no pointer rewrites at all, on all nineteen, because the picture bank is the last thing in it and the only implied position above the insertion point is the trailer. So a new picture, or a longer last picture, needs the two restamped header fields and nothing else. Growth in the middle needs thousands.
The fields a growth makes wrong on its own¶
Three, before anything has moved:
end_addr, theu32at offset 4. It names the end marker's own address, which is the flash base plus the length less four, exactly, on all nineteen containers. That is also why deriving the container's base back out of it is circular, section 117: the check tests the assumption it was computed from.- the trailer checksum, section 41, which any change voids and which a writer restamps in two bytes of arithmetic. It is the only check the remote makes.
- the end marker's position,
0x0Bplus four times the pointer count. It moves with the number of slots, which is per architecture, so a growth never touches it. Listed to say so.
Base slot 3's timestamp and base slot 13's clock records are not here. They are wrong because
time passed rather than because the file got longer, and FIELD_RULES in edit.ts is their table.
Five hazards that are not counts¶
Sharing. 18751 addresses are named by more than one field, and editing what sits at one changes
several meanings. The shapes: 15507 are a screen program named both by base slot 11's table and by a
base slot 14 record, so moving one program rewrites two fields in different sections; 2008 are a
program named by several jumps or switch arms, and one address in h525_config is named 472 times;
788 are a touch area named by its page and by its own back pointer; 431 are section 61's shared
infrared duration blocks.
Interior addresses. 16740 of the 140234 inward addresses land inside a structure rather than on
its first byte, so they need the containing structure's new address plus an offset. There are exactly
two families and both are mechanical: 13353 are section 121's shared glyph runs, where opcode 4
names the payload of an opcode 5 instruction in another program, and 3387 are an infrared group's
record pointers, which land IR_RECORD_POINTER_BIAS bytes into their record, seven, asserted rather
than assumed.
The checksum is blind to this. A control in growth.test.ts moves one action list pointer by
three bytes, restamps the trailer the way a writer would, and the container parses, passes every
check it makes about itself, and reads a different action list. Nothing in the format validates an
address, which is the same hazard as section 117's wrong base and section 122's damaged read: a wrong
address does not error, it reads the neighbouring bytes.
The copy nothing reads. Every mode page's tagged list has a second copy whose position is implied, section 69, and nothing on the remote reads it. So an emitter that omitted it, or placed it wrongly, passes every check the remote makes.
Lengths the firmware demands. Base slot 15's group lengths and entry count are not free, section 44: a group whose length differs is silently replaced by compiled in defaults, and a different entry count is a silent no-op. So those two structures cannot grow at all, whatever the addressing says.
What the emitter can and cannot do today¶
coverage.ts says which structure owns a byte and emit.ts says whether that structure can be
written back from typed fields, so the two together say which addresses a relocation could rewrite.
Every one of the 140272 sits inside a rebuild, in every container, so there is no address in a
region no rebuilder reaches.
Four rebuilds carry bytes they do not frame, and only one of them carries its own addresses. Base
slot 5's headers, base slot 7's font sets and base slot 14's records each write their addresses with
a u24 and carry a different byte. Screen programs frame the opcode and carry every operand, so
the 33660 addresses inside a screen instruction are the whole of the framing work a relocation would
need and today's emitter does not do. That is one item, not a programme.
What could not be settled¶
- Whether there is room to grow. A container's
end_addrsays where it ends and nothing in it says where the flash region ends. That bound is apackages/usbquestion,WRITE_FLASH's region per architecture, and the ceiling on arch 12 is0x3D0000rather than0x400000because the stored application firmware sits inside the nominally writable region. - Whether a remote validates anything a growth would break. The trailer checksum is what the boot validator computes, section 41, and no other check is read. Absence of evidence: the firmware was not re-read for this survey.
- Screen opcodes 1 and 21. Six operand bytes and four, and neither is known to hold an address. They are not in the census, so if either does the count is low by however many there are.
- Where opcode 3 draws. Section 146, and it does not affect the census: the address is a picture wherever it is drawn.
- The two byte bias. Base slot 17 names the picture bank two bytes in front of it on arch 8, 9 and 14, section 62, and what those two bytes are for is unread. A relocation has to reproduce the bias rather than the address.
- Whether growth is the right route at all. Section 66's other finding stands: three arch 8 configs generated ten minutes apart differ in 73 to 84% of their bytes, so an editor makes minimal diffs against an existing config and reproducing what Logitech's generator would have emitted is not achievable. A relocation is for changing a config, not for matching one.
Section 146 | the archive | section 148. Section 147 of the findings archive, which is frozen; the reference holds the current answer. The archive on GitHub.