# Planted 3-SAT Hybrid Solver v14

## Family Description
Random 3-SAT instances with planted solutions. All instances are satisfiable.
Four generator types detected by clause-to-variable ratio:
- **barthel** (~4.30 ratio): Easy for SLS, ~78 instances, solved instantly
- **plain** (~4.41 ratio): Harder, ~44 instances, requires SLS+CDCL combination
- **komb** (~5.21 ratio): Near phase transition, ~66 instances, SLS or CDCL
- **qhid** (~5.50 ratio): Best solved by CDCL, ~75 instances

## Solver Architecture

### Phase 1: Stochastic Local Search (SLS)
- **probSAT**: Polynomial break function with eps=0.9, cb=2.06
- **PAWS** (for plain instances): Additive clause weighting with periodic smoothing
- Neighborhood search when close to solution (≤5 unsat clauses)
- Biased initialization every 3rd restart (polarity bias from clause participation)

### Phase 2: CDCL (Conflict-Driven Clause Learning)
- 2-watched literals (MiniSat convention)
- 1-UIP conflict analysis
- VSIDS variable ordering with max-heap
- LBD (Literal Block Distance) tracking for clause quality
- Glucose-style dynamic restarts + Luby restarts as backup
- Aggressive clause deletion: preserves glue clauses (LBD≤2), sorts by LBD then activity
- Periodic database compaction to prevent memory blowup
- Phase saving: SLS best assignment transferred as initial polarities

### Time Allocation
| Type | SLS Budget | Weighting | CDCL Budget |
|------|-----------|-----------|-------------|
| barthel | 30s | No | ~545s |
| plain | 180s | Yes (PAWS) | ~395s |
| komb | 60s | No | ~515s |
| qhid | 5s | No | ~570s |

## Baseline Performance
- Kissat SC2024: 240/263 solved, PAR-2 126.8s
- Our v13 (prev submission): 226/263 solved (all barthel 78, all qhid 75, komb 66, plain 7)

## Key Insights
- barthel/qhid: Easy for their respective methods (SLS/CDCL)
- komb: SLS gets close (5-15 unsat) but needs time; CDCL can finish if SLS fails
- plain: Main bottleneck. SLS sometimes solves quickly, sometimes gets stuck at ~10 unsat.
  CDCL fallback needed. Kissat solves 22/44 plain instances.

## Experiments Tried
- Belief propagation: doesn't converge at ratio 5.2+
- BP-guided decimation: unreliable
- CCAnr, WalkSAT, Novelty+: worse than probSAT
- Various probSAT parameters: cb=2.06 eps=0.9 is near-optimal
- Pure SLS on plain: only ~7/44 with 575s budget
- CDCL-only on qhid: solves in <1s typically

## Changelog
- v14: Split plain time (180s SLS + 395s CDCL), LBD tracking, Glucose-style restarts,
  aggressive clause deletion preserving glue clauses, database compaction,
  SLS-to-CDCL phase transfer
- v13: Fixed Luby sequence (was causing infinite recursion), VSIDS heap,
  fixed reduceDB performance
- v12: Added CDCL with 2WL/1UIP/VSIDS, added PAWS weighting
- Earlier: Pure probSAT, various SLS strategies

## Known Limitations
- Plain instances remain the main bottleneck
- No UNSAT support (all instances are SAT)
- CDCL memory can be high for long runs despite compaction

## Next Steps
- Try more aggressive SLS strategies for plain (focused random walk, etc.)
- Tune CDCL parameters (variable decay, restart frequency) for random 3-SAT
- Consider interleaving SLS and CDCL
- Profile CDCL on plain instances to identify bottlenecks
