Skip to content

feat(usb): switch online overlay schema to nested per-VID shape#717

Merged
zackees merged 1 commit into
mainfrom
feat/usb-vid-nested-format
Jun 20, 2026
Merged

feat(usb): switch online overlay schema to nested per-VID shape#717
zackees merged 1 commit into
mainfrom
feat/usb-vid-nested-format

Conversation

@zackees

@zackees zackees commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

data/usb-vid.json on the online-data branch changes from the previous flat {VVVV:PPPP -> {vendor, product}} shape to a nested per-VID shape with products as 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-data branch 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)
  • Local end-to-end pipeline run: 1,942 vendors → 1.49 MB output (vs 20,536 flat entries → 2.0 MB)
  • After admin merge + orphan-reseed: workflow_dispatch of update-data confirms the new shape lands and the resolver's tier-2 still works

🤖 Generated with Claude Code

`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>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@zackees, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 26edad42-3401-4137-9cdf-d81133ea7702

📥 Commits

Reviewing files that changed from the base of the PR and between 74f2bd9 and f8c53ff.

📒 Files selected for processing (1)
  • crates/fbuild-core/src/usb/data.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/usb-vid-nested-format

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees zackees merged commit e80ef6e into main Jun 20, 2026
85 of 91 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant