Repository navigation
Description
Background
The recent C++ lint perf sweep (PR #3335) took `bash lint --cpp` from 3m 20s → 3-5s warm via:
- Switching the Rust linter to dev profile + line-tables-only debug
- Killing per-line regex compile loops + adding whole-file early exits in 10+ checkers
- Fanning out the Rust + 2 clang-query AST passes in parallel
- A bespoke Python fingerprint cache for the AST passes (`ci/lint_cpp/ast_cache.py`, ~150 LOC)
- `uv run --no-sync` on the `lint` wrapper to skip uv's project-sync probe
Two follow-ups are blocked on upstream work:
1. Drop `ci/lint_cpp/ast_cache.py` once zccache exposes a Python binding
Filed upstream: zackees/zccache#838 — feat(python): native PyO3 binding for GenericToolExec (subsumes #837 for Python consumers — the binding's input list never serializes to a command line, so the Windows 32K argv ceiling does not apply).
Once #838 lands in a published zccache release we should replace `ci/lint_cpp/ast_cache.py` with a thin call into the binding. Concretely:
```python
import zccache
result_bytes = zccache.exec_cached(
name="noexcept_ast",
input_files=[*src_fl_files, baseline_path, tool_path],
extra_key=b"v1",
runner=lambda: _serialize(_run()),
)
return _deserialize(result_bytes)
```
Wins over the bespoke cache:
- No Windows 32K argv ceiling (Python list passed in-process to the daemon)
- No subprocess hop for the cache probe
- Faster fingerprint (zccache uses blake3 + jwalk parallel readdir)
- Cross-tool / cross-repo cache sharing via the daemon
- Centralized eviction, retention, observability (`zccache cache report`, `zccache analyze`)
- CI integration via `zccache gha-cache` for free
- ~150 LOC of `ast_cache.py` evaporates
2. (Optional) Rust orchestrator port at the same time
While re-touching the orchestrator for #1, evaluate porting all of `ci/lint_cpp/run_all_checkers.py` into a Rust subcommand of `fastled-lint` (e.g. `fastled-lint orchestrate`). The Rust binary already owns the per-file checker dispatch; the orchestrator's remaining job is:
- AST-cache fingerprint check (via WS2812b running light effect programming issue #838 binding if it has Rust callers too, or via in-process Rust)
- Spawn 2 clang-query subprocesses in parallel
- Merge results + pretty-print
Estimated wins:
| State | Current | With Rust orchestrator | Saved |
|---|---|---|---|
| Warm (no changes) | 3-5s | ~1-2s | 60% |
| Cold edit (AST cache hit) | 11s | ~8s | 27% |
| Truly cold | 25s | ~22s | 12% |
Estimated cost: 1-2 days of work, mostly mechanical (port ast_cache.py to Rust, port format_and_print_results, add `--json` mode to `check_noexcept.py` / `check_array_params.py` so the Rust orchestrator can spawn them and parse stdout). Architectural cleanup: one binary as the lint entry point, no `uv run` foot-gun in the lint hot path.
The Rust port is opt-in depending on whether #838 alone is enough — if the Python binding plus the existing parallel-fan-out gets close to the Rust-orchestrator numbers, the rewrite may not be worth it.
Action items (in order)
- Watch zackees/zccache#838 for landing in a published release
- Replace `ci/lint_cpp/ast_cache.py` with the new binding (~30 LOC diff expected)
- Measure: does the binding alone close the gap to a hypothetical Rust orchestrator?
- If gap remains and is worth closing: file a follow-up to port the orchestrator to Rust
Refs
- PR #3335 — current optimization round (cumulative 8x cold / 40-67x warm)
- zccache #837 — bulk `--input-file` (CLI form, blocked by argv limit on Windows)
- zccache #838 — Python binding (preferred path for in-process consumers)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
zackees commentedon Aug 20, 2026
Deferred under the active bug-burn-down policy because the issue's upstream prerequisite is still functionally incomplete, despite its tracker being closed.
Verified current state:
ExecProbe/ExecStoreprotocol and handler support.exec_cachedimplementation or export; code search finds only protocol/daemon references.zccache.exec_cached.zccache>=1.13.0; the installed 1.13.0 wheel has_nativebut noexec_cached.ci/lint_cpp/ast_cache.pyis still the only working cache for the three AST passes inrun_all_checkers.py. Removing it now would regress the documented 3-5 s warm lint path.I filed the missing upstream work as forge-ci/zccache#1433 and marked it deferred with the remaining PyO3, persistence, cross-platform wheel, release, and real-consumer acceptance criteria.
Restart criteria:
zccache.exec_cachedon all supported FastLED hosts.cached_ast_checkwith an explicit graceful policy for daemon/protocol unavailability.bash lint --cpptimings before deciding whether the optional Rust orchestrator port has enough remaining value to warrant a separate issue.The issue remains open and is excluded from the actionable queue while labeled
deferred.