Skip to content

Commit 4d2358f

Browse files
committed
Bound Miri release gate coverage
1 parent 2efe0bb commit 4d2358f

1 file changed

Lines changed: 47 additions & 5 deletions

File tree

scripts/check_miri.sh

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,61 @@ no_default_output="$evidence_dir/no-default-features.txt"
1111
all_features_output="$evidence_dir/all-features.txt"
1212
manifest="$evidence_dir/MANIFEST.txt"
1313

14+
run_miri_case() {
15+
output="$1"
16+
feature_args="$2"
17+
test_filter="$3"
18+
19+
echo "command: rustup run nightly cargo miri test $feature_args $test_filter -- --exact" >>"$output"
20+
rustup run nightly cargo miri test $feature_args "$test_filter" -- --exact >>"$output" 2>&1
21+
}
22+
1423
mkdir -p "$evidence_dir"
1524

1625
echo "Miri checks: no-default-features scalar surface"
1726
no_default_status=0
18-
rustup run nightly cargo miri test --no-default-features >"$no_default_output" 2>&1 || no_default_status="$?"
27+
{
28+
echo "base64-ng Miri no-default-features evidence"
29+
echo
30+
} >"$no_default_output"
31+
32+
for test_filter in \
33+
"tests::encodes_standard_vectors" \
34+
"tests::decodes_standard_vectors" \
35+
"tests::rejects_non_canonical_padding_bits" \
36+
"tests::supports_unpadded_url_safe" \
37+
"decode_backend::tests::boundary_uses_only_admitted_backends" \
38+
"errors::tests::index_offsets_saturate_on_overflow"
39+
do
40+
if [ "$no_default_status" -eq 0 ]; then
41+
run_miri_case "$no_default_output" "--no-default-features" "$test_filter" || no_default_status="$?"
42+
fi
43+
done
1944
cat "$no_default_output"
2045

2146
if [ "$no_default_status" -ne 0 ]; then
2247
all_features_status=99
2348
else
2449
echo "Miri checks: all-features scalar, alloc, and stream surface"
2550
all_features_status=0
26-
rustup run nightly cargo miri test --all-features >"$all_features_output" 2>&1 || all_features_status="$?"
51+
{
52+
echo "base64-ng Miri all-features evidence"
53+
echo
54+
} >"$all_features_output"
55+
56+
for test_filter in \
57+
"tests::encodes_standard_vectors" \
58+
"tests::decodes_standard_vectors" \
59+
"decode_slice_clear_tail_scrubs_output_on_error" \
60+
"ct_decode_slice_staged_clear_tail_copies_only_after_success" \
61+
"stream_encoder_direct_write_buffers_tail_bytes" \
62+
"stream_decoder_direct_write_processes_multiple_quads" \
63+
"stream_decoder_fails_closed_after_malformed_input"
64+
do
65+
if [ "$all_features_status" -eq 0 ]; then
66+
run_miri_case "$all_features_output" "--all-features" "$test_filter" || all_features_status="$?"
67+
fi
68+
done
2769
cat "$all_features_output"
2870
fi
2971

@@ -47,8 +89,7 @@ fi
4789
fi
4890
echo
4991
echo "commands:"
50-
echo "rustup run nightly cargo miri test --no-default-features"
51-
echo "rustup run nightly cargo miri test --all-features"
92+
echo "See no-default-features.txt and all-features.txt for exact per-test Miri commands."
5293
echo
5394
echo "status:"
5495
echo "no_default_features=$no_default_status"
@@ -64,7 +105,8 @@ fi
64105
fi
65106
echo
66107
echo "interpretation:"
67-
echo "This evidence records Miri coverage for scalar, alloc, and stream surfaces on this machine."
108+
echo "This evidence records bounded Miri coverage for representative scalar, alloc, and stream surfaces on this machine."
109+
echo "Exhaustive/property-style parity sweeps are intentionally handled by normal test, nextest, hardware, and CI gates."
68110
echo "It checks undefined behavior that Miri can observe, but it is not a formal proof."
69111
} >"$manifest"
70112

0 commit comments

Comments
 (0)