Skip to content

[pr-review] Remove guidance on when tests are required - #202615

Closed
ezyang wants to merge 2 commits into
mainfrom
ptq/20261029-pytorch-adhoc-f90711
Closed

ezyang wants to merge 2 commits into
mainfrom
ptq/20261029-pytorch-adhoc-f90711

Conversation

@ezyang

@ezyang ezyang commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Human Note

Based on composability discussion. I ended up keeping things that were about how to write tests, rather than if they should exist.

Agent Report

What changed

The pr-review skill no longer tells the reviewer when a PR needs tests. Guidance on how to write tests stays.

  • .agents/skills/pr-review/review-checklist.md: drops the ### Test Existence subsection's "Tests exist" and "Regression tests for bug fixes" items (its placement items, "Tests are in the right place" and "New test file is rare", move to ### Test Patterns), drops "Edge cases covered" from ### Test Quality, and trims the "Use OpInfo" item's last sentence, which asked for single-operator behavior tests to be extended to all applicable operators. "Error conditions tested" becomes "Use assertRaisesRegex for expected exceptions": it says how to write an exception test, not when one is needed. "No duplicated test logic", "Prefer xfail over skip", and "Use weakref for lifetime testing" are unchanged.
  • .agents/skills/pr-review/SKILL.md: drops test coverage from the description and review focus (the focus now says "test patterns"), drops "tests that should exist" from what sub-agents look for, drops the rule that missing tests always mean Request Changes (the unaddressed-maintainer-comment rule stays), and rescopes the ### Testing output section and its precedence entry to how the tests are written. The "One finding, one section" example no longer uses a missing test.

Left alone

  • CLAUDE.md / AGENTS.md: its Testing section only says how to write tests.
  • Test-writing items elsewhere in the checklist (Testing implications, gradcheck, config.patch, torch.compile compatibility, Distributed testing).

Validation

Markdown-only change. The pr-review skill files are hashed into the hardened review's prompt hash, so the pr_review script suite runs on this PR:

python3 -m unittest discover -s scripts/pr_review -t .

526 tests; the two failures in TestTheSuiteActuallyRunsInCI fail identically on the unmodified base in this environment. lintrunner reports no issues.

Agent Worklog

2026-10-29

  • Goal: remove explicit test guidance from CLAUDE.md / AGENTS.md and the pr-review skill.
  • Edited CLAUDE.md, .agents/skills/pr-review/SKILL.md, .agents/skills/pr-review/review-checklist.md. bc-guidelines.md and ci-runner-naming.md contain no test guidance.
  • No duplicate open PR found via gh search prs.
  • pr_review unittest suite: same 2 env failures with and without the change; lintrunner clean.
  • Narrowed per review: keep CLAUDE.md and all test-writing guidance; remove only when-to-test guidance from the pr-review skill.

This PR was generated by ptq with human review.

As agreed at the composability sync, the automated reviewer should not
decide whether a PR needs tests. Drop the checklist items that require
tests to exist or cover edge cases, the OpInfo item's ask to extend
single-operator tests to all operators, and the "missing tests means
Request Changes" rule. Guidance on how to write tests (Test Patterns,
xfail over skip, weakref, assertRaisesRegex) stays, and the Testing
review section is rescoped to it.

Test Plan:

```
python3 -m unittest discover -s scripts/pr_review -t .
lintrunner
```

The two TestTheSuiteActuallyRunsInCI failures reproduce on the base
commit in this environment.

This PR was authored with the assistance of an AI agent.
@ezyang ezyang added the topic: not user facing topic category label Oct 29, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

⏳ No Failures, 17 Pending

As of commit dd5bf96 with merge base 421855c (image):
💚 Looks good so far! There are no failures yet. 💚

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

  • Policy change
    • Removes the rule that missing tests always mean Request Changes from .agents/skills/pr-review/SKILL.md
    • Drops the Tests exist and Regression tests for bug fixes items from .agents/skills/pr-review/review-checklist.md
  • Steering for AI reviewers
    • Both files are pytorch's AI PR-review skill instructions, so the edit changes what a later reviewer enforces
  • Socialization
    • PR body says the change follows a composability discussion; a review-policy shift like this needs a human sign-off

reason: not_trivial
Reviewed commit: e22210a (NOT the current head dd5bf96)

Inference job

🐛 Report a wrong verdict

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

@ezyang
ezyang requested a review from drisspg October 29, 2026 18:17
@ezyang
ezyang marked this pull request as ready for review October 29, 2026 18:17
@ezyang ezyang added autoland mergedog mergedog is watching this PR labels Oct 29, 2026

- [ ] **Proper module ownership** - Test files must have a real `# Owner(s): ["module: ..."]` label, not `"module: unknown"`. The author should create a new module label if needed and add themselves as owner
- [ ] **Use OpInfo** - Any testing for an operator or a cross-cutting feature must be done via OpInfo. Flag manual tests (e.g., `assertEqual(a + b, expected)`) for operators that already have OpInfo entries — these are redundant and will rot. When a PR adds dtype/device support to an operator, the testing should come from existing OpInfo infrastructure automatically (e.g., by adding the dtype to the operator's OpInfo `dtypes`), not from new manual tests. Likewise, a test checking a specific behavior for a single operator should not be a standalone test — the OpInfo infrastructure for that test category should be updated to cover the behavior across all applicable operators
- [ ] **Use OpInfo** - Any testing for an operator or a cross-cutting feature must be done via OpInfo. Flag manual tests (e.g., `assertEqual(a + b, expected)`) for operators that already have OpInfo entries — these are redundant and will rot. When a PR adds dtype/device support to an operator, the testing should come from existing OpInfo infrastructure automatically (e.g., by adding the dtype to the operator's OpInfo `dtypes`), not from new manual tests

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.

  • Use toleranceOverride - PR hard-codes tolerance values in individual assertions instead of using @toleranceOverride / @precisionOverride decorators which set per-dtype tolerances
  • Use DecorateInfo for OpInfo skips - PR adds @skipIf conditionals inside OpInfo test methods instead of using DecorateInfo in the OpInfo's skips or decorators tuple

shoudl this go in reveiw.md closer to opinfos?

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.

Claude is reluctant to do this because it involves a bunch of surgery, I'll give you a follow up PR for it.

@pytorchgreenlight pytorchgreenlight Bot added the GL/human GreenLight marked as needing human review label Oct 29, 2026
Comment thread .agents/skills/pr-review/SKILL.md Resolved
@ezyang

ezyang commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge -f "ci unnecessary"

@pytorchgreenlight pytorchgreenlight Bot added GL/superseded GreenLight review is superseded by changes and removed GL/human GreenLight marked as needing human review labels Oct 29, 2026

@janeyx99 janeyx99 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.

Looks like we can do a general followup sweep to move certain pieces to more local REVIEW.md's, like the sections above (e.g., Dynamo / Inductor / Compile) but not urgent and not in scope of PR

@albanD albanD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's try this!

@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

@pytorchbot pytorchbot added the in progress PR is being worked on by the author, until the automated review accepts it label Oct 29, 2026

@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 dd5bf96: nothing blocking; ready for human review.

The PR removes the pr-review skill's guidance on whether a PR needs tests and keeps the guidance on how to write them. Both maintainer comments are handled, but two checklist items (review-checklist.md:98 gradcheck and :130 torch.compile compatibility) still require tests to exist. Recommendation: Needs Discussion.

⚪ 1 non-blocking finding

review-checklist.md:98 (gradcheck testing) and :130 (torch.compile compatibility) still require tests to exist, which goes against the goal of this PR. (They are outside the diff, so this is anchored to the ### Test Patterns heading.) The PR description is wrong to list them under Left alone as "test-writing items". :98 flags custom backward logic that isn't tested with torch.autograd.gradcheck(), and :130 flags an op that isn't verified under torch.compile. Both are missing-test checks. In practice: a PR adds a custom autograd.Function backward with no gradient test. A reviewer following :98 still files "add a gradcheck test". Because the new SKILL.md:261 limits Testing to "how the tests are written", the finding moves to Infrastructure (precedence 5). So the when-to-test rule survives in another section and the reviewer gets mixed signals. Fix: reword both as how-to rules. :98: "PR checks custom backward gradients with hand-written comparisons instead of gradcheck() / gradgradcheck()". :130: "PR checks torch.compile compatibility with ad-hoc compiled-vs-eager tests instead of torch.library.opcheck / pt2_compliant_tag". Otherwise, state the exception in the PR description.

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

pytorchmergebot pushed a commit that referenced this pull request Oct 30, 2026
## Human Note
Opus misunderstood Driss's meaning, this is actually very small

## Agent Report
### What changed

Follow-up to #202615, from a review comment there on the "Use OpInfo" checklist item. Moves "Use toleranceOverride" and "Use DecorateInfo for OpInfo skips" up in `.agents/skills/pr-review/review-checklist.md` so they sit directly after "Use OpInfo". The text of every item is unchanged; this is a pure reorder.

### Validation

Markdown-only change.

```
python3 -m unittest discover -s scripts/pr_review -t .
lintrunner
```

<details>
<summary>Agent Worklog</summary>

### 2026-10-29

- Review comment on #202615, anchored on the "Use OpInfo" line, quoted the toleranceOverride / DecorateInfo items and asked whether they should go "closer to opinfos".
- A directory REVIEW.md was considered and rejected: REVIEW.md only applies to changed files under its directory, and these items are violated in test files spread across test/. Read the comment as asking to group the items with "Use OpInfo" in the checklist.

</details>

---
*This PR was generated by [ptq](https://github.com/drisspg/pt_job_queue) with human review.*
Pull Request resolved: #202617
Approved by: https://github.com/Skylion007, https://github.com/drisspg
pytorchmergebot pushed a commit that referenced this pull request Nov 3, 2026
…2802)

✴️ iz2: `add_numbered_label("merged")` counted every label containing "merged", so a PR carrying the unrelated `mergedog` label landed as `mergedX1` instead of `Merged` (e.g. #202615, #202617; 90 PRs carry `mergedX1`). Anything that checks for `Merged` then reads these lands as closed unmerged. #98551 meant the numbering to count only the label's own repeats.

This change counts only labels equal to the base or fully matching `<base>X<n>`.

Matching stays case-sensitive on purpose. The repo labels are `Merged` and `Reverted`, which `"merged" in "Merged"` never matched, so re-merges have always kept plain `Merged` (no PR carries `Merged` + `mergedX1` without `mergedog`, and none carries `revertedX1`). This keeps that behaviour; only PRs with a substring-matching label change.

Test plan: new `TestAddNumberedLabel` cases (`mergedog`, `mergedX1foo`/`mergedx1`, `Merged`, own repeats) fail on the old condition and pass with the fix. `python -m unittest test_trymerge`: 216 run, all pass except two git end-to-end tests that fail identically on unmodified main in my environment (tmp-dir cleanup `OSError`).
Pull Request resolved: #202802
Approved by: https://github.com/huydhn
bbayeste added a commit that referenced this pull request Nov 5, 2026
## Linked issue or supporting maintainer

Follow-up to #202615 and #202952.

## BC-breaking?

No.

## Summary (human written only)

Sync with PR #202615 on removing tests review from review agent

## Agent details (if applicable)

#202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed.

The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. This change removes the contradiction; whether it lowers that share is for the production numbers to show.

Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other.

| | main | This change |
|---|---|---|
| Findings asking for tests the PR lacks | 8 | 0 |
| Findings about how the PR's tests are written | 27 | 39 |
| All findings | 152 | 163 |
| Blocking findings | 46 | 50 |
| Reviews requesting changes | 10 of 10 | 10 of 10 |

The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic), and that part would still be raised under the exception.

Test plan:

```
python3 -m unittest discover -s scripts/pr_review -t .
# local replays, once per arm (--main 47ffd6f for main):
python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir>
```

This PR was authored with the help of an AI assistant (Claude).

ghstack-source-id: d8fdcf1
Pull-Request: #203491
bbayeste added a commit that referenced this pull request Nov 5, 2026
## Linked issue or supporting maintainer

Follow-up to #202615 and #202952.

## BC-breaking?

No.

## Summary (human written only)

Sync with PR #202615 on removing tests review from review agent

## Agent details (if applicable)

#202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed.

The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. This change removes the contradiction; whether it lowers that share is for the production numbers to show.

Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other.

| | main | This change |
|---|---|---|
| Findings asking for tests the PR lacks | 8 | 0 |
| Findings about how the PR's tests are written | 27 | 39 |
| All findings | 152 | 163 |
| Blocking findings | 46 | 50 |
| Reviews requesting changes | 10 of 10 | 10 of 10 |

The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic), and that part would still be raised under the exception.

Test plan:

```
python3 -m unittest discover -s scripts/pr_review -t .
# local replays, once per arm (--main 47ffd6f for main):
python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir>
```

This PR was authored with the help of an AI assistant (Claude).

ghstack-source-id: 8210062
Pull-Request: #203491
bbayeste added a commit that referenced this pull request Nov 5, 2026
## Linked issue or supporting maintainer

Follow-up to #202615 and #202952.

## BC-breaking?

No.

## Summary (human written only)

Sync with PR #202615 on removing tests review from review agent

## Agent details (if applicable)

#202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", which asks for the judgement #202615 removed. This drops "missing coverage" from that brief, so the brief matches #202615 again; the rest of the brief is unchanged.

Test plan:

```
python3 -m unittest discover -s scripts/pr_review -t .
```

This PR was authored with the help of an AI assistant (Claude).

ghstack-source-id: 57eabaa
Pull-Request: #203491
bbayeste added a commit that referenced this pull request Nov 5, 2026
## Linked issue or supporting maintainer

Follow-up to #202615 and #202952.

## BC-breaking?

No.

## Summary (human written only)

Sync with PR #202615 on removing tests review from review agent

## Agent details (if applicable)

#202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed.

The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. Per review, the share with at least one blocking missing-test finding was 24% before #202615, 26% between #202615 and #202952, and 36% after #202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show.

Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other.

| | main | This change |
|---|---|---|
| Findings asking for tests the PR lacks | 8 | 0 |
| Findings about how the PR's tests are written | 27 | 39 |
| All findings | 152 | 163 |
| Blocking findings | 46 | 50 |
| Reviews requesting changes | 10 of 10 | 10 of 10 |

The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic), and that part would still be raised under the exception.

Test plan:

```
python3 -m unittest discover -s scripts/pr_review -t .
# local replays, once per arm (--main 47ffd6f for main):
python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir>
```

This PR was authored with the help of an AI assistant (Claude).

ghstack-source-id: 8210062
Pull-Request: #203491
bbayeste added a commit that referenced this pull request Nov 5, 2026
## Linked issue or supporting maintainer

Follow-up to #202615 and #202952.

## BC-breaking?

No.

## Summary (human written only)

Sync with PR #202615 on removing tests review from review agent

## Agent details (if applicable)

#202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed.

The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. A test the PR deletes without explaining why is still a finding: asking to restore it is not asking for more tests. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. Per review, the share with at least one blocking missing-test finding was 24% before #202615, 26% between #202615 and #202952, and 36% after #202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show.

Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other.

| | main | This change |
|---|---|---|
| Findings asking for tests the PR lacks | 8 | 0 |
| Findings about how the PR's tests are written | 27 | 39 |
| All findings | 152 | 163 |
| Blocking findings | 46 | 50 |
| Reviews requesting changes | 10 of 10 | 10 of 10 |

The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic) and one is about tests the PR deleted; both would still be raised under the final wording.

Test plan:

```
python3 -m unittest discover -s scripts/pr_review -t .
# local replays, once per arm (--main 47ffd6f for main):
python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir>
```

This PR was authored with the help of an AI assistant (Claude).

ghstack-source-id: d4c0d17
Pull-Request: #203491
bbayeste added a commit that referenced this pull request Nov 5, 2026
## Linked issue or supporting maintainer

Follow-up to #202615 and #202952.

## BC-breaking?

No.

## Summary (human written only)

Sync with PR #202615 on removing tests review from review agent

## Agent details (if applicable)

#202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed.

The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. A test the PR deletes without explaining why is still a finding: asking to restore it is not asking for more tests. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. Per review, the share with at least one blocking missing-test finding was 24% before #202615, 26% between #202615 and #202952, and 36% after #202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show.

Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other.

| | main | This change |
|---|---|---|
| Findings asking for tests the PR lacks | 8 | 0 |
| Findings about how the PR's tests are written | 27 | 39 |
| All findings | 152 | 163 |
| Blocking findings | 46 | 50 |
| Reviews requesting changes | 10 of 10 | 10 of 10 |

The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic) and one is about tests the PR deleted; both would still be raised under the final wording.

Test plan:

```
python3 -m unittest discover -s scripts/pr_review -t .
# local replays, once per arm (--main 47ffd6f for main):
python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir>
```

This PR was authored with the help of an AI assistant (Claude).

ghstack-source-id: 7c08175
Pull-Request: #203491
pytorchmergebot pushed a commit that referenced this pull request Nov 5, 2026
#203491)

## Linked issue or supporting maintainer

Follow-up to #202615 and #202952.

## BC-breaking?

No.

## Summary (human written only)

Sync with PR #202615 on removing tests review from review agent

## Agent details (if applicable)

#202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. #202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement #202615 removed.

The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. A test the PR deletes without explaining why is still a finding: asking to restore it is not asking for more tests. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before #202615, 13% between #202615 and #202952, and 13% after #202952. Per review, the share with at least one blocking missing-test finding was 24% before #202615, 26% between #202615 and #202952, and 36% after #202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show.

Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other.

| | main | This change |
|---|---|---|
| Findings asking for tests the PR lacks | 8 | 0 |
| Findings about how the PR's tests are written | 27 | 39 |
| All findings | 152 | 163 |
| Blocking findings | 46 | 50 |
| Reviews requesting changes | 10 of 10 | 10 of 10 |

The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic) and one is about tests the PR deleted; both would still be raised under the final wording.

Test plan:

```
python3 -m unittest discover -s scripts/pr_review -t .
# local replays, once per arm (--main 47ffd6f for main):
python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir>
```

This PR was authored with the help of an AI assistant (Claude).

Pull Request resolved: #203491
Approved by: https://github.com/huydhn
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 5, 2026
## Human Note
Based on composability discussion. I ended up keeping things that were about how to write tests, rather than if they should exist.

## Agent Report
### What changed

The pr-review skill no longer tells the reviewer when a PR needs tests. Guidance on how to write tests stays.

- `.agents/skills/pr-review/review-checklist.md`: drops the `### Test Existence` subsection's "Tests exist" and "Regression tests for bug fixes" items (its placement items, "Tests are in the right place" and "New test file is rare", move to `### Test Patterns`), drops "Edge cases covered" from `### Test Quality`, and trims the "Use OpInfo" item's last sentence, which asked for single-operator behavior tests to be extended to all applicable operators. "Error conditions tested" becomes "Use assertRaisesRegex for expected exceptions": it says how to write an exception test, not when one is needed. "No duplicated test logic", "Prefer xfail over skip", and "Use weakref for lifetime testing" are unchanged.
- `.agents/skills/pr-review/SKILL.md`: drops test coverage from the description and review focus (the focus now says "test patterns"), drops "tests that should exist" from what sub-agents look for, drops the rule that missing tests always mean **Request Changes** (the unaddressed-maintainer-comment rule stays), and rescopes the `### Testing` output section and its precedence entry to how the tests are written. The "One finding, one section" example no longer uses a missing test.

### Left alone

- `CLAUDE.md` / `AGENTS.md`: its Testing section only says how to write tests.
- Test-writing items elsewhere in the checklist (Testing implications, gradcheck, config.patch, torch.compile compatibility, Distributed testing).

### Validation

Markdown-only change. The pr-review skill files are hashed into the hardened review's prompt hash, so the pr_review script suite runs on this PR:

```
python3 -m unittest discover -s scripts/pr_review -t .
```

526 tests; the two failures in `TestTheSuiteActuallyRunsInCI` fail identically on the unmodified base in this environment. `lintrunner` reports no issues.

<details>
<summary>Agent Worklog</summary>

### 2026-10-29

- Goal: remove explicit test guidance from CLAUDE.md / AGENTS.md and the pr-review skill.
- Edited CLAUDE.md, .agents/skills/pr-review/SKILL.md, .agents/skills/pr-review/review-checklist.md. bc-guidelines.md and ci-runner-naming.md contain no test guidance.
- No duplicate open PR found via `gh search prs`.
- pr_review unittest suite: same 2 env failures with and without the change; lintrunner clean.
- Narrowed per review: keep CLAUDE.md and all test-writing guidance; remove only when-to-test guidance from the pr-review skill.

</details>

---
*This PR was generated by [ptq](https://github.com/drisspg/pt_job_queue) with human review.*
Pull Request resolved: pytorch#202615
Approved by: https://github.com/drisspg, https://github.com/janeyx99, https://github.com/albanD
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 5, 2026
…#202617)

## Human Note
Opus misunderstood Driss's meaning, this is actually very small

## Agent Report
### What changed

Follow-up to pytorch#202615, from a review comment there on the "Use OpInfo" checklist item. Moves "Use toleranceOverride" and "Use DecorateInfo for OpInfo skips" up in `.agents/skills/pr-review/review-checklist.md` so they sit directly after "Use OpInfo". The text of every item is unchanged; this is a pure reorder.

### Validation

Markdown-only change.

```
python3 -m unittest discover -s scripts/pr_review -t .
lintrunner
```

<details>
<summary>Agent Worklog</summary>

### 2026-10-29

- Review comment on pytorch#202615, anchored on the "Use OpInfo" line, quoted the toleranceOverride / DecorateInfo items and asked whether they should go "closer to opinfos".
- A directory REVIEW.md was considered and rejected: REVIEW.md only applies to changed files under its directory, and these items are violated in test files spread across test/. Read the comment as asking to group the items with "Use OpInfo" in the checklist.

</details>

---
*This PR was generated by [ptq](https://github.com/drisspg/pt_job_queue) with human review.*
Pull Request resolved: pytorch#202617
Approved by: https://github.com/Skylion007, https://github.com/drisspg
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 5, 2026
…orch#202802)

✴️ iz2: `add_numbered_label("merged")` counted every label containing "merged", so a PR carrying the unrelated `mergedog` label landed as `mergedX1` instead of `Merged` (e.g. pytorch#202615, pytorch#202617; 90 PRs carry `mergedX1`). Anything that checks for `Merged` then reads these lands as closed unmerged. pytorch#98551 meant the numbering to count only the label's own repeats.

This change counts only labels equal to the base or fully matching `<base>X<n>`.

Matching stays case-sensitive on purpose. The repo labels are `Merged` and `Reverted`, which `"merged" in "Merged"` never matched, so re-merges have always kept plain `Merged` (no PR carries `Merged` + `mergedX1` without `mergedog`, and none carries `revertedX1`). This keeps that behaviour; only PRs with a substring-matching label change.

Test plan: new `TestAddNumberedLabel` cases (`mergedog`, `mergedX1foo`/`mergedx1`, `Merged`, own repeats) fail on the old condition and pass with the fix. `python -m unittest test_trymerge`: 216 run, all pass except two git end-to-end tests that fail identically on unmodified main in my environment (tmp-dir cleanup `OSError`).
Pull Request resolved: pytorch#202802
Approved by: https://github.com/huydhn
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 5, 2026
pytorch#203491)

## Linked issue or supporting maintainer

Follow-up to pytorch#202615 and pytorch#202952.

## BC-breaking?

No.

## Summary (human written only)

Sync with PR pytorch#202615 on removing tests review from review agent

## Agent details (if applicable)

pytorch#202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. pytorch#202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement pytorch#202615 removed.

The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. A test the PR deletes without explaining why is still a finding: asking to restore it is not asking for more tests. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before pytorch#202615, 13% between pytorch#202615 and pytorch#202952, and 13% after pytorch#202952. Per review, the share with at least one blocking missing-test finding was 24% before pytorch#202615, 26% between pytorch#202615 and pytorch#202952, and 36% after pytorch#202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show.

Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other.

| | main | This change |
|---|---|---|
| Findings asking for tests the PR lacks | 8 | 0 |
| Findings about how the PR's tests are written | 27 | 39 |
| All findings | 152 | 163 |
| Blocking findings | 46 | 50 |
| Reviews requesting changes | 10 of 10 | 10 of 10 |

The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic) and one is about tests the PR deleted; both would still be raised under the final wording.

Test plan:

```
python3 -m unittest discover -s scripts/pr_review -t .
# local replays, once per arm (--main 47ffd6f for main):
python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir>
```

This PR was authored with the help of an AI assistant (Claude).

Pull Request resolved: pytorch#203491
Approved by: https://github.com/huydhn
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 9, 2026
## Human Note
Based on composability discussion. I ended up keeping things that were about how to write tests, rather than if they should exist.

## Agent Report
### What changed

The pr-review skill no longer tells the reviewer when a PR needs tests. Guidance on how to write tests stays.

- `.agents/skills/pr-review/review-checklist.md`: drops the `### Test Existence` subsection's "Tests exist" and "Regression tests for bug fixes" items (its placement items, "Tests are in the right place" and "New test file is rare", move to `### Test Patterns`), drops "Edge cases covered" from `### Test Quality`, and trims the "Use OpInfo" item's last sentence, which asked for single-operator behavior tests to be extended to all applicable operators. "Error conditions tested" becomes "Use assertRaisesRegex for expected exceptions": it says how to write an exception test, not when one is needed. "No duplicated test logic", "Prefer xfail over skip", and "Use weakref for lifetime testing" are unchanged.
- `.agents/skills/pr-review/SKILL.md`: drops test coverage from the description and review focus (the focus now says "test patterns"), drops "tests that should exist" from what sub-agents look for, drops the rule that missing tests always mean **Request Changes** (the unaddressed-maintainer-comment rule stays), and rescopes the `### Testing` output section and its precedence entry to how the tests are written. The "One finding, one section" example no longer uses a missing test.

### Left alone

- `CLAUDE.md` / `AGENTS.md`: its Testing section only says how to write tests.
- Test-writing items elsewhere in the checklist (Testing implications, gradcheck, config.patch, torch.compile compatibility, Distributed testing).

### Validation

Markdown-only change. The pr-review skill files are hashed into the hardened review's prompt hash, so the pr_review script suite runs on this PR:

```
python3 -m unittest discover -s scripts/pr_review -t .
```

526 tests; the two failures in `TestTheSuiteActuallyRunsInCI` fail identically on the unmodified base in this environment. `lintrunner` reports no issues.

<details>
<summary>Agent Worklog</summary>

### 2026-10-29

- Goal: remove explicit test guidance from CLAUDE.md / AGENTS.md and the pr-review skill.
- Edited CLAUDE.md, .agents/skills/pr-review/SKILL.md, .agents/skills/pr-review/review-checklist.md. bc-guidelines.md and ci-runner-naming.md contain no test guidance.
- No duplicate open PR found via `gh search prs`.
- pr_review unittest suite: same 2 env failures with and without the change; lintrunner clean.
- Narrowed per review: keep CLAUDE.md and all test-writing guidance; remove only when-to-test guidance from the pr-review skill.

</details>

---
*This PR was generated by [ptq](https://github.com/drisspg/pt_job_queue) with human review.*
Pull Request resolved: pytorch#202615
Approved by: https://github.com/drisspg, https://github.com/janeyx99, https://github.com/albanD
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 9, 2026
…#202617)

## Human Note
Opus misunderstood Driss's meaning, this is actually very small

## Agent Report
### What changed

Follow-up to pytorch#202615, from a review comment there on the "Use OpInfo" checklist item. Moves "Use toleranceOverride" and "Use DecorateInfo for OpInfo skips" up in `.agents/skills/pr-review/review-checklist.md` so they sit directly after "Use OpInfo". The text of every item is unchanged; this is a pure reorder.

### Validation

Markdown-only change.

```
python3 -m unittest discover -s scripts/pr_review -t .
lintrunner
```

<details>
<summary>Agent Worklog</summary>

### 2026-10-29

- Review comment on pytorch#202615, anchored on the "Use OpInfo" line, quoted the toleranceOverride / DecorateInfo items and asked whether they should go "closer to opinfos".
- A directory REVIEW.md was considered and rejected: REVIEW.md only applies to changed files under its directory, and these items are violated in test files spread across test/. Read the comment as asking to group the items with "Use OpInfo" in the checklist.

</details>

---
*This PR was generated by [ptq](https://github.com/drisspg/pt_job_queue) with human review.*
Pull Request resolved: pytorch#202617
Approved by: https://github.com/Skylion007, https://github.com/drisspg
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 9, 2026
…orch#202802)

✴️ iz2: `add_numbered_label("merged")` counted every label containing "merged", so a PR carrying the unrelated `mergedog` label landed as `mergedX1` instead of `Merged` (e.g. pytorch#202615, pytorch#202617; 90 PRs carry `mergedX1`). Anything that checks for `Merged` then reads these lands as closed unmerged. pytorch#98551 meant the numbering to count only the label's own repeats.

This change counts only labels equal to the base or fully matching `<base>X<n>`.

Matching stays case-sensitive on purpose. The repo labels are `Merged` and `Reverted`, which `"merged" in "Merged"` never matched, so re-merges have always kept plain `Merged` (no PR carries `Merged` + `mergedX1` without `mergedog`, and none carries `revertedX1`). This keeps that behaviour; only PRs with a substring-matching label change.

Test plan: new `TestAddNumberedLabel` cases (`mergedog`, `mergedX1foo`/`mergedx1`, `Merged`, own repeats) fail on the old condition and pass with the fix. `python -m unittest test_trymerge`: 216 run, all pass except two git end-to-end tests that fail identically on unmodified main in my environment (tmp-dir cleanup `OSError`).
Pull Request resolved: pytorch#202802
Approved by: https://github.com/huydhn
dominikjastrzebskix pushed a commit to dominikjastrzebskix/pytorch that referenced this pull request Nov 9, 2026
pytorch#203491)

## Linked issue or supporting maintainer

Follow-up to pytorch#202615 and pytorch#202952.

## BC-breaking?

No.

## Summary (human written only)

Sync with PR pytorch#202615 on removing tests review from review agent

## Agent details (if applicable)

pytorch#202615 removed the pr-review skill's guidance on whether a PR needs tests and kept the guidance on how tests are written. pytorch#202952, which landed three days later, briefed the fan-out Tests reviewer with "missing coverage", so the skill now asks for the judgement pytorch#202615 removed.

The Tests brief now covers only how the PR's tests are written (tests that cannot fail or do not check what they claim, flakiness, and the checklist's Testing items) and says that whether the PR needs more tests is not a finding, unless the checklist or an applicable `REVIEW.md` requires the test (for example the adversarial test for a `weights_only` allowlist change in torch/REVIEW.md, or `gradcheck` for custom backward logic), so those requirements still stand. A test the PR deletes without explaining why is still a finding: asking to restore it is not asking for more tests. The explicit sentence is there because the agent raises missing coverage without being asked: in a sample of one production review per PR (1,331 PRs, Oct 2 to Nov 4), findings about missing coverage were 9% of all findings before pytorch#202615, 13% between pytorch#202615 and pytorch#202952, and 13% after pytorch#202952. Per review, the share with at least one blocking missing-test finding was 24% before pytorch#202615, 26% between pytorch#202615 and pytorch#202952, and 36% after pytorch#202952: removing the guidance did not change the behavior. This change removes the contradiction; whether it lowers that share is for the production numbers to show.

Evaluation: 10 PRs from ciforge's `recall_full` dataset, the ones where the fan-out review most often asked for tests, each reviewed once with main (47ffd6f) and once with this change, locally with production's prompts and model. A model labelled each finding as asking for tests the PR lacks, about how the PR's tests are written, or other.

| | main | This change |
|---|---|---|
| Findings asking for tests the PR lacks | 8 | 0 |
| Findings about how the PR's tests are written | 27 | 39 |
| All findings | 152 | 163 |
| Blocking findings | 46 | 50 |
| Reviews requesting changes | 10 of 10 | 10 of 10 |

The Tests reviewer stops asking for missing tests and spends that attention on the tests the PR has. Blocking findings and verdicts do not drop; the difference is within run-to-run noise. One run per PR: a signal, not a measurement. These runs used the brief before the checklist and `REVIEW.md` exception was added; of the 8 missing-test findings, one partly asks for a test the checklist requires (`gradcheck` for custom backward logic) and one is about tests the PR deleted; both would still be raised under the final wording.

Test plan:

```
python3 -m unittest discover -s scripts/pr_review -t .
# local replays, once per arm (--main 47ffd6f for main):
python3 run_local_eval.py --dataset recall_full --only <the 10 cases> --main <this commit> --out <dir>
```

This PR was authored with the help of an AI assistant (Claude).

Pull Request resolved: pytorch#203491
Approved by: https://github.com/huydhn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoland GL/superseded GreenLight review is superseded by changes in progress PR is being worked on by the author, until the automated review accepts it mergedog mergedog is watching this PR mergedX1 topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants