Allow fallback to take more than one iteration to converge#991
Allow fallback to take more than one iteration to converge#991carljm merged 1 commit intosalsa-rs:masterfrom
Conversation
✅ Deploy Preview for salsa-rs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
CodSpeed Performance ReportMerging #991 will not alter performanceComparing Summary
|
ibraheemdev
left a comment
There was a problem hiding this comment.
This makes sense to me. Do you think Fallback is still a good name for the operation, as opposed to something like Restart?
Also, should the test here be using FallbackImmediate?
|
I don't think that test needs to use |
|
Looking at a rename, it seems like maybe I think I'd prefer to land this with minimal API changes for now, and revisit API changes / renames later. I have some other possible features in mind that would also change the API (e.g. having the cycle recovery function accept the latest and previous iterations' values, to help users maintain monotonicity), and it would probably be best to do the API changes together if possible. |
The
Fallbackoption for fixpoint iteration has proved not very useful in practice, due to the requirement that the fallback value must converge in the very next iteration. In order to make it more useful, allow it to converge in any number of iterations. In other words, with this PR it is no longer an immediate fallback (that option is covered byFallbackImmediate), instead it allows "jumping" fixpoint iteration to a new point, and iterating from there. It is up to the user to provide a fallback value that will converge, otherwise it is still possible to reach a "too many iterations" panic after returningFallback.I have a working proof-of-concept in ty of using this new capability to avoid "too many iterations" in divergent cases by falling back to a
Divergenttype.