Compare commits

..

1 Commits

Author SHA1 Message Date
483738817a Benchmark no longer auto commits and just leaves a comment on the PR
Some checks failed
Merge-Checker / Benchmarking (pull_request) Failing after 22s
Merge-Checker / build_and_test (pull_request) Successful in 17s
2025-05-29 16:21:40 -04:00
3 changed files with 53 additions and 56 deletions

View File

@@ -93,35 +93,32 @@ jobs:
echo "timings_changed=false" >> $GITHUB_OUTPUT
fi
- name: Commit and push timing results
if: steps.check_diff.outputs.timings_changed == 'true' && github.event.pull_request.head.repo.full_name == github.repository
- name: Leave PR comment with timing updates
if: steps.check_diff.outputs.timings_changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "ci-bot"
git config --global user.email "ci-bot@local"
echo "Preparing PR comment with new timing results..."
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
git stash
echo "Checking out source branch $BRANCH_NAME"
git fetch origin "$BRANCH_NAME"
git checkout "$BRANCH_NAME"
git pull
COMMENT_BODY=$(echo -e "### ⏱ Timing Results Changed\n\n" \
"The benchmark detected significant timing changes (≥ 0.1s).\n\n" \
"**Please review and commit the updated timing results** to:\n\`\`\`\nunit-tests/timing-results/matrix-timing-tests.txt\n\`\`\`\n\n" \
"Latest result:\n\`\`\`\n$(cat unit-tests/timing-results/matrix-timing-tests.txt)\n\`\`\`\n\n" \
"<!-- timing-bot-comment -->")
echo "Checking if last commit was a timing update"
LAST_COMMIT_MSG=$(git log -1 --pretty=%B)
PR_NUMBER="${{ github.event.pull_request.number }}"
if echo "$LAST_COMMIT_MSG" | grep -q "Update matrix-timing-tests timings"; then
echo "Last commit was a timing update, skipping commit."
exit 0
# Look for an existing bot comment
COMMENT_ID=$(gh api repos/${{ github.repository }}/issues/${PR_NUMBER}/comments \
--jq '.[] | select(.body | contains("<!-- timing-bot-comment -->")) | .id')
if [ -z "$COMMENT_ID" ]; then
echo "Creating new PR comment"
gh api repos/${{ github.repository }}/issues/${PR_NUMBER}/comments \
-f body="$COMMENT_BODY"
else
echo "Last commit name was: $LAST_COMMIT_MSG"
git stash pop
echo "Updating existing PR comment"
gh api repos/${{ github.repository }}/issues/comments/${COMMENT_ID} \
-X PATCH -F body="$COMMENT_BODY"
fi
git add unit-tests/timing-results/matrix-timing-tests.txt
if git diff --quiet --cached; then
echo "No changes to commit"
else
git commit -m "Update matrix-timing-tests timings"
git push origin "$BRANCH_NAME"
fi

View File

@@ -1,7 +1,7 @@
name: Merge-Checker
on:
push:
pull_request:
branches: ["**"]
jobs:

View File

@@ -1,51 +1,51 @@
Randomness seeded to: 2272928918
0.178 s: Addition
0.179 s: Timing Tests
0.171 s: Subtraction
0.172 s: Timing Tests
1.875 s: Multiplication
1.875 s: Timing Tests
0.123 s: Scalar Multiplication
0.123 s: Timing Tests
0.172 s: Element Multiply
0.172 s: Timing Tests
0.181 s: Element Divide
0.181 s: Timing Tests
0.160 s: Minor Matrix
0.160 s: Timing Tests
0.103 s: Determinant
0.103 s: Timing Tests
0.415 s: Matrix of Minors
0.415 s: Timing Tests
Randomness seeded to: 2310772973
0.174 s: Addition
0.174 s: Timing Tests
0.169 s: Subtraction
0.169 s: Timing Tests
20 s: Multiplication
1.853 s: Timing Tests
0.121 s: Scalar Multiplication
0.121 s: Timing Tests
0.177 s: Element Multiply
0.177 s: Timing Tests
0.168 s: Element Divide
0.168 s: Timing Tests
0.150 s: Minor Matrix
0.150 s: Timing Tests
0.102 s: Determinant
0.102 s: Timing Tests
0.419 s: Matrix of Minors
0.419 s: Timing Tests
0.110 s: Invert
0.110 s: Timing Tests
0.125 s: Transpose
0.125 s: Timing Tests
0.192 s: Normalize
0.192 s: Timing Tests
0.123 s: Transpose
0.123 s: Timing Tests
0.189 s: Normalize
0.189 s: Timing Tests
0.006 s: GET ROW
0.006 s: Timing Tests
0.235 s: GET COLUMN
0.235 s: Timing Tests
0.229 s: GET COLUMN
0.229 s: Timing Tests
===============================================================================
test cases: 1 | 1 passed
assertions: - none -
Command being timed: "build/unit-tests/matrix-timing-tests -d yes"
User time (seconds): 4.05
User time (seconds): 3.98
System time (seconds): 0.00
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:04.05
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:03.99
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 3072
Maximum resident set size (kbytes): 3200
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 184
Minor (reclaiming a frame) page faults: 171
Minor (reclaiming a frame) page faults: 172
Voluntary context switches: 1
Involuntary context switches: 20
Involuntary context switches: 10
Swaps: 0
File system inputs: 12
File system outputs: 1