Skip to content

Witness spec tools: declarative WITNESS.json inputs, EXPECTED.json comparisons and a generic verifier (no κ claim) - #587

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
jeremykothe2:witness-spec-tools
Oct 12, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
jeremykothe2:witness-spec-tools

Conversation

@jeremykothe2

Copy link
Copy Markdown

Summary

This PR adds tooling only and makes no κ claim.

research/witness-spec-tools/ lets you describe a witness declaratively and get a complete, generic verifier for it. Today each new record forks the previous package and hand-edits constants spread through verify.py, bind, audit and assemble. With this tool, a new candidate is a data change instead.

  • WITNESS.json holds inputs only:
    • the pinned sources;
    • the geometry;
    • typed provider build chains (greedy_kernels, promote, joint_prefix, multicut/cold steps, all naming recipes by hash);
    • the dispatch and call order;
    • PLAN and OWNERS, referenced by hash.
      The verifier builds everything from this file.
  • EXPECTED.json holds expected values only: built word hashes, control counts, per-provider artifacts and profiles, the global profile and counts, and κ. The verifier only compares against it. No value in EXPECTED.json feeds a computation. Every value is recomputed independently first, and moment endpoints are re-certified rather than read, so a wrong EXPECTED.json can only make verification fail.
  • Entry points: spec.py generate|check and verify.py. Python 3.11+, standard library only, assertions required.

The admission scripts in code/ are PR582's, unchanged except that shape constants now come from geometry and moment endpoints are always re-certified.

Tests (tests/run_tests.py, fixture: PR582 at 747ec97)

All 8 pass:

  • Fixture: from examples/pr582/WITNESS.json alone, every provider word is built through the typed steps, with no prebuilt words or reused locals. The generated EXPECTED.json equals PR582's published values, and spec.py check passes. A strict verify from scratch reproduces κ 0.001601486955392486.
  • Mutations that must fail, each rejected at its named check:
    • a profile count;
    • a dispatch entry;
    • an owner byte;
    • a kernel coefficient.

Not included

These are left out on purpose: witness search (owner solvers, kernel and width screens, orchestration), new step types, probe builds of recipe output hashes, and a spec-driven accounting model. See the README.

Credits

Adapted from the PR582 → PR576 → PR571/PR569/PR568/PR564 lineage and PR575/PR558, with all original notices retained.

AI disclosure and authorship: Claude Opus 5.5 (Anthropic), running in the omp coding harness, wrote this tooling. Jeremy Kothe (jeremykothe2) directed and reviewed it and is submitting it.

…n comparisons, generic verifier with PR582 fixture and mutation tests
@Mister-Meeseeks

Copy link
Copy Markdown
Contributor

Thank you @jeremykothe2. This contribution at 9bf577d56312f7491e4bb39b5fa7d844f318cde9 is incorporated in the reviewed family through #588, published in 9594b61.

Inputs and expected outputs separated. pin() returns recomputed got; expected values only compare. Cold runs do full physical admission. Hidden reuse flags lack standalone provenance binding and must not be used as acceptance evidence without external source/input/receipt binding. The replay covers the fixed PR582 accounting model; it is not a theorem for arbitrary geometry declarations.

Preserved implementation and research:

The family review and individual disposition record the scope, evidence and attribution. Parallel and intermediate contributions remain credited even where a later composition has a stronger bound. The published multiplication bound remains conditional on the documented compiler, realization, hosting and analytic assumptions; these finite checks are not a full Lean multiplication proof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants