Files
ziran/tests/numeric_width_matrix.sh
T
waozi 4838ce9b2f Improve runtimes, add an experimental direct backend, and prune Ziran tests
Prepare short portable helpers and scalar record reads, improve JSON SIMD scanning, expose one-line execution, and publish qualified Alpha benchmark artifacts. Add the experimental verified lowered execution, serialization and Linux x86-64 backend with source maps.

Physically remove 263 redundant test entry points and unused helpers, migrate retained helpers to Ziran, and execute the full retained suite without sharding. Allow ignored backup state for the managed physical Alpha workflow.

Local validation: all 268 retained tests passed across the full run and corrected targeted reruns; bootstrap matches. Current assembly verifier, x86-64, executor and serializer tests passed. Website examples and all 4661 local links passed. Six Alpha JSON/text workloads retain verified artifacts, raw samples and explicit unsupported Wasm diagnostics. The mobile sub-500 ns target remains pending.
2026-11-11 18:46:34 -03:00

31 lines
1.2 KiB
Bash

#!/bin/sh
set -eu
ziran=$1
repo=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT HUP INT TERM
"$ziran" run --target=c --root "$repo/tests" "$repo/tests/numeric_width_matrix_gen.zi" -- "$work/width_matrix.zi"
"$ziran" ir --root "$work" -o "$work/ir" "$work/width_matrix.zi"
for form in source saved; do
root=$work
input=$work/width_matrix.zi
if [ "$form" = saved ]; then root=$work/ir; input=$work/ir/width_matrix.zir; fi
"$ziran" bundle --root "$root" --entry width_matrix:Answer -o "$work/$form.zx" "$input"
test "$("$ziran" run "$work/$form.zx")" = 42
for target in c go; do
output=$work/$form-$target
set --
if [ "$target" = go ]; then set -- --pkg main; fi
"$ziran" build "--target=$target" --exe --entry width_matrix:Run \
"$@" --root "$root" -o "$output" "$input"
case "$target" in
c) result=$("$output/width_matrix") ;;
go) result=$(GO111MODULE=off go run "$output/"*.go) ;;
esac
if [ "$result" != 42 ]; then
echo "$form/$target failed conversion $result" >&2
exit 1
fi
done
done