Skip to content

Add bounded greedy completion to incremental search - #2

Merged
aytey merged 7 commits into
stpfrom
stp-native-greedy
Oct 16, 2026
Merged

aytey merged 7 commits into
stpfrom
stp-native-greedy

Conversation

@aytey

@aytey aytey commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Add optional greedy SAT completion above the assumption prefix or the current CDCL trail. Conflicting choices are flipped once, unsuccessful walks restore their protected prefix without learning conditional root units, and ordinary search continues. Attempts share termination polling, have a soft time allowance, and back off after failure until the formula grows. The native default is disabled.

Expose work thresholds, retry growth, optional phase caching and a header capability for clients. Carry the already published cancellation fix b639548, which STP currently pins, and the Release warning fix needed by this library build.

The STP integration and scoped automatic profiles are proposed in stp/stp#1358.

Performance evidence

The selected policy still loses 26 sessions completed by existing Kissat and 63 completed by CaDiCaL. QF_ABV regresses from 3.3540 s to 3.4273 s mean PAR2, so the proposed STP integration preserves its existing QF_ABV defaults. CaDiCaL also retains the lower QF_BV PAR2.

The final experiment used 22,833 complete incremental sessions per configuration, a 24 s whole-session wall limit, 8 GiB address-space limit and 18 workers on a shared 24-core host. Every timeout, error, unknown or incomplete session costs 48 s. All observations and failures are retained.

Experimental configuration Completed sessions Mean PAR2 (s)
Native greedy, selected policy without copying 22,448 1.372499162
Native greedy with optional copy/restoration policy 22,447 1.376600934
CaDiCaL, factoring off 22,440 1.406727171
Existing Kissat defaults 22,410 1.450489187

The policy without copying has 2.43% lower aggregate PAR2 than the strongest measured CaDiCaL configuration and 5.38% lower than existing Kissat. It recovers 64 existing-Kissat losses; it completes 71 sessions that CaDiCaL does not. Across the four configurations there are 91,332 observations, 39 memory failures, 0 known wrong answers and 0 answer disagreements. The memory failures remain penalized in the table.

These results come from frozen experimental solver/adapter revisions, not a fresh benchmark of this publication branch. Settings were selected during the investigation, so this is not an unseen holdout. Shared-host timing and per-file losses limit the conclusion. The copy/restoration policy is reported as experimental evidence; the native greedy mechanism here uses the persistent solver.

Verification

  • 2/2 local compilation configurations completed: GCC 16.2.1 Release with -Wall -Wextra -Werror, and clang 21.1.6 RelWithDebInfo with UBSan instrumentation and the same warning policy.
  • Existing GitHub CI is green in 2/2 jobs. CMake reports 5/5 passing tests in both Debug and Release; the upstream suite reports 1,049 successful Debug jobs and 869 successful Release jobs. These default-option suites do not exercise the new greedy modes.
  • The earlier experiment included 136 model-checking observations with 0 errors or answer disagreements, retaining timeouts; those observations do not verify this curated branch.
  • Focused regressions for the newly exposed greedy modes and runtime sanitizer checks have not been run on this branch. This PR remains draft pending focused verification of the new modes.
cmake -S . -B build-release -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_TESTING=OFF -DKISSAT_BUILD_CLI=ON \
  -DCMAKE_C_FLAGS='-Wall -Wextra -Werror'
cmake --build build-release --parallel 6

cmake -S . -B build-ubsan -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DBUILD_TESTING=OFF -DKISSAT_BUILD_CLI=ON -DCMAKE_C_COMPILER=clang \
  -DCMAKE_C_FLAGS='-fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer -Wall -Wextra -Werror' \
  -DCMAKE_EXE_LINKER_FLAGS=-fsanitize=undefined \
  -DCMAKE_SHARED_LINKER_FLAGS=-fsanitize=undefined
cmake --build build-ubsan --parallel 4

aytey added 7 commits October 15, 2026 10:12
Poll the public termination callback while scanning and greedily
assigning variables. Backtrack an interrupted partial candidate before
leaving probing mode so an incremental caller can resume safely.

Expose the capability in the public header for callers that run a
budgeted disposable candidate pass. Add cancellation and resume coverage
that fails when the greedy pass never consults the callback.

Assisted-by: OpenAI Codex (GPT-6), via Codex
Some incremental SAT calls admit quick greedy models when replayed into
a fresh solver, but copying a large formula can erase that benefit. Try
the same assignment orders in the persistent solver after a work trigger.

Preserve every assumption decision and never analyze greedy conflicts.
Failed walks restore the complete assumption prefix before CDCL resumes,
so no conditional fact becomes a permanent root unit. Bound optional work
and back off after an inconclusive attempt until substantial CNF growth.

Keep the experiment disabled by default, including a matched prefix
restart mode to distinguish restarting from the greedy search itself.

Assisted-by: OpenAI Codex (GPT-6), via Codex
A Release build with warnings treated as errors drops LOG and leaves
this existing counter set but unused. Preserve its diagnostic count
while making the disabled-logging build warning-clean.

Assisted-by: OpenAI Codex (GPT-6), via Codex
Compare greedy completion above the current decision level with a walk
that first returns to the assumption prefix. Inconclusive current-trail
walks restore every existing CDCL decision.

Also allow successful greedy models to seed saved phases, since probing
suppresses the ordinary phase updates. Keep both sensitivities optional
and disabled in the existing configurations.

Assisted-by: OpenAI Codex (GPT-6), via Codex
A large persistent formula may need only a few new decisions after a
small assertion change. Allow experiments to skip full greedy scans in
that case while retaining the work-triggered walk on harder contexts.
Keep the threshold zero by default to preserve existing configurations.

Assisted-by: OpenAI Codex (GPT-6), via Codex
Permit local experiments to retry a failed greedy walk when the
assumption vector changes or after smaller clause growth. Keep the
existing fourfold growth backoff and context policy by default.

Assisted-by: OpenAI Codex (GPT-6), via Codex
Identify the optional greedy search through a header capability so that
clients can reject an older incremental library instead of silently
ignoring its options. Describe the protected prefixes, bounded work and
retry controls independently of the STP experiment interface.

Assisted-by: OpenAI Codex (GPT-6), via Codex
@aytey
aytey marked this pull request as ready for review October 16, 2026 12:17
@aytey
aytey merged commit a4c4618 into stp Oct 16, 2026
2 checks passed
@aytey
aytey deleted the stp-native-greedy branch October 16, 2026 12:17
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.

1 participant