Skip to content

chore(lint): migrate ci/lint_cpp orchestrator (drop bespoke ast_cache, evaluate Rust port) after zccache#838 lands #3338

Open

Description

@zackees

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:

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)

Activity

  1. zackees commented on Aug 20, 2026

    @zackees
    MemberAuthor

    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:

    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:

    1. feat(python): finish and publish exec_cached binding promised by #838 (slices 2-6) forge-ci/zccache#1433 lands and a published wheel exports zccache.exec_cached on all supported FastLED hosts.
    2. Raise FastLED's zccache floor to that release.
    3. Port cached_ast_check with an explicit graceful policy for daemon/protocol unavailability.
    4. Run correctness tests for hit/miss, invalidation, corrupt cached bytes, and concurrent checkers.
    5. Record cold and warm bash lint --cpp timings 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.

  2. added
    deferred
    on Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deferred

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions