Commit Graph
16 Commits
Author SHA1 Message Date
andrew bf149c26b5 Saturate and gate all llvm-cov coverage metrics
Require 100% region, function, instantiation, line, branch, and MC/DC
coverage in run-coverage.sh. Enable MC/DC instrumentation and rewrite the
two decisions that Clang could not instrument cleanly: the crossed-room
ternary, and the nested boolean under negation in crossedCompleteEndLeOne.
2026-11-18 15:10:02 -05:00
andrew f23d8a28d3 Remove dispatch-redundant tests from fast.cpp
CI / build-and-check (push) Successful in 8m5s
Two mutation rounds plus z3 checks found conditions that an enclosing
dispatch already decides, and two places that re-tested the same split.

* crossed complete: HeadBottom implies NonposBottom, so drop it; inline
  the clamp dispatch so EndOne/LongNonpos are not tested twice; after the
  failed strict ordering test the non-strict one is free.
* reversed truncation: the dispatch has failed end.offset <= 1, so
  BelowEnd does not need to re-test end.offset >= 2; the two TopCrossed
  cases split on end.key < last, so test that once; revTruncGeTwoLarge
  was a tautological split of TopLarge on isTop begin.
* TopLarge's sentinel re-tested TopLarge even though the caller had
  established it; only the sentinel test is needed.
* complete forward: begin is bottom exactly when clampsToBottom, and
  bottom <= end always, so the disjunction is just the key comparison.

z3 refutes the negation of each implication.  Sweep, golden, corpus, SMT,
extreme, and fuzz pass; fast.cpp stays at 100% line/branch coverage.
2026-11-18 14:31:52 -05:00
andrew 2c8221be54 Drop the reference to the previous key model
The note compared against an implementation that no longer exists.
2026-11-18 14:18:37 -05:00
andrew 6e8f5175e2 Remove the recorded validation snapshot
The table was a one-off measurement on a particular machine.  Keep the
commands and the properties they check; readers can run them for current
numbers.
2026-11-18 14:18:31 -05:00
andrew fad9095062 Point the benchmark section at cr_bench
Remove the recorded benchmark tables.  They are measurements of a
particular machine and build, and they go stale as soon as the
implementation or harness changes.  Leave the command and a one-line
description of what it compares, so the reader can run it.
2026-11-18 14:18:15 -05:00
andrew 023ed53579 Stop recording churning metrics in the C++ docs
Remove the exact coverage totals and the offset-5 branch-coverage
explanation: both change whenever fast.cpp or the sweep is adjusted.
The coverage script already reports the current totals and enforces the
100% gate.

Replace the benchmark table's absolute nanoseconds with the stable
shape, and point readers at cr_bench for current numbers.  The recorded
crossed-truncated-reverse figure was already stale after the fast.cpp
change.
2026-11-18 14:17:25 -05:00
andrew e351a0cf8d Hoist the crossed offset test in fast.cpp
Test end.offset <= 1 before revTruncLeOneLow in the reversed crossed
dispatch, and specialize revTruncLeOneLow under that path fact.  The
helper drops the now-tautological end.offset conjuncts and the key
comparison implied by a failed optLe.

The crossed truncated reverse benchmark drops from about 67 ns to
about 61 ns.  Sweep, corpus, SMT cases, and 100% line and branch
coverage still pass.
2026-11-18 14:14:44 -05:00
andrew e1395f20ef Refresh C++ coverage counts
CI / build-and-check (push) Successful in 7m56s
Update the README's coverage table to match the current summarised
implementation, and drop a trailing space in a Lean docstring.
2026-11-18 13:26:18 -05:00
andrew a0b68d148b Simplify crossed dispatch and add SMT-derived cases
Drop the redundant begin.offset split in crossedCompleteOvershoot and
the rE > 0 guard in closedFormForwardSaturated; both are implied by
the call-site invariants.

Add an SMT-derived empty-interval case as the smt_cases CTest and as a
committed fuzz_readable seed.  run-fuzz.sh now loads the read-only seed
corpus alongside the writable one.

Rename exhaustive to sweep and document that it is exhaustive only
over its bounded family of instances.
2026-11-18 13:03:55 -05:00
andrew 7a41d1f647 Register C++ tests with CTest 2026-11-18 11:31:51 -05:00
andrew 24f28dd9c8 Store public selector offsets as int32 2026-11-18 11:28:47 -05:00
andrew cb160a6881 Limit copyright headers to reviewed files 2026-11-18 10:38:21 -05:00
andrew 273ad72f0c 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
2026-11-17 21:29:16 -05:00
andrew 73e371fb40 Remove dead branches from the fast translation
Drop predicate operands and unreachable arms that dispatch and readable invariants fix, and extend the exhaustive sweep to cover every branch side. Gate coverage on branch coverage as well.
2026-11-17 19:26:09 -05:00
andrew 3bb5d062ff Harden and fully cover the C++ translation
Add an exhaustive readable-instance sweep and a coverage gate requiring
100% line coverage of the summarised implementation. Delete branches that
are unreachable under `Readable`, centralise and assert the 32-bit offset
contract at the public entry points, and stop materialising `n` zero bytes
when deciding `keyAfterN n k < upper`.

Also add the extreme-offset regression test, harden the corpus parsers,
remove unused model helpers, document the literal-total / fast-readable
split, and refresh the validation and benchmark numbers.
2026-11-17 18:46:24 -05:00
andrew e32e42d933 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.
2026-11-17 16:08:07 -05:00