Skip to content

[CI] check_signal: wait for a located run instead of giving up on it - #8339

Merged
zufayu merged 1 commit into
mainfrom
opus/check-signal-wait-for-prechecks
Nov 20, 2026
Merged

zufayu merged 1 commit into
mainfrom
opus/check-signal-wait-for-prechecks

Conversation

@zufayu

@zufayu zufayu commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

check-signal goes red on a pre-check that passes, whenever the queue is deep. It gates eight workflows, and Aiter Test Gate is one of them.

What happens

.github/scripts/check_signal.sh spends one budget -- MAX_RETRIES=5, thirty seconds apart -- on two different situations:

  • the Checks run has not been found yet;
  • the run has been found and is still queued / in_progress.

Five attempts is a reasonable budget for the first. For the second it is not a budget at all: it says the pre-check has 2.5 minutes to finish, and when it does not, the script prints Failed to read pre-checks status after 5 attempts and exits 1.

Observed on #8291 (run 44609631181), with ~190 runs queued on the repo at the time:

Attempt 2: run 44609631130 status=queued     conclusion=<none>
Attempt 3: run 44609631130 status=in_progress conclusion=<none>
Attempt 4: run 44609631130 status=in_progress conclusion=<none>
Attempt 5: run 44609631130 status=in_progress conclusion=<none>
Failed to read pre-checks status after 5 attempts. Exiting workflow.

Run 44609631130 finished completed / success. The run it was waiting for was fine; only the waiting was too short. Re-running the job alone turned it green.

The change

Budget the two apart.

  • MAX_RETRIES keeps bounding the lookup: a run that cannot be found usually means the event never started one, and that should not take long to conclude.
  • Once a run is located, poll it until it completes, bounded by MAX_WAIT_SECONDS (default 2700). A genuinely stuck run still ends the job rather than holding a runner forever, and the message says which case it was.

Exit codes are unchanged: 0 on success, 78 on a pre-check that did not pass, 1 when the run cannot be located or is still running at the deadline.

Verified

Against a stubbed gh, all four paths:

case current this PR
located, runs past the budget, then succeeds exit 1 exit 0
pre-checks failed 78 78
never located 1 1
still running at the deadline — 1

🤖 Generated with Claude Code

PR Self-Review

Reviewed revision

0097c0ba67

Behavior and intent

.github/scripts/check_signal.sh spends a single retry budget -- five attempts, thirty seconds apart -- on two situations that are not alike: the Checks run has not been found yet, and the run has been found and is still queued / in_progress. For the first that is a reasonable budget. For the second it is not a budget at all: it gives the pre-check 2.5 minutes to finish, and when it does not, the script exits 1 and takes the gate red on a pre-check that goes on to pass.

The existing behaviour is insufficient because the failure is a function of queue depth, not of anything the PR did. Observed on #8291 (run 44609631181) with ~190 runs queued on the repo: run 44609631130 was located on attempt 2, was in_progress through attempt 5, and the script gave up -- that run finished completed / success. Re-running the job alone turned it green. Eight workflows gate on this script and Aiter Test Gate is one of them, so every PR is exposed whenever the repo is busy.

This budgets the two apart. MAX_RETRIES still bounds locating the run, because a run that cannot be found usually means the event never started one. Once located, the script polls until the run completes, bounded by MAX_WAIT_SECONDS (default 2700) so a genuinely stuck run still ends the job rather than holding a runner indefinitely. Exit codes are unchanged: 0 on success, 78 on a pre-check that did not pass, 1 on "cannot locate" or "still running at the deadline".

Validation and unverified scope

Exercised against a stubbed gh on this machine, with MAX_RETRIES=3 RETRY_INTERVAL_SECONDS=0, running both the current origin/main script and this one over the same stub:

case origin/main this PR
located, still running past the budget, then completed/success exit 1 exit 0
pre-checks concluded failure 78 78
run never located 1 1
still running when MAX_WAIT_SECONDS elapses n/a 1

bash -n clean.

Unverified: the real-CI path. The stub replaces gh run list and gh api .../actions/runs/<id>, so what is proven is the script's control flow and exit codes, not the shape of the live API responses. Those two call sites are unchanged from the current script, which is the argument for the stub being representative rather than merely convenient. What would close it is one real run while the repo is busy -- which is the condition that cannot be arranged on demand.

PR-specific question

What permissions and untrusted-input boundary does this CI change have, and can fork PR code or text reach a privileged execution path?

No new permissions and no new boundary. The script keeps running in the same job, with the same GITHUB_TOKEN the step already passed it, and makes the same two read-only API calls as before (gh run list for the workflow, gh api repos/.../actions/runs/<id> for status). It writes nothing and still executes nothing from the repository under test.

Nothing from a fork PR gains a path here. The values the script interpolates are workflow-provided -- GITHUB_REPOSITORY, GITHUB_SHA, GITHUB_HEAD_REF, and the event payload's head SHA -- and are used exactly as before, as gh arguments and in a --jq string comparison; no new interpolation site is added. The two new quantities, MAX_WAIT_SECONDS and the loop counter, are numeric and come from the workflow environment, not from PR content. The only behavioural difference a fork PR can produce is that the job waits longer before concluding.

Changed op tests

None.

One retry budget covered two different situations: not having found the
Checks run yet, and having found it while it is still going. Five
attempts thirty seconds apart is a reasonable budget for the first and
no budget at all for the second -- on a busy day the queue alone holds a
run past 2.5 minutes, and the script then reports "Failed to read
pre-checks status" and exits 1, taking the gate red on a pre-check that
goes on to pass.

Seen on #8291: run 44609631130 was located on attempt 2 and was still
in_progress through attempt 5; its conclusion was success. Every
workflow that gates on this script -- eight of them -- fails the same
way whenever the queue is deep.

So the two are budgeted apart. MAX_RETRIES still bounds locating the
run, because a missing run usually means the event never started one.
Once located, the script polls until the run completes, bounded by
MAX_WAIT_SECONDS (45 minutes) so a genuinely stuck run still ends the
job rather than holding a runner forever.

Exercised against a stubbed `gh` on all four paths: slow-then-success
(exit 0, where the current script exits 1), pre-checks failed (78),
never located (1), and still running at the deadline (1).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@zufayu
zufayu requested a review from a team November 20, 2026 02:37
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
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 Radeon R9700 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 8339 --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.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@github-actions github-actions Bot added the CI label Nov 20, 2026
@aiter-bot

aiter-bot commented Nov 20, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 0097c0ba67aa · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

`.github/scripts/check_signal.sh` spends a single retry budget -- five attempts, thirty seconds apart -- on two situations that are not alike: the Checks run has not been found yet, and the run has been found and is still `queued` / `in_progress`. For the first that is a reasonable budget. For the second it is not a budget at all: it gives the pre-check 2.5 minutes to finish, and when it does not, the script exits 1 and takes the gate red on a pre-check that goes on to pass.

The existing behaviour is insufficient because the failure is a function of queue depth, not of anything the PR did. Observed on #8291 (run `44609631181`) with ~190 runs queued on the repo: run `44609631130` was located on attempt 2, was `in_progress` through attempt 5, and the script gave up -- that run finished `completed / success`. Re-running the job alone turned it green. Eight workflows gate on this script and `Aiter Test Gate` is one of them, so every PR is exposed whenever the repo is busy.

This budgets the two apart. `MAX_RETRIES` still bounds locating the run, because a run that cannot be found usually means the event never started one. Once located, the script polls until the run completes, bounded by `MAX_WAIT_SECONDS` (default 2700) so a genuinely stuck run still ends the job rather than holding a runner indefinitely. Exit codes are unchanged: 0 on success, 78 on a pre-check that did not pass, 1 on "cannot locate" or "still running at the deadline".

Validation and unverified scope

Exercised against a stubbed `gh` on this machine, with `MAX_RETRIES=3 RETRY_INTERVAL_SECONDS=0`, running both the current `origin/main` script and this one over the same stub:

| case | `origin/main` | this PR |
|---|---|---|
| located, still running past the budget, then `completed/success` | exit 1 | **exit 0** |
| pre-checks concluded `failure` | 78 | 78 |
| run never located | 1 | 1 |
| still running when `MAX_WAIT_SECONDS` elapses | n/a | 1 |

`bash -n` clean.

Unverified: the real-CI path. The stub replaces `gh run list` and `gh api .../actions/runs/<id>`, so what is proven is the script's control flow and exit codes, not the shape of the live API responses. Those two call sites are unchanged from the current script, which is the argument for the stub being representative rather than merely convenient. What would close it is one real run while the repo is busy -- which is the condition that cannot be arranged on demand.

PR-specific question

*What permissions and untrusted-input boundary does this CI change have, and can fork PR code or text reach a privileged execution path?*

No new permissions and no new boundary. The script keeps running in the same job, with the same `GITHUB_TOKEN` the step already passed it, and makes the same two read-only API calls as before (`gh run list` for the workflow, `gh api repos/.../actions/runs/<id>` for status). It writes nothing and still executes nothing from the repository under test.

Nothing from a fork PR gains a path here. The values the script interpolates are workflow-provided -- `GITHUB_REPOSITORY`, `GITHUB_SHA`, `GITHUB_HEAD_REF`, and the event payload's head SHA -- and are used exactly as before, as `gh` arguments and in a `--jq` string comparison; no new interpolation site is added. The two new quantities, `MAX_WAIT_SECONDS` and the loop counter, are numeric and come from the workflow environment, not from PR content. The only behavioural difference a fork PR can produce is that the job waits longer before concluding.

Changed op tests

None.

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot did not review the current head SHA

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed

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 merged commit afc300d into main Nov 20, 2026
5 checks passed
@zufayu
zufayu deleted the opus/check-signal-wait-for-prechecks branch November 20, 2026 08:21
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.

3 participants