Skip to content

Run both ends of the interpreter matrix on a pull request, all four on main - #9080

Merged
danielhanchen merged 3 commits into
mainfrom
ci-matrix-pr-subset
Aug 17, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
ci-matrix-pr-subset

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

No description provided.

…n main

Measured on one runner over the same tree, the four legs collect the same 26,320
tests and differ by exactly ONE of them. 3.10 and 3.11 report 26193 passed and 127
skipped; 3.12 and 3.13 report 26194 and 126. The single difference is the
sys.version_info >= (3, 12) gate on
test_demonstrates_the_underlying_stdlib_regression, which documents a stdlib
behaviour change.

They cost 97 runner-minutes per push, 1663 + 1249 + 1419 + 1506 seconds, against a
queue observed 195 deep.

Pull requests now run 3.10 and 3.13, which keeps both ends of the range and keeps
that one gate straddled. Pushes to main still run all four, which the workflow
already triggers on, so an interior-version break is caught on merge rather than
never. That is the trade: two interior legs, for half the cost on every PR.

A guard asserts the subset keeps both ends, that it loses no version gate the full
matrix can see, and that main still runs everything. The gate check compares the
two matrices rather than demanding the subset straddle every gate outright: one
test gates on >= 3.10 and the full matrix starts AT 3.10, so neither list can see
that one, and holding the subset to a standard the full matrix does not meet would
fail forever. Each of the three is mutation-checked.
Measured on one runner over the same tree, the four legs collect the same 26,320
tests and differ by exactly ONE of them: the sys.version_info >= (3, 12) gate on
test_demonstrates_the_underlying_stdlib_regression. 3.10 and 3.11 report 26193
passed and 127 skipped; 3.12 and 3.13 report 26194 and 126. Four legs cost 97
runner-minutes per push, 1663 + 1249 + 1419 + 1506 seconds, against a queue
observed 195 deep.

What the older legs were really guarding is syntax and evaluated annotations on
older interpreters, and tests/test_python39_compatibility.py already does that
statically, against the floor pyproject.toml declares (3.9) rather than the oldest
leg here (3.10). It parses every packaged module with feature_version set to that
floor and separately catches PEP 604 unions in evaluated positions, which is the
failure that created it. One AST pass on one interpreter, covering a version this
matrix never ran.

Pull requests therefore run the ceiling alone: removals and deprecations land
there first, and the one version-gated test executes there rather than skipping.
Pushes to main still run all four.

What that leaves uncovered until merge is a stdlib BEHAVIOUR difference on 3.11 or
3.12, which no static check can see. One test in 26,320 is gated on such a thing.

The guard asserts the pull-request leg is the ceiling, that the static floor check
still exists and still parses at the declared floor, that the declared floor is
below the matrix floor, and that main still runs everything. All four are
mutation-checked, including deleting the floor check outright.
@danielhanchen danielhanchen changed the title Run both ends of the interpreter matrix on a pull request, all four on main Run one interpreter on a pull request, all four on main Aug 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e2e39acea

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/studio-backend-ci.yml Outdated
# on such a difference, and the push-to-main run below still runs all four.
python: >-
${{ github.event_name == 'pull_request'
&& fromJSON('["3.13"]')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep Python 3.10 in the pull-request matrix

For every pull_request, this expression selects only Python 3.13, contrary to the stated plan to retain both 3.10 and 3.13. The static floor check cannot replace executing the suite on the older runtime: for example, studio/backend/core/inference/sandbox_site/sitecustomize.py has a real Python <3.11 _NormalAccessor path that is absent and therefore unexercised on 3.13. A regression in that supported-runtime path, or in dependency installation on 3.10, can consequently merge before the main-branch matrix detects it; include 3.10 in the PR array.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Correct, and this is the substantive one. I had argued that the static floor check replaces the older legs, and that is only true for SYNTAX: it parses, it does not run, so a branch taken only on an older interpreter is never executed by it.

Your example holds and it is not alone. sitecustomize.py repoints pathlib's pre-3.11 _NormalAccessor, which 3.11 dropped; native_path_leases.py and third_party_source.py branch on >= 3.12; worker.py branches on a minimum below that. On 3.13 alone the older side of each is dead code for the whole pull request.

3.10 is back, so pull requests run both ends and main still runs all four.

The guard now scans the backend SOURCE as well as its tests for version_info comparisons and requires the pull-request matrix to straddle every boundary the full matrix straddles. That is the check that would have caught this, and it rejects the single-leg matrix outright, which I verified by mutation. Scanning only the tests is what let it look defensible: the tests have three gates, the source has more and they matter more.

Fixed in the head of this branch.

…ranch

The single-leg version was wrong. The static floor check covers older SYNTAX, and
I took that to cover older interpreters generally. It does not: it parses, it does
not run, so a branch taken only on an older version is never executed by it.

The backend has several. sitecustomize.py repoints pathlib's pre-3.11
_NormalAccessor, which 3.11 dropped. native_path_leases.py and
third_party_source.py branch on >= 3.12. worker.py branches on a minimum below
that. On 3.13 alone the older side of each is dead code for the whole pull
request.

Pull requests run 3.10 and 3.13 again, both ends of the matrix. Main still runs
all four.

The guard now scans the backend SOURCE as well as its tests for version_info
comparisons, and requires the pull-request matrix to straddle every boundary the
full matrix straddles. That is the check that would have caught this: it rejects
the single-leg matrix outright. Compared against the full matrix rather than in
absolute terms, since >= 3.10 and < 3.14 sit outside the matrix range and no list
here can see them.
@danielhanchen danielhanchen changed the title Run one interpreter on a pull request, all four on main Run both ends of the interpreter matrix on a pull request, all four on main Aug 17, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 4679b9f0c7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@danielhanchen
danielhanchen merged commit a41f778 into main Aug 17, 2026
20 checks passed
@danielhanchen
danielhanchen deleted the ci-matrix-pr-subset branch August 17, 2026 10:08
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