interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / evidence / deepinfer / run.sh

54 lines · 2457 bytes Raw Blame History
1#!/bin/sh
2# Replays the DeepInfer coverage verdicts in docs/DEEPINFER.md against built omega-mv adapters.
3# OMEGA_MV = an omega-mv checkout whose adapters are built (PR #839 head 656192e0 was measured:
4# build/L627/import/python-import, build/S2/c-i64-import, build/L739/cpp-import).
5# Prints one row per input and exits 1 if any exit status differs from the recorded one.
6set -u
7: "${OMEGA_MV:?set OMEGA_MV to a built omega-mv checkout}"
8here=$(cd "$(dirname "$0")" && pwd)
9py="$OMEGA_MV/build/L627/import/python-import"
10c="$OMEGA_MV/build/S2/c-i64-import"
11cpp="$OMEGA_MV/build/L739/cpp-import"
12for t in "$py" "$c" "$cpp"; do [ -x "$t" ] || { echo "missing adapter $t" >&2; exit 2; }; done
13sha256sum "$py" "$c" "$cpp"
14tmp=$(mktemp -d); trap 'rm -rf "$tmp"' EXIT
15bad=0
16check() { # adapter expected-status input
17 "$1" < "$3" > "$tmp/out" 2> "$tmp/err"; got=$?
18 verdict=PASS; [ "$got" = "$2" ] || { verdict=FAIL; bad=1; }
19 printf '%-5s %-14s want=%-3s got=%-3s out=%5sB %-40s %s\n' "$verdict" "$(basename "$1")" "$2" "$got" \
20 "$(wc -c < "$tmp/out" | tr -d ' ')" "$(head -c 40 "$tmp/err" | tr '\n' ' ')" "${3#"$here"/}"
21}
22v="$here/py-verbatim"; s="$here/py-stripped"; x="$here/cxx"
23check "$py" 66 "$v/000_is_power_of_two.py"
24check "$py" 66 "$v/001_ceil_div.py"
25check "$py" 66 "$v/002_i64.py"
26check "$py" 72 "$v/003_expanded_image_token_len.py"
27check "$py" 72 "$v/004__align_to_multiple.py"
28check "$py" 71 "$v/005__needs_compress_state.py"
29check "$py" 0 "$v/ctrl_pos.py"
30check "$py" 68 "$v/ctrl_unmasked.py"
31check "$py" 68 "$s/000_is_power_of_two.py"
32check "$py" 68 "$s/001_ceil_div.py"
33check "$py" 69 "$v/probe_doc_ascii.py"
34check "$py" 72 "$v/probe_nonascii_comment.py"
35check "$py" 69 "$s/002_i64.py"
36check "$py" 68 "$s/003_expanded_image_token_len.py"
37check "$py" 68 "$s/004__align_to_multiple.py"
38check "$py" 68 "$s/005__needs_compress_state.py"
39check "$c" 66 "$x/floor_prefix.hdr-c"
40check "$c" 66 "$x/capped_prefix.hdr-c"
41check "$c" 66 "$x/pairs.hdr-c"
42check "$c" 68 "$x/floor_prefix.c17"
43for f in floor_prefix capped_prefix pairs; do
44 check "$c" 72 "$x/$f.verbatim"
45 check "$cpp" 72 "$x/$f.verbatim"
46done
47check "$c" 0 "$x/ctrl_pos.c17"
48check "$cpp" 69 "$x/floor_prefix.hdr-cpp"
49check "$cpp" 69 "$x/capped_prefix.hdr-cpp"
50check "$cpp" 69 "$x/pairs.hdr-cpp"
51check "$cpp" 0 "$x/ctrl_pos.hdr-cpp"
52check "$cpp" 71 "$x/ctrl_name.hdr-cpp"
53[ "$bad" = 0 ] && echo "DEEPINFER-COVERAGE REPLAY PASS" || echo "DEEPINFER-COVERAGE REPLAY FAIL"
54exit "$bad"