Switch benchmarks to comment-triggered invocation#48
Merged
Conversation
Benchmarks are expensive and shouldn't run on every PR push. Switch to comment-triggered invocation via `/run-nps-benchmark` and `/run-stockfish-benchmark` commands. A help comment is posted automatically when a PR is opened that touches engine code.
Greptile SummarySwitches both Stockfish and NPS benchmarks from automatic
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| .github/workflows/benchmark-help.yml | New workflow that posts benchmark trigger instructions as a comment when a PR is opened that touches engine code. Straightforward and correct. |
| .github/workflows/benchmark.yml | Switched from pull_request trigger to issue_comment trigger for comment-based invocation. Adds gh pr checkout step, updates reaction handling, and correctly uses github.event.issue.number for PR references. The job dependency chain correctly gates execution through the react job's if condition. |
| .github/workflows/nps-benchmark.yml | New NPS benchmark workflow triggered by /run-nps-benchmark comment. Correct issue_comment pattern with proper if guard. Runs benchmark and posts results back to the PR. |
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant PR as Pull Request
participant GHA as GitHub Actions
participant Runner as CI Runner
Dev->>PR: Opens PR (touches engine code)
PR->>GHA: pull_request [opened]
GHA->>PR: Posts benchmark help comment
Dev->>PR: Comments /run-nps-benchmark
PR->>GHA: issue_comment [created]
GHA->>PR: Adds rocket reaction
GHA->>Runner: Checkout PR branch & run NPS bench
Runner->>PR: Posts NPS results comment
Dev->>PR: Comments /run-stockfish-benchmark
PR->>GHA: issue_comment [created]
GHA->>PR: Adds rocket reaction
GHA->>Runner: Checkout PR & run Stockfish bench (5 chunks × 3 skill levels)
Runner->>PR: Posts aggregated Stockfish results comment
Last reviewed commit: 6add9d9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/run-stockfish-benchmarkor/run-nps-benchmarkas a PR commentbenchmark-help.ymlworkflow posts instructions automatically when a PR is opened that touches engine codeTest plan
moonfish/**and verify the help comment is posted/run-nps-benchmarkon a PR and verify the NPS benchmark runs/run-stockfish-benchmarkon a PR and verify the Stockfish benchmark runs