Compare commits

...

1 Commits

Author SHA1 Message Date
b027c83b9c Fixing timing test runner
All checks were successful
Merge-Checker / build_and_test (pull_request) Successful in 54s
2025-05-29 11:33:13 -04:00

View File

@@ -42,33 +42,39 @@ jobs:
- name: Compare timing results
id: check_diff
run: |
# Ensure the previous version exists (from git)
git show origin/${{ github.event.pull_request.head.ref }}:unit-tests/timing-results/matrix-timing-tests.txt > old.txt || echo "" > old.txt
cp unit-tests/timing-results/matrix-timing-tests.txt new.txt
echo "Comparing timing results..."
echo "Comparing timing results for changes ≥ 0.1s (ignoring 'Timing Tests' lines)..."
CHANGED=0
awk '
BEGIN { change_threshold=0.1 }
/^[0-9]+\.[0-9]+ s: / {
new_time = $1
label = substr($0, index($0, ":") + 2)
if (label_times[label]) {
old_time = label_times[label]
delta = new_time - old_time
if (delta < 0) delta = -delta
if (delta >= change_threshold) {
changed = 1
}
} else {
changed = 1
}
BEGIN {
change_threshold = 0.1
changed = 0
}
FILENAME == "old.txt" && /^[0-9]+\.[0-9]+ s: / {
label = substr($0, index($0, ":") + 2)
if (label != "Timing Tests") {
label_times[label] = $1
}
}
FILENAME == "new.txt" && /^[0-9]+\.[0-9]+ s: / {
new_time = $1
label = substr($0, index($0, ":") + 2)
if (label == "Timing Tests") next
old_time = label_times[label]
delta = new_time - old_time
if (delta < 0) delta = -delta
if (old_time != "" && delta >= change_threshold) {
printf "⚠️ %.3f s → %.3f s: %s (Δ=%.3f s)\n", old_time, new_time, label, delta
changed = 1
} else if (old_time == "") {
printf "🆕 New timing entry: %.3f s: %s\n", new_time, label
changed = 1
}
}
END {
exit changed == 1 ? 0 : 1
}