Skip to content

Commit

Permalink
internal/core/adt: fix let issue for eval v2
Browse files Browse the repository at this point in the history
This only fixes the issue for V2: for v3 this causes
too many issues and another solution has to be found.

Note that of the tests only letjoin.txtar has material
changes. The changes in let.txtar reflect the behavior
in V2 from before the regression.
All other test changes are counter changes.

See the original regression:
https://cuelang.org/cl/1199752

Issue #3590
Issue #3591

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I9ff6496c37dbf21ca58861ee2906d82beaa82e62
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1206279
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
  • Loading branch information
mpvl committed Dec 23, 2024
1 parent 06f41bc commit 2702426
Show file tree
Hide file tree
Showing 15 changed files with 159 additions and 170 deletions.
4 changes: 2 additions & 2 deletions cue/testdata/benchmarks/cycleshare.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ diff old new
-Freed: 965
-Reused: 951
-Allocs: 22
-Retain: 15
-Retain: 17
+Leaks: 64
+Freed: 0
+Reused: 0
Expand All @@ -62,7 +62,7 @@ Leaks: 8
Freed: 965
Reused: 951
Allocs: 22
Retain: 15
Retain: 17

Unifications: 559
Conjuncts: 1046
Expand Down
8 changes: 4 additions & 4 deletions cue/testdata/benchmarks/issue2176.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ output: {
-- out/eval/stats --
Leaks: 90
Freed: 4079
Reused: 4072
Allocs: 97
Retain: 1364
Reused: 4074
Allocs: 95
Retain: 1359

Unifications: 4161
Conjuncts: 9489
Disjuncts: 4809
Disjuncts: 4804
-- out/evalalpha --
(struct){
#Datastream: (#struct){
Expand Down
2 changes: 1 addition & 1 deletion cue/testdata/compile/scope.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Leaks: 2
Freed: 48
Reused: 45
Allocs: 5
Retain: 7
Retain: 8

Unifications: 50
Conjuncts: 102
Expand Down
12 changes: 6 additions & 6 deletions cue/testdata/comprehensions/checkdefined.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ structs: {

-- out/eval/stats --
Leaks: 11
Freed: 87
Reused: 83
Freed: 89
Reused: 85
Allocs: 15
Retain: 20
Retain: 26

Unifications: 98
Conjuncts: 131
Disjuncts: 102
Unifications: 100
Conjuncts: 134
Disjuncts: 105
-- out/eval --
(struct){
xc: (#struct){
Expand Down
8 changes: 4 additions & 4 deletions cue/testdata/comprehensions/issue2481.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ full: {
-- out/eval/stats --
Leaks: 3
Freed: 23
Reused: 16
Allocs: 10
Retain: 61
Reused: 17
Allocs: 9
Retain: 58

Unifications: 26
Conjuncts: 50
Disjuncts: 59
Disjuncts: 56
-- out/eval --
Errors:
out: cannot combine regular field "val" with "b":
Expand Down
2 changes: 1 addition & 1 deletion cue/testdata/comprehensions/pushdown.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,7 @@ Leaks: 17
Freed: 443
Reused: 437
Allocs: 23
Retain: 104
Retain: 103

Unifications: 444
Conjuncts: 721
Expand Down
2 changes: 1 addition & 1 deletion cue/testdata/cycle/evaluate.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Leaks: 48
Freed: 127
Reused: 120
Allocs: 55
Retain: 136
Retain: 138

Unifications: 163
Conjuncts: 299
Expand Down
24 changes: 12 additions & 12 deletions cue/testdata/cycle/issue990.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ diff old new
--- old
+++ new
@@ -1,9 +1,9 @@
-Leaks: 7
-Freed: 3218
-Reused: 3200
-Leaks: 6
-Freed: 3232
-Reused: 3213
-Allocs: 25
-Retain: 26
+Leaks: 605
Expand All @@ -264,9 +264,9 @@ diff old new
+Allocs: 605
+Retain: 0

-Unifications: 2577
-Conjuncts: 12017
-Disjuncts: 3244
-Unifications: 2588
-Conjuncts: 12056
-Disjuncts: 3258
+Unifications: 175
+Conjuncts: 2668
+Disjuncts: 92
Expand Down Expand Up @@ -617,15 +617,15 @@ diff old new
}
}
-- out/eval/stats --
Leaks: 7
Freed: 3218
Reused: 3200
Leaks: 6
Freed: 3232
Reused: 3213
Allocs: 25
Retain: 26

Unifications: 2577
Conjuncts: 12017
Disjuncts: 3244
Unifications: 2588
Conjuncts: 12056
Disjuncts: 3258
-- out/eval --
(struct){
#AC: (#struct){
Expand Down
2 changes: 1 addition & 1 deletion cue/testdata/cycle/structural.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ Leaks: 15
Freed: 835
Reused: 823
Allocs: 27
Retain: 65
Retain: 66

Unifications: 664
Conjuncts: 1289
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/eval/issue2235.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ Leaks: 3
Freed: 101
Reused: 84
Allocs: 20
Retain: 69
Retain: 72

Unifications: 104
Conjuncts: 271
Disjuncts: 160
Disjuncts: 161
-- out/evalalpha --
(struct){
shorewallParams: (#struct){
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/eval/let.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,11 @@ Leaks: 52
Freed: 158
Reused: 149
Allocs: 61
Retain: 151
Retain: 184

Unifications: 196
Conjuncts: 365
Disjuncts: 242
Disjuncts: 241
-- out/eval --
Errors:
indirectReference.y: conflicting values 2 and 1:
Expand Down
Loading

0 comments on commit 2702426

Please sign in to comment.