Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
11c1522
Enable `__powitf2` on MSVC
beetrees May 21, 2025
7966f1b
fixed typo in readme
Lorl0rd May 10, 2025
db21837
libm: Clean up unused files
tgross35 Apr 22, 2025
4c264c9
Update `CmpResult` to use a pointer-sized return type
tgross35 May 23, 2025
c04f133
Typo in README.md
D-Dario0 May 28, 2025
5978b8b
aarch64: Add a note saying why we use `frintx` rather than `frintn`
tgross35 May 28, 2025
2c9fb22
jsondoclint: Extract `Command`/`CommandKind` into its own file
aDotInTheVoid May 28, 2025
851aa05
cleanup: Reuse `MinInt` and `Int` from `libm` in `compiler-builtins`
tgross35 Apr 21, 2025
877feef
Reuse `libm`'s `Caat` and `CastFrom` in `compiler-builtins`
tgross35 May 29, 2025
97c0beb
Remove unneeded C symbols
tgross35 May 28, 2025
a63f482
Replace the `nm` symbol check with a Rust implementation
tgross35 Apr 19, 2025
8db9bd6
Remove the now-unneeded llvm-tools-preview
tgross35 May 28, 2025
151b1cb
Change `compiler-builtins` to edition 2024
tgross35 May 29, 2025
af16553
symcheck: Print the command to make reproducing errors easier
tgross35 May 29, 2025
7db8cf1
Add benchmarks for float parsing and printing
tgross35 May 29, 2025
c136fb7
Run `builtins-test-intrinsics` when possible
tgross35 Mar 19, 2025
3464b4b
ci: Allow concurrency outside of pull requests
tgross35 May 29, 2025
9f84e99
Increase the benchmark rustc version to 2025-05-28
tgross35 May 29, 2025
8edaa6e
libm-test: Make `extensive` an attribute rather than a test type
tgross35 May 29, 2025
4d325e8
ci: Allow for multiple icount benchmarks in the same run
tgross35 May 29, 2025
14db1b5
jsondocck: command -> directive
aDotInTheVoid May 28, 2025
3c35505
chore: release
github-actions[bot] May 29, 2025
c6df6a7
Fix new `dead_code` warnings from recent nightlies
tgross35 Jun 1, 2025
0a7e592
Upgrade all dependencies to the latest available version
tgross35 Jun 1, 2025
e83ca86
cleanup: Use `x.biteq(y)` rather than `x.to_bits() == y.to_bits()`
tgross35 Jun 2, 2025
ba7cdb6
ci: Refactor benchmark regression checks
tgross35 Jun 1, 2025
5778643
libm-test: Fix unintentional skips in `binop_common`
tgross35 Jun 2, 2025
763663a
rustdoc-json-type: Depend on `serde` and `serde_derive` seperately
aDotInTheVoid Jun 3, 2025
28231d9
Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of None
oli-obk Jun 4, 2025
9091a94
bootstrap: Fix file permissions when dereferencing symlinks
smpdt Jun 4, 2025
06ab34e
cleaned up some tests
Kivooeo Jun 3, 2025
6417248
Report the actual item that evaluation failed for
oli-obk Jun 4, 2025
55f59fb
Fix parsing of frontmatters with inner hyphens
matthewjasper Jun 4, 2025
e1e3cc2
Replace the musl submodule with a download script
tgross35 Jun 4, 2025
f67ca0f
Add an empty rust-version file
tgross35 May 28, 2025
3353a89
Add tooling for `josh` syncs
tgross35 May 18, 2025
eb45e57
Update the upstream Rust version
tgross35 Jun 4, 2025
1599091
Merge ref 'df8102fe5f24:/library/compiler-builtins' from https://gith…
tgross35 Jun 4, 2025
ab453db
`panic-handler`: Remove the `no_core` feature
tgross35 Jun 4, 2025
91ad4bf
jsondocck: Explain what `KNOWN_DIRECTIVE_NAMES` is doing
aDotInTheVoid Jun 5, 2025
bee6dc4
Rollup merge of #141709 - aDotInTheVoid:split-for-docs, r=GuillaumeGomez
matthiaskrgr Jun 5, 2025
5a4abf0
Rollup merge of #141974 - Kivooeo:tf4, r=jieyouxu
matthiaskrgr Jun 5, 2025
1dcd4a7
Rollup merge of #141989 - aDotInTheVoid:sin-sooner, r=GuillaumeGomez
matthiaskrgr Jun 5, 2025
276506e
Rollup merge of #142012 - oli-obk:no-optional-spans, r=fee1-dead
matthiaskrgr Jun 5, 2025
8689de4
Rollup merge of #142015 - oli-obk:wrong-instance, r=RalfJung
matthiaskrgr Jun 5, 2025
64f4bd5
Rollup merge of #142026 - smpdt:master, r=Kobzol
matthiaskrgr Jun 5, 2025
5604376
Rollup merge of #142032 - matthewjasper:frontmatter-lexing, r=fee1-dead
matthiaskrgr Jun 5, 2025
eef9831
Rollup merge of #142036 - tgross35:update-builtins, r=tgross35
matthiaskrgr Jun 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ci: Refactor benchmark regression checks
iai-callgrind now correctly exits with error if regressions were found
[1], so we no longer need to check for regressions manually. Remove this
check and instead exit based on the exit status of the benchmark run.

[1] gungraun/gungraun#337
  • Loading branch information
tgross35 committed Jun 2, 2025
commit ba7cdb681468ef7617bfa5a2bde7e3fb3d79a2be
19 changes: 10 additions & 9 deletions library/compiler-builtins/ci/bench-icount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@ function run_icount_benchmarks() {
shift
done

# Run iai-callgrind benchmarks
cargo bench "${cargo_args[@]}" -- "${iai_args[@]}"
# Run iai-callgrind benchmarks. Do this in a subshell with `&& true` to
# capture rather than exit on error.
(cargo bench "${cargo_args[@]}" -- "${iai_args[@]}") && true
exit_code="$?"

# NB: iai-callgrind should exit on error but does not, so we inspect the sumary
# for errors. See https://github.com/iai-callgrind/iai-callgrind/issues/337
if [ -n "${PR_NUMBER:-}" ]; then
# If this is for a pull request, ignore regressions if specified.
./ci/ci-util.py check-regressions --home "$iai_home" --allow-pr-override "$PR_NUMBER"
else
if [ "$exit_code" -eq 0 ]; then
echo "Benchmarks completed with no regressions"
elif [ -z "${PR_NUMBER:-}" ]; then
# Disregard regressions after merge
./ci/ci-util.py check-regressions --home "$iai_home" || true
echo "Benchmarks completed with regressions; ignoring (not in a PR)"
else
./ci/ci-util.py handle-banch-regressions "$PR_NUMBER"
fi
}

Expand Down
84 changes: 19 additions & 65 deletions library/compiler-builtins/ci/ci-util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import subprocess as sp
import sys
from dataclasses import dataclass
from glob import glob, iglob
from glob import glob
from inspect import cleandoc
from os import getenv
from pathlib import Path
Expand All @@ -38,14 +38,10 @@

Note that `--extract` will overwrite files in `iai-home`.

check-regressions [--home iai-home] [--allow-pr-override pr_number]
Check `iai-home` (or `iai-home` if unspecified) for `summary.json`
files and see if there are any regressions. This is used as a workaround
for `iai-callgrind` not exiting with error status; see
<https://github.com/iai-callgrind/iai-callgrind/issues/337>.

If `--allow-pr-override` is specified, the regression check will not exit
with failure if any line in the PR starts with `allow-regressions`.
handle-bench-regressions PR_NUMBER
Exit with success if the pull request contains a line starting with
`ci: allow-regressions`, indicating that regressions in benchmarks should
be accepted. Otherwise, exit 1.
"""
)

Expand Down Expand Up @@ -365,64 +361,22 @@ def locate_baseline(flags: list[str]) -> None:
eprint("baseline extracted successfully")


def check_iai_regressions(args: list[str]):
"""Find regressions in iai summary.json files, exit with failure if any are
found.
"""

iai_home_str = "iai-home"
pr_number = None

while len(args) > 0:
match args:
case ["--home", home, *rest]:
iai_home_str = home
args = rest
case ["--allow-pr-override", pr_num, *rest]:
pr_number = pr_num
args = rest
case _:
eprint(USAGE)
exit(1)

iai_home = Path(iai_home_str)

found_summaries = False
regressions: list[dict] = []
for summary_path in iglob("**/summary.json", root_dir=iai_home, recursive=True):
found_summaries = True
with open(iai_home / summary_path, "r") as f:
summary = json.load(f)

summary_regs = []
run = summary["callgrind_summary"]["callgrind_run"]
fname = summary["function_name"]
id = summary["id"]
name_entry = {"name": f"{fname}.{id}"}

for segment in run["segments"]:
summary_regs.extend(segment["regressions"])
def handle_bench_regressions(args: list[str]):
"""Exit with error unless the PR message contains an ignore directive."""

summary_regs.extend(run["total"]["regressions"])

regressions.extend(name_entry | reg for reg in summary_regs)

if not found_summaries:
eprint(f"did not find any summary.json files within {iai_home}")
exit(1)
match args:
case [pr_number]:
pr_number = pr_number
case _:
eprint(USAGE)
exit(1)

if len(regressions) == 0:
eprint("No regressions found")
pr = PrInfo.load(pr_number)
if pr.contains_directive(REGRESSION_DIRECTIVE):
eprint("PR allows regressions")
return

eprint("Found regressions:", json.dumps(regressions, indent=4))

if pr_number is not None:
pr = PrInfo.load(pr_number)
if pr.contains_directive(REGRESSION_DIRECTIVE):
eprint("PR allows regressions, returning")
return

eprint("Regressions were found; benchmark failed")
exit(1)


Expand All @@ -433,8 +387,8 @@ def main():
ctx.emit_workflow_output()
case ["locate-baseline", *flags]:
locate_baseline(flags)
case ["check-regressions", *args]:
check_iai_regressions(args)
case ["handle-bench-regressions", *args]:
handle_bench_regressions(args)
case ["--help" | "-h"]:
print(USAGE)
exit()
Expand Down