Skip to content

feat(config): embed MCU→VID heuristic so null-vid boards resolve offline (#959)#1012

Merged
zackees merged 1 commit into
mainfrom
fix/959-buildtime-vid-embedding
Jul 9, 2026
Merged

feat(config): embed MCU→VID heuristic so null-vid boards resolve offline (#959)#1012
zackees merged 1 commit into
mainfrom
fix/959-buildtime-vid-embedding

Conversation

@zackees

@zackees zackees commented Jul 9, 2026

Copy link
Copy Markdown
Member

Fixes #959.

Problem

Six boards with null build.vid/build.pid (esp32-c3-devkitm-1, esp32-c6-devkitc-1, esp32-p4-evboard, esp32doit-devkit-v1, uno_r4_wifi, lpc845brk) resolved a USB VID only via the online-data mcu_to_vid pipeline fetched at runtime. That online fallback (flagged in PR #925, which had to drop all six from the static freeze test) breaks offline / air-gapped / CI resolution.

Fix

Ingest the mapping at build time: include_str! the in-repo seed (online-data-tools/seed_mcu_to_vid.json — the same table the online pipeline publishes) into fbuild-config and apply the pipeline's exact rule (family == mcu OR mcu LIKE family%, highest score wins). Single source of truth; no network.

  • board::mcu_vid::vid_for_mcu() — offline lookup.
  • BoardConfig::resolved_vid() — explicit build.vid, else the heuristic. Resolution/display only — does not feed -DUSB_VID, so no board's compiled output changes.
  • issue_959_null_vid_boards_resolve_via_embedded_mcu_heuristic pins all six resolving offline.

Verified locally

soldr cargo test -p fbuild-config --lib185 passed / 0 failed (5 new). clippy + fmt clean.

🤖 Generated with Claude Code

…ine (#959)

Boards whose PlatformIO JSON carries no `build.vid`/`build.pid` (native-USB
SoCs — ESP32-C6, LPC845-BRK, UNO R4 / RA4M1, plain ESP32) previously resolved
a VID only via the `online-data` `mcu_to_vid` pipeline fetched over the network
at runtime. That online fallback made offline / air-gapped / CI resolution
impossible for those boards (PR #925 had to drop all six from the static
`FIRST_PARTY_VID_PID_ROWS` freeze test for exactly this reason).

Bake the same curated MCU-family→VID table (`online-data-tools/seed_mcu_to_vid.json`,
the seed the online pipeline publishes from) into the binary via `include_str!`,
and apply the same match rule the pipeline's SQLite view uses
(`family == mcu OR mcu LIKE family%`, highest score wins). Single source of
truth — one JSON feeds both the online publish and the embedded copy.

- `board::mcu_vid::vid_for_mcu()` — the offline lookup.
- `BoardConfig::resolved_vid()` — explicit `build.vid`, else the heuristic.
  Resolution/display only; deliberately does NOT feed `-DUSB_VID`, so no
  board's compiled output changes.
- New `issue_959_null_vid_boards_resolve_via_embedded_mcu_heuristic` freeze
  test pins all six boards resolving offline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 22 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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 reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

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, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1de4cc20-e585-4f7c-95fd-bd78d6479df4

📥 Commits

Reviewing files that changed from the base of the PR and between 9b72690 and 694c0ab.

📒 Files selected for processing (4)
  • crates/fbuild-config/src/board/mcu_vid.rs
  • crates/fbuild-config/src/board/methods.rs
  • crates/fbuild-config/src/board/mod.rs
  • crates/fbuild-config/src/board/tests_common_board_vidpid.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/959-buildtime-vid-embedding

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.

@zackees
zackees merged commit 5aebf62 into main Jul 9, 2026
88 of 93 checks passed
@zackees
zackees deleted the fix/959-buildtime-vid-embedding branch July 9, 2026 19:28
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 10, 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.

follow up all known vids needs built in embedding

1 participant