Improve constraint solving #971

Merged
zxq9 merged 6 commits from improve_constraint_solving into master 2023-08-23 16:43:49 +09:00
zxq9 commented 2023-08-08 21:11:37 +09:00 (Migrated from gitlab.com)

Created by: hanssv

Fingers itched... This solves one actual problem (on Ceres branch once rebased) where three constraints depended on each other and the current implementation only made two iterations.

The rewrite should be more general and easier to further change if necessary. Would be nice to separate solving and error reporting further - but lets save that for another rainy day.

This PR is supported by the Æternity Crypto Foundation

*Created by: hanssv* Fingers itched... This solves one actual problem (on Ceres branch once rebased) where three constraints depended on each other and the current implementation only made two iterations. The rewrite should be more general and easier to further change if necessary. Would be nice to separate solving and error reporting further - but lets save that for another rainy day. This PR is supported by the Æternity Crypto Foundation
zxq9 commented 2023-08-21 04:17:08 +09:00 (Migrated from gitlab.com)

Created by: radrow

I guess this is when we did not improve anything. Why is it ok then?

*Created by: radrow* I guess this is when we did not improve anything. Why is it `ok` then?
zxq9 commented 2023-08-21 04:20:59 +09:00 (Migrated from gitlab.com)

Created by: radrow

Review: Commented

It is hard for me to assess what exactly has changed since many functions have been moved around. Could you add some tests that show the improvement?

Also, it's a great opportunity for adding a bit more comments around...

*Created by: radrow* **Review:** Commented It is hard for me to assess what exactly has changed since many functions have been moved around. Could you add some tests that show the improvement? Also, it's a great opportunity for adding a bit more comments around...
zxq9 commented 2023-08-21 16:18:45 +09:00 (Migrated from gitlab.com)

Created by: hanssv

Feel free to rename it to done or something it doesn't really matter. This is the terminating case in the fix-point recursion.

*Created by: hanssv* Feel free to rename it to `done` or something it doesn't really matter. This is the terminating case in the fix-point recursion.
zxq9 commented 2023-08-21 16:22:35 +09:00 (Migrated from gitlab.com)

Created by: hanssv

@radrow The general problem addressed was the lack of a proper fix-point iteration - this shows up when there are constraints that depend on each other and the order in which you try suddenly matters. It seemed like you or @ghallak had already noticed this -- and "solved" it by adding a second copy of all constraints to the solver.

I could have solved the current issue by adding a third copy of the constraints, but instead opted to implement the iteration that checked for progress more generally. And yes there could have been more comments, but it could also have been done properly the first time.

*Created by: hanssv* @radrow The general problem addressed was the lack of a proper fix-point iteration - this shows up when there are constraints that depend on each other and the order in which you try suddenly matters. It seemed like you or @ghallak had already noticed this -- and "solved" it by adding a _second_ copy of all constraints to the solver. I could have solved the current issue by adding a third copy of the constraints, but instead opted to implement the iteration that checked for progress more generally. And yes there could have been more comments, but it could also have been done properly the first time.
zxq9 commented 2023-08-22 23:00:13 +09:00 (Migrated from gitlab.com)

Created by: radrow

Review: Approved

*Created by: radrow* **Review:** Approved
zxq9 commented 2023-08-23 16:43:36 +09:00 (Migrated from gitlab.com)

Created by: UlfNorell

Review: Approved

*Created by: UlfNorell* **Review:** Approved
zxq9 commented 2023-08-23 16:43:49 +09:00 (Migrated from gitlab.com)

Merged by: hanssv at 2023-08-23 07:43:49 UTC

*Merged by: hanssv at 2023-08-23 07:43:49 UTC*
Sign in to join this conversation.
No description provided.