Fix multiple bugs (#191, #312, #333, #339, #348) and add regression tests (#99) #352
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.



What's in this PR
Hey! This PR tackles a bunch of open issues that have been sitting around.
Bug Fixes
#191 - Instance won't be None
The check was using
is Nonebut the function returnsInvalidConfig(), notNone. Changed it to useisinstance()instead.#312 - Adjacent neighborhood returns invalid configs
The hill climber was getting neighbor values that could create invalid configs when only one param was changed. Fixed
get_param_neighbors()to only return values from neighbors that differ at exactly one index.#333 - Restrictions not backwards compatible
Old restriction functions expected keyword args but the new code was passing positional args. Added a wrapper to convert them back to kwargs so old code keeps working.
#339 - NVCUDA backend broken with cuda-python 13
cuda-python 13 moved the modules around (
cuda.cuda→cuda.bindings.driver). Added fallback imports so both old and new versions work.#348 - Lambda restrictions with captured variables fail
When a lambda like
lambda p: p['x'] <= limitgets converted to a string, thelimitvariable is lost. Now we detect closures and keep those lambdas as-is.New Stuff
#99 - Regression tests
Added a test setup that compares tuning results against known baseline data. Uses the existing vector_add cache file from RTX A4000 as the baseline.
Testing
pep440module) was already broken before these changes