Skip to content

Clarify the scope of little-endian byte ordering - #233

Open
glopesdev wants to merge 1 commit into
mainfrom
dev/payload-byte-order
Open

glopesdev wants to merge 1 commit into
mainfrom
dev/payload-byte-order

Conversation

@glopesdev

Copy link
Copy Markdown
Collaborator

Narrows the byte-ordering note in the binary protocol. The note says only that the protocol uses little-endian byte ordering. It does not say whether the rule applies to each value, or to the payload as a whole. The two readings differ when a payload carries an array.

For an array of U8 values the rule has no content, because a single byte has no byte order. A restatement of the rule on such a register can therefore only mean that the array itself is reversed. This already produced one error. R_UID was described as a 128-bit little-endian value, which #225 corrected. INTERFACE_HASH in R_VERSION still carried the same sentence.

The note now applies the rule to each multi-byte value, and says that it does not reorder the values of an array. The array parsing section gives the index order directly. This also removes the byte-order sentence from INTERFACE_HASH. The register layout diagram positions the 20 digest bytes, as it does for every other field of R_VERSION.

Also clarified the diagram conventions. A register that holds a single value is indexed by bit, and drawn most significant first. A register that holds a sequence of fields is indexed by byte, and drawn from byte 0.

The R_OPERATION_CTRL diagram is a separate fix. A blank line between the code fence and the frontmatter stopped GitHub from rendering it. The gantt parser received the frontmatter as diagram content.

State that the byte ordering rule applies to each multi-byte value
individually and does not reorder the values of a payload containing
an array, and give the array order directly in the parsing section.
Remove the byte-order sentence from INTERFACE_HASH, leaving the
digest bytes positioned by the R_VERSION layout diagram like every
other field.

Distinguish the two register layout diagram conventions by what they
index, bit for a register holding a single value and byte for one
holding a sequence of fields. Fix the R_OPERATION_CTRL frontmatter so
the diagram renders again.
@glopesdev
glopesdev requested a review from a team September 16, 2026 22:00
@glopesdev glopesdev added the fix Pull request that fixes an issue label Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull request that fixes an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant