Skip to content

Commit

Permalink
bench features
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jan 16, 2025
1 parent fad893f commit 806b471
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 30 deletions.
50 changes: 21 additions & 29 deletions ci/ci-util.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,50 +195,40 @@ def locate_baseline(flags: list[str]) -> None:
exit(1)

try:
args = [
"gh",
"run",
"list",
"--limit=1",
"--status=success",
f"--branch={DEFAULT_BRANCH}",
"--json=databaseId,url,headSha,conclusion,createdAt,"
"status,workflowDatabaseId,workflowName",
f'--jq=select(.[].workflowName == "{WORKFLOW_NAME}")',
]

eprint("ARGS:", args)

# Locate the most recent job to complete with success on our branch
latest_job = sp.check_output(
# [
# "gh",
# "run",
# "list",
# "--limit=1",
# "--status=success",
# f"--branch={DEFAULT_BRANCH}",
# "--json=databaseId,url,headSha,conclusion,createdAt,"
# "status,workflowDatabaseId,workflowName",
# f'--jq=select(.[].workflowName == "{WORKFLOW_NAME}")',
# ],
args,
[
"gh",
"run",
"list",
"--limit=1",
"--status=success",
f"--branch={DEFAULT_BRANCH}",
"--json=databaseId,url,headSha,conclusion,createdAt,"
"status,workflowDatabaseId,workflowName",
f'--jq=select(.[].workflowName == "{WORKFLOW_NAME}")',
],
text=True,
)
eprint(f"latest: '{latest_job}'")
except sp.CalledProcessError as e:
eprint(f"failed to run github command: {e}")
return

latest = json.loads(latest_job)[0]
eprint("latest job: ", json.dumps(latest, indent=4))
try:
latest = json.loads(latest_job)[0]
eprint("latest job: ", json.dumps(latest, indent=4))
except json.JSONDecodeError as e:
eprint(f"failed to decode json '{latest_job}', {e}")
return

if not download:
eprint("--download not specified, returning")
return

job_id = latest.get("databaseId")
if job_id is None:
eprint("unable to find job ID")
eprint("skipping download step")
return

sp.run(
Expand All @@ -247,6 +237,7 @@ def locate_baseline(flags: list[str]) -> None:
)

if not extract:
eprint("skipping extraction step")
return

# Find the baseline with the most recent timestamp. GH downloads the files to e.g.
Expand All @@ -260,6 +251,7 @@ def locate_baseline(flags: list[str]) -> None:
baseline_archive = candidate_baselines[0]
eprint(f"extracting {baseline_archive}")
sp.run(["tar", "xJvf", baseline_archive], check=True)
eprint("baseline extracted successfully")


def check_iai_regressions(iai_home: str | None | Path):
Expand Down
2 changes: 1 addition & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ cmd="$cmd --exclude util --exclude libm-macros"

# Test once with intrinsics enabled
$cmd --features unstable-intrinsics
$cmd --features unstable-intrinsics --bench random
$cmd --features unstable-intrinsics --benches

# Test the same in release mode, which also increases coverage. Also ensure
# the soft float routines are checked.
Expand Down
1 change: 1 addition & 0 deletions crates/libm-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ libtest-mimic = "0.8.1"
[[bench]]
name = "icount"
harness = false
required-features = ["icount"]

[[bench]]
name = "random"
Expand Down

0 comments on commit 806b471

Please sign in to comment.