Skip to content

[pr-review] Recognize the self-hosted macOS label form in the runner naming check - #201579

Closed
huydhn wants to merge 1 commit into
pytorch:mainfrom
huydhn:pr-review-exempt-macos
Closed

huydhn wants to merge 1 commit into
pytorch:mainfrom
huydhn:pr-review-exempt-macos

Conversation

@huydhn

@huydhn huydhn commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

The pr-review runner naming check (.agents/skills/pr-review/ci-runner-naming.md, from #199315) flags every new self-hosted macOS label as a blocker. That's how macos-m2-27 was flagged on #201517. But these runners aren't OSDC runners, and their macos-m* labels follow their own convention.

This PR keeps them in scope and accepts their form. It matches how the runner install playbook in pytorch-gha-infra builds the label on each Mac:

^macos-m[1-9][0-9]*-([1-9][0-9]|stable)$      # macos-<chip>-<macOS major>, plus a per-chip -stable alias
  • New section "Self-Hosted macOS Labels" with the form
  • "Checking a Label", step 3: validate macos-m* labels against that form, not the OSDC full form or length rule
  • "What to Report": for a malformed macos-m* label, suggest a name in the macOS form (these runners are set up by pytorch-gha-infra, not ci-infra), and scope the Apple Silicon entry in "Hardware the Standard Cannot Express" to OSDC-form labels

New chips and macOS releases pass with no further edits, and malformed macOS labels are still flagged. Every macos-m* label in .github today (macos-m1-15, macos-m1-stable, macos-m2-26, macos-m2-27) matches.

The reviewer loads this file from main, so the change applies to reviews after it lands. No test changes are needed: test_workflow_contract.py pins which files are hashed, not what they contain.

cc @jeanschmidt

@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Oct 20, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

PR Status: in progress

A maintainer requested changes. Please address their feedback before the PR returns to maintainer review.

To become ready for review, the change must pass automated review and every maintainer comment must be addressed, either with a code change or a reply explaining why no change is needed. A fresh automated review checks that the feedback has been addressed. All CI must finish and Dr. CI must classify every failure as unrelated to your PR. Fix the failures it attributes to your PR (see status below in this comment). Workflows waiting for a maintainer to approve their run do not block this.

To minimize iteration time, feel free to run the pr-review skill from the repo locally. If you address comments without pushing, comment @pytorchbot review to re-run the automated review. To bypass automated review, please add the “no automated review” label.

🟡 AUTOMATED REVIEW - Changes requested:

The PR adds a separate label form for the self-hosted `macos-m*` runners to the
pr-review runner naming check, so these labels are checked against the macOS
form instead of the OSDC grammar. Recommendation: Request Changes. The blocker
template would give wrong reasons on the exact macOS labels this PR is meant to
handle, and the macOS form needs a pinned source like the OSDC grammar has.

Findings (3):

[major] .agents/skills/pr-review/ci-runner-naming.md:153
The blocker template still gives OSDC reasons for a macOS label. The new
sentence ("For a `macos-m*` label, instead suggest a name in the macOS form...")
only replaces the naming suggestion and the ci-infra pointer. The rest of the
bullet still applies: "state the consequence" (every runner must follow the
standard), the `rel-` marker, the 37-character length limit, and the `l-`
segment HUD queue-time queries use to treat a job as ARC. None of that holds for
the macOS fleets: no `rel-` marker, no length rule (step 3 says "only"), not
ARC, and outside "the standard", which line 5 defines as ci-infra's
`runner_naming_convention.md`. A malformed label such as `macos-m2-pro-26` would
get a blocker that gives the author wrong reasons. Fix: make the macOS case its
own sentence that also replaces the consequence text (e.g. the label must match
the form the pytorch-gha-infra playbook registers, or the job never gets a
runner), or limit the "Tooling keys off the structure..." sentence to OSDC-form
labels.

[major] .agents/skills/pr-review/ci-runner-naming.md:86
The macOS form has no recorded source. The OSDC grammar is linked and pinned
("copied from it at commit ca6864a9 (last changed 2026-08-04)", line 5), so it
can be re-checked when ci-infra changes. The macOS regex only says "the runner
install playbook in pytorch-gha-infra", with no file path, link or commit. If
the playbook's naming changes (e.g. a `-pro` suffix or a new alias besides
`stable`), nobody can tell this copy is stale, and the reviewer would block
correct labels. Line 5 also still calls ci-infra "the canonical standard" for
the whole document, but this section comes from elsewhere. Fix: link the
playbook file and give the commit it was copied from, as line 5 does, and update
line 5 to say the macOS form has a separate source.

[minor] .agents/skills/pr-review/ci-runner-naming.md:89
The Examples table (lines 50-74) has no macOS rows. The table is where this file
spells out its edge cases, and the new step-3 branch has non-obvious ones:
`mt-macos-m1-15`, or `${{ needs.get-label-type.outputs.label-type
}}macos-m1-15`, does not start with `macos-m` and falls through to the "anything
else... does not conform" rule; `macos-m2-pro-26` is invalid because Pro shares
the base chip's label (line 92); `macos-m01-15` is invalid because of the
leading zero; `macos-m1-stable` is valid. Without these rows the reviewer has to
work out each case from the prose. Add valid and invalid macOS rows to the
table.

Reviewed commit: 52204af

Review run

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/201579

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 11 Pending

As of commit 52204af with merge base 88ce27b (image):
💚 Looks good so far! There are no failures yet. 💚

🟡 GREEN LIGHT - OUTDATED (earlier commit) - PR requires human review:

  • Never trivial: AI reviewer steering
    • Edits .agents/skills/pr-review/ci-runner-naming.md, the skill the hardened PR reviewer loads from main, per hardened-pr-review-run.yml
    • A markdown-only edit there changes a later automated reviewer's instructions, the same risk as editing .claude/ skills
  • Never trivial: alters a review rule
    • Exempts macos-m* labels from the full form and length rule via a new macOS regex in step 3 of Checking a Label
    • review-checklist.md makes a non-conforming label a Request Changes blocker, so this relaxes a gate
  • Socialization
    • Removes Apple Silicon from Hardware the Standard Cannot Express; runner-naming owners should confirm the new convention

reason: not_trivial
Reviewed commit: 20c476d (NOT the current head 52204af)

Inference job

🐛 Report a wrong verdict

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@huydhn
huydhn force-pushed the pr-review-exempt-macos branch from 19272fd to 2416196 Compare October 20, 2026 23:46
@huydhn huydhn changed the title [pr-review] Exempt self-hosted macOS runners from the runner naming check [pr-review] Recognize the self-hosted macOS label form in the runner naming check Oct 20, 2026
@huydhn
huydhn force-pushed the pr-review-exempt-macos branch from 2416196 to 83934f0 Compare October 20, 2026 23:53
@huydhn huydhn changed the title [pr-review] Recognize the self-hosted macOS label form in the runner naming check [pr-review] Recognize the legacy self-hosted macOS label form in the runner naming check Oct 20, 2026
@huydhn
huydhn force-pushed the pr-review-exempt-macos branch from 83934f0 to 7385ced Compare October 20, 2026 23:54
@huydhn huydhn changed the title [pr-review] Recognize the legacy self-hosted macOS label form in the runner naming check [pr-review] Recognize the self-hosted macOS label form in the runner naming check Oct 20, 2026
@huydhn
huydhn force-pushed the pr-review-exempt-macos branch from 7385ced to 20c476d Compare October 21, 2026 00:08
@huydhn
huydhn requested a review from jeanschmidt October 21, 2026 00:08
@huydhn
huydhn marked this pull request as ready for review October 21, 2026 00:08
@pytorchbot pytorchbot added the in progress PR is being worked on by the author, until the automated review accepts it label Oct 21, 2026
github-actions[bot]

This comment was marked as outdated.

@huydhn
huydhn force-pushed the pr-review-exempt-macos branch from 20c476d to 31a8dac Compare October 23, 2026 18:28
github-actions[bot]

This comment was marked as outdated.

…naming check

The self-hosted macOS fleets are not OSDC runners and use their own label
convention, so flagging every new one (e.g. macos-m2-27 on pytorch#201517) as a blocker
was wrong. Keep them in scope, but accept their form, matching what the runner
install playbook in pytorch-gha-infra derives on each Mac:
macos-<chip>-<macOS major> plus a per-chip -stable alias,
^macos-m[1-9][0-9]*-([1-9][0-9]|stable)$. New chips and macOS releases pass
with no further edits; malformed macOS labels are still flagged.
@huydhn
huydhn force-pushed the pr-review-exempt-macos branch from 31a8dac to 52204af Compare October 23, 2026 18:42

@github-actions github-actions 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.

Automated review of 52204af: changes requested before human review.

The PR adds a separate label form for the self-hosted macos-m* runners to the pr-review runner naming check, so these labels are checked against the macOS form instead of the OSDC grammar. Recommendation: Request Changes. The blocker template would give wrong reasons on the exact macOS labels this PR is meant to handle, and the macOS form needs a pinned source like the OSDC grammar has.

🔴 2 blocking findings are attached to the code below.

⚪ 1 non-blocking finding

^macos-m[1-9][0-9]*-([1-9][0-9]|stable)$

The Examples table (lines 50-74) has no macOS rows. The table is where this file spells out its edge cases, and the new step-3 branch has non-obvious ones: mt-macos-m1-15, or ${{ needs.get-label-type.outputs.label-type }}macos-m1-15, does not start with macos-m and falls through to the "anything else... does not conform" rule; macos-m2-pro-26 is invalid because Pro shares the base chip's label (line 92); macos-m01-15 is invalid because of the leading zero; macos-m1-stable is valid. Without these rows the reviewer has to work out each case from the prose. Add valid and invalid macOS rows to the table.

Please address the findings and push; a new commit normally gets a fresh automated review.

This review is AI-generated and advisory. Each new automated review replaces the previous one.

Anchor a finding on the label line, or on the changed prefix line or determinator line when only the prefix changed, or, for a label new CI gets from an input or matrix key it omits, on the new job's `uses:` line or the new matrix entry; if the label repeats, on its first added occurrence. For a label existing CI falls back to after the PR deletes an input, prefix or matrix key, anchor on the new-side line right after the deletion, inside the hunk that removed it. In /pr-review, file findings under Infrastructure. When one line yields labels in both tiers, such as a determinator prefix whose `mt-` label other CI uses while its `lf-` label is new, report only the blocker for that line and leave its already-used label out of the heads-up.

- **Blocker: no other CI in this repo uses the label.** One finding per distinct label; the labels one line yields through a prefix expression, such as `mt-X` and `lf-X`, are one finding. Always Request Changes. Name the label and the field or fields that break the standard, and suggest a conforming name: describe its shape from the intended hardware, or name a conforming label already used in this repo with the same resources. The runner must be defined under that name in pytorch/ci-infra. For hardware the standard cannot express, say the canonical doc must be extended first. State the consequence, so the finding is not mistaken for a naming preference: every runner introduced in this repo must follow the standard, and maintainers send back PRs that do not. Tooling keys off the structure: the `rel-` marker and the length limit above, and the `l-` segment, which HUD queue-time queries and queue alerts use to treat a job as ARC.
- **Blocker: no other CI in this repo uses the label.** One finding per distinct label; the labels one line yields through a prefix expression, such as `mt-X` and `lf-X`, are one finding. Always Request Changes. Name the label and the field or fields that break the standard, and suggest a conforming name: describe its shape from the intended hardware, or name a conforming label already used in this repo with the same resources. The runner must be defined under that name in pytorch/ci-infra. For hardware the standard cannot express, say the canonical doc must be extended first. For a `macos-m*` label, instead suggest a name in the macOS form; these runners are set up by pytorch-gha-infra, not ci-infra. State the consequence, so the finding is not mistaken for a naming preference: every runner introduced in this repo must follow the standard, and maintainers send back PRs that do not. Tooling keys off the structure: the `rel-` marker and the length limit above, and the `l-` segment, which HUD queue-time queries and queue alerts use to treat a job as ARC.

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.

🔴 The blocker template still gives OSDC reasons for a macOS label. The new sentence ("For a macos-m* label, instead suggest a name in the macOS form...") only replaces the naming suggestion and the ci-infra pointer. The rest of the bullet still applies: "state the consequence" (every runner must follow the standard), the rel- marker, the 37-character length limit, and the l- segment HUD queue-time queries use to treat a job as ARC. None of that holds for the macOS fleets: no rel- marker, no length rule (step 3 says "only"), not ARC, and outside "the standard", which line 5 defines as ci-infra's runner_naming_convention.md. A malformed label such as macos-m2-pro-26 would get a blocker that gives the author wrong reasons. Fix: make the macOS case its own sentence that also replaces the consequence text (e.g. the label must match the form the pytorch-gha-infra playbook registers, or the job never gets a runner), or limit the "Tooling keys off the structure..." sentence to OSDC-form labels.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged, leaving this wording as is for now: the macOS sentence already overrides the naming suggestion, which is the part that matters. (Reply posted by Claude on behalf of @huydhn.)


### Self-Hosted macOS Labels

The self-hosted macOS fleets (EC2 Mac pet instances) are not OSDC runners and use their own label convention. It is what the runner install playbook in pytorch-gha-infra derives on each Mac, `macos-<chip>-<macOS major>`, plus a `-stable` alias per chip:

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.

🔴 The macOS form has no recorded source. The OSDC grammar is linked and pinned ("copied from it at commit ca6864a9 (last changed 2026-08-04)", line 5), so it can be re-checked when ci-infra changes. The macOS regex only says "the runner install playbook in pytorch-gha-infra", with no file path, link or commit. If the playbook's naming changes (e.g. a -pro suffix or a new alias besides stable), nobody can tell this copy is stale, and the reviewer would block correct labels. Line 5 also still calls ci-infra "the canonical standard" for the whole document, but this section comes from elsewhere. Fix: link the playbook file and give the commit it was copied from, as line 5 does, and update line 5 to say the macOS form has a separate source.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Intentional: citing pytorch-gha-infra is enough here, and its playbook isn't publicly linkable. (Reply posted by Claude on behalf of @huydhn.)

@huydhn

huydhn commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge -f 'Lint jobs have passed'

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in progress PR is being worked on by the author, until the automated review accepts it Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants