Skip to content

Add compiler scaling fixtures#12

Merged
loreste merged 1 commit into
loreste:mainfrom
attahn:bench/compile-time-fixtures
Jul 21, 2026
Merged

Add compiler scaling fixtures#12
loreste merged 1 commit into
loreste:mainfrom
attahn:bench/compile-time-fixtures

Conversation

@attahn

@attahn attahn commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Adds deterministic compiler-scaling fixtures at 1k, 10k, and 100k lines across single-file, multi-file, generic-heavy, and backend-shaped projects.

The runner records cold and cached checks, supports optional full builds, and writes attributable JSON reports. CI validates the full generated matrix on Linux, exercises 10k single and generic builds, and uploads a 1k smoke report on every native platform without enforcing timing thresholds.

Verified with cargo test --bin mako (78 passed), the full 12-fixture check matrix, and the 10k full-build smoke.

Summary by CodeRabbit

  • New Features

    • Added reproducible compiler-scaling benchmarks covering 1k, 10k, and 100k-line projects across multiple project shapes.
    • Added measurements for cold and cached checks, with optional full builds and JSON reports containing benchmark metadata.
    • Added configurable fixture generation for local performance investigations.
  • Documentation

    • Added benchmark usage instructions and expanded performance documentation with commands, coverage details, and CI validation behavior.
  • Chores

    • Extended Linux CI to validate benchmark fixtures, run smoke builds, and publish benchmark artifacts.

@attahn

attahn commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai[bot] review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@attahn, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b2214123-ff71-4b25-9c05-9777c3d5d74f

📥 Commits

Reviewing files that changed from the base of the PR and between 7d71122 and 3c02bfd.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • benchmarks/compile/README.md
  • benchmarks/compile/fixtures.json
  • docs/PERFORMANCE.md
  • scripts/bench-compile.py
📝 Walkthrough

Walkthrough

Changes

Compiler scaling benchmarks

Layer / File(s) Summary
Fixture matrix and source generation
benchmarks/compile/fixtures.json, scripts/bench-compile.py
Defines 1k, 10k, and 100k fixtures across four project shapes, generates exact-line-count sources, and writes fixture metadata.
Benchmark execution and reporting
scripts/bench-compile.py
Runs cold and warm mako check or build samples with isolated caches, then records timing summaries and environment metadata as JSON.
CI gates and benchmark documentation
.github/workflows/ci.yml, benchmarks/compile/README.md, docs/PERFORMANCE.md, CHANGELOG.md
Adds Linux CI validation, smoke builds, artifact uploads, Python setup, benchmark instructions, and changelog coverage.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CIWorkflow
  participant BenchCompile
  participant FixtureFiles
  participant MakoCompiler
  participant JSONReport
  CIWorkflow->>BenchCompile: invoke benchmark command
  BenchCompile->>FixtureFiles: generate fixture sources and metadata
  BenchCompile->>MakoCompiler: run cold and warm check/build commands
  MakoCompiler-->>BenchCompile: return compile status and elapsed time
  BenchCompile->>JSONReport: write benchmark JSON artifacts
Loading

Suggested reviewers: loreste

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: adding deterministic compiler scaling fixtures.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

@attahn: I’ll review the changes in #12.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/bench-compile.py (1)

247-258: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

source_files means different things in the two JSON schemas.

In the per-fixture fixture.json metadata (Line 252), "source_files" is a list of filenames. In the aggregate mako.compile-bench.v1 report (Line 476), "source_files" is fixture.source_files, an int count. Same key name, different type across the two schemas the script emits — confusing for any tooling that consumes both.

♻️ Proposed fix
     metadata = {
         "schema": "mako.compile-fixture.v1",
         "name": name,
         "shape": shape,
         "lines": actual,
-        "source_files": sorted(sources),
+        "source_file_names": sorted(sources),
     }

Also applies to: 472-478

🤖 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 `@scripts/bench-compile.py` around lines 247 - 258, Rename the aggregate
report’s source-file count field in the reporting logic around the aggregate
metadata construction (near the use of fixture.source_files) to distinguish it
from the per-fixture source_files filename list. Keep the per-fixture metadata
key unchanged, and update the aggregate schema/value consistently so it uses an
explicit count-oriented key while preserving the integer count.
🤖 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 `@scripts/bench-compile.py`:
- Around line 307-322: Add a finite timeout to the subprocess.run calls in
run_once and command_output, using the benchmark’s existing timeout
configuration or a shared constant where available. Preserve current success
handling and ensure timeout failures propagate clearly instead of allowing a
hung compiler to block indefinitely.

---

Nitpick comments:
In `@scripts/bench-compile.py`:
- Around line 247-258: Rename the aggregate report’s source-file count field in
the reporting logic around the aggregate metadata construction (near the use of
fixture.source_files) to distinguish it from the per-fixture source_files
filename list. Keep the per-fixture metadata key unchanged, and update the
aggregate schema/value consistently so it uses an explicit count-oriented key
while preserving the integer count.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: bd6818c7-eff5-4148-96a6-9715bbd6d1c9

📥 Commits

Reviewing files that changed from the base of the PR and between 286a862 and 7d71122.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • benchmarks/compile/README.md
  • benchmarks/compile/fixtures.json
  • docs/PERFORMANCE.md
  • scripts/bench-compile.py

Comment thread scripts/bench-compile.py
@attahn
attahn force-pushed the bench/compile-time-fixtures branch from 7d71122 to 3c02bfd Compare July 21, 2026 17:53
@attahn
attahn marked this pull request as ready for review July 21, 2026 18:06
@attahn

attahn commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai[bot] review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

@attahn I’ll review the changes in #12.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@loreste
loreste merged commit 99a1dfc into loreste:main Jul 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants