# Twelve runnable research utilities

The [ten earlier utilities](PROTOTYPES-2026-10-09-v2.md) now have two additional components for the data and allocation candidates. All are local research prototypes with separate evidence limits; none demonstrates buyer demand, profitability or independent validity of the source proofs.

## New fixed-margin reference

[contingency_reference.py](tools/contingency_reference.py) uses conventional row dynamic programming to count small fixed-margin integer tables and map ranks to tables. It supports explicit cell bounds and structural zeros. A uniformly selected rank maps to a uniform table; optional draws use `secrets.randbelow` and record ranks for replay. This law differs from fixed-margin conditional independence.

The reference is limited to at most six rows/columns, total 128, 50,000 memo states and a count-work budget of one million units. Work units count newly evaluated memo states and visited row-prefix nodes; they are not measured bit operations or a wall-time guarantee. A separate sampling budget caps output work. Counting exhaustion returns unknown with `exact_count=null`; completed infeasibility returns zero. Count-complete sampling exhaustion preserves the count and any completed tables. It does not implement the source's unrestricted polynomial-bit sampler or FPRAS, and provides no privacy guarantee.

```sh
python3 research/tools/contingency_reference.py research/fixtures/contingency-two-by-two.json --rank 0 --rank 1 --rank 2
python3 research/tools/contingency_reference.py research/fixtures/contingency-two-by-two.json --random-samples 4
```

[325 saved checks](snapshots/2026-10-08-baseline/contingency-validation-2026-10-09-v1.json) cover closed-form two-by-two counts, rank coverage, independent Cartesian fixtures, structural zeros, permutation counts, invalid input and budget semantics. The [exact law comparison](snapshots/2026-10-08-baseline/contingency-law-contrast-2026-10-09-v1.json) gives distance `1/3` from the conditional-independence law in the two-by-two example. [Saved deterministic example](snapshots/2026-10-08-baseline/contingency-example-2026-10-09-v1.json).

## New matching certificate audit

[audit_matching_certificate.py](tools/audit_matching_certificate.py) checks a matching's edges and endpoint disjointness on a simple unweighted graph. It removes a supplied vertex subset `S`, counts odd components, and checks the upper bound `(n-q+|S|)/2` together with `floor(n/2)`. A feasible candidate attaining a bound is certified maximum cardinality. A loose bound leaves optimality unknown; invalid candidates receive no certificate. It hashes the input record and records the exact objective.

The input cap is 100,000 vertices and 500,000 edges. The connected-component pass is linear in graph size; the audit also validates and hashes the input. It does not construct a matching or the subset, implement the new source backend, handle weighted objectives or establish model fairness. Its program has not been formally verified.

```sh
python3 research/tools/audit_matching_certificate.py research/fixtures/star-matching-certificate.json
```

[1,042 saved checks](snapshots/2026-10-08-baseline/matching-certificate-validation-2026-10-09-v1.json) include all 1,024 five-vertex graphs and 32,768 subset bounds against a separate brute-force matching optimizer. Additional cases distinguish invalid, maximum and inconclusive candidates. [Saved star certificate](snapshots/2026-10-08-baseline/matching-certificate-example-2026-10-09-v1.json). This is finite component validation, not a source-algorithm speed benchmark or proof for an arbitrary implementation.

## Full current utility list

| Utility | Main capability |
| --- | --- |
| [Proof preflight](tools/proof_preflight.py) | Static configuration/module/trust inspection |
| [Withdrawal impact](tools/withdrawal_impact.py) | Explicit corrections and dependency paths |
| [Embedding audit](tools/audit_embedding.py) | Finite floating-point distortion |
| [GAD capacity objective](tools/gad_capacity.py) | Finite scalar objective evaluation |
| [Claim contract audit](tools/audit_claim_contract.py) | Documentary gaps in nine curated contracts |
| [Periodic interface reference](tools/periodic_interface_reference.py) | Explicit cubic-periodic perimeter formula |
| [Binary waveform audit](tools/audit_binary_waveform.py) | Exact correlations and sampled spectrum |
| [Ramanujan graph audit](tools/audit_ramanujan_graph.py) | Exact finite strict spectral bound |
| [Cyclic-chain reference](tools/cyclic_chain_reference.py) | Exact small-group shortest cyclic quotient chain |
| [Evidence bundle](tools/evidence_bundle.py) | Source fingerprints and joined local report |
| [Contingency reference](tools/contingency_reference.py) | Exact bounded table count/rank generation |
| [Matching certificate audit](tools/audit_matching_certificate.py) | Feasibility plus attaining cardinality bound |

The eight component validation reports now record 1,473 passed checks. Most of the added checks are exhaustive small-graph and small-table cases. Earlier static, withdrawal and embedding fixtures are separate evidence; none is a mathematical kernel check or a buyer-value test.

All saved-output commands require fresh filenames or directories and preserve earlier editions. The dated batch/validation drivers should not be rerun into existing paths. [Explicit direct-backend parameter calculations](snapshots/2026-10-08-baseline/direct-candidate-parameters-2026-10-09-v1.json) explain why the new finite utilities are separate from the deferred literal research algorithms.
