Add a C++ translation of the closed form
- Literal transliteration of `Statement.closedForm` plus an equivalent summarised implementation - Borrowed input keys (`std::string_view` / `std::span`) and owned result keys (`std::string`) - Golden-vector test, differential/safety fuzzers, and a nanobench comparison The literal and summarised implementations agree on 40,000 Lean golden vectors, 18,971 sorted corpus cases, and the readable fuzzer; the raw fuzzer runs both implementations under ASan/UBSan. `build/` and the generated `oracle/golden.txt` are ignored.
This commit is contained in:
1 parent
6559cc582b
commit
e32e42d933
17 files changed
+8871
No files matched your search
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build (if needed) and run the differential and safety fuzzers.
|
||||
set -euo pipefail
|
||||
|
||||
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
build="${1:-$here/build}"
|
||||
seconds="${2:-300}"
|
||||
|
||||
if [[ ! -x "$build/fuzz_readable" ]]; then
|
||||
cmake -S "$here" -B "$build" -G Ninja -DCMAKE_CXX_COMPILER=clang++-21
|
||||
cmake --build "$build" --target fuzz_readable fuzz_raw
|
||||
fi
|
||||
|
||||
corpus="${TMPDIR:-/tmp}/cr-fuzz-corpus"
|
||||
mkdir -p "$corpus/readable" "$corpus/raw"
|
||||
|
||||
echo "== differential fuzzing (readable instances) =="
|
||||
"$build/fuzz_readable" -max_total_time="$seconds" -max_len=1024 "$corpus/readable"
|
||||
|
||||
echo "== safety fuzzing (arbitrary instances) =="
|
||||
"$build/fuzz_raw" -max_total_time="$seconds" -max_len=1024 "$corpus/raw"
|
||||
Reference in new issue
Block a user