#!/bin/sh set -eu [ "$#" -eq 6 ] || { echo "usage: $0 ANALYZER AT8191 AT8192 AT8193 AT65536 AT131072" >&2 exit 2 } analyzer=$1 at8191=$2 at8192=$3 at8193=$4 at65536=$5 at131072=$6 fixture=$(mktemp -d /private/tmp/gem-online-merge-boundary.XXXXXX) trap 'rm -rf "$fixture"' EXIT INT TERM HUP "$analyzer" "$at8191" "$at8192" "$at8193" "$at65536" "$at131072" \ "$fixture/audit.json" jq -e ' .workload == "d512-online-softmax-cpu-gate-audit" and .fixed_controls.tokens == [8191,8192,8193,65536,131072] and .screening.passed == true and .screening.promotion_eligible == false and (.inputs.at_8192.sha256 | test("^[0-9a-f]{64}$")) ' "$fixture/audit.json" >/dev/null jq '.tokens = 8194' "$at8193" > "$fixture/bad-boundary.json" if "$analyzer" "$at8191" "$at8192" "$fixture/bad-boundary.json" \ "$at65536" "$at131072" >/dev/null 2>&1; then echo "online-merge boundary analyzer accepted a changed boundary" >&2 exit 1 fi if "$analyzer" "$at8191" "$at8192" "$at8193" "$at65536" "$at131072" \ "$fixture/audit.json" \ >/dev/null 2>&1; then echo "online-merge boundary analyzer overwrote an existing audit" >&2 exit 1 fi