Repository navigation
Skip the validity checks of clean_extreme_slopes, trapezoidation and simplify outside debug builds - #153
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shape::check()runs a full self-intersection test.clean_extreme_slopes_outer,clean_extreme_slopes_inner,trapezoidationandsimplifycheck 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_DEBUGandSIMPLIFICATION_ENABLE_DEBUG, as already done withAPPROXIMATE_ENABLE_DEBUGinapproximation.cpp. Theintersect()tests which trigger the fallback reconstruction inclean_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.