Skip to content

review-pr: the queue notice was wrong in both directions - #7615

Merged
zufayu merged 2 commits into
ROCm:mainfrom
zufayu:fix/review-bot-queue-depth
Nov 9, 2026
Merged

zufayu merged 2 commits into
ROCm:mainfrom
zufayu:fix/review-bot-queue-depth

Conversation

@zufayu

@zufayu zufayu commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

What this changes

Two defects in the queue gate, both found in the rollout, both in the same notice:

  1. A burst was invisible. survey() read only status=in_progress runs. Ten requests fired together queued eight whole runs at the hosted runner before any gate job could run — and every gate that did run said "queued behind 1 review(s)" to a requester with six ahead of them. The 8-hour limit saw a shallow queue the whole time, so it refused nothing: it was designed against queue depth and only ever saw steady-state depth.

  2. The estimate was a constant remembered, not measured. AVG_REVIEW_MINUTES = 50 came from the longest review anyone had seen. The rollout measured 17/18/19/20/22/26 min (median 20), so every notice carried an ETA 2.5x high and the wait limit fired 2.5x early.

Why

A queued run of this workflow is a real request: a comment without the trigger phrase skips the gate job's if in seconds without ever waiting for a runner, so a run still sitting at queued passed that if. live_runs() now reads in_progress and queued.

But a review job at queued is ambiguous — waiting for the box, or its own gate never got a hosted runner — and the two demand opposite responses. The gate job's completed/success state is the discriminator:

  • past its gate, waiting for the box → counts toward the queue and toward the no-runner verdict (nothing moving with work waiting means the box is not picking up)
  • still short of the box → counts toward the queue and the ETA, never toward the no-runner verdict: a starved hosted runner is not a dead box, and paging the runner's owner over one would send someone to a healthy box

The mechanism

  • watchdog.py — paging refactored into _runs(repo, *statuses); in_progress_runs keeps its behavior (box_busy still asks only that: a queued run holds no runner). New live_runs() and recent_review_minutes(repo, want), which times the review job of the last few completed runs. Refused requests conclude successfully too, with no review to time, so they are skipped rather than priced.
  • queue_gate.py — survey() returns (running, waiting, arriving); decide() counts arriving toward ahead and the ETA but never toward no-runner. The estimate is the median of the last 8 completed reviews, falling back to the constant — with a warning — when the history cannot be read. The ETA is a courtesy, not a gate.

queue_gate_test.py grew five cases and four mutants, and its fake now serves runs by status, so paging and URLs stay shipping code. selftest 108 green / 0 red, check_prompts 0 drift.

🤖 Generated with Claude Code

Ten requests fired together queued eight whole runs at the hosted runner
before any gate job could run, and every gate that did read "queued behind
1" -- the requests it could not see were exactly the ones ahead of the
requester, and the 8-hour limit saw a shallow queue the whole time. In the
other direction, the estimate was a constant taken from the longest review
anyone had seen: the rollout measured 17/18/19/20/22/26 min (median 20)
while every notice said 50, so a requester was told to expect 2.5x what
the box does, and the wait limit fired 2.5x early.

A queued run of this workflow is a real request: a comment without the
trigger phrase skips the gate job's `if` in seconds without ever waiting
for a runner, so a run still queued passed it. survey() now reads those
runs too. But a review job sitting at "queued" is ambiguous -- waiting
for the box, or its own gate never got a hosted runner -- and the gate
job's completed/success state is what tells them apart. A request still
short of the box counts toward the queue but never toward the no-runner
verdict: a starved hosted runner is not a dead box, and paging the
runner's owner over one would send someone to a healthy box.

The estimate is now measured, not remembered: recent_review_minutes()
times the review job of the last few completed runs and the gate prices
the queue by the median. Refused requests conclude successfully too, with
no review to time, so they are skipped rather than priced. A history that
cannot be read degrades to the constant with a warning -- the ETA is a
courtesy, not a gate.

queue_gate_test.py grew five cases and four mutants, and its fake now
serves runs by status, so paging and URLs stay shipping code. selftest
108 green / 0 red, check_prompts 0 drift.

Co-Authored-By: Claude Code <[email protected]>
@zufayu
zufayu requested a review from a team November 7, 2026 23:59
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7615 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@aiter-bot

aiter-bot commented Nov 7, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 38b8814221c9 · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What is the most important boundary or failure mode introduced by this change, and what evidence covers it?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@zufayu
zufayu requested a review from valarLip November 8, 2026 07:47
@zufayu
zufayu merged commit 7125cd3 into ROCm:main Nov 9, 2026
ruanjm pushed a commit that referenced this pull request Nov 10, 2026
* review-pr: the queue notice was wrong in both directions

Ten requests fired together queued eight whole runs at the hosted runner
before any gate job could run, and every gate that did read "queued behind
1" -- the requests it could not see were exactly the ones ahead of the
requester, and the 8-hour limit saw a shallow queue the whole time. In the
other direction, the estimate was a constant taken from the longest review
anyone had seen: the rollout measured 17/18/19/20/22/26 min (median 20)
while every notice said 50, so a requester was told to expect 2.5x what
the box does, and the wait limit fired 2.5x early.

A queued run of this workflow is a real request: a comment without the
trigger phrase skips the gate job's `if` in seconds without ever waiting
for a runner, so a run still queued passed it. survey() now reads those
runs too. But a review job sitting at "queued" is ambiguous -- waiting
for the box, or its own gate never got a hosted runner -- and the gate
job's completed/success state is what tells them apart. A request still
short of the box counts toward the queue but never toward the no-runner
verdict: a starved hosted runner is not a dead box, and paging the
runner's owner over one would send someone to a healthy box.

The estimate is now measured, not remembered: recent_review_minutes()
times the review job of the last few completed runs and the gate prices
the queue by the median. Refused requests conclude successfully too, with
no review to time, so they are skipped rather than priced. A history that
cannot be read degrades to the constant with a warning -- the ETA is a
courtesy, not a gate.

queue_gate_test.py grew five cases and four mutants, and its fake now
serves runs by status, so paging and URLs stay shipping code. selftest
108 green / 0 red, check_prompts 0 drift.

Co-Authored-By: Claude Code <[email protected]>

* review-pr: the github class outgrew its "three calls" docstring

Co-Authored-By: Claude Code <[email protected]>

---------

Co-authored-by: zufayu <[email protected]>
Co-authored-by: Claude Code <[email protected]>
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.

3 participants