Skip to content

feat(aplite): reuse compiled queries with temporary assumptions - #2175

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/aplite/reuse-compiled-queries-tmp-assumptions--80ec4395
Oct 26, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/aplite/reuse-compiled-queries-tmp-assumptions--80ec4395

Conversation

@tignear

@tignear tignear commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Repeated constraint queries currently validate and bit-blast the same expressions on every solve. Add PreparedQuery to compile a fixed scalar formula, context and Boolean predicate definitions once, then assert chosen predicate polarities per call. Encode assumptions as decision levels rather than permanent unit clauses, reapply them after backjumps, and retain learned clauses after successful searches. Discard mutable search state after UNSAT or interruption while keeping the original encoding reusable.

Share source compilation, phase initialization and model replay with the existing solver. Replay every SAT witness against the original formula, requested context and asserted predicates. Preparation and solve budgets are explicit and separate; invalid predicate indexes or resource exhaustion return Unknown, never UNSAT. The API is a reusable solving primitive, not a uniform sampler or an implementation of SystemVerilog randomize.

Validation: 84 existing Aplite tests plus six prepared-query regressions and three README doctests. Exhaustively checked 4,096 changing assumption queries against all three-Boolean truth tables; tested retained learned clauses, opposite/duplicate/constant assumptions, sort conflicts, invalid input, and recovery after interrupted searches. Lydite IR (38), solver (29), kernel (5), and pipeline/search consumers (7) passed, including finite-only proofs and deliberate fault detection. Affected all-target clippy, formatting, package include/version checks, diff checks and standalone cargo package verification passed. No full RV32I campaign or release build was run.

Depends-On: #2170

Repeated constraint queries currently validate and bit-blast the same expressions on every solve. Add PreparedQuery to compile a fixed scalar formula, context and Boolean predicate definitions once, then assert chosen predicate polarities per call. Encode assumptions as decision levels rather than permanent unit clauses, reapply them after backjumps, and retain learned clauses after successful searches. Discard mutable search state after UNSAT or interruption while keeping the original encoding reusable.

Share source compilation, phase initialization and model replay with the existing solver. Replay every SAT witness against the original formula, requested context and asserted predicates. Preparation and solve budgets are explicit and separate; invalid predicate indexes or resource exhaustion return Unknown, never UNSAT. The API is a reusable solving primitive, not a uniform sampler or an implementation of SystemVerilog randomize.

Validation: 84 existing Aplite tests plus six prepared-query regressions and three README doctests. Exhaustively checked 4,096 changing assumption queries against all three-Boolean truth tables; tested retained learned clauses, opposite/duplicate/constant assumptions, sort conflicts, invalid input, and recovery after interrupted searches. Lydite IR (38), solver (29), kernel (5), and pipeline/search consumers (7) passed, including finite-only proofs and deliberate fault detection. Affected all-target clippy, formatting, package include/version checks, diff checks and standalone cargo package verification passed. No full RV32I campaign or release build was run.
Change-Id: I80ec43950e64c7fc7a7dfc0c0975848fe51adea2
@tignear

tignear commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(aplite): reuse compiled queries with temporary assumptions #2175 👈
2 feat(aplite): query bounded projected XOR cells #2177
3 perf(aplite): reduce affine XOR rows before bit blasting #2183
4 feat(aplite): generate approximate projected sample batches #2184

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T17:02:09.695156Z e8aec71 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 26, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 26, 2026
@mergify

mergify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 50 minutes 59 seconds in the queue, including 37 minutes 2 seconds running CI.

Required conditions to merge

Base automatically changed from stack/tignear/feat/aplite/sample-small-projected-solution-sets-uniformly--a225f690 to master October 26, 2026 17:39
@mergify
mergify Bot merged commit 8bb3cd8 into master Oct 26, 2026
24 checks passed
@mergify
mergify Bot deleted the stack/tignear/feat/aplite/reuse-compiled-queries-tmp-assumptions--80ec4395 branch October 26, 2026 18:02
@mergify mergify Bot removed the queued Mergify queue entry label Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-ready Request merging through Mergify after required checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant