Polish release docs and add CI checks
- Correct stale references and headline-path wording in READMEs and Lean docstrings - Document build steps, comparator requirements, sweep scope, and coverage - Unify Apache headers across Lean and C++ sources - Add a bwrap-free axiom audit for the headline theorems - Add a Gitea workflow running lake build, the axiom audit, C++ tests, and coverage - Match LLVM coverage tool versions to the compiler and recreate stale build dirs
This commit is contained in:
1 parent
73e371fb40
commit
273ad72f0c
34 files changed
+431
-133
No files matched your search
+12
-7
@@ -90,18 +90,23 @@ cases that satisfy the readable sorting invariant:
|
||||
# extreme: 7574 cases, 0 mismatches
|
||||
```
|
||||
|
||||
`exhaustive_test` enumerates small readable instances instead of sampling them:
|
||||
every sorted database of up to four keys over a fixed universe of boundary
|
||||
keys, every selector key (including `⊥` and `⊤`) with offsets in `[-3, 5]`, and
|
||||
every readable result (the complete traversal, each nonempty truncated prefix,
|
||||
or the empty result when the traversal is empty) in both directions:
|
||||
`exhaustive_test` enumerates a specific finite class rather than sampling it:
|
||||
every sorted database of at most four stored keys drawn from a fixed universe of
|
||||
boundary keys, every selector key (including `⊥` and `⊤`) with offsets in
|
||||
`[-3, 5]`, both traversal directions, and every readable result shape (the
|
||||
complete traversal, each nonempty truncated prefix, or the empty result when the
|
||||
traversal is empty):
|
||||
|
||||
```sh
|
||||
./cpp/build/exhaustive_test
|
||||
# exhaustive: 10562068 cases, 0 mismatches
|
||||
# exhaustive: 13565772 cases, 0 mismatches
|
||||
```
|
||||
|
||||
It runs in about a second and is also the coverage driver.
|
||||
It runs in about a second and is also the coverage driver. The class is not all
|
||||
readable inputs; the guarantee is that every instance in this family agrees. In
|
||||
particular, branch coverage cannot exercise a predicate operand that the
|
||||
implementation no longer contains: the coverage result below describes the code
|
||||
as written, it is not a proof of equivalence with `literal.cpp`.
|
||||
|
||||
## Coverage
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/-
|
||||
Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: FormalConflictRange contributors
|
||||
-/
|
||||
|
||||
import Statement
|
||||
|
||||
/-!
|
||||
|
||||
+53
-2
@@ -8,14 +8,65 @@ set -euo pipefail
|
||||
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
build="${1:-$here/build-coverage}"
|
||||
cxx="${CXX:-clang++-21}"
|
||||
profdata="${LLVM_PROFDATA:-$(command -v llvm-profdata-21 || command -v llvm-profdata || true)}"
|
||||
cov="${LLVM_COV:-$(command -v llvm-cov-21 || command -v llvm-cov || true)}"
|
||||
# Prefer LLVM tools whose version matches the compiler (for example
|
||||
# `clang++-21` with `llvm-profdata-21`/`llvm-cov-21`). Do not guess among
|
||||
# versioned tools: mixing profile formats fails in confusing ways.
|
||||
if [[ "$(basename "$cxx")" =~ -([0-9]+)$ ]]; then
|
||||
cxx_version="${BASH_REMATCH[1]}"
|
||||
else
|
||||
cxx_version=""
|
||||
fi
|
||||
cxx_major=""
|
||||
if [[ -z "$cxx_version" ]]; then
|
||||
cxx_major="$("$cxx" -dumpversion 2>/dev/null | cut -d. -f1 || true)"
|
||||
fi
|
||||
|
||||
pick_tool() {
|
||||
local tool="$1" override="$2"
|
||||
if [[ -n "$override" ]]; then
|
||||
printf '%s\n' "$override"
|
||||
return 0
|
||||
fi
|
||||
if [[ -n "$cxx_version" ]]; then
|
||||
if command -v "${tool}-${cxx_version}" >/dev/null 2>&1; then
|
||||
command -v "${tool}-${cxx_version}"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
if command -v "$tool" >/dev/null 2>&1; then
|
||||
command -v "$tool"
|
||||
return 0
|
||||
fi
|
||||
if [[ -n "$cxx_major" ]] && command -v "${tool}-${cxx_major}" >/dev/null 2>&1; then
|
||||
command -v "${tool}-${cxx_major}"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
profdata="$(pick_tool llvm-profdata "${LLVM_PROFDATA:-}")" || true
|
||||
cov="$(pick_tool llvm-cov "${LLVM_COV:-}")" || true
|
||||
|
||||
if [[ -z "$profdata" || -z "$cov" ]]; then
|
||||
echo "llvm-profdata and llvm-cov are required" >&2
|
||||
echo "install the LLVM tools matching $cxx, or set LLVM_PROFDATA and LLVM_COV" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Reusing a coverage build directory after changing the compiler makes CMake
|
||||
# discard its cache, which also drops the instrumentation flags. Recreate the
|
||||
# directory instead of silently producing an uninstrumented binary.
|
||||
cxx_path="$(command -v "$cxx" 2>/dev/null || printf '%s' "$cxx")"
|
||||
cache="$build/CMakeCache.txt"
|
||||
if [[ -f "$cache" ]]; then
|
||||
cached_cxx="$(sed -n 's/^CMAKE_CXX_COMPILER:.*=//p' "$cache" | head -n 1)"
|
||||
if [[ -n "$cached_cxx" && "$cached_cxx" != "$cxx" && "$cached_cxx" != "$cxx_path" ]]; then
|
||||
echo "coverage build used $cached_cxx; recreating it for $cxx" >&2
|
||||
rm -rf "$build"
|
||||
fi
|
||||
fi
|
||||
|
||||
cmake -S "$here" -B "$build" -G Ninja \
|
||||
-DCMAKE_CXX_COMPILER="$cxx" \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
// A summarised implementation of the same decision procedure as
|
||||
// `Statement.closedForm`.
|
||||
//
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "model.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
// A deliberately literal transliteration of `Statement.closedForm` from
|
||||
// Statement.lean. Every helper mirrors the Lean definition of the same name,
|
||||
// including repeated scans of `res.keys`; correctness of the translation, not
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "model.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
// Shared data model for the C++ translation of `Statement.closedForm`.
|
||||
//
|
||||
// Keys are byte strings ordered lexicographically. The model separates
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
// nanobench comparison of the literal translation and the summarised
|
||||
// implementation on representative readable instances.
|
||||
#define ANKERL_NANOBENCH_IMPLEMENT
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
// Compare the literal translation with the summarised implementation on the
|
||||
// Lean-generated corpus (readable or not).
|
||||
#include <cstdint>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
// A deterministic exhaustive sweep of small readable instances, comparing the
|
||||
// literal translation with the summarised implementation.
|
||||
//
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
// Regression test for offsets at the extremes of the input domain. Offsets
|
||||
// supplied by callers are 32-bit; a positive `end.offset` near `INT32_MAX`
|
||||
// would otherwise materialise about 2^31 zero bytes for Lean's
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
// libFuzzer safety harness: arbitrary (not necessarily readable) instances.
|
||||
// Equivalence is only promised on readable inputs, so this harness merely runs
|
||||
// both implementations under ASan/UBSan to catch memory-safety or UB issues in
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
// libFuzzer differential harness: the literal translation versus the
|
||||
// summarised implementation, on readable-by-construction instances.
|
||||
#include <cstddef>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
// Validates the C++ literal translation against golden vectors produced by
|
||||
// `cpp/oracle/gen.lean` (which calls the real `Statement.closedForm`).
|
||||
#include <cstdint>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2026 FormalConflictRange contributors. All rights reserved.
|
||||
// Released under Apache 2.0 license as described in the file LICENSE.
|
||||
// Authors: FormalConflictRange contributors
|
||||
|
||||
// Deterministic, readable-by-construction instance generation shared by the
|
||||
// differential fuzzer and the benchmarks.
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user