|
| 1 | +# bench/fastled-examples |
| 2 | + |
| 3 | +Warm-cache library-selection benchmarks across the FastLED examples matrix. |
| 4 | +This is the harness referenced by `FastLED/fbuild#205` for acceptance |
| 5 | +criterion **AC#5 / P-01**: |
| 6 | + |
| 7 | +> Warm library-selection on FastLED examples matrix `<= current fbuild |
| 8 | +> + 50 ms`. |
| 9 | +
|
| 10 | +## Status: empty placeholder |
| 11 | + |
| 12 | +There is no harness here yet, and on purpose. P-01 measures the **warm** |
| 13 | +path through the resolver, which depends on the zccache K/V memoization |
| 14 | +delivered by `#205` Phase 4 (gated on `zackees/zccache#130`). Until that |
| 15 | +lands, every `resolve()` call is cold and there is no warm number to |
| 16 | +gate against. Adding a "warm-ish" harness today would just measure cold |
| 17 | +work twice and produce a misleading baseline. |
| 18 | + |
| 19 | +When Phase 4 ships and a `zccache` release is cut, a follow-up PR drops |
| 20 | +the actual harness into this directory and wires it into CI. |
| 21 | + |
| 22 | +## The plan once Phase 4 lands |
| 23 | + |
| 24 | +1. Iterate the FastLED examples tree (`~/dev/fastled/examples/**`) under |
| 25 | + each supported board: at minimum `teensyLC`, `teensy30`, `teensy41`, |
| 26 | + `stm32f103c8`, `esp32-s3`, `uno`, `ws2812`. The matrix expands with |
| 27 | + board coverage. |
| 28 | +2. For each `(example, board)` pair, run the resolver twice: |
| 29 | + - **Cold pass.** Empty `~/.zccache/`. Captures the K/V miss path and |
| 30 | + the underlying scan + walk + LDF cost. This is the P-02 lane. |
| 31 | + - **Warm pass.** Populated `~/.zccache/`. Captures the K/V hit path, |
| 32 | + where the only work should be cache lookup + result deserialization. |
| 33 | + This is the P-01 lane. |
| 34 | +3. Diff the warm scan time against a captured baseline checked into |
| 35 | + `tasks/baseline-205.md`. CI fails the job if any `(example, board)` |
| 36 | + regresses the warm path by more than 50 ms vs. that baseline (the |
| 37 | + `#205` AC#5 threshold). |
| 38 | +4. Emit a structured JSON report (`bench/fastled-examples/report.json`) |
| 39 | + that future PR comments can diff. Format TBD with the harness. |
| 40 | + |
| 41 | +## Running a partial version today |
| 42 | + |
| 43 | +The closest signal available right now is the per-crate cold-resolve |
| 44 | +criterion bench: |
| 45 | + |
| 46 | +```bash |
| 47 | +uv run soldr cargo bench -p fbuild-library-select --bench resolve_cold |
| 48 | +``` |
| 49 | + |
| 50 | +That bench drives a synthetic ~30-library Teensyduino-class tree built |
| 51 | +from `fbuild-test-support`'s `MiniFramework` rather than real FastLED |
| 52 | +sketches, and it measures the cold path only. It is a useful regression |
| 53 | +guard for the resolver itself, but it does **not** satisfy AC#5. |
| 54 | + |
| 55 | +## Cross-links |
| 56 | + |
| 57 | +- Issue: `FastLED/fbuild#205` |
| 58 | +- Phase 4 design note (the prerequisite for this directory): |
| 59 | + [`../../tasks/zccache-kv-design.md`](../../tasks/zccache-kv-design.md) |
| 60 | +- Subsystem architecture: |
| 61 | + [`../../docs/architecture/library-selection.md`](../../docs/architecture/library-selection.md) |
| 62 | +- Foundation baseline that the warm threshold compares against: |
| 63 | + [`../../tasks/baseline-205.md`](../../tasks/baseline-205.md) |
| 64 | +- Per-crate cold benches (different scope, same subsystem): |
| 65 | + [`../../crates/fbuild-library-select/benches/README.md`](../../crates/fbuild-library-select/benches/README.md), |
| 66 | + [`../../crates/fbuild-header-scan/benches/README.md`](../../crates/fbuild-header-scan/benches/README.md) |
0 commit comments