Skip to content

Re-enable bound strengthening and diophantine check in simplex - #651

Merged
ahmed-irfan merged 2 commits into
masterfrom
iss410-reenable-intfeas
Jul 5, 2026
Merged

Re-enable bound strengthening and diophantine check in simplex#651
ahmed-irfan merged 2 commits into
masterfrom
iss410-reenable-intfeas

Conversation

@ahmed-irfan

Copy link
Copy Markdown
Member

Fixes #410.

Commit 14d675f ("Test code", Oct 2018, shipped in 2.6.1) disabled bound strengthening and the diophantine-solver check in simplex_make_integer_feasible with if (false && ...) guards, leaving only the integrality check before branch & bound. On the issue's 2-variable QF_LIA mod/div instance this makes B&B thrash: 0.003s in 2.5.x vs 812s in 2.6.4 (315s on current master). That commit also added the per-variable Gomory cut path, so the phases were most likely disabled to exercise the new cuts and never re-enabled.

This restores the four disabled calls. The issue's instance drops to 0.009s, matching 2.5.4 behavior (2 branch atoms, 3 dioph checks). The latent bug in this path (unnormalized gcd passed to q_integer_rem in strengthen_bounds_on_integer_variable) was already fixed by the q_normalize calls added in #513.

Verification:

  • Full regression suite passes on debug and release; without the fix, the new iss410 test fails by timeout.
  • Differential fuzzing (1000 QF_LIA/QF_UFLIA/QF_LIRA instances with mod/div, gcd-structured equalities, mixed int/real) against the pre-fix binary: no answer mismatches, no crashes, no debug assertion failures.
  • Suite timing is unchanged except one CAV_2009 QF_LIA test (0.19s -> 0.99s); on random instances the fix is a net win (15 pre-fix-only timeouts vs 1 post-fix-only in 500 seeds).

The iss547 test relies on a 1s timeout firing, and its instance now solves instantly, so it no longer tested the timeout path. Replaced with a Cornuejols-Dawande market-split instance (hard for B&B); verified the timeout fires and the expected output is produced on debug, release, and pre-fix binaries.

Commit 14d675f ('Test code', 2018) disabled these integer-feasibility
phases with 'if (false && ...)' guards, leaving only the integrality
check before branch & bound. This caused large slowdowns on easy
QF_LIA instances with mod/div (issue #410: 0.003s in 2.5.x vs 812s
in 2.6.4). Restore the four calls and add a regression test.
With the integer-feasibility phases re-enabled, the original instance
solves in under a second, so the 1s timeout it relies on never fires.
Use a Cornuejols-Dawande market-split instance instead, which is hard
for branch & bound.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 71.192% (+1.1%) from 70.062% — iss410-reenable-intfeas into master

@ahmed-irfan
ahmed-irfan merged commit 963b6c5 into master Jul 5, 2026
33 checks passed
@ahmed-irfan
ahmed-irfan deleted the iss410-reenable-intfeas branch July 5, 2026 09:54
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.

QF_LIA performance issue with mod/div

2 participants