Skip to content

pdr2: justification-frontier (jftr) search in GipSAT - #617

Merged
alanminko merged 3 commits into
berkeley-abc:masterfrom
ChenWish:pdr2-jftr-v4
Nov 26, 2026
Merged

alanminko merged 3 commits into
berkeley-abc:masterfrom
ChenWish:pdr2-jftr-v4

Conversation

@ChenWish

Copy link
Copy Markdown
Contributor

pdr2: justification-frontier (jftr) search in GipSAT

This PR adds an opt-in search mode to GipSAT, the justification-frontier
(jftr) mode, and lets pdr2 use it for its SAT queries. It is off by default.
pdr2 --set JFTR_CONFS=<n> (or the variable PDR2_JFTR_CONFS=<n> for the
direct schedules -B 0..2) enables it with a budget of <n> conflicts per
solve.

Why. Many SAT queries of PDR are easy and satisfiable. In a profile of
the PDR engine alone with the mode off (pdrsolves137, seed 0, the cases
both variants solve, previous base), 86-94% of the generalization and
infinity-frame queries are satisfiable, with 0.6-2.3 conflicts on average.
The ordinary search still completes the assignment over the query domain
before it answers SAT. For such queries a search that stops as soon as the
assumptions are justified is enough; in that profile the mode reduced the
propagations per query, over all queries, from 1241 to 705.

How. In the mode the decisions are backward justification from the
assumptions. A solve answers SAT as soon as the assigned nodes are
justified, the lemma clauses are covered and the round constraints hold; the
partial answer stands for one completed register state. Conflicts are
analysed and learnt as usual, and after <n> conflicts the solve continues
as the ordinary GipSAT search. For predecessors, a justification walk
selects the leaves that imply the target. The variable PDR2_JFTR_SCOPE
(bit mask, default all kinds; read by the direct schedules) selects the
query kinds. Solver configurations the mode does not support (structural
CNF encodings, variable elimination, unused-input compaction, CNF
justification, lifting memo, initial-state predicates, shared solvers) use
the ordinary search.

Results. Base: upstream be1101681, unmodified. jftr: this PR, the same command plus
--set JFTR_CONFS=8; every other option at its default. 300 s and 40 GB per run.

Benchmark Schedule Runs per arm Solved jftr / base + / − Pairs Time ratio 25% / 50% / 75% Geo-mean
pdrsolves137 -B 2 (default of the previous base 08e513034) 411 (137 cases × 3 seeds) 286 / 270 +47 / −31 239 0.30 / 0.65 / 1.10 0.54
pdrsolves137 -B 4 (current default) 411 (137 cases × 3 seeds) 373 / 387 +6 / −20 283 0.69 / 0.95 / 1.04 0.79
HWMCC25 -B 4 (current default) 330 (330 cases × 1 seed) 232 / 233 +3 / −4 106 0.59 / 1.00 / 1.15 0.84
  • + / −: runs solved only by jftr / only by base.
  • Pairs: runs solved by both arms where at least one arm takes 1 s or more.
  • Time ratio: jftr time / base time over those pairs, at the 25th, 50th and 75th percentiles; Geo-mean: its
    geometric mean. Below 1 means jftr is faster.
  • -B 2: the direct schedule, three PDR runs in alternation, the same for every circuit. It is the default
    schedule of the previous base, upstream 08e513034; here it is run on be1101681 with an explicit -B 2.
  • -B 4: the current default since be1101681, the tuned structural schedule. It chooses a sequence of stages
    for each circuit from its features; a stage is one engine (BMC, BDD, induction, or a PDR variant) with its own
    options and time budget.
  • pdrsolves137: seeds 0, 1, 2; wall time.
  • HWMCC25: the 330 bit-level safety cases, seed 0, each preprocessed by its class (none without constraints;
    fold with constraints; logic; undc; strash; fold with constraints and uninitialized latches); one job per
    performance core, pinned; pdr2's own solve time. -B 4 uses its tuned schedule only for circuits whose initial
    values are all 0; on the other 111 cases (no constraints, latches starting at 1 or uninitialized) it runs the
    direct schedule, as -B 2 does.

Analysis.

  1. Previous default (-B 2, upstream 08e513034). On pdrsolves137 jftr solves 16 more runs (286 against 270) and the runs both
    arms solve take about half the time (geo-mean 0.54).

  2. Current default (-B 4) on pdrsolves137. jftr is still faster on the common runs (geo-mean 0.79), but it solves
    14 fewer runs (373 against 387).

  3. Where jftr acts under -B 4. jftr only changes PDR's SAT queries. 152 of the 411 base runs end in a stage
    where jftr does not run: a non-PDR engine (BMC, BDD reachability, induction; 102 runs), or a PDR stage whose
    options conflict with jftr (50 runs): CNF justification (input-search), variable elimination
    (elimination), or an initial-state constraint on the register inputs (reverse). There jftr is requested
    but not applicable, and pdr2 uses the ordinary search. In these 152 runs both arms solve the same runs, with
    time ratios near 1 (geo-mean 0.97 and 1.00); pdr2 is deterministic, and both arms print the same search statistics
    in all but 6 of them (where an earlier stage of the run used jftr). This is why the overall geo-mean is closer to 1
    under -B 4 than under -B 2. All of the difference lies in the other 259 runs, where jftr is applicable:
    221 against 235 solved (+6 / −20), geo-mean 0.72.

  4. HWMCC25 under -B 4. The solved counts differ by one case (232 against 233, +3 / −4), and the common runs
    are faster (geo-mean 0.84). Split the same way: 60 cases end where jftr does not run (39 non-PDR, 21 not
    applicable) and are identical in both arms; in the 159 jftr-applicable cases of the tuned schedule jftr solves
    102 against 102 (geo-mean 0.74); in the 111 cases on the direct schedule it solves 70 against 71 (geo-mean 0.86). The loss
    of solved runs seen on pdrsolves137 under -B 4 does not recur on HWMCC25.

  5. Summary. jftr makes the commonly solved runs faster in every setting: geo-mean 0.54 (pdrsolves137,
    -B 2), 0.79 (pdrsolves137, -B 4) and 0.84 (HWMCC25, -B 4). Under the previous default (-B 2, upstream
    08e513034) it also solves more runs on pdrsolves137 (+16). Under the latest default (-B 4) it solves fewer
    runs on pdrsolves137 (−14), while on HWMCC25 it solves about the same number (232 against 233).

ChenWish and others added 3 commits November 22, 2026 11:21
Add an optional search mode (gipJftr.c). Its decisions are backward
justification from the assumptions on the CNF of the circuit, and a solve
may answer SAT early with a partial assignment plus a register completion.
On request a justification walk selects the leaves that imply the
assumptions, and a shrink keeps only those assigned.

A solver created with a positive PDR2_JFTR_CONFS has the mode. A solve uses
it when requested with Gip_SolverSetJftr() and continues as the ordinary
search after that many conflicts. A request is ignored for a solver or a
context the mode is not defined for. PDR2_JFTR_CHECK checks every early
answer.

Nothing changes when the option is unset; no caller requests the mode yet.
Request the mode for the bad-state, blocking, generalization, push,
propagation and infinity queries, with the justification walk wherever the
model may become a predecessor. Consumers that need a state read the
register completion of an early answer.

The ordinary query functions keep their signatures; the requesting call
sites use Pdr2_ManSolveRelativeJftr() and Pdr2_ManTryDropJftr().
PDR2_JFTR_SCOPE selects the query kinds (default: all), and manager
configurations the mode does not support use the ordinary search. The
budget can also be given as "pdr2 --set JFTR_CONFS=<n>".

Nothing changes when the budget is unset or zero.
Give eligible GipSAT queries eight JFTR conflicts in the tuned
structural schedule (-B 4). Plans opening with abstraction or dynamic
abstraction use ordinary search throughout. This opening rule is a
development-set heuristic. Direct -B 2 still requires an explicit budget.

Use -O N to override the JFTR budget for one command (0 disables it).
Use repeatable -O NAME=value in place of --set for advanced settings.
Bare -O retains the existing obligation toggle. Credit Wei-Hsu (Wish)
Chen in the command help for contributing justification-frontier search.

Reuse the lemma cover across ordinary handovers and detect unsupported
clause layouts once per context. Count fallbacks, rebuilds, early-SAT
checks and check failures. Keep policy option storage within bounds.

With frozen 900-second runs, the ordinary/selective/always-on solve
counts on the development sets were 394/385/377 of 411 on pdrsolves
and 281/299/299 of 315 on pdrhards. The selective counts there were
reconstructed from the measured arms. On the HWMCC24 holdout the
counts were 159/165/166 of 267. On the 111 abstraction-opening
case/seed pairs they were 59/59/60. The holdout supports the feature
but does not distinguish the opening rule in its favor.
@alanminko
alanminko merged commit cd837e9 into berkeley-abc:master Nov 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants