interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / tests / coder / synthetic.sh

273 lines · 17200 bytes Raw Blame History
1#!/bin/bash
2# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3# ERC1 host tests on generated matrices: round trips, size identity, row independence, every
4# negative control, flip scan. No GPU, no checkpoint.
5# sh tests/coder/synthetic.sh OMC [WORKDIR] OMC = the compiler the repository PIN names
6# QUICK=1 skips the flip scan and the order tests (mutants.sh uses it).
7# Ends with "ERC1 SYNTHETIC PASS n checks" and exit 0, or "ERC1 SYNTHETIC FAIL ..." and exit 1.
8export LC_ALL=C
9HERE=$(cd "$(dirname "$0")" && pwd)
10ROOT=$(cd "$HERE/../.." && pwd)
11. "$HERE/lib.sh"
12OMC=${1:?usage: synthetic.sh OMC [WORKDIR]}
13W=${2:-$(mktemp -d)}
14mkdir -p "$W"
15SRC=${ERC_SRC:-$ROOT/om/coder/erc.om}
16ERC=$W/erc
17build "$OMC" "$SRC" "$ERC" || { echo "ERC1 SYNTHETIC FAIL: compile"; exit 1; }
18
19gen() { # NAME ROWS COLS KIND SEED
20 local f=$W/$1.raw n=$(($2 * $3))
21 case $4 in
22 uniform) prng "$5" "$n" > "$f" ;;
23 zeros) head -c "$n" /dev/zero > "$f" ;;
24 two) prng "$5" "$n" | tr '\000-\177' '\060' | tr '\200-\377' '\061' > "$f" ;;
25 skew) prng "$5" "$n" | tr '\000-\357' '\000' | tr '\360-\377' '\001-\020' > "$f" ;;
26 onediff) { head -c $((n - 1)) /dev/zero; printf '\007'; } > "$f" ;;
27 esac
28}
29
30# roundtrip NAME ROWS COLS: encode, decode, compare, size identity, CRC against gzip, every row alone.
31roundtrip() {
32 local n=$1 r=$2 c=$3 raw=$W/$1.raw enc=$W/$1.erc out
33 out=$("$ERC" encode "$raw" 0 "$r" "$c" "$enc") || { bad "$n: encode"; return; }
34 "$ERC" decode "$enc" "$W/$n.dec" > /dev/null || { bad "$n: decode"; return; }
35 check "$n: ${r}x${c} decode is byte-identical" cmp -s "$raw" "$W/$n.dec"
36 local size hdr streams want
37 size=$(stat -c %s "$enc")
38 want=$(echo "$out" | sed 's/.*coded_bytes=\([0-9]*\).*/\1/')
39 check "$n: coded_bytes printed equals file size ($size)" [ "$size" = "$want" ]
40 hdr=$((552 + 6 * r))
41 streams=$(echo "$out" | sed 's/.*stream_bytes=\([0-9]*\).*/\1/')
42 check "$n: file = 552 + 6 rows + stream bytes" [ "$size" = $((hdr + streams)) ]
43 local crc
44 crc=$(gzip -c "$raw" | tail -c8 | od -An -tx4 -N4 | tr -d ' ')
45 check "$n: matrix_crc32 equals the gzip trailer CRC32 ($crc)" [ "$("$ERC" info "$enc" | sed 's/.*matrix_crc32=//')" = "$crc" ]
46 local row okrows=1 step=1
47 [ "$r" -gt 300 ] && step=$((r / 97 + 1))
48 for ((row = 0; row < r; row += step)); do
49 "$ERC" decode-row "$enc" "$row" "$W/row.out" 2> /dev/null && dd if="$raw" of="$W/row.ref" bs="$c" skip="$row" count=1 2> /dev/null && cmp -s "$W/row.out" "$W/row.ref" || { okrows=0; echo " row $row differs"; }
50 done
51 check "$n: decode-row alone equals the raw row (every $step-th row)" [ "$okrows" = 1 ]
52}
53
54gen s11a 1 1 skew 1; roundtrip s11a 1 1
55printf '\070' > "$W/s11c.raw"; roundtrip s11c 1 1
56gen s1x4096 1 4096 skew 2; roundtrip s1x4096 1 4096
57gen s4096x1 4096 1 skew 3; roundtrip s4096x1 4096 1
58gen s7x13 7 13 uniform 4; roundtrip s7x13 7 13
59gen s100z 100 100 zeros 5; roundtrip s100z 100 100
60gen s33x77 33 77 two 6; roundtrip s33x77 33 77
61gen s256u 256 256 uniform 7; roundtrip s256u 256 256
62gen s50d 50 50 onediff 8; roundtrip s50d 50 50
63gen s200d 200 200 onediff 9; roundtrip s200d 200 200
64gen s64k 64 512 skew 10; roundtrip s64k 64 512
65gen s640x2560 640 2560 skew 11; roundtrip s640x2560 640 2560
66# all 256 byte values once each (a table of 256 equal entries of 64)
67for i in $(seq 0 255); do printf "$(printf '\\x%02x' "$i")"; done > "$W/sall.raw"; roundtrip sall 1 256
68
69check "uniform bytes do not shrink (256x256 coded >= raw)" [ "$(stat -c %s "$W/s256u.erc")" -ge 65536 ]
70check "skewed bytes do shrink (64x512 coded < raw)" [ "$(stat -c %s "$W/s64k.erc")" -lt 32768 ]
71
72# encode from a byte offset of a larger file (how the checkpoint matrices are read)
73{ prng 12 1000; cat "$W/s64k.raw"; prng 13 77; } > "$W/shard.bin"
74"$ERC" encode "$W/shard.bin" 1000 64 512 "$W/off.erc" > /dev/null
75check "encode at a byte offset equals encode of the slice" cmp -s "$W/off.erc" "$W/s64k.erc"
76
77# ---------------------------------------------------------------- argument and I/O refusals
78"$ERC" > /dev/null 2>&1; check "no arguments exit 2" [ $? = 2 ]
79"$ERC" encode "$W/s64k.raw" 0 0 512 "$W/x.erc" > /dev/null 2>&1; check "ROWS 0 exit 2" [ $? = 2 ]
80"$ERC" encode "$W/s64k.raw" 0 64 513 "$W/x.erc" > /dev/null 2>&1; check "raw shorter than ROWS*COLS exit 4" [ $? = 4 ]
81"$ERC" decode "$W/none.erc" "$W/x.out" > /dev/null 2>&1; check "missing input exit 4" [ $? = 4 ]
82"$ERC" decode-row "$W/s64k.erc" 64 "$W/x.out" > /dev/null 2>&1; check "ROW past the last row exit 2" [ $? = 2 ]
83"$ERC" encode "$W/s64k.raw" 9999999999999999999 1 1 "$W/x.erc" > /dev/null 2>&1; check "OFFSET beyond a signed file offset exit 2 (not a trap)" [ $? = 2 ]
84"$ERC" encode "$W/s64k.raw" 0 4294967295 4294967295 "$W/x.erc" > /dev/null 2>&1; check "ROWS * COLS beyond a signed file offset exit 2 (not a trap)" [ $? = 2 ]
85"$ERC" encode "$W/s64k.raw" 0 64 5x2 "$W/x.erc" > /dev/null 2>&1; check "COLS that is not a number exit 2" [ $? = 2 ]
86"$ERC" encode "$W/s64k.raw" 0 4294967296 1 "$W/x.erc" > /dev/null 2>&1; check "ROWS 2^32 exit 2" [ $? = 2 ]
87
88# ---------------------------------------------------------------- damaged files, each for its reason
89G=$W/s64k.erc # 64 rows x 512 cols
90K=20 # the row that gets damaged
91cp "$G" "$W/g.erc"
92check "undamaged copy decodes" "$ERC" decode "$W/g.erc" "$W/g.out"
93: > "$W/empty.erc"
94refuses "empty file" TRUNC - "$ERC" decode "$W/empty.erc" "$W/x.out"
95prng 14 3000 > "$W/noise.erc"
96refuses "random bytes" MAGIC - "$ERC" decode "$W/noise.erc" "$W/x.out"
97
98# a flipped bit in a stream
99mk() { cp "$G" "$W/$1.erc"; }
100ks=$(row_start "$G" $K); ke=$(row_end "$G" $K); mid=$(((ks + ke) / 2))
101mk fs; flipbit "$W/fs.erc" "$mid" 3
102refuses "stream bit flip (row $K), decode-row" ROWCRC $K "$ERC" decode-row "$W/fs.erc" $K "$W/x.out"
103refuses "stream bit flip (row $K), decode" ROWCRC $K "$ERC" decode "$W/fs.erc" "$W/x.out"
104check "decode left no output file after the refusal" [ ! -e "$W/x.out" ]
105other=0
106for row in 0 19 21 63; do
107 "$ERC" decode-row "$W/fs.erc" $row "$W/o.out" || other=1
108 dd if="$W/s64k.raw" of="$W/o.ref" bs=512 skip=$row count=1 2> /dev/null
109 cmp -s "$W/o.out" "$W/o.ref" || other=1
110done
111check "rows other than $K still decode to their original bytes after the flip" [ "$other" = 0 ]
112# every byte outside row K's stream replaced by noise: row K alone still decodes, and only it is read
113mk iso; sb=$(sbase "$G"); fsz=$(stat -c %s "$G")
114prng 77 $((ks - sb)) | dd of="$W/iso.erc" bs=1 seek="$sb" conv=notrunc 2> /dev/null
115prng 78 $((fsz - ke)) | dd of="$W/iso.erc" bs=1 seek="$ke" conv=notrunc 2> /dev/null
116"$ERC" decode-row "$W/iso.erc" $K "$W/o.out"; dd if="$W/s64k.raw" of="$W/o.ref" bs=512 skip=$K count=1 2> /dev/null
117check "all other rows' streams replaced by noise: row $K alone decodes to its original bytes" cmp -s "$W/o.out" "$W/o.ref"
118refuses "the same file, whole-matrix decode" ROWCRC 0 "$ERC" decode "$W/iso.erc" "$W/x.out"
119# flip the very first and the very last byte of a stream, and one bit of every byte of the state
120mk fs0; flipbit "$W/fs0.erc" "$ks" 0
121refuses "first stream byte bit flip" ROWCRC $K "$ERC" decode-row "$W/fs0.erc" $K "$W/x.out"
122mk fs1; flipbit "$W/fs1.erc" $((ke - 1)) 7
123refuses "last stream byte bit flip" ROWCRC $K "$ERC" decode-row "$W/fs1.erc" $K "$W/x.out"
124# the stream-level checks, reached by recomputing the row CRCs (fixrows) so only they can refuse
125fixrows() { "$ERC" fixrows "$W/$1.erc" > /dev/null; }
126mk st0; setu32 "$W/st0.erc" "$ks" 4294967295; fixrows st0
127refuses "state 0xffffffff" STATE $K "$ERC" decode-row "$W/st0.erc" $K "$W/x.out"
128mk st1; setu32 "$W/st1.erc" "$ks" 8388607; fixrows st1
129refuses "state 2^23 - 1" STATE $K "$ERC" decode-row "$W/st1.erc" $K "$W/x.out"
130ko=$((544 + 4 * (K + 1))); kv=$(u32at "$G" $ko)
131mk ex; setu32 "$W/ex.erc" $ko $((kv - 1)); fixrows ex
132refuses "stream one byte short" EXHAUST $K "$ERC" decode-row "$W/ex.erc" $K "$W/x.out"
133mk lo; setu32 "$W/lo.erc" $ko $((kv + 1)); fixrows lo
134refuses "stream one byte long" LEFTOVER $K "$ERC" decode-row "$W/lo.erc" $K "$W/x.out"
135# a flipped bit that leaves the stream consumed exactly but ends in the wrong state
136fin=0
137for ((b = 4; b < 60 && fin == 0; b++)); do for bit in 0 1 2 3 4 5 6 7; do
138 mk fn; flipbit "$W/fn.erc" $((ks + b)) $bit; fixrows fn
139 if "$ERC" decode-row "$W/fn.erc" $K "$W/x.out" 2>&1 | grep -q "refused FINAL row $K\$"; then fin=1; break; fi
140done; done
141check "a stream bit flip exists that only the final-state check refuses (FINAL)" [ "$fin" = 1 ]
142# a forged row CRC: the stream is fine, the stored CRC is wrong
143mk rc; rp=$((548 + 4 * 64 + 2 * K)); setbyte "$W/rc.erc" $rp 170; setbyte "$W/rc.erc" $((rp + 1)) 170; "$ERC" fixcrc "$W/rc.erc" > /dev/null
144refuses "row CRC-16 entry changed, header CRC recomputed" ROWCRC $K "$ERC" decode-row "$W/rc.erc" $K "$W/x.out"
145
146# frequency table, row offset, header fields: the header CRC covers them
147mk ft; flipbit "$W/ft.erc" $((32 + 2 * 17 + 1)) 2
148refuses "frequency table bit flip" HDRCRC - "$ERC" decode "$W/ft.erc" "$W/x.out"
149refuses "frequency table bit flip, decode-row" HDRCRC - "$ERC" decode-row "$W/ft.erc" 3 "$W/x.out"
150refuses "frequency table bit flip, info" HDRCRC - "$ERC" info "$W/ft.erc"
151mk ro; flipbit "$W/ro.erc" $((544 + 4 * 30)) 4
152refuses "row offset bit flip" HDRCRC - "$ERC" decode "$W/ro.erc" "$W/x.out"
153refuses "row offset bit flip, decode-row" HDRCRC - "$ERC" decode-row "$W/ro.erc" 30 "$W/x.out"
154mk mc; flipbit "$W/mc.erc" 22 1
155refuses "matrix CRC field bit flip" HDRCRC - "$ERC" info "$W/mc.erc"
156mk hc; flipbit "$W/hc.erc" "$(hcrc_pos "$G")" 5
157refuses "header CRC field bit flip" HDRCRC - "$ERC" info "$W/hc.erc"
158mk co; flipbit "$W/co.erc" 12 0
159refuses "cols field bit flip" HDRCRC - "$ERC" info "$W/co.erc"
160mk ma; flipbit "$W/ma.erc" 2 6
161refuses "magic bit flip" MAGIC - "$ERC" info "$W/ma.erc"
162mk ve; setbyte "$W/ve.erc" 4 2
163refuses "version 2" VERSION - "$ERC" info "$W/ve.erc"
164mk fl; setbyte "$W/fl.erc" 6 1
165refuses "flags nonzero" VERSION - "$ERC" info "$W/fl.erc"
166mk pb; setu32 "$W/pb.erc" 16 15
167refuses "prob_bits 15" FIELD - "$ERC" info "$W/pb.erc"
168mk r0; setu32 "$W/r0.erc" 8 0
169refuses "rows 0" FIELD - "$ERC" info "$W/r0.erc"
170mk tl; flipbit "$W/tl.erc" 24 4
171refuses "total_len bit flip" LENGTH - "$ERC" info "$W/tl.erc"
172
173# truncation and extension
174sz=$(stat -c %s "$G")
175head -c $((sz - 1)) "$G" > "$W/t1.erc"
176refuses "truncated by one byte" LENGTH - "$ERC" decode "$W/t1.erc" "$W/x.out"
177head -c $((sz / 2)) "$G" > "$W/t2.erc"
178refuses "truncated to half" LENGTH - "$ERC" decode "$W/t2.erc" "$W/x.out"
179head -c 600 "$G" > "$W/t3.erc"
180refuses "truncated inside the row table" TRUNC - "$ERC" decode "$W/t3.erc" "$W/x.out"
181head -c 20 "$G" > "$W/t4.erc"
182refuses "truncated inside the header" TRUNC - "$ERC" decode "$W/t4.erc" "$W/x.out"
183{ cat "$G"; printf 'x'; } > "$W/t5.erc"
184refuses "one byte appended" LENGTH - "$ERC" decode "$W/t5.erc" "$W/x.out"
185
186# forged files: the header CRC is recomputed, so only the second-layer checks can refuse
187fixed() { "$ERC" fixcrc "$W/$1.erc" > /dev/null; }
188mk fq; setu32 "$W/fq.erc" $((32 + 2 * 5)) 1000; fixed fq # table entry 5 becomes 1000: sum is wrong
189refuses "forged table, sum is not 2^14" FREQ - "$ERC" info "$W/fq.erc"
190mk fo1; setu32 "$W/fo1.erc" $((544 + 4 * 64)) $(($(u32at "$G" $((544 + 4 * 64))) + 1)); fixed fo1
191refuses "forged last offset +1" OFFSET - "$ERC" info "$W/fo1.erc"
192mk fo2; setu32 "$W/fo2.erc" $((544 + 4 * 2)) 3; fixed fo2
193refuses "forged offset: stream of 3 bytes" OFFSET - "$ERC" info "$W/fo2.erc"
194mk fo3; setu32 "$W/fo3.erc" 544 4; fixed fo3
195refuses "forged first offset not 0" OFFSET - "$ERC" info "$W/fo3.erc"
196mk fo4; setu32 "$W/fo4.erc" $((544 + 4 * 30)) $(($(u32at "$G" $((544 + 4 * 29))) + 2)); fixed fo4
197refuses "forged offset: stream shorter than a state" OFFSET - "$ERC" info "$W/fo4.erc"
198mk fo5; setu32 "$W/fo5.erc" $((544 + 4 * 30)) $(($(u32at "$G" $((544 + 4 * 30))) + 5)); fixed fo5
199refuses "forged offset moved 5 bytes into the next stream, row CRCs kept" ROWCRC 29 "$ERC" decode-row "$W/fo5.erc" 29 "$W/x.out"
200mk fo6; setu32 "$W/fo6.erc" $((544 + 4 * 30)) $(($(u32at "$G" $((544 + 4 * 30))) + 5)); fixrows fo6
201refuses "forged offset moved 5 bytes into the next stream, row CRCs recomputed" LEFTOVER 29 "$ERC" decode-row "$W/fo6.erc" 29 "$W/x.out"
202# a table that still sums to 2^14 but is wrong: streams decode under the wrong model
203mk fm
204f0=$(od -An -tu2 -j 32 -N2 "$G" | tr -d ' '); f1=$(od -An -tu2 -j 34 -N2 "$G" | tr -d ' ')
205setbyte "$W/fm.erc" 32 $(((f0 + 1) & 255)); setbyte "$W/fm.erc" 33 $(((f0 + 1) >> 8)); setbyte "$W/fm.erc" 34 $(((f1 - 1) & 255)); setbyte "$W/fm.erc" 35 $(((f1 - 1) >> 8)); fixed fm
206refuses_any "forged table, count moved between two symbols, decode" "STATE EXHAUST LEFTOVER FINAL MATCRC" - "$ERC" decode "$W/fm.erc" "$W/x.out"
207# a forged matrix CRC: every stream is fine, only the whole-matrix check can refuse
208mk fc; setu32 "$W/fc.erc" 20 305419896; fixed fc
209refuses "forged matrix CRC, decode" MATCRC - "$ERC" decode "$W/fc.erc" "$W/x.out"
210"$ERC" decode-row "$W/fc.erc" 7 "$W/o.out"; dd if="$W/s64k.raw" of="$W/o.ref" bs=512 skip=7 count=1 2> /dev/null
211check "forged matrix CRC: one row alone still decodes (the matrix CRC is a whole-matrix check)" cmp -s "$W/o.out" "$W/o.ref"
212
213# known answers for the two checksums
214printf 123456789 > "$W/ka.bin"
215check "CRC-32 of 123456789 is cbf43926 and CRC-16/CCITT-FALSE is 29b1" [ "$("$ERC" sum "$W/ka.bin")" = "crc32=cbf43926 crc16=000029b1" ]
216
217# absurd fields must give a refusal, never a trap or a crash
218mk big1; setu32 "$W/big1.erc" 8 4294967295
219refuses "rows 2^32 - 1 in a small file" TRUNC - "$ERC" decode "$W/big1.erc" "$W/x.out"
220mk big2; setu32 "$W/big2.erc" 12 4294967295; fixed big2
221refuses_any "cols 2^32 - 1 with valid CRCs" "EXHAUST ALLOC STATE LEFTOVER FINAL ROWCRC" - "$ERC" decode "$W/big2.erc" "$W/x.out"
222
223# random damage, with the header CRC fixed, with the row CRCs fixed too, and with neither: the tool must
224# exit 0 or 3 (never a trap or a crash), and every exit 0 must have produced the original bytes
225FUZZ_N=${FUZZ_N:-300}
226nums=($(prng fuzz $((FUZZ_N * 12 + 12)) | od -An -v -tu4))
227fsz=$(stat -c %s "$G"); fzbad=0; fzok=0; fzref=0
228for ((i = 0; i < FUZZ_N; i++)); do
229 pos=$((nums[i * 3] % fsz)); bit=$((nums[i * 3 + 1] % 8)); md=$((nums[i * 3 + 2] % 3)); rw=$((nums[i * 3 + 2] / 3 % 64))
230 cp "$G" "$W/fz.erc"; flipbit "$W/fz.erc" "$pos" "$bit"
231 [ "$md" = 1 ] && "$ERC" fixcrc "$W/fz.erc" > /dev/null 2>&1
232 [ "$md" = 2 ] && "$ERC" fixrows "$W/fz.erc" > /dev/null 2>&1
233 rm -f "$W/fz.out" "$W/fz.row"
234 "$ERC" decode "$W/fz.erc" "$W/fz.out" > /dev/null 2>&1; rc=$?
235 case $rc in
236 0) if cmp -s "$W/fz.out" "$W/s64k.raw"; then fzok=$((fzok + 1)); else fzbad=$((fzbad + 1)); echo " fuzz $i: exit 0 with wrong bytes (byte $pos bit $bit mode $md)"; fi ;;
237 3) fzref=$((fzref + 1)) ;;
238 *) fzbad=$((fzbad + 1)); echo " fuzz $i: decode exit $rc (byte $pos bit $bit mode $md)" ;;
239 esac
240 "$ERC" decode-row "$W/fz.erc" "$rw" "$W/fz.row" > /dev/null 2>&1; rc=$?
241 case $rc in
242 0) dd if="$W/s64k.raw" of="$W/fz.ref" bs=512 skip="$rw" count=1 2> /dev/null; cmp -s "$W/fz.row" "$W/fz.ref" || { fzbad=$((fzbad + 1)); echo " fuzz $i: decode-row exit 0 with wrong bytes (byte $pos bit $bit mode $md row $rw)"; } ;;
243 3) ;;
244 *) fzbad=$((fzbad + 1)); echo " fuzz $i: decode-row exit $rc (byte $pos bit $bit mode $md)" ;;
245 esac
246done
247check "$FUZZ_N random single-bit damages: exit 0 or 3 only, every exit 0 has the original bytes (refused $fzref, accepted $fzok)" [ "$fzbad" = 0 ]
248
249# ---------------------------------------------------------------- rows are independent
250if [ -z "${QUICK:-}" ]; then
251 for m in s64k s256u; do
252 r=$(rows_of "$W/$m.erc"); c=$(u32at "$W/$m.erc" 12)
253 mkdir -p "$W/ord_$m"; rm -f "$W/ord_$m"/*
254 for row in $(seq 0 $((r - 1)) | shuf --random-source=<(prng ord 100000)); do
255 "$ERC" decode-row "$W/$m.erc" "$row" "$W/ord_$m/$(printf %05d "$row")" || bad "$m: row $row"
256 done
257 cat "$W/ord_$m"/* > "$W/ord_$m.joined"
258 check "$m: all $r rows decoded one process each in shuffled order equal the raw matrix" cmp -s "$W/ord_$m.joined" "$W/$m.raw"
259 rm -f "$W/ord_$m"/*
260 for row in $(seq $((r - 1)) -1 0); do "$ERC" decode-row "$W/$m.erc" "$row" "$W/ord_$m/$(printf %05d "$row")"; done
261 cat "$W/ord_$m"/* > "$W/ord_$m.joined"
262 check "$m: all rows in reverse order equal the raw matrix" cmp -s "$W/ord_$m.joined" "$W/$m.raw"
263 done
264 # flip every stream bit of a small matrix once; the damaged row alone must never decode silently wrong
265 gen s16 16 1024 skew 15; "$ERC" encode "$W/s16.raw" 0 16 1024 "$W/s16.erc" > /dev/null
266 fs=$("$ERC" flipscan "$W/s16.erc"); echo " flipscan 16x1024: $fs"
267 check "flipscan: with the row CRC no flipped stream bit is undetected" [ "$(echo "$fs" | sed 's/.*checked_undetected=\([0-9]*\).*/\1/')" = 0 ]
268 check "flipscan: with the row CRC no flipped stream bit gives a wrong row" [ "$(echo "$fs" | sed 's/.*checked_undetected_wrong_output=\([0-9]*\).*/\1/')" = 0 ]
269fi
270
271if [ "$FAIL" = 0 ]; then echo "ERC1 SYNTHETIC PASS $PASS checks"; exit 0; fi
272echo "ERC1 SYNTHETIC FAIL $FAIL of $((PASS + FAIL)) checks"
273exit 1