Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AD while-loop conversion bug. #1529

Closed
zfnmxt opened this issue Nov 19, 2021 · 3 comments
Closed

AD while-loop conversion bug. #1529

zfnmxt opened this issue Nov 19, 2021 · 3 comments
Assignees
Labels
AD Related to automatic differentiation bug compiler

Comments

@zfnmxt
Copy link
Collaborator

zfnmxt commented Nov 19, 2021

At the moment, while loops are transformed into a for-loop with a if-then-else for the body, which does an iteration of the original loop if the original condition on the while loop holds and otherwise simply returns the current loop variable(s). This isn't quite correct: we should return the current loop variables(s) if the original condition has ever been met.

@zfnmxt zfnmxt self-assigned this Nov 19, 2021
@athas athas added the AD Related to automatic differentiation label Dec 8, 2021
@athas
Copy link
Member

athas commented Jan 24, 2022

Do we have a test for this?

@zfnmxt
Copy link
Collaborator Author

zfnmxt commented Jan 24, 2022

No, but I'll make one when I fix it (tonight or tomorrow).

@zfnmxt
Copy link
Collaborator Author

zfnmxt commented Jan 25, 2022

I see now why you've asked about a test--this isn't actually a bug (and hence I cannot construct a test for it). I thought it might be an issue due to the bound annotations but if the while-loop's stopping condition ever holds (when it is checked) then it must continue to hold because it'll simply return the current loop variables without modification.

@zfnmxt zfnmxt closed this as completed Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AD Related to automatic differentiation bug compiler
Projects
None yet
Development

No branches or pull requests

2 participants