refactor(pumpkin-propagators): Move away from TestSolver in propagator tests#387
refactor(pumpkin-propagators): Move away from TestSolver in propagator tests#387maartenflippo merged 14 commits intomainfrom
Conversation
…tor tests The `TestSolver` is deprecated because it has unclear semantics on how it works. The `State` abstraction is much better designed, so more appropriate for test cases for propagators. Not all tests are converted, because I wanted to avoid changing the State API in this PR. Some tests use features in `TestSolver` that are not present in `State` for various reasons. This is entirely produced by clause code, and nice to evaluate how well it performs on these refactoring tasks. The task is not difficult, but tedious for us to complete.
|
This looks overall fantastic. Great that we can finally move away from the TestSolver! Let us carefully review all these changes...it seems doable. Question: do we want the claude.md file? It might be useful but not fully sure. |
|
I had a look at 20% of the code. I will do the review in batches. Overall the changes are very welcome, using I also noticed a few other things that we can open issues or fix immediately (not necessarily as part of this PR).
let result = state.propagate_to_fixed_point();
assert!(result.is_err());and state.propagate_to_fixed_point().expect("Expected no conflict to be detected");and state.propagate_to_fixed_point().expect("no empty domains");so perhaps we can get it to unify this. This is not a problem per se.
|
Fixed! Now we use expect/unwrap everywhere. |
Should be a separate PR. I created an issue #400. |
Hopefully yes, but this PR is a good step toward that |
Should be a separate PR. Created an issue #401. |
It definitely helps to have it if we want to use this tool going forward. It ensures that claude code can properly identify formatting and clippy issues. |
|
I reviewed the PR about 50%. I will only be able to complete the rest next week. If Imko reviews the Pr it is fine with me to merge! Overall, it seems great so far. |
ImkoMarijnissen
left a comment
There was a problem hiding this comment.
Some small comments about how reasons are created using PropositionalConjunction which is unnecessarily convoluted, some added generics in the time-tabling tests which are unnecessary, and clarifications on the StateExt trait.
I have a lot of comments to mark the instances in which this occurs so that it is easier to check later whether this was resolved.
Other than that, it looks good to me!
The
TestSolveris deprecated because it has unclear semantics on howit works. The
Stateabstraction is much better designed, so moreappropriate for test cases for propagators.
Not all tests are converted, because I wanted to avoid changing the
State API in this PR. Some tests use features in
TestSolverthat arenot present in
Statefor various reasons.This is entirely produced by claude code, to evaluate how well
it performs on these refactoring tasks. The task is not difficult, but
tedious for us to complete.