feat(usb): switch online overlay schema to nested per-VID shape#717
Conversation
`data/usb-vid.json` on the `online-data` branch changes from the
previous flat
{"VVVV:PPPP": {"vendor": ..., "product": ...}}
to a nested per-VID shape with `products` as a list of `[pid, name]`
tuples:
{
"VVVV": {
"vendor": "...",
"products": [
["PPPP", "..."],
["PPPP", "..."]
]
}
}
Reasons:
- The vendor name was duplicated across every product entry under a
given VID in the old format. With ~20k products and ~2k vendors,
that's a lot of redundant strings — the new payload is ~1.5 MB
vs ~2.0 MB (-25%).
- Many real lookups don't need the per-PID granularity; consumers
can grab `["VVVV"].vendor` directly without iterating products.
Internally the resolver still flattens into the same `HashMap<u32,
UsbInfo>` keyed by `(vid << 16) | pid` for O(1) `(vid, pid)` lookup —
no behavior change for callers. New `VendorEntry` Deserialize struct
parses the on-disk shape; updated tests cover the round-trip.
The `online-data` branch will be orphaned + reseeded with the new
shape in a separate operation (the previous flat data can't be
merged with the new shape — it would need a schema-aware
transformation), so consumers should not see a transitional
half-and-half manifest at any point.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 43 minutes and 38 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
data/usb-vid.jsonon theonline-databranch changes from the previous flat{VVVV:PPPP -> {vendor, product}}shape to a nested per-VID shape withproductsas a list of[pid, name]tuples:{ "0403": { "vendor": "Future Technology Devices International, Ltd", "products": [ ["6001", "FT232 Serial (UART) IC"], ["6010", "FT2232C/D/H Dual UART/FIFO IC"] ] } }Why: vendor name was duplicated 20k× under the old shape (one per product). New payload is ~1.5 MB vs ~2.0 MB (-25%) with the same information density.
Internally the resolver still flattens into the same
HashMap<u32, UsbInfo>for O(1)(vid, pid)lookup — no behavior change for callers.The
online-databranch will be orphaned and reseeded with the new shape in a separate operation (the previous flat data can't be transparently merged with the new shape).Test plan
soldr cargo test -p fbuild-core usb— 10/10 pass (new format round-trip + missing-products + bad-json + missing-file)workflow_dispatchof update-data confirms the new shape lands and the resolver's tier-2 still works🤖 Generated with Claude Code