Uh oh!
There was an error while loading. Please reload this page.
feat(bloat): add fbuild bloat-diff <a> <b> subcommand - #446
Conversation
Subsumes the ad-hoc `.claude/symbolaudit/diff.py` the FastLED #2773 audit carried. Each input may be a `report.json`, an ELF, or a project directory — same resolution as `fbuild bloat`. Symbol identity is `(demangled, archive, object)` so two symbols with the same name in different archives are kept distinct (matches the existing FastLED diff.py and what the audit report depends on). Categorises each row as `added` / `removed` / `grew` / `shrunk`. Default output dir mirrors `fbuild bloat`: `<project>/.fbuild/build/<env>/bloat-diff/<a>__vs__<b>/` when both inputs share a project, else `<cwd>/bloat-diff/<a>__vs__<b>/`. Writes both `delta-report.json` and `delta-report.md`. Refactors `bloat_cmd.rs`'s analyzer-pipeline into a `load_or_analyze` helper so bloat-diff drives the same `ToolPaths::resolve` + `analyze_elf` chain. The helper also auto-detects `report.json` inputs and short- circuits to `serde_json::from_slice` so users can diff existing reports without re-running the analyzer. Closes#440. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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
Closes#440 (Phase 4 of #434). Stacked on top of #445 → #443 → #436. Merge those first.
Subsumes the ad-hoc
.claude/symbolaudit/diff.pythe FastLED #2773 audit carried. Each input may be areport.json, an ELF, or a project directory — same resolution asfbuild bloat.(demangled, archive, object). Two symbols with the same name in different archives stay distinct (matches FastLEDdiff.pysemantics).added/removed/grew/shrunk.<project>/.fbuild/build/<env>/bloat-diff/<a-stem>__vs__<b-stem>/when both inputs share a project, else<cwd>/bloat-diff/<a>__vs__<b>/. Writes bothdelta-report.json+delta-report.md.--region flash(default) or--region ram. Net totals always cover both regions.--top N: Top-N movers in the MD table (default 25).Refactor: shared analyzer entrypoint
Extracts
bloat_cmd::load_or_analyzeso bothbloatandbloat-diffdrive the sameToolPaths::resolve+analyze_elfpipeline. The helper also detectsreport.jsoninputs and short-circuits toserde_json::from_slice, so users can diff existing reports without re-running the analyzer.Test plan
soldr cargo check -p fbuild-cli --all-targets✅soldr cargo clippy -p fbuild-cli --all-targets -- -D warnings✅soldr cargo test -p fbuild-cli --bin fbuild— 41 passed (was 32 + 9 new)New tests:
diff_categorises_added_removed_grew_shrunkdiff_net_totals_are_correctdiff_filters_by_regiondiff_distinguishes_same_name_in_different_archivesdiff_rollup_by_archive_aggregates_net_changeparse_region_defaults_to_flashformat_diff_markdown_emits_expected_sectionsbloat_diff_command_parses_positional_argsbloat_diff_region_flag_is_accepted🤖 Generated with Claude Code