Files
manifold/scripts/report_weekly_benchmarks.py
T
AnshulandClaude Sonnet 4.6 ff42ddc885 Weekly benchmarks (#1758)
* support weekly benchmarks

* updated for perftest

* rem clipper

* other tests

* parse cmake output + use ember-benchmark-cases.json

* add only required STl files for ember tests

* remove ember tests+fix corrupted stl file

* shell script to py + minor changes

* mac-os

* more info of machine with linux fallback

* storage for weekly benchmarks

* rebase

* binary stl

* clean

* .

* fix ember phase capture and drop removed phases

- merge stderr into stdout in run_ember_case so man_bench diagnostic
  output is not silently dropped
- remove Assembly/Triangulation/Simplification/Sorting from
  INDEPENDENT_PHASES; their Timer::Print calls were removed in PR #1745
  and they always produced 0.0; only Intersect12 and Winding03 phases
  are still reported
- update build_ember_summary table to match the 4 remaining phases

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* revert runner

* add frontend + trigger on publish + san extended test

* fix formatting

* TEMP: allow workflow_dispatch to exercise data-publish steps for testing

Not for merge - revert before this PR lands. Only relaxing the if: gate
so a manual run can validate the folded run: > block and sanitizer arg
passing reviewers asked about, without waiting for a scheduled/release run.

* Revert "TEMP: allow workflow_dispatch to exercise data-publish steps for testing"

This reverts commit e00c5f5784eefa27255681dce4105bd45be3daa0.

* Move weekly sanitizer lane to Linux, fix artifact path, derive compiler

- Move build_sanitizer/test_sanitizer in weekly_benchmark.yml from
  macos-15 to ubuntu-24.04, matching the existing PR-triggered sanitizer
  lane in manifold.yml, since nothing about ASan/UBSan requires macOS
  here. Drops the compiler overrides and macOS-only setup steps.
- Download sanitizer build artifacts into build/ instead of the
  workspace root, so manifold_test's baked-in RPATH to libsamples can
  actually resolve. It was crashing on load with
  "Library not loaded: @rpath/libsamples.3.dylib" because the artifact
  download flattened the build/ directory away.
- Capture the sanitizer build's own cmake configure log and derive
  SANITIZER_SUMMARY_COMPILER from it at runtime instead of hardcoding
  the string, reusing system_metadata.py's existing helpers.
- Trim set -euo pipefail to set -u in the data-publish steps, since
  GitHub Actions' default bash invocation already applies -e/pipefail.
- Remove the duplicate weeklybenchmark-test job from manifold.yml in
  favor of testing weekly_benchmark.yml directly via workflow_dispatch.

* Merge dashboard pages + remove dead JS fallbacks + gtest JSON output + simplify perf summary formatting + clean up .gitignore

* Stop forcing clang-18 for sanitizer builds, use runner default (gcc)

* small changes

* -Wno-maybe-uninitialized

* review changes

* dead code

* fix cmke read

* change flags

* remove redundant flags and schema version

* /dashboard route + remove upload route + change dead and retention changes

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-02 17:14:38 +08:00

76 lines
2.3 KiB
Python

#!/usr/bin/env python3
import argparse
import json
import os
import sys
from pathlib import Path
import parse_weekly_benchmarks as pwb
def print_file(path: Path) -> None:
sys.stdout.write(path.read_text(encoding="utf-8-sig"))
def raw_run_files(suite_dir: Path) -> list[Path]:
return sorted(
path
for path in suite_dir.rglob("run*.txt")
if path.is_file() and "build" not in path.relative_to(suite_dir).parts
)
def main() -> int:
if hasattr(sys.stdout, "reconfigure"):
sys.stdout.reconfigure(encoding="utf-8")
parser = argparse.ArgumentParser(description="Report weekly benchmark results.")
parser.add_argument("source_dir", type=Path)
parser.add_argument("suite_dir", type=Path)
parser.add_argument("repeats", type=int)
args = parser.parse_args()
summary_path = args.suite_dir / "summary.md"
result_path = args.suite_dir / "result.json"
metadata = pwb.resolve_metadata(argparse.Namespace(suite_dir=args.suite_dir))
suites = pwb.parse_suites(args.suite_dir, args.source_dir)
markdown = pwb.build_summary(suites, metadata, args.repeats)
payload = {
"metadata": metadata,
"config": {"repeats": args.repeats, "suites": list(suites.keys())},
"suites": suites,
}
summary_path.write_text(markdown + "\n", encoding="utf-8")
result_path.write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")
print("::group::Weekly benchmark summary")
print_file(summary_path)
print("::endgroup::")
print("::group::Weekly benchmark result.json")
print_file(result_path)
print("::endgroup::")
print("::group::Weekly benchmark raw outputs")
for run_file in raw_run_files(args.suite_dir):
print(f"--- {run_file} ---")
print_file(run_file)
print("::endgroup::")
step_summary = os.getenv("GITHUB_STEP_SUMMARY")
if step_summary:
with Path(step_summary).open("a", encoding="utf-8") as out:
out.write(summary_path.read_text(encoding="utf-8"))
out.write("\n")
out.write(
"Raw logs: open this step and expand `Weekly benchmark result.json` "
"and `Weekly benchmark raw outputs` groups.\n"
)
return 0
if __name__ == "__main__":
sys.exit(main())