Open and answer this issue on GitHub.
ready · opened 2026-11-07 · updated 2026-11-21 · 2 comments
Part of #1053. Was blocked on #1285 (the solver moves into crates/nikaia-std/src/tools/ and becomes the engine behind lg_check; this builds on the files there), now closed; the solver’s files have since moved to packages/logic/src/sv_*.nika (4a48f306a, “The solvers and the logic layer are the package logic”). ADR-270 D8 step 4.
The rest of D8 step 4. nikaia.proofs (D19-D22) is built (proofs_answers.nika, proofs_book.nika, --locked). Two parts are open:
target/nikaia/. They are not committed and never read by a --locked build.scripts/solver.nika, D17): instructions (callgrind) and peak memory beside solved count and PAR-2, for this solver, z3 and cvc5compare in scripts/solver.nika).This issue’s part:
sv_check_batch(queries, budget) -> Vec[LgAnswer] answers a list of queries. Above a work threshold it uses par_iter() (ADR-235, Part II 12.6); below it, a plain loop. The threshold is a named parameter in the strategy’s parameter set (D14), counted in the solver’s work units, not in time. The answers keep the input’s order, so the result is the same at every thread count. Test: tests/compiler/tests/solver_batch.nika + .stdout. A batch answered at threshold 0 (always parallel) and at a threshold above the batch (one thread) prints the same answers.scripts/solver.nika run --threads N answers the files of a set through sv_check_batch. --summary prints the same solved count and the same answers as without --threads.tests/solver/qflia, tests/solver/qflra). D8 asks for at least 0.7 × threads. docs/measuring.md counts work and has no rule for threads yet. Measured with callgrind --separate-threads=yes: speedup = total instructions / instructions of the busiest thread. Wall time is shown beside it, not as the figure. This rule is added to docs/measuring.md.A batch above the threshold runs on every thread with the same answers at every thread count (the solver_batch test, and scripts/solver.nika run --threads N --summary equal to the run without it), and the speedup figure with the rule in docs/measuring.md is recorded here; the commit of item 1 carries Fixes #1319.
packages/logic/src/sv_*.nika, scripts/solver.nika, docs/measuring.md (the thread rule), new tests in tests/compiler/tests/solver_*.nika.par_iter cannot carry the solver’s state (a missing Sync form or a missing per-worker arena), stop and report Result: blocked with a probe. Do not write around it.tests/compiler/nikaia.contracts, nikaia.derived.nikaia.proofs).Owner, 2026-11-07: the solver is a product of its own. It should be faster than z3 and cvc5, use fewer resources, and solve more. ADR-270 D17 now records the resource goal. Added to this issue:
sv_strategy_pick chooses it from the features (small, dense, without disjunctions), the same way it chooses the search or the walk, rather than sv_ask always running it first. The compiler’s order (FM first, #1285) stays until the measurements show that the pick is cheaper on the compiler’s queries.scripts/solver.nika, D17): beside solved count and PAR-2, instructions (callgrind) and peak memory, for this solver, z3 and cvc5, on the instances all three solve.Generated by Claude Code
Split into run-sized issues (2026-11-21).
Found built: item 10, the resource figures on the rod (instructions and peak memory for this solver, z3 and cvc5), in 667b0ff4 (compare in scripts/solver.nika). Items 1-9 were not found built (no sv_check_batch, no solver-cache / solver-measure, no --threads in scripts/solver.nika; sv_ask still runs Fourier-Motzkin first and sv_strategy_pick never picks it).
The blocker “The compiler asks the new solver: move it into tools” (#1285) is closed, so the label is now ready. The solver’s files moved to packages/logic/src/sv_*.nika (4a48f306a); the bodies name that place.
This issue keeps items 1 and 2 (the batch entry, --threads) and the speedup figure of item 7 with its rule for docs/measuring.md.
New issues:
Generated by Claude Code