Skip to content

unix: use extended PGO training set#1018

Draft
indygreg wants to merge 6 commits intomainfrom
pgo-extended
Draft

unix: use extended PGO training set#1018
indygreg wants to merge 6 commits intomainfrom
pgo-extended

Conversation

@indygreg
Copy link
Copy Markdown
Collaborator

This will run all tests by default and ensure we have maximal training coverage for PGO.

@geofft
Copy link
Copy Markdown
Collaborator

geofft commented Mar 20, 2026

I suspect this PR is equivalent to "get the full test suite passing," which we've talked about wanting to do but hasn't quite been prioritized :)

@indygreg
Copy link
Copy Markdown
Collaborator Author

Yeah. I just wanted to throw up the PR to see what kind of damage we were looking at for enabling the full test harness. It looks substantial :/

@indygreg indygreg changed the base branch from main to gps-pgo-tweaks March 21, 2026 05:30
@indygreg indygreg force-pushed the pgo-extended branch 4 times, most recently from 0e37663 to c3eb94d Compare March 21, 2026 07:23
@indygreg indygreg force-pushed the pgo-extended branch 3 times, most recently from c7381c9 to 0bfc6cc Compare March 21, 2026 12:31
Base automatically changed from gps-pgo-tweaks to main March 23, 2026 21:55
@indygreg indygreg force-pushed the pgo-extended branch 15 times, most recently from 6ce760e to 2ea873e Compare March 26, 2026 05:49
Docker on aarch64 macOS will automagically virtualize x86-64 containers
if containers are spawned with `platform=linux/amd64`. Performance of
spawned containers is a bit slower than native, but not horrible. This
functionality means it is viable to develop Linux x86-64 from modern
Apple hardware.

This commit teaches the build system to support cross-compiling
Linux x86-64 from macOS aarch64.

Implementing this wasn't too difficult: we need to pass `platform` into
Docker's APIs for building and creating containers. We need to teach
code to resolve the effective host platform when this scenario is
detected. And we need to advertise support for cross-compiling in the
`targets.yml` file.

In case you are wondering, yes, a similar solution could be employed for
Linux too by using emulation. But this requires Docker be configured to
support emulation, which isn't common. Rosetta on macOS "just works" and
is therefore the lowest hanging fruit to implement.
A couple of tests appear to have race conditions on freethreaded builds
on machines with a sufficient number of CPU cores. (These feel like
CPython bugs, which I will report later.)

We disable these tests during PGO training as a workaround.
Default runners have 2 CPUs. We can achieve a nice speed-up
(but not quite linear) by leveraging runners with more CPUs.
This will run all tests, ensuring maximal training coverage.

As part of this, we had to annotate/ignore every failing test because
test failures would otherwise fail the build.
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