Skip to content

docs: a registry of device letters, and a check that every build keeps to it - #1036

Merged
pdfinn merged 3 commits into
masterfrom
docs/device-letters
Nov 1, 2026
Merged

pdfinn merged 3 commits into
masterfrom
docs/device-letters

Conversation

@pdfinn

@pdfinn pdfinn commented Oct 31, 2026

Copy link
Copy Markdown
Member

A kernel finds a device by one character after #, and two devices with one letter in one build leave one of them unreachable. The camera (#1005) took #V on master while the Dis VMs had it on their branch (#944), and nothing noticed until the merge.

docs/DEVICE-LETTERS.md lists every letter with:

  • what it is here, native and/or hosted;
  • what it is in Plan 9 (4th edition), 9front and Inferno, read from every dev*.c Dev table in their sources.

The rules:

  • One letter, one device, in every build.
  • A new device takes its precedent's letter.
  • The letter comes with the device, in the same PR.
  • Where this tree differs from precedent, the difference is written down with its planned move.

The planned moves:

From To Why
#V Dis VMs (branch) #X the camera has #V; #X is 9front's vmx
#b bench #x Inferno's bench; #b is Inferno's dbg
#P prof (hosted) #K kprof in all three; then #P is arch everywhere
#w wmsz (hosted) to be chosen the watchdog's letter in Plan 9 and 9front
#F 2fa (hosted) to be chosen the flash device's letter in all three

Reserved for likely devices: #r RTC, #J I2C, #Q SPI, #$ PCI, #v display out, #W PWM, #N CAN.

tools/devletters.py --check, run by tests/host/devletters_test.sh in CI, reads every native devtab.c and every emulator config. It fails on a letter twice in one build, or on a device whose letter the registry does not give it.

  • On master: 34 letters in use across 20 builds. PASS.
  • Fed the camera moved onto #c: FAIL, "#c is both cons and cam", for each of the three kernels.
  • Fed the camera moved onto an unregistered #q: FAIL.
  • Fed the multi-VM branch: FAIL until it fills in the #X row, which its PR will do.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T5tjh7MFpJjYJnvTT33utv

…s to it

A kernel finds a device by one character, and two in one build leave one
unreachable. The camera (#1005) took #V on master while the Dis VMs had
it on their branch, and nothing noticed until the merge.

docs/DEVICE-LETTERS.md is every letter: what it is here, native or
hosted, and what it is in Plan 9, 9front and Inferno, read from their
Dev tables. The rule: one letter, one device, in every build; precedent
first for a new one; the letter comes with the device, in the same PR.
Where this tree differs from precedent the difference is written down
with its move: the bench to #x, the hosted profiler to #K, wmsz and 2fa
off the watchdog's and flash's letters; and the VMs take #X.

tools/devletters.py --check, run by tests/host/devletters_test.sh in
CI, reads every native devtab.c and emulator config and fails on a
letter twice in one build, or a device whose letter the registry does
not give it. Shown failing on the camera moved onto #c and onto an
unregistered #q, and on the multi-VM branch until it fills in #X.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T5tjh7MFpJjYJnvTT33utv
xxxxxxxxxxxxx and others added 2 commits October 31, 2026 20:19
…#h for wmsz and 2fa

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T5tjh7MFpJjYJnvTT33utv
…check now refuses that

The table's generator created an entry for every letter it looked up,
so letters only the precedents use (g, y, ...) came out "in use" here.
They are "free here". devletters.py fails a row marked in use that
names no device, which would have caught it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T5tjh7MFpJjYJnvTT33utv
pdfinn pushed a commit that referenced this pull request Oct 31, 2026
#J, #Q and #W, the letters the device registry in #1036 reserves for
them; its rows are to be marked in use when that lands. All polled.

Timed on the board: an I2C address byte through a jumper at 10.0us a
bit (the block adds nothing to its counts, so the first values ran at
115kHz); 8192 bytes through SPI's loopback intact at 1 and 10MHz; PWM
at 10ms and 2.5ms to the microsecond at the pin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195u6z8JjsAy9yrE5TqKxzx
@pdfinn
pdfinn merged commit c555177 into master Nov 1, 2026
27 checks passed
@pdfinn
pdfinn deleted the docs/device-letters branch November 1, 2026 01:23
pdfinn pushed a commit that referenced this pull request Nov 1, 2026
…y moved to

devletters.py --check failed on master: #1037 and #1039 moved the
devices and #1036, landing after, had them only as planned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195u6z8JjsAy9yrE5TqKxzx
pdfinn pushed a commit that referenced this pull request Nov 1, 2026
#1037, #1038, #1039 and #1040 merged around the registry (#1036), so
master's devletters_test failed: #K prof, #X vm, #x bench, #z wmsz and
#h tfa were in use and still "reserved" here. Their rows are in use;
#P is arch only; #b, #w and #F are free here, at their precedents'
meanings, #w and #F now reserved for a watchdog and flash. The planned
moves are the moves made.

tools/devletters.py --check: PASS, 36 letters in use across 20 builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T5tjh7MFpJjYJnvTT33utv
(cherry picked from commit d147d1b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants