Skip to content

Skip the validity checks of clean_extreme_slopes, trapezoidation and simplify outside debug builds - #153

Merged
fontanf merged 1 commit into
mainfrom
disable-shape-checks
Oct 31, 2026
Merged

fontanf merged 1 commit into
mainfrom
disable-shape-checks

Conversation

@fontanf

@fontanf fontanf commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Shape::check() runs a full self-intersection test. clean_extreme_slopes_outer, clean_extreme_slopes_inner, trapezoidation and simplify check their input and output shapes on every call, and in packingsolver they are called on every item shape each time a tree search builds its preprocessing (every subproblem of the sequential value correction, every restart). Profiling on alma_08 and alma_10 (alma2025 dataset) showed these checks were a significant part of the preprocessing time.

The checks are now only compiled with CLEAN_ENABLE_DEBUG, TRAPEZOIDATION_ENABLE_DEBUG and SIMPLIFICATION_ENABLE_DEBUG, as already done with APPROXIMATE_ENABLE_DEBUG in approximation.cpp. The intersect() tests which trigger the fallback reconstruction in clean_extreme_slopes_* are kept.

In packingsolver: same number of bins on the 10 alma2025 instances (120 s), and about 15% faster sequential value correction iterations on alma_10.

…simplify outside debug builds

Shape::check() runs a full self-intersection test. These functions are
called on every item shape each time a packing solver builds its
preprocessing, and the checks took a significant part of that time. They
are now only enabled with CLEAN_ENABLE_DEBUG, TRAPEZOIDATION_ENABLE_DEBUG
and SIMPLIFICATION_ENABLE_DEBUG, as already done in approximation.cpp.
@fontanf
fontanf merged commit 8e13e55 into main Oct 31, 2026
3 checks passed
@fontanf
fontanf deleted the disable-shape-checks branch October 31, 2026 09:04
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