# Registered protocol: automatic sweeps for BDD proofs

Frozen on 29 November 2026, before the evaluation was run. Corrections are dated addenda at the end; nothing above
the addenda is edited after the freeze.

## The question

Bryant and Heule (ACM TOCL 24(4), 2023, section 5.5) generate polynomial-size extended-resolution proofs for the
mutilated chessboard and the pigeonhole problem (Sinz encoding) with a BDD-based solver, but only with a schedule and
a variable order designed by hand for each problem. They write: "It remains an open question whether column scanning
can be made more general and whether a suitable schedule and variable ordering can be generated automatically." For
pigeonhole in the direct (pairwise) encoding they report: "we were unable to find any method that avoided exponential
scaling".

The method under test computes both from the clauses alone:

- **orders** (`spectral.py`): the low eigenvectors of the variable graph's Laplacian (a clause of k variables joins
  each pair with weight 1/(k−1)). A fixed random combination of the first eigenvalue cluster is the time direction t;
  the first later cluster (t removed) that has at least half its variance inside slices of equal t is the
  transverse direction s. The BDD order sorts by (s, t); the elimination order sorts by (t, s), cut into
  round(√N) slices.
- **schedule** (`schedule.py`, `sweep`): each clause joins the slice of its earliest variable. Per slice: conjoin its
  clauses, quantify the variables used only there, conjoin into the running state, quantify the slice's variables.
- **proofs** (`prover.py`): every BDD node is an extension variable; every step is written in LRAT and the proof is
  checked by drat-trim's `lrat-check` (compiled from github.com/marijnheule/drat-trim).

## What was seen before the freeze

The method was designed on `chess` and `php-sinz` (sizes up to 24, with the hand-designed orders and the automatic
ones). `php-direct` and `tseitin-grid` (up to 16), `parity` (up to 80), `tseitin-random` (up to 30) and `random3` (up
to 40) were each run once at those small sizes after the design was complete; no part of the method was changed after
those runs. `chess-random`, `chess-rect` and `tseitin-torus` had been run only as a smoke test at one size each
(8, 6 and 5); nothing larger has been run for any family.

## Frozen files (SHA-256)

```
c06d788abf72d194064a39371ddb535b1814e02673d8fb85a4073f57b4da5d9a  prover.py
617c83fd31bf5c6821d908826730e8d85580b76874d8e80efa2cbbc494449e45  schedule.py
f4e8b64c33c4aa0aa69bcb679e098f1f9f7df5107c41e27a92cd96f85720653c  spectral.py
dd6a1639655e74d60ba1b30a5e2f72a372786e0b445c10b349274807391c4b88  orders.py
5551a71cf8f107f78e3b33eeb221f2749dd221c48934c57a532b57336af7b335  families.py
f70f0bd1e58d60acaab961d0fb3b6c96feb88661c166f7be617e8cac0fc233a5  run.py
3295509cd5e77d4e575efc9f6ee1fc2b314c6f074b5561f4ac8137536d2863be  experiment.py
ff15544761ed8fe133b0ef31ae68280b4318e6fc11a5fe36f50b6ca7f28bbab2  analyze.py
```

## Runs

`python3 experiment.py` runs 31 series (listed by `--list`). Each run has a budget of 50 million proof clauses and
1,800 seconds for generation and checking together; a series stops at its first run over either limit. In every run
of the automatic method, the formula's variables are renamed and its clauses and literals reordered at random
(`--shuffle`), so that nothing depends on how a generator numbers things.

## Hypotheses and how they are scored (`analyze.py`)

- **H0 (soundness).** Every run that reports "unsat" has a proof that `lrat-check` verifies.
- **H1 (automatic scaling on the families seen before the freeze).** For `chess`, `php-sinz`, `php-direct` and
  `tseitin-grid`, the automatic sweep reaches at least n = 32 with verified proofs, and over the verified sizes
  n ≥ 16 the proof size fits a power of n better than an exponential in n (lower residual sum of squares in log
  space), with exponent at most 5.
- **H2 (the automatic baselines fail).** Linear conjunction and bucket elimination (Bryant and Heule's two automatic
  modes) in the generators' own numbering exceed the budget or the time limit at some n ≤ 20 on each of the same four
  families.
- **H3 (held-out families).** The H1 criterion holds for `chess-random` (two random same-coloured squares removed),
  `chess-rect` (an n × (n+2) board) and `tseitin-torus`, none of which shaped the method.
- **H4 (control).** On random 3-SAT at clause ratio 4.26, the median verified proof size grows exponentially: the
  exponential fit beats the power fit. (Random formulas have no low-dimensional structure to find.)
- **H5 (invariance).** For `chess`, `php-direct` and `tseitin-grid` at n = 8, 16, 24 and 32, three different
  shuffles give proof sizes within a factor of 2 of each other.
- **H6 (exploratory, no prediction scored).** Tseitin formulas on random 4-regular graphs (Urquhart's family) and
  Chew and Heule's parity formulas, under the sweep and under bucket elimination.

The hand-designed column scan (`--orders oracle`) is run as a reference; its comparison with the automatic orders is
reported, not scored.

## What a pass would and would not show

A pass shows that, on these families and sizes, schedules and orders computed from the clauses alone yield
verified extended-resolution proofs whose size grows polynomially on the measured range. It is a measurement on a
finite range, not a proof of polynomial size, and it says nothing about formulas without low-dimensional structure
(H4 is there to show that). No CDCL solver is run here (building one was not permitted on this machine); comparisons
with CDCL cite Bryant and Heule's published Kissat measurements and the known resolution lower bounds.

## Addenda

### Addendum 1 (29 November 2026, after 25 runs; the evaluation restarted from the beginning)

Three problems appeared in the first 25 runs. None of them concerns the method, the hypotheses or the scoring, which
are unchanged.

1. **Memory.** With three runs in parallel the machine (15 GB) ran out of memory and the kernel killed a process. The
   prover now drops the literals of the two case-split clauses of each AND and implication step once the step that
   uses them is written (`Prover.forget`); nothing later refers to them. The proof written is byte-identical: on
   `chess` 16 (bucket elimination and the hand-designed sweep), `php-direct` 12 (hand-designed sweep) and `php-sinz`
   10 (linear conjunction), the patched and frozen provers wrote the same file. The runner now runs two series at a
   time and limits each run to 7 GiB of address space; a run over the limit fails and ends its series, as the budget
   and time limit do.
2. **Reproducibility.** ARPACK starts from a random vector and the BLAS library used several threads, so on formulas
   with nearly equal eigenvalues (the chessboard) two runs of the same formula could compute slightly different
   eigenvectors, and so different orders and different (equally verified) proofs. `spectral.py` now gives ARPACK a
   fixed start vector and sets single-threaded linear algebra; the same formula then gives the same orders (checked
   four times on the shuffled 16 × 16 board, once with four BLAS threads requested). The definition of the orders is
   unchanged.
3. The 25 runs made before this addendum are kept, unscored, in `results/runs-superseded-2026-11-29.jsonl`; all 25
   reported "unsat" with a verified proof. The evaluation was restarted with an empty `results/runs.jsonl`.

Files changed by this addendum (SHA-256):

```
40281439e45abc86a11c4023510c4419ff79544015fbbcfd7a661ddb10c83e43  prover.py
26bd331ddeb643228a3d49cca468dc2fd1eded913ffe7f553f306e85475c4a73  spectral.py
b69ef6dc8ef48d90de7dd7fb5ba513720f6a5d5f2a5108c2689c02518e5b2298  experiment.py
```

### Addendum 2 (29 November 2026, after the evaluation finished; nothing in the method or scoring changed)

One run was killed by the kernel, not by its own limits: `php-direct` n = 32 with shuffle 2 (H5) ended with an empty
error at a time when an unlimited exploratory run outside this protocol had exhausted the machine's memory. Its
record was moved to `results/runs-superseded-2026-11-29.jsonl` and the run was repeated alone under the protocol's
limits; it then stopped at the 7 GiB limit with a `MemoryError`, as the same size did under shuffles 1 and 3.
