# Solver Notes

## Formula Notes

- The family is RB-style random binary CSP encoded into CNF.
- High-level variables are finite-domain objects. Each object appears as one long clause of length `d` requiring at least one selected value.
- Binary clauses inside a block encode at-most-one. Binary clauses across blocks forbid selected value pairs.
- Most files use positive one-hot block literals, but the `sc2009` style files can polarity-flip individual Boolean variables. The detector therefore treats each long-clause literal as the signed selection literal and decodes binary clauses as complements of two selection literals.
- Observed local sizes include `n,d = 40,19`, `45,21`, `50,23`, `55,25`, and `60,26`; baseline metadata also shows larger RB instances up to about `80,33`.

## Techniques Used

- Structural detector recovers signed one-hot blocks without comments, filenames, or hashes.
- The solver builds one high-level forbidden-pair relation per CSP variable pair using bit masks.
- SAT search is a randomized high-level local search: greedy initialization, min-conflicts repair over violated CSP edges, endpoint move evaluation, and breakout-style weights incremented on currently violated edges to escape plateaus.
- Before returning SAT, the solver maps the selected high-level values back through the signed one-hot literals and checks every original CNF clause. If that check fails, it returns UNKNOWN.

## Remaining Things To Try

- Add a belief-propagation or arc-consistency decimation constructor before local repair for larger planted SAT instances.
- Preserve breakout weights across some restarts or diversify seeds more aggressively for n >= 50 cases that sometimes need longer than 60 seconds.
- Design a VeriPB proof strategy for UNSAT RB instances; currently no UNSAT result is claimed.

## Known Limitations

- The solver is not a complete CSP solver and does not claim UNSAT.
- Search is stochastic but deterministic from formula dimensions and clause count; some satisfiable instances may need close to the full 600 second evaluation budget.
- Unsupported encodings return UNKNOWN.

## Changelog

- Initial scaffold replaced with a C++ direct-encoding RB detector and high-level local-search solver.
- Added signed one-hot block recovery for polarity-scrambled benchmark variants.
- Added breakout weights and endpoint move evaluation, improving local solves on n=50 and n=55 samples.
- Changed the local-search seed to derive from recovered constraint masks, diversifying deterministic trajectories without using filenames or stored answers; this fixed a prior n=50 timeout locally.
- Updated metadata and build-ready documentation for broker submission.
