Skip to content

[pr-review] Block in proportion to stakes, not on everything - #202820

Draft
ezyang wants to merge 2 commits into
gh/ezyang/3647/basefrom
gh/ezyang/3647/head
Draft

ezyang wants to merge 2 commits into
gh/ezyang/3647/basefrom
gh/ezyang/3647/head

Conversation

@ezyang

@ezyang ezyang commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Linked issue or supporting maintainer

Part of pytorch/test-infra#9243

BC-breaking?

No.

Summary (human written only)

Agent details (if applicable)

"Treat every line as potentially load-bearing" and "Everything is a
must-fix" give the reviewer no way to call a true observation minor, so
every observation becomes Request Changes. In the ciforge eval, main
blocked 34/54 runs (63%) on PRs maintainers approved and merged
unchanged, and in local replays of re-review rounds from the PRs in
pytorch/test-infra#9243 it requested changes 88% of the time, which is
what keeps agent edit/review loops going.

Deleting the rule alone does not work: the skill then has no notion of
severity. On #202692 at 731814c (a branch mutation silently written into
a stride-fixing copy), the reviewer still found the bug but recommended
Needs Discussion in 4/5 runs, which stage B maps to ready for human
review. A flat "block only on concrete failures" rule overcorrected the
other way: in ciforge it cut false blocks to 9% and loop-round Request
Changes to 42%, but kept only 22/30 blocks on maintainer-confirmed
defects, because the reviewer found bugs and rated them non-blocking as
"not reachable" or "already broken before this PR".

This replaces the rule with three principles. Block in proportion to
stakes, weighing irreversibility and silence (serialized formats, then
silent wrong results, then APIs, then loud test or tooling crashes), with
REVIEW.md for directory-specific history. A bug the PR creates, exposes or
changes the failure of is the PR's even if the old code was also wrong,
while an unrelated preexisting bug does not block and the author is
reminded to fix it in a separate stacked PR. Before asking for a check,
look for the invariant: drop what it rules out, report what a concrete
path reaches, and treat a missing invariant as a design question rather
than a demand for defensive code.

It also drops the "load-bearing" paragraph (each example is already a
checklist item), softens "pattern mismatches are always wrong", and
removes the two references to the deleted rule. The non-blocking
convention matches #202634, so first reviews and re-reviews share one
severity model.

Test Plan:

The numbers above are for the flat "concrete failures" wording, not this
text. Eval runs (production stage A+B, 3 reps per case):

gh workflow run pr-review-eval-maintainer.yml -R pytorch/ciforge -f prompt_refs=4f716f5fe1a35fef5679118f57387eb58eab32cb,pr:202820 -f reps=3
gh workflow run pr-review-eval-regressions.yml -R pytorch/ciforge -f prompt_refs=4f716f5fe1a35fef5679118f57387eb58eab32cb,pr:202820 -f reps=3

Loop rounds and the #202692 control were replayed locally with a stage-A
replica (headless claude -p "/pr-review N" with production's offline
system prompt, tool allowlist, model and effort). This text should get
the same ciforge pair before it lands.

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

@pytorch-bot

pytorch-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit e1c770b with merge base 4f716f5 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Oct 30, 2026
@ezyang ezyang changed the title [pr-review] Block only on concrete failures (draft, eval only) [pr-review] Block in proportion to stakes, not on everything Oct 31, 2026
…dance

This revises the pr-review skill's Review Philosophy. The earlier version of this PR replaced "Everything is a must-fix" with one rule, "Block only on concrete failures". This update splits that rule into three principles and renumbers the list from 9 to 11 items.

5. **Block in proportion to stakes.** Reviewers now judge how irreversible and how silent a failure would be, instead of checking a fixed list of failure types. The rule gives examples to calibrate against:
   - Serialized formats are permanent.
   - Public APIs can be deprecated.
   - Silent wrong results are serious.
   - A crash in test or tooling code fails CI loudly, but tests that silently stop running are serious.

   A directory's `REVIEW.md` can add local guidance. Request Changes is still for high-stakes problems: wrong results, crashes users hit, and security or BC breaks. Everything else is marked "non-blocking" and kept out of the Recommendation. Needs Discussion stays reserved for direction questions, not defects.

6. **Own bugs the PR touches, not ones it doesn't.** The previous rule blocked whenever "the code was already wrong in that case before the PR". The new rule is more precise. A bug the PR creates, exposes, or whose failure it changes belongs to the PR, even if the old code was also wrong. A bug in code the PR doesn't affect is reported but doesn't block. The review should remind the author to fix it in a separate PR stacked with this one, not bundled in. An agent author that isn't already allowed to create a stack should ask permission first.

7. **Find the invariant before asking for a check.** This replaces the old "plausible path blocks even if unreproduced" wording:
   - If an invariant rules the case out, drop the finding.
   - If there is a concrete path that reaches it, report it, marked low confidence if it hasn't been reproduced.
   - If there's no clear invariant either way, raise it as a design question rather than asking for defensive code.

The softened "Match the immediate context" wording from the previous revision is unchanged. Only its number changes.

[ghstack-poisoned]
ezyang added a commit that referenced this pull request Oct 31, 2026
"Treat every line as potentially load-bearing" and "Everything is a
must-fix" give the reviewer no way to call a true observation minor, so
every observation becomes Request Changes. In the ciforge eval, main
blocked 34/54 runs (63%) on PRs maintainers approved and merged
unchanged, and in local replays of re-review rounds from the PRs in
pytorch/test-infra#9243 it requested changes 88% of the time, which is
what keeps agent edit/review loops going.

Deleting the rule alone does not work: the skill then has no notion of
severity. On #202692 at 731814c (a branch mutation silently written into
a stride-fixing copy), the reviewer still found the bug but recommended
Needs Discussion in 4/5 runs, which stage B maps to ready for human
review. A flat "block only on concrete failures" rule overcorrected the
other way: in ciforge it cut false blocks to 9% and loop-round Request
Changes to 42%, but kept only 22/30 blocks on maintainer-confirmed
defects, because the reviewer found bugs and rated them non-blocking as
"not reachable" or "already broken before this PR".

This replaces the rule with three principles. Block in proportion to
stakes, weighing irreversibility and silence (serialized formats, then
silent wrong results, then APIs, then loud test or tooling crashes), with
REVIEW.md for directory-specific history. A bug the PR creates, exposes or
changes the failure of is the PR's even if the old code was also wrong,
while an unrelated preexisting bug does not block and the author is
reminded to fix it in a separate stacked PR. Before asking for a check,
look for the invariant: drop what it rules out, report what a concrete
path reaches, and treat a missing invariant as a design question rather
than a demand for defensive code.

It also drops the "load-bearing" paragraph (each example is already a
checklist item), softens "pattern mismatches are always wrong", and
removes the two references to the deleted rule. The non-blocking
convention matches #202634, so first reviews and re-reviews share one
severity model.

Test Plan:

The numbers above are for the flat "concrete failures" wording, not this
text. Eval runs (production stage A+B, 3 reps per case):

```
gh workflow run pr-review-eval-maintainer.yml -R pytorch/ciforge -f prompt_refs=4f716f5fe1a35fef5679118f57387eb58eab32cb,pr:202820 -f reps=3
gh workflow run pr-review-eval-regressions.yml -R pytorch/ciforge -f prompt_refs=4f716f5fe1a35fef5679118f57387eb58eab32cb,pr:202820 -f reps=3
```

Loop rounds and the #202692 control were replayed locally with a stage-A
replica (headless `claude -p "/pr-review N"` with production's offline
system prompt, tool allowlist, model and effort). This text should get
the same ciforge pair before it lands.

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

Pull-Request: #202820
ghstack-source-id: d355056
janeyx99 added a commit that referenced this pull request Nov 2, 2026
## Linked issue or supporting maintainer

Part of pytorch/test-infra#9243

## BC-breaking?

No.

## Summary (human written only)

<!-- TODO: human summary -->

## Agent details (if applicable)

This ports Edward Yang's #202820 onto the minimized skill below it, so it
can be measured together with the re-review rules. The idea and most of the
wording are from #202820; see its description for the evidence behind it.

"Everything is a must-fix" turns every true observation into Request
Changes. In the ciforge maintainer eval on the stack below, the reviewer
blocked 42 of 54 runs on PRs that maintainers merged unchanged. This
replaces the rule with #202820's three principles: block in proportion to
stakes, own bugs the PR touches but not ones it doesn't, and find the
invariant before asking for a check. It also drops the "load-bearing"
paragraph, softens "pattern mismatches are always wrong", and removes the
two sibling-file references to the deleted rule.

Two changes from #202820. The Maintainer decision rule from the change
below moves from the deleted principle into the new principle 5, next to
"Needs Discussion is for a direction question". The untouched principles
keep their minimized wording.

Test Plan:

```
python3 -m unittest scripts.pr_review.test_workflow_contract.TestStageBMapsPrReviewsReview scripts.pr_review.test_workflow_contract.TestStageACoversTheSkillOffline
lintrunner -a .agents/skills/pr-review/SKILL.md .agents/skills/pr-review/review-checklist.md .agents/skills/pr-review/ci-runner-naming.md
```

ciforge results to follow.

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

ghstack-source-id: 64f31a7
Pull-Request: #203029

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant