fix: function and arg size book-keeping for TestSub recursion#874
Open
jodavies wants to merge 1 commit into
Open
fix: function and arg size book-keeping for TestSub recursion#874jodavies wants to merge 1 commit into
jodavies wants to merge 1 commit into
Conversation
Collaborator
Author
|
Tentatively, this is also a 1% performance improvement in forcer, forcer-exp and maybe hyperform. |
When TestSub is called recursively, correctly update the nested sizes. Rely on the recursion to fix the sizes at each level, except when an argument term disappears completely; then we fix up the whole nesting stack and continue processing further argument terms. This fix was prepared with the help of an LLM report: https://gist.github.com/tueda/9d71a87e04dcc1f51fbbb432ae1af903 Its findings are in line with previous debugging efforts by me, but I did not figure out a proper fix at the time. In addition: - add a check that we do not exceed the FunctionLevels setup parameter, and give an error message for the user if so. - check RecFlag has the same value on entry and when returning from TestSub
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.
When TestSub is called recursively, correctly update the nested sizes. Rely on the recursion to fix the sizes at each level, except when an argument term disappears completely; then we fix up the whole nesting stack and continue processing further argument terms.
This fix was prepared with the help of an LLM report: https://gist.github.com/tueda/9d71a87e04dcc1f51fbbb432ae1af903
Its findings are in line with previous debugging efforts by me, but I did not figure out a proper fix at the time.
In addition:
This fixes #367 and #741