-
Notifications
You must be signed in to change notification settings - Fork 294
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
evaluator: bounded recursion regression #2052
Comments
Thanks for raising this, @caleblloyd. Confirmed and bisected to 748a685. What did you do?
What did you expect to see?Passing test. What did you see instead?
|
The underlying problem is a spurious structural cycle. The below is a simplification of what triggers it.
|
Another issue that is exposed by this once the cycle issue is fixed:
The issue is that |
Without this fix errors could be doubled for each argument, causing a rapid growth of errors lists. These errors were deduplicated down the line, causing this to go unnoticed. Issue #2052 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ia26a8b3a3ccde1d01ce28fdbc247e6643d1eafa3 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/546219 Reviewed-by: Roger Peppe <[email protected]> Unity-Result: CUEcueckoo <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
They all fail and will be made to pass in subsequent CLs. Issue #2052 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ib3f6941734042dd701bcf45cb91db93b657e214b Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/546102 Reviewed-by: Roger Peppe <[email protected]> Unity-Result: CUEcueckoo <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
Cycle tracking is more strict in expressions. However, when an inlined expression refers to "regular" fields (for instance a["x\(k+1)"]), the same expression may occur within a recursion referring to different, existing fields. Not taking into account that the same expression may refer to different existing fields may result in in spurious cycles. This relaxes this to avoid such issues. Issue #2052 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I054730cb2ccdf7288f0d068b898defcf54b2788d Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/546220 Unity-Result: CUEcueckoo <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Roger Peppe <[email protected]>
When not finalizing a node, i.e. if state <= Partial. Don't recursively evaluate constructed lists (i.e. don't use Finalize). Don't propagate error up in evalCached Incomplete comprehension errors are reported at the origin as well as "void" arcs. This should not be done, however, when the error is not yet reported, but only consulted for control flow IndexExpr and SelectorExpr should not unconditionally set a node to an error. Issue #2052 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: If5e7b6921f61dd16397c4b50e22decc43ad3f07d Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/546221 Reviewed-by: Roger Peppe <[email protected]> Unity-Result: CUEcueckoo <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
What version of CUE are you using (
cue version
)?v0.5.0-alpha.1.0.20221101144719-b3bcc7aaf3d0
built from commit b3bcc7aDoes this issue reproduce with the latest release?
Reproduces starting in
v0.5.0-alpha.1
Works as expected in
v0.4.3
What did you do?
Following example at https://cuetorials.com/deep-dives/recursion/#bounded-recursion
Package
r
recurse.cue:
depth.cue:
Then run the command
cue export --out cue ./r
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: