# Solver Notes

## Formula Notes

- The main family is subgraph isomorphism.
- Direct encodings have one long clause per pattern vertex. Each variable appears
  in exactly one long clause, but `shuffled-as` instances may polarity-flip the
  domain literals. Binary clauses are complements of two domain literals and
  mean that the two high-level choices cannot both be selected.
- Logarithmic SGI encodings use five Boolean variables per pattern vertex.
  Length-5 clauses forbid the two invalid 5-bit host codes, and length-10
  clauses forbid a pair of host codes for two pattern vertices.
- Positive unshuffled `srhd`, `satsgi`, and `new-difficult` instances keep
  domain literals ordered by host label. Many SAT cases are generated by
  deleting a small number of host labels from an ordered host graph.
- The `si2` and `Subisomorphism` files use a different auxiliary-heavy encoding.
  A small in-house CDCL fallback can find several SAT models there, but the
  high-level structure is not recovered yet.

## Techniques Used

- Structural direct-CSP detector over signed domain literals.
- Log-CSP detector over 5-bit row groups and forbidden code pairs.
- Bit-mask arc consistency and depth-first search over recovered high-level
  mapping variables.
- Min-conflicts pre-search for supported CSPs.
- Ordered host-deletion embedding recovery for positive unshuffled formulas.
- A conservative stochastic fallback for unsupported SAT-shaped formulas; it
  only reports SAT after full clause verification.
- A bounded in-house CDCL fallback for auxiliary-heavy encodings and missed
  satisfiable direct/log cases.
- CDCL learned clauses are logged as VeriPB `rup` constraints. If CDCL reaches
  a level-0 contradiction, the solver can emit a checkable UNSAT proof.

## Remaining Things To Try

- Reverse-engineer the `si2` auxiliary encoding instead of relying on CDCL.
  The first clauses show repeated small blocks and many large clauses, likely a
  Tseitinized subgraph encoding.
- Recover global host labels for shuffled complete direct/log instances from
  injection-only row pairs and use a graph-specific VF2/Glasgow-style search.
- Strengthen CDCL enough to prove more direct SGI UNSAT cases. Proof logging is
  present, but the current CDCL engine is still weaker than competition solvers.
- The experimental direct-CSP MAC proof path (`LYMPHOSAT_MAC_PROOF=1`) can
  explain arc-consistency deletions as RUP clauses, but on shuffled direct SGI
  it produced very large partial proofs before finishing. It is disabled by
  default and needs proof-size control or stronger conflict minimization before
  broker use.
- Profile supported CSP search on the shuffled SGI instances and tighten value
  ordering or add restarts if broker feedback shows missed SAT cases.

## Known Limitations

- UNSAT is claimed only when the in-house CDCL fallback reaches a level-0
  contradiction and writes a VeriPB RUP proof. CSP-only UNSAT knowledge is not
  reported in the default configuration.
- Unsupported encodings may spend the configured search budget and still return
  UNKNOWN.
- The ordered embedding path is deliberately conservative and depends only on
  positive, ordered domain structure plus final CNF verification.

## Changelog

- Implemented direct signed-domain CSP detector and model mapper.
- Implemented logarithmic 5-bit SGI detector.
- Added bit-mask arc consistency, min-conflicts pre-search, and high-degree row
  branching.
- Added ordered host-deletion embedding recovery for positive unshuffled
  srhd/satsgi/new-difficult instances.
- Added conservative stochastic SAT fallback for unsupported encodings.
- Added a compact CDCL SAT fallback for unsupported encodings and CSP misses.
- Added VeriPB RUP proof logging for CDCL UNSAT conclusions.
- Raised the default internal search budget to 180 seconds to prioritize solved
  count under the 600 second broker timeout.
- Updated metadata and build notes for broker submission.
- Made the CDCL fallback continue from an immediately conflicting learned
  assertion instead of abandoning the run early.
- Added an env-gated direct-CSP MAC/RUP proof experiment and left it disabled by
  default after local tests generated oversized unfinished proofs.
