Skip to content

fix: unbreak benchmark pipeline (ty errors + Python selection) - #9

Merged
RianKoja merged 2 commits into
mainfrom
fix/20260731_pipeline
Jul 31, 2026
Merged

fix: unbreak benchmark pipeline (ty errors + Python selection)#9
RianKoja merged 2 commits into
mainfrom
fix/20260731_pipeline

Conversation

@RianKoja

@RianKoja RianKoja commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Problem

The weekly benchmark has failed on every run since late December 2025 (last success: 2025-12-21).

run.sh uses set -euo pipefail, so the non-zero exit from ty check . at line 72 aborted the whole suite before a single benchmark ran, which matches the ~25s failure duration. A ty release in that window started emitting four diagnostics:

  • 05_comparison.py:413: DataFrame.to_markdown() is typed str | None, so + "\n\n" is an unsupported operator
  • 05_comparison.py:433-435: DataFrame.itertuples() is typed tuple[Any, ...], so row.framework / row.cache_status / row.mean are unresolved attributes

Reproduced locally with act against the unmodified tree, which failed at exactly this step.

Two further issues surfaced while diagnosing:

  • The workflow was disabled on GitHub (disabled_inactivity). GitHub auto-disables scheduled workflows after 60 days without repo activity, which is why the last run was 2026-03-22. Already re-enabled; it now reports active.
  • The Python-version detection step was one CPython release from hard-failing. It tried the newest interpreter and downgraded up to twice, running a full uv pip sync per attempt just to test compatibility. The local act run consumed all three attempts (3.15.0b43.143.13), so the next minor would have hit No compatible Python version found after 3 attempts. It also evaluated pre-release betas as candidates, and the Using Python $PYTHON_VERSION echo was always empty (GITHUB_ENV only applies to later steps).

Changes

Fix the ty diagnostics: f-string instead of + concatenation, and iterate to_dict("records") instead of itertuples(). ty deliberately stays unpinned and a hard gate: this repo exists to benchmark latest versions, so picking up new diagnostics is the point, even at the cost of an occasional break.

Replace ~80 lines of version-detection bash with a direct query. FireDucks is the framework that lags newest CPython, so its published wheels decide the version: take the highest cp3XX manylinux wheel tag from the latest FireDucks release, then confirm the remaining dependencies resolve there before committing to it.

Selects Python 3.13 today (FireDucks 1.4.4 ships cp39cp313, requires_python: <3.14,>=3.9) and correctly rejects 3.14. It adopts 3.14+ automatically the day FireDucks ships those wheels: no annual maintenance, no retry cap.

Housekeeping: ruff format . applied (02_benchmark.py was being silently reformatted by CI on every run), and a README note about the 60-day auto-disable.

The weekly run has failed since late December 2025. `run.sh` uses
`set -euo pipefail`, so the non-zero exit from `ty check .` aborted the
suite before any benchmark ran. A ty release started flagging four real
issues in 05_comparison.py:

- `DataFrame.to_markdown()` is typed `str | None`, so `+ "\n\n"` was
  rejected; use an f-string instead.
- `DataFrame.itertuples()` is typed `tuple[Any, ...]`, so `row.framework`
  and friends were unresolved attributes; iterate `to_dict("records")`.

ty stays unpinned on purpose: the repo benchmarks latest versions, and
picking up new diagnostics is the point.

Also replace the ~80-line Python-version detection step. It tried the
newest interpreter and downgraded up to twice, doing a full `uv pip sync`
per attempt just to test compatibility. Locally it already needed all
three attempts (3.15.0b4 -> 3.14 -> 3.13) and would have hard-failed on
the next CPython minor. Since fireducks is the framework that lags newest
CPython, read the highest cp3XX Linux wheel tag from its latest release
and use that, then confirm the remaining dependencies resolve there.
Selects Python 3.13 today and adopts newer versions automatically.

Verified end to end with `act`: full workflow green.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 53 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ec110e58-7bb3-4e60-9a1a-65543e77bec1

📥 Commits

Reviewing files that changed from the base of the PR and between 05180c3 and cd79f76.

📒 Files selected for processing (1)
  • .github/workflows/benchmark.yml

Summary by CodeRabbit

  • Chores

    • Improved benchmark automation by selecting the newest supported Python version automatically.
    • Added clearer validation and error reporting when compatible wheels or dependencies are unavailable.
    • Simplified benchmark environment checks for more predictable workflow execution.
  • Documentation

    • Updated the README with Python version selection details.
    • Documented automatic disabling of scheduled workflows after 60 days of inactivity and how to re-enable them.

Walkthrough

The workflow now selects and validates the Python version from FireDucks wheel availability. Benchmark expressions and comparison output use revised formatting without changing their behavior. The README documents workflow version selection and scheduled-workflow re-enablement.

Changes

Benchmark maintenance

Layer / File(s) Summary
Python version selection and workflow documentation
.github/workflows/benchmark.yml, README.md
The workflow detects the highest compatible CPython Linux wheel, validates dependency resolution, exports PYTHON_VERSION, and documents scheduled-workflow behavior.
Benchmark and comparison formatting
02_benchmark.py, 05_comparison.py
Benchmark lambdas use multiline expressions. Comparison output uses f-strings and dictionary fields without changing results.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly identifies the two primary changes: fixing ty errors and updating Python version selection for the benchmark pipeline.
Description check ✅ Passed The description directly explains the benchmark failures, the ty fixes, the Python selection changes, and the related workflow documentation updates.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/20260731_pipeline

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 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

🤖 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 @.github/workflows/benchmark.yml:
- Around line 32-36: Update the PyPI request in the minor-version discovery
pipeline to add an explicit short connect timeout, maximum request duration, and
limited retry count for transient failures. Preserve the existing curl failure
behavior and jq-based version extraction.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8c1b5b88-df05-4bd4-8c1a-6cf1241b3511

📥 Commits

Reviewing files that changed from the base of the PR and between 754914b and 05180c3.

📒 Files selected for processing (4)
  • .github/workflows/benchmark.yml
  • 02_benchmark.py
  • 05_comparison.py
  • README.md

Comment thread .github/workflows/benchmark.yml Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@RianKoja
RianKoja merged commit 523766f into main Jul 31, 2026
2 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.

1 participant