omega-bridge
Omega-first language interoperability: checked conversion backends and native language bindings
Brought by drakestapleton
omega-bridge / evidence / deepinfer / run.sh
| 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. |
| 6 | set -u |
| 7 | : "${OMEGA_MV:?set OMEGA_MV to a built omega-mv checkout}" |
| 8 | here=$(cd "$(dirname "$0")" && pwd) |
| 9 | py="$OMEGA_MV/build/L627/import/python-import" |
| 10 | c="$OMEGA_MV/build/S2/c-i64-import" |
| 11 | cpp="$OMEGA_MV/build/L739/cpp-import" |
| 12 | for t in "$py" "$c" "$cpp"; do [ -x "$t" ] || { echo "missing adapter $t" >&2; exit 2; }; done |
| 13 | sha256sum "$py" "$c" "$cpp" |
| 14 | tmp=$(mktemp -d); trap 'rm -rf "$tmp"' EXIT |
| 15 | bad=0 |
| 16 | check() { # 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 | } |
| 22 | v="$here/py-verbatim"; s="$here/py-stripped"; x="$here/cxx" |
| 23 | check "$py" 66 "$v/000_is_power_of_two.py" |
| 24 | check "$py" 66 "$v/001_ceil_div.py" |
| 25 | check "$py" 66 "$v/002_i64.py" |
| 26 | check "$py" 72 "$v/003_expanded_image_token_len.py" |
| 27 | check "$py" 72 "$v/004__align_to_multiple.py" |
| 28 | check "$py" 71 "$v/005__needs_compress_state.py" |
| 29 | check "$py" 0 "$v/ctrl_pos.py" |
| 30 | check "$py" 68 "$v/ctrl_unmasked.py" |
| 31 | check "$py" 68 "$s/000_is_power_of_two.py" |
| 32 | check "$py" 68 "$s/001_ceil_div.py" |
| 33 | check "$py" 69 "$v/probe_doc_ascii.py" |
| 34 | check "$py" 72 "$v/probe_nonascii_comment.py" |
| 35 | check "$py" 69 "$s/002_i64.py" |
| 36 | check "$py" 68 "$s/003_expanded_image_token_len.py" |
| 37 | check "$py" 68 "$s/004__align_to_multiple.py" |
| 38 | check "$py" 68 "$s/005__needs_compress_state.py" |
| 39 | check "$c" 66 "$x/floor_prefix.hdr-c" |
| 40 | check "$c" 66 "$x/capped_prefix.hdr-c" |
| 41 | check "$c" 66 "$x/pairs.hdr-c" |
| 42 | check "$c" 68 "$x/floor_prefix.c17" |
| 43 | for f in floor_prefix capped_prefix pairs; do |
| 44 | check "$c" 72 "$x/$f.verbatim" |
| 45 | check "$cpp" 72 "$x/$f.verbatim" |
| 46 | done |
| 47 | check "$c" 0 "$x/ctrl_pos.c17" |
| 48 | check "$cpp" 69 "$x/floor_prefix.hdr-cpp" |
| 49 | check "$cpp" 69 "$x/capped_prefix.hdr-cpp" |
| 50 | check "$cpp" 69 "$x/pairs.hdr-cpp" |
| 51 | check "$cpp" 0 "$x/ctrl_pos.hdr-cpp" |
| 52 | check "$cpp" 71 "$x/ctrl_name.hdr-cpp" |
| 53 | [ "$bad" = 0 ] && echo "DEEPINFER-COVERAGE REPLAY PASS" || echo "DEEPINFER-COVERAGE REPLAY FAIL" |
| 54 | exit "$bad" |