feat: publish nightly build benchmark#1145
Conversation
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis change adds a shared Arduino Uno Blink fixture, a Rust runner comparing Arduino CLI, PlatformIO, and fbuild build times, generated benchmark artifacts, and scheduled GitHub Actions publication to ChangesBuild Comparison Benchmark
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant benchmark as benchmark job
participant runner as bench-build-comparison
participant stats as benchmark-stats branch
participant publish as publish job
participant pages as GitHub Pages
participant deploy as deploy-pages job
benchmark->>runner: run cold and warm toolchain trials
runner-->>benchmark: write benchmark site snapshot and log
benchmark->>publish: upload benchmark-stats artifact
publish->>stats: force-push generated snapshot
publish->>pages: upload Pages artifact
deploy->>pages: deploy uploaded benchmark site
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
bench/fastled-examples/src/build_comparison.rs (2)
408-421: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a unit test for
remove_dir_within's traversal guard.This is the one path-safety-critical function in the file (guarding against removing a directory outside the repo root), but it has no dedicated test — only exercised indirectly. Worth a direct test covering
target == root, a sibling path outside root, and a valid nested path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bench/fastled-examples/src/build_comparison.rs` around lines 408 - 421, Add a focused unit test for remove_dir_within covering rejection of target == root, rejection of a sibling path outside root, and successful removal of a valid nested directory. Use temporary directories and verify the nested target is removed while guarded paths remain unaffected.
191-357: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winBundle the repeated build-context parameters.
measure_tool,clean_tool, andtimed_buildeach thread the same 6-7 parameters (options,repo_root,project_dir,fbuild,arduino_build_dir,log), forcing#[allow(clippy::too_many_arguments)]onmeasure_tool. Bundling these into a smallBuildContextstruct would remove the lint override and reduce call-site noise.♻️ Sketch of the refactor
+struct BuildContext<'a> { + options: &'a Options, + repo_root: &'a Path, + project_dir: &'a Path, + fbuild: &'a Path, + arduino_build_dir: &'a Path, +} + -fn measure_tool( - kind: ToolKind, - version: &str, - options: &Options, - repo_root: &Path, - project_dir: &Path, - fbuild: &Path, - arduino_build_dir: &Path, - log: &mut File, -) -> AppResult<ToolResult> { +fn measure_tool(kind: ToolKind, version: &str, ctx: &BuildContext, log: &mut File) -> AppResult<ToolResult> {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bench/fastled-examples/src/build_comparison.rs` around lines 191 - 357, Introduce a small BuildContext struct containing options, repo_root, project_dir, fbuild, arduino_build_dir, and log, then update measure_tool, clean_tool, and timed_build to accept and access this context instead of threading the individual parameters. Adjust all call sites accordingly and remove the #[allow(clippy::too_many_arguments)] override from measure_tool.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/benchmark-build-comparison.yml:
- Line 36: Update the actions/checkout step in the benchmark build comparison
workflow to set persist-credentials to false. Leave the existing checkout
configuration unchanged otherwise.
- Around line 139-146: Update the publish job’s if condition to compare
github.ref against the literal default branch reference refs/heads/main, while
retaining the successful benchmark requirement. Remove the dependency on
github.event.repository.default_branch for the scheduled publish gate.
In `@bench/blink/platformio.ini`:
- Around line 1-7: The benchmark currently pins only the PlatformIO board
platform, not the Arduino AVR core used by the comparison build. In
bench/blink/platformio.ini, align platform_packages/framework-arduino-avr with
the core revision from arduino:avr@1.8.8; alternatively, update
bench/blink/README.md to soften its “exact same target” claim if exact core
alignment is not possible.
---
Nitpick comments:
In `@bench/fastled-examples/src/build_comparison.rs`:
- Around line 408-421: Add a focused unit test for remove_dir_within covering
rejection of target == root, rejection of a sibling path outside root, and
successful removal of a valid nested directory. Use temporary directories and
verify the nested target is removed while guarded paths remain unaffected.
- Around line 191-357: Introduce a small BuildContext struct containing options,
repo_root, project_dir, fbuild, arduino_build_dir, and log, then update
measure_tool, clean_tool, and timed_build to accept and access this context
instead of threading the individual parameters. Adjust all call sites
accordingly and remove the #[allow(clippy::too_many_arguments)] override from
measure_tool.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 201f395c-45b7-4195-8044-f98680039bb4
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (11)
.github/workflows/README.md.github/workflows/benchmark-build-comparison.yml.gitignoreREADME.mdbench/README.mdbench/blink/README.mdbench/blink/blink.inobench/blink/platformio.inibench/fastled-examples/Cargo.tomlbench/fastled-examples/src/README.mdbench/fastled-examples/src/build_comparison.rs
… gate The Formatting and Check workflows have been red on main since #1145: - four files (two from this branch, two pre-existing: board/loaders.rs, ch32v_core.rs) carry diffs under the pinned 1.94.1 formatter. Local cargo-fmt --all silently skips the daemon handler files on this checkout, so they were formatted with direct invocations. - the #1150 health-classification helpers in fbuild-serial have no non-Windows, non-test caller, which RUSTFLAGS=-D warnings promotes to a hard error on the ubuntu/macos Check jobs. Annotate them cfg_attr(not(windows), allow(dead_code)) — they are fed by the Windows PnP enumeration and unit-tested cross-platform. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…quisition (#1153) * fix(rp2040): consume Windows port health in deploy selection and reacquisition A retained CM_PROB_PHANTOM devnode whose serial still matches the board could be selected pre-flash, touched at 1200 baud, and returned as the post-flash deploy port. Health from #1146/#1150 now gates every step: - rp2040_target: select_cdc_candidate returns a health-eligible PicoCdcPort (phantom/present-problem records are never selected); resolve_requested_runtime_target fails an explicit selector that matches a known-unhealthy record, with health/problem/instance detail - rp2040: the post-flash wait adds a bounded openability probe seam; timeout diagnostics carry the last open error and phantom-aware BOOT/RESET recovery guidance; Deployer::owns_post_flash_port_discovery marks the RP2040 port as authoritative - daemon: recovery/monitor port resolution no longer substitutes the requested pre-flash name when the deployer owns port discovery (deploy_port_str.or(result.port) inverted the trust order); flash success with an unrecovered CDC now surfaces the deployer's recovery diagnostic instead of discarding it; choose_deploy_port partitions known-unhealthy RP2040 records out of auto-selection with a diagnostic warning Closes #1147 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ci): satisfy pinned formatter tree-wide and non-Windows dead-code gate The Formatting and Check workflows have been red on main since #1145: - four files (two from this branch, two pre-existing: board/loaders.rs, ch32v_core.rs) carry diffs under the pinned 1.94.1 formatter. Local cargo-fmt --all silently skips the daemon handler files on this checkout, so they were formatted with direct invocations. - the #1150 health-classification helpers in fbuild-serial have no non-Windows, non-test caller, which RUSTFLAGS=-D warnings promotes to a hard error on the ubuntu/macos Check jobs. Annotate them cfg_attr(not(windows), allow(dead_code)) — they are fed by the Windows PnP enumeration and unit-tested cross-platform. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ci): mark registry-backed boards doctests no_run board_hint, vcom_for_env, and family_for_vid_pid resolve through the FastLED/boards registry at runtime; on doctest hosts (local and CI) that cache is absent, so the three examples panicked on every Check job since the vendored-table migration. no_run keeps them compile-checked without requiring a populated registry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ci): annotate riscv multilib GCC probe for the direct-spawn lint ci/find_direct_subprocess.py --fail has flagged the ch32v multilib probe since it landed, keeping the Check jobs red. The spawn is a short synchronous -print-multi-directory capability probe; mark it allow-direct-spawn rather than routing a one-flag probe through the subprocess facade. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ci): drop embedded WCH ISP VID/PID from the wchisp failure message The USB VID/PID catalogue-literal guard has flagged this user-facing string since the wchisp deployer landed, keeping Check (ubuntu) red. Identity data belongs to the FastLED/boards registry; point the user at 'fbuild port scan' instead of embedding 4348/1a86 literals. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ci): apply nightly import ordering in ban_raw_subprocess dylint The Dylint crate-formatting gate (nightly style edition) has wanted these two use-statement reorders since the lint landed; apply them so the gate goes green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ci): apply nightly import ordering in ban_raw_path_prefix_compare dylint Same nightly-2026-03-26 style-edition reorders as ban_raw_subprocess; verified with the crate-pinned formatter that both format-checked dylint crates are now clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ci): allowlist riscv toolchain GCC probe in ban_raw_subprocess dylint Companion to the Python-lint marker: the workspace dylint pass wants its own allowlist.txt entry for the same short synchronous -print-multi-directory capability probe. ci/check_dylint_allowlists.py passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ci): allowlist esp32 framework-library cache in ban_raw_path_prefix_compare WalkDir-derived paths are stripped against the exact root spelling they were enumerated from (same-normalized by construction) and feed a content hash, not a path-keyed cache lookup — the lint's own stated exemption. Pre-existing debt unmasked once the earlier Dylint gate failures were fixed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ci): force rebuild of ban_raw_path_prefix_compare after allowlist edit The previous round still flagged the freshly-allowlisted esp32 framework-library cache: the workspace dylint step served a compiled lint from the restored build cache, ignoring the allowlist-only edit. Touch the lint source (documenting the trap) so the fingerprint moves. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ci): refresh stale dylint @toolchain aliases after rebuilds cargo-dylint loads the <name>@<toolchain> library copy, but the alias loop only created it when absent. With target caching, a restored stale alias therefore pinned every lint to its first-ever compiled allowlist: rebuilt bare libraries (allowlist/source edits) were never loaded, which is why ban_raw_path_prefix_compare kept flagging the freshly-allowlisted esp32 framework-library cache. Overwrite the alias when the bare library is newer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Summary
benchmark-statsbranch nightly and deploy the same snapshot through GitHub PagesValidation
soldr cargo test -p fbuild-bench-fastled-examples --bin bench-build-comparisonsoldr cargo clippy -p fbuild-bench-fastled-examples --bin bench-build-comparison -- -D warningsactionlint .github/workflows/benchmark-build-comparison.ymluv run --no-project python ci/check_workspace_crates.pybench/blinkThe repository Pages build type has already been switched from legacy to GitHub Actions so the deploy job can publish after merge.
Summary by CodeRabbit
New Features
Documentation
Chores