Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
sdk-generator-smoke / sdk-smoke (push) Has been cancelled
SDK Publish & Sign / sdk-publish (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled
oas-ci / oas-validate (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
33 lines
1.1 KiB
Bash
33 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# BENCH-DETERMINISM-401-057: run determinism harness and collect artifacts
|
|
|
|
ROOT="$(git rev-parse --show-toplevel)"
|
|
HARNESS="${ROOT}/src/Bench/StellaOps.Bench/Determinism"
|
|
OUT="${ROOT}/out/bench-determinism"
|
|
THRESHOLD="${BENCH_DETERMINISM_THRESHOLD:-0.95}"
|
|
mkdir -p "$OUT"
|
|
|
|
cd "$HARNESS"
|
|
|
|
python run_bench.py \
|
|
--sboms inputs/sboms/*.json \
|
|
--vex inputs/vex/*.json \
|
|
--config configs/scanners.json \
|
|
--runs 10 \
|
|
--shuffle \
|
|
--output results \
|
|
--manifest-extra "${DET_EXTRA_INPUTS:-}" \
|
|
${DET_RUN_EXTRA_ARGS:-}
|
|
|
|
cp -a results "$OUT"/
|
|
det_rate=$(python -c "import json;print(json.load(open('results/summary.json'))['determinism_rate'])")
|
|
printf "determinism_rate=%s\n" "$det_rate" > "$OUT/summary.txt"
|
|
printf "timestamp=%s\n" "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> "$OUT/summary.txt"
|
|
|
|
awk -v rate="$det_rate" -v th="$THRESHOLD" 'BEGIN {if (rate+0 < th+0) {printf("determinism_rate %s is below threshold %s\n", rate, th); exit 1}}'
|
|
|
|
tar -C "$OUT" -czf "$OUT/bench-determinism-artifacts.tgz" .
|
|
echo "[bench-determinism] artifacts at $OUT"
|