Skip to content

Assign PIDs in aligned blocks of 16 - #4

Merged
mrpollo merged 2 commits into
mainfrom
block-allocation-policy
Aug 27, 2026
Merged

Assign PIDs in aligned blocks of 16#4
mrpollo merged 2 commits into
mainfrom
block-allocation-policy

Conversation

@mrpollo

@mrpollo mrpollo commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Replaces the "pick the lowest free PID" policy with per-manufacturer block allocation. The allocation unit is now an aligned block of 16 PIDs, 0xNNN0-0xNNNF, claimed in a new blocks list on each manufacturer. Every PID a vendor is assigned has to fall inside one of their blocks.

Blocks are nibble-aligned so a vendor's entire product line matches a single glob: 003? in a udev rule, 3643:003 in a log grep, one row in a table instead of five entries scattered across the range. There are 4,096 blocks under 0x3643 and five manufacturers registered so far, so the space cannot realistically exhaust. The sequential-single habit was costing us that property, not address space. Claim a block when you have hardware to name, and another one when the first fills up; no speculative reservations.

Nothing moves. No pid, board or date value changes anywhere in this diff, because those are burned into hardware that is already shipping. Both new fields are additive, which matters because PX4-Autopilot CI, including release branches carrying older copies of check_usb_ids.py, fetches usb-ids.yaml from main at check time. Older checkers ignore blocks and legacy and keep working exactly as before.

Manufacturer Assigned PID After this PR
PX4/Dronecode 0x001D block 0x0010-0x001F, which already contained it
ZeroOne 0x15E0 block 0x15E0-0x15EF, which already contained it
NewBeeDrone 0x0050 block 0x0050-0x005F, which already contained it
Syro 0x0001 legacy: true, frozen, no block
Agam Robotics 0x0002, 0x0003 legacy: true, frozen, no block

Three of the five already sat inside a clean block and simply declare it. Syro and Agam are in the interleaved low range where no clean block exists, so they are grandfathered with legacy: true: exempt from block containment, frozen in place, still globally unique. Since no manufacturer may claim a block holding another vendor's PID, 0x0000-0x000F is now permanently unclaimable, which is the right outcome for a range holding three assignments split across two unrelated companies.

@mrpollo
mrpollo marked this pull request as ready for review August 27, 2026 16:18
Vendors were taking sequential single PIDs (0x0001, 0x0002, 0x0003),
interleaving unrelated manufacturers across the low range. The allocation
unit is now an aligned block of 16, 0xNNN0-0xNNNF, claimed in a new
per-manufacturer `blocks` list; every PID a vendor is assigned has to fall
inside one of their blocks.

Existing assignments do not move. PX4, ZeroOne and NewBeeDrone simply
declare the block that already contains their PID. Syro's 0x0001 and
Agam's 0x0002 and 0x0003 sit in the interleaved low range where no clean
block exists, so they carry a new `legacy: true` flag: exempt from
containment, frozen in place, still globally unique. No manufacturer may
claim a block holding another vendor's PID, which permanently freezes
0x0000-0x000F.

`legacy` is maintainer-set only. It is valid solely for the PIDs named in
LEGACY_PIDS, and only on entries dated before 2026-09-01, so a request
cannot grant itself the exemption without editing this validator.

Both fields are additive, so deployed PX4-Autopilot checkers that fetch
usb-ids.yaml from main keep working unchanged.
The README, the PR checklist and the issue form all still told requesters
to pick the lowest free PID. They now describe claiming an aligned 16-PID
block, with a reminder that PID values are hexadecimal: after "0x0039"
comes "0x003A", not "0x0040". The sequential-single habit came partly from
reading the list as decimal.

CODEOWNERS puts the registry and its validator under maintainer review.
It stays advisory until main has branch protection with "Require review
from Code Owners" enabled.
@mrpollo
mrpollo force-pushed the block-allocation-policy branch from 6f7bc28 to f27c802 Compare August 27, 2026 16:21
@mrpollo
mrpollo merged commit 20fa814 into main Aug 27, 2026
1 check passed
@mrpollo mrpollo mentioned this pull request Aug 27, 2026
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.

1 participant