# Solver Notes

## Formula Notes

The family is the mechanical master-key lock-chart encoding.  The detector does
not use comments or filenames.  It recovers:

- `key[k][position][depth]` exactly-one variables at the beginning of the CNF.
- Adjacent-depth jump clauses, matching the `J=1` key geometry restriction.
- Lock allowed-depth variables, each defined as the OR of all authorized keys
  with that position/depth.
- Blocked lock/key mismatch variables.  A blocked key must have at least one
  position where its chosen depth is not accepted by the lock.

Group2 instances are randomized lock charts with `P=8,D=4` and are SAT in the
training data.  Group3 instances have `P=4,D=3` and visible examples are UNSAT;
the solver currently returns `UNKNOWN` for them because no VeriPB proof strategy
has been implemented.  Group1 instances are structured sparse charts with many
keys and locks.  In the visible group1 chart every lock authorizes five keys:
a global master key, a coarse interval key, two finer interval/window keys, and
a one-lock leaf key.  The solver now uses a greedy partition-cover initializer
and weighted incremental repair for these larger charts.

## Techniques Used

The solver reconstructs the high-level chart, then searches over key bittings
instead of CNF assignments.  For small randomized group2 charts it keeps the
inherited simulated annealer over individual key-position depths, preserving the
adjacent jump constraint.  For large structured group1 charts it first builds a
sequence of depth partitions that covers many blocked lock/key pairs, then runs
incremental weighted min-conflicts using lock depth counts and bad-pair weights.
On a zero-cost state, the solver derives all lock and mismatch auxiliaries from
the key cuts and checks every original CNF clause before returning
`SATISFIABLE`.

## Remaining Things To Try

- Generalize the group1 constructive insight into an explicit deterministic
  assignment, instead of relying on weighted repair after the greedy cover.
- Design and emit compact VeriPB proofs for group3 UNSAT cases.
- Add conflict weights or a better cooling/restart schedule for harder
  randomized group2 seeds.
- Revisit the omitted-depth formulation for group2 as move guidance; a direct
  sufficient omitted-depth model was too restrictive in local experiments.

## Known Limitations

- UNSAT is never claimed.
- SAT is claimed only after full CNF model verification.
- Large structured group1 SAT instances are searched directly and the visible
  `L=190,K=276` instance solves locally in about 53 seconds, but larger held-out
  charts may still need more repair time.
- Randomized group2 remains stochastic; the visible `L=18,K=36` instance solves
  locally in about 97 seconds with the inherited annealing schedule, while other
  seeds can still remain `UNKNOWN`.

## Changelog

- Replaced the scaffold with a C++ lock-chart detector and model builder.
- Added high-level extraction of key variables, lock OR variables, chart sets,
  and mismatch auxiliary implications.
- Added a conservative SAT path with full original-clause model checking.
- Added a simulated annealer over key-position cells; this solves the visible
  randomized group2 SAT instances under the broker timeout.
- Updated metadata and notes for broker submission.
- Broker iteration: the first annealing schedule was too wall-clock dependent
  and produced all `UNKNOWN`; the move-count schedule solved two train group2
  instances but wasted resources on group1.  Added a conservative quick
  `UNKNOWN` path for large structured charts.
- 2026-05-09: Added greedy partition-cover initialization and incremental
  weighted repair for large structured charts.  Removed the large-chart quick
  `UNKNOWN` path; the visible group1 chart now solves locally with full CNF
  model checking.
- 2026-05-09: Kept the inherited annealing-first schedule for small randomized
  group2 charts after greedy repair repeatedly stalled at a few residual
  violations.  Scoped expensive final DFS away from large charts after it
  delayed otherwise successful weighted min-conflicts repair.
- 2026-05-09: Broker run `eval_20260509T222015Z_d170ad0f` solved 4 training
  instances with no invalid answers, beating the provided VBS solved count of 3.
  Shortened large-chart repair restarts and removed the ineffective large-chart
  annealing fallback to reduce timeout risk on unsolved structured charts.
- 2026-05-09: Broker run `eval_20260509T230421Z_edb89f1f` solved only 2
  instances.  The shorter large-chart chunk was too aggressive on broker
  hardware and cut off group1 runs that solve locally.  Reverted to the
  190-second large-chart chunk and restored the previous fallback to recover
  the 4-solve behavior.
- 2026-05-10: Broker run `eval_20260509T234507Z_b36c3bfc` recovered 3 solves
  but missed the previously solved `L=210,K=303` group1 instance, indicating
  wall-clock restart sensitivity.  Increased the large-chart chunk to 240
  seconds while keeping the overall large-chart budget fixed.
