Skip to content

refactor PGO implementation#553

Open
davidhewitt wants to merge 3 commits into
mainfrom
dh/pgo
Open

refactor PGO implementation#553
davidhewitt wants to merge 3 commits into
mainfrom
dh/pgo

Conversation

@davidhewitt

@davidhewitt davidhewitt commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This changes the python wheel builds so that the monty-python client crate is no longer PGO-optimized, only the monty-runtime main binary.

At the same time I switch to use maturin's new --pgo flag to do the build.

There is a bug in maturin (not new in this PR) which I noted that the runtime is being built per-version; that shouldn't be necessary, I'll try to debug and fix upstream.


Summary by cubic

Refactored PGO to only optimize the monty-runtime binary with maturin --pgo, and folded runtime wheel builds into the main CI job. PGO runs on Linux x86_64, macOS aarch64, and Windows x86_64.

  • Refactors

    • PGO applies only to monty-runtime; the monty-python extension builds normally.
    • Use maturin --pgo with pgo-command running monty-datatest’s new pgo-exercise to train via monty-pool test cases.
    • Removed .github/actions/build-pgo-wheel; integrated PGO into the main build with clearer artifacts (pypi_files-python-*, pypi_files-runtime-*).
    • CI builds runtime wheels for all targets; PGO is enabled on Linux x86_64, macOS aarch64, and Windows x86_64, and installs llvm-tools_preview when needed.
    • Updated make dev-py-pgo to build/install a PGO pydantic_monty_runtime wheel with maturin==1.14.1, then maturin develop the monty-python package.
    • Note: maturin currently produces versioned runtime wheels; -i is used as a workaround.
  • Dependencies

    • Bumped maturin to >=1.14.1 and require Rust llvm-tools for PGO.
    • Added monty-pool to monty-datatest; set default-run to monty-datatest.

Written for commit 43435e7. Summary will update on new commits.

Review in cubic

@davidhewitt

Copy link
Copy Markdown
Contributor Author

maturin issue reported as PyO3/maturin#3256

@github-actions

Copy link
Copy Markdown

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 40931 uncovered lines.
✅ Project coverage is 49.64%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    49.64%    49.64%        —%
==========================================
  Files          319       319         —
  Lines        81272     81272         —
  Branches    172725    172725         —
==========================================
+ Hits         40341     40341         —
- Misses       40931     40931         —
- Partials      3089      3089         —

Generated by Codecov Action

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Jul 10, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 26 untouched benchmarks
⏩ 16 skipped benchmarks1


Comparing dh/pgo (43435e7) with main (fe8dc5e)

Open in CodSpeed

Footnotes

  1. 16 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/ci.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant