Skip to content

Commit 105b8b7

Browse files
committedJan 28, 2025·
internal/core/adt: fix sharing-related counter issue
In case of a structural cycle, the conjunct was neither marked as shared, nor as non-shared. When then later another reference is unified, this may stick as a shared node. As a result, the second conjunct is now recognized as a "new" value, and thus the structural cycle is allowed to descend one more level. This brings V3 more in line with V2. The added tests do not expose a bug per se, but expose a counter error. As they do not change anything except a counter, which are reduced here anyway, they are not added in a separate test. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ia73090d73fa292415aaccdcd6c0d49c3b0686948 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207749 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Matthew Sackman <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent a833722 commit 105b8b7

File tree

6 files changed

+318
-69
lines changed

6 files changed

+318
-69
lines changed
 

‎cue/testdata/cycle/disjunction.txtar

+3-8
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,7 @@ Result:
213213
// [eval]
214214
#foo: (string){ =~"^foo" }
215215
#nesting: ((string|list|struct)){ |((string){ string }, (#struct){
216-
name?: (_|_){
217-
// [structural cycle] issue3042.#nesting.name: structural cycle
218-
}
216+
name?: (string){ =~"^foo" }
219217
}, (list){
220218
}) }
221219
data: (_|_){
@@ -258,7 +256,7 @@ diff old new
258256
cycle: (_|_){
259257
// [structural cycle]
260258
a: (_|_){
261-
@@ -58,22 +67,28 @@
259+
@@ -58,22 +67,26 @@
262260
x: (#list){
263261
}
264262
}
@@ -267,10 +265,7 @@ diff old new
267265
+ // [eval]
268266
#foo: (string){ =~"^foo" }
269267
#nesting: ((string|list|struct)){ |((string){ string }, (#struct){
270-
- name?: (string){ =~"^foo" }
271-
+ name?: (_|_){
272-
+ // [structural cycle] issue3042.#nesting.name: structural cycle
273-
+ }
268+
name?: (string){ =~"^foo" }
274269
}, (list){
275270
}) }
276271
- data: (#struct){

‎cue/testdata/cycle/issue990.txtar

+6-6
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ out: #sub & {#p: _test.s1}
8080
-- diff/todo/p3 --
8181
Reordering
8282
-- out/evalalpha/stats --
83-
Leaks: 1182
83+
Leaks: 1184
8484
Freed: 81
8585
Reused: 81
86-
Allocs: 1182
86+
Allocs: 1184
8787
Retain: 0
8888

8989
Unifications: 243
90-
Conjuncts: 4270
90+
Conjuncts: 4276
9191
Disjuncts: 204
9292
-- out/evalalpha --
9393
(struct){
@@ -328,17 +328,17 @@ diff old new
328328
-Reused: 3213
329329
-Allocs: 25
330330
-Retain: 26
331-
+Leaks: 1182
331+
+Leaks: 1184
332332
+Freed: 81
333333
+Reused: 81
334-
+Allocs: 1182
334+
+Allocs: 1184
335335
+Retain: 0
336336

337337
-Unifications: 2588
338338
-Conjuncts: 12056
339339
-Disjuncts: 3258
340340
+Unifications: 243
341-
+Conjuncts: 4270
341+
+Conjuncts: 4276
342342
+Disjuncts: 204
343343
-- diff/-out/evalalpha<==>+out/eval --
344344
diff old new

‎cue/testdata/cycle/structural.txtar

+32-42
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ b7.b.0.0: conflicting values 1 and [a] (mismatched types int and list):
631631
./in.cue:99:11
632632
./in.cue:100:5
633633
b7.b.0.0.0: structural cycle
634-
c1.a.c: structural cycle
634+
c1.a.c.c: structural cycle
635635
d1.r: structural cycle
636636
d2.a.b.c.d.t: structural cycle
637637
d3.x.indirect: structural cycle
@@ -1237,7 +1237,12 @@ Result:
12371237
b: (struct){
12381238
}
12391239
c: (_|_){
1240-
// [structural cycle] c1.a.c: structural cycle
1240+
// [structural cycle]
1241+
b: (struct){
1242+
}
1243+
c: (_|_){
1244+
// [structural cycle] c1.a.c.c: structural cycle
1245+
}
12411246
}
12421247
}
12431248
}
@@ -1850,13 +1855,12 @@ diff old new
18501855
b6.b.a.0.0: structural cycle
18511856
b6.x.a.0: structural cycle
18521857
b7.a.0: structural cycle
1853-
-c1.a.c.c: structural cycle
1854-
-d1.a.b.c.d.t: structural cycle
18551858
+b7.b.0.0: conflicting values 1 and [a] (mismatched types int and list):
18561859
+ ./in.cue:99:11
18571860
+ ./in.cue:100:5
18581861
+b7.b.0.0.0: structural cycle
1859-
+c1.a.c: structural cycle
1862+
c1.a.c.c: structural cycle
1863+
-d1.a.b.c.d.t: structural cycle
18601864
+d1.r: structural cycle
18611865
d2.a.b.c.d.t: structural cycle
18621866
-d2.r.c.d.t: structural cycle
@@ -2143,21 +2147,7 @@ diff old new
21432147
}
21442148
}
21452149
}
2146-
@@ -579,12 +627,7 @@
2147-
b: (struct){
2148-
}
2149-
c: (_|_){
2150-
- // [structural cycle]
2151-
- b: (struct){
2152-
- }
2153-
- c: (_|_){
2154-
- // [structural cycle] c1.a.c.c: structural cycle
2155-
- }
2156-
+ // [structural cycle] c1.a.c: structural cycle
2157-
}
2158-
}
2159-
}
2160-
@@ -600,47 +643,27 @@
2150+
@@ -600,47 +648,27 @@
21612151
// [structural cycle]
21622152
h: (int){ int }
21632153
t: (_|_){
@@ -2222,7 +2212,7 @@ diff old new
22222212
c: (_|_){
22232213
// [structural cycle]
22242214
d: (_|_){
2225-
@@ -667,28 +690,25 @@
2215+
@@ -667,28 +695,25 @@
22262216
}
22272217
x: (_|_){
22282218
// [structural cycle]
@@ -2256,7 +2246,7 @@ diff old new
22562246
#List: (#struct){
22572247
Next: (null){ null }
22582248
}
2259-
@@ -697,9 +717,7 @@
2249+
@@ -697,9 +722,7 @@
22602250
// [structural cycle]
22612251
t1: (struct){
22622252
#Foo: (#struct){
@@ -2267,7 +2257,7 @@ diff old new
22672257
}
22682258
}
22692259
t2: (_|_){
2270-
@@ -707,10 +725,7 @@
2260+
@@ -707,10 +730,7 @@
22712261
Foo: (_|_){
22722262
// [structural cycle]
22732263
ref: (_|_){
@@ -2279,7 +2269,7 @@ diff old new
22792269
}
22802270
}
22812271
}
2282-
@@ -717,9 +732,7 @@
2272+
@@ -717,9 +737,7 @@
22832273
}
22842274
comprehension: (struct){
22852275
#list: (#struct){
@@ -2290,7 +2280,7 @@ diff old new
22902280
}
22912281
}
22922282
}
2293-
@@ -745,8 +758,7 @@
2283+
@@ -745,8 +763,7 @@
22942284
}
22952285
}
22962286
let _schema_1#1 = (_|_){
@@ -2300,7 +2290,7 @@ diff old new
23002290
}
23012291
}
23022292
fieldsSumInfinite: (_|_){
2303-
@@ -757,7 +769,8 @@
2293+
@@ -757,7 +774,8 @@
23042294
fries: (float){ 2.00 }
23052295
sprite: (float){ 1.00 }
23062296
total: (_|_){
@@ -2310,7 +2300,7 @@ diff old new
23102300
}
23112301
}
23122302
}
2313-
@@ -772,27 +785,16 @@
2303+
@@ -772,27 +790,16 @@
23142304
head: (int){ 3 }
23152305
tail: (struct){
23162306
head: (int){ 2 }
@@ -2347,7 +2337,7 @@ diff old new
23472337
}
23482338
}
23492339
e1: (_|_){
2350-
@@ -831,11 +833,12 @@
2340+
@@ -831,11 +838,12 @@
23512341
// [eval] e3.a: conflicting values [a] and {c:a} (mismatched types list and struct):
23522342
// ./in.cue:412:5
23532343
// ./in.cue:413:5
@@ -2365,7 +2355,7 @@ diff old new
23652355
}
23662356
}
23672357
b: (_|_){
2368-
@@ -842,11 +845,12 @@
2358+
@@ -842,11 +850,12 @@
23692359
// [eval] e3.b: conflicting values [b] and {c:b} (mismatched types list and struct):
23702360
// ./in.cue:415:5
23712361
// ./in.cue:416:5
@@ -2383,7 +2373,7 @@ diff old new
23832373
}
23842374
}
23852375
}
2386-
@@ -855,38 +859,72 @@
2376+
@@ -855,38 +864,72 @@
23872377
a: (_|_){
23882378
// [eval]
23892379
0: (_|_){
@@ -2478,7 +2468,7 @@ diff old new
24782468
0: (struct){
24792469
c: (int){ 1 }
24802470
}
2481-
@@ -913,17 +951,16 @@
2471+
@@ -913,17 +956,16 @@
24822472
// [eval]
24832473
0: (_|_){
24842474
// [eval] nestedList.v1e.y.0: 4 errors in empty disjunction:
@@ -2501,7 +2491,7 @@ diff old new
25012491
1: (int){ 1 }
25022492
}
25032493
1: (int){ 1 }
2504-
@@ -935,17 +972,16 @@
2494+
@@ -935,17 +977,16 @@
25052495
// [eval]
25062496
0: (_|_){
25072497
// [eval] nestedList.v2e.y.0: 4 errors in empty disjunction:
@@ -2524,7 +2514,7 @@ diff old new
25242514
1: (int){ 1 }
25252515
}
25262516
1: (int){ 1 }
2527-
@@ -999,7 +1035,10 @@
2517+
@@ -999,7 +1040,10 @@
25282518
head: (int){ 3 }
25292519
tail: (struct){
25302520
head: (int){ 4 }
@@ -2536,7 +2526,7 @@ diff old new
25362526
}
25372527
}
25382528
}
2539-
@@ -1013,7 +1052,10 @@
2529+
@@ -1013,7 +1057,10 @@
25402530
head: (int){ 2 }
25412531
tail: (struct){
25422532
head: (int){ 3 }
@@ -2548,7 +2538,7 @@ diff old new
25482538
}
25492539
}
25502540
}
2551-
@@ -1027,8 +1069,12 @@
2541+
@@ -1027,8 +1074,12 @@
25522542
head: (int){ 2 }
25532543
tail: (struct){ |((struct){
25542544
head: (int){ 3 }
@@ -2563,7 +2553,7 @@ diff old new
25632553
}, (struct){
25642554
head: (int){ 3 }
25652555
}) }
2566-
@@ -1050,9 +1096,7 @@
2556+
@@ -1050,9 +1101,7 @@
25672557
// [structural cycle]
25682558
f: (_|_){
25692559
// [structural cycle]
@@ -2574,7 +2564,7 @@ diff old new
25742564
}
25752565
g: (_|_){
25762566
// [structural cycle]
2577-
@@ -1073,10 +1117,7 @@
2567+
@@ -1073,10 +1122,7 @@
25782568
x: (_){ _ }
25792569
y: (_){ _ }
25802570
}
@@ -2586,7 +2576,7 @@ diff old new
25862576
}
25872577
}
25882578
t2: (struct){
2589-
@@ -1089,10 +1130,7 @@
2579+
@@ -1089,10 +1135,7 @@
25902580
x: (_){ _ }
25912581
y: (_){ _ }
25922582
}
@@ -2598,7 +2588,7 @@ diff old new
25982588
}
25992589
}
26002590
t3: (struct){
2601-
@@ -1107,16 +1145,8 @@
2591+
@@ -1107,16 +1150,8 @@
26022592
y: (_){ _ }
26032593
z: (_){ _ }
26042594
}
@@ -2617,7 +2607,7 @@ diff old new
26172607
}
26182608
}
26192609
t4: (struct){
2620-
@@ -1132,51 +1162,11 @@
2610+
@@ -1132,51 +1167,11 @@
26212611
y: (_){ _ }
26222612
z: (_){ _ }
26232613
}
@@ -2674,7 +2664,7 @@ diff old new
26742664
}
26752665
}
26762666
t5: (struct){
2677-
@@ -1187,18 +1177,8 @@
2667+
@@ -1187,18 +1182,8 @@
26782668
}
26792669
}
26802670
C: (struct){
@@ -2695,7 +2685,7 @@ diff old new
26952685
}
26962686
}
26972687
}
2698-
@@ -1221,19 +1201,19 @@
2688+
@@ -1221,19 +1206,19 @@
26992689
}
27002690
}
27012691
n4: (struct){

‎cue/testdata/eval/sharing.txtar

+274-11
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,25 @@ issue3546: reduced: {
121121
out: #Network
122122
out: val
123123
}
124+
-- sharecycle.cue --
125+
shareCycle: t1: {
126+
#X: {}
127+
Y: {
128+
x: #X & Y
129+
}
130+
}
131+
shareCycle: t2: {
132+
#X: int
133+
Y: {
134+
x: #X & Y
135+
}
136+
}
137+
shareCycle: t3: {
138+
#X: {}
139+
Y: {
140+
x: Y & #X
141+
}
142+
}
124143
-- acrossdisjunction.cue --
125144
import "list"
126145

@@ -133,16 +152,32 @@ issue3679: {
133152
}
134153
-- out/eval/stats --
135154
Leaks: 3
136-
Freed: 158
137-
Reused: 151
155+
Freed: 174
156+
Reused: 167
138157
Allocs: 10
139158
Retain: 21
140159

141-
Unifications: 159
142-
Conjuncts: 331
143-
Disjuncts: 177
160+
Unifications: 175
161+
Conjuncts: 365
162+
Disjuncts: 193
144163
-- out/evalalpha --
145-
(struct){
164+
Errors:
165+
shareCycle.t2.Y.x: conflicting values int and {x:(#X & Y)} (mismatched types int and struct):
166+
./sharecycle.cue:8:6
167+
./sharecycle.cue:9:5
168+
shareCycle.t1.Y.x.x: field not allowed:
169+
./sharecycle.cue:4:11
170+
./sharecycle.cue:4:3
171+
shareCycle.t2.Y.x.x: field not allowed:
172+
./sharecycle.cue:10:11
173+
./sharecycle.cue:10:3
174+
shareCycle.t3.Y.x.x: field not allowed:
175+
./sharecycle.cue:16:10
176+
./sharecycle.cue:16:3
177+
178+
Result:
179+
(_|_){
180+
// [eval]
146181
issue3679: (struct){
147182
b: (#list){
148183
0: (string){ "bar" }
@@ -369,12 +404,87 @@ Disjuncts: 177
369404
}
370405
}
371406
}
407+
shareCycle: (_|_){
408+
// [eval]
409+
t1: (_|_){
410+
// [eval]
411+
#X: (#struct){
412+
}
413+
Y: (_|_){
414+
// [eval]
415+
x: (_|_){
416+
// [eval]
417+
x: (_|_){
418+
// [eval] shareCycle.t1.Y.x.x: field not allowed:
419+
// ./sharecycle.cue:4:11
420+
// ./sharecycle.cue:4:3
421+
}
422+
}
423+
}
424+
}
425+
t2: (_|_){
426+
// [eval]
427+
#X: (int){ int }
428+
Y: (_|_){
429+
// [eval]
430+
x: (_|_){
431+
// [eval] shareCycle.t2.Y.x: conflicting values int and {x:(#X & Y)} (mismatched types int and struct):
432+
// ./sharecycle.cue:8:6
433+
// ./sharecycle.cue:9:5
434+
// shareCycle.t2.Y.x.x: field not allowed:
435+
// ./sharecycle.cue:10:11
436+
// ./sharecycle.cue:10:3
437+
x: (_|_){
438+
// [eval] shareCycle.t2.Y.x.x: field not allowed:
439+
// ./sharecycle.cue:10:11
440+
// ./sharecycle.cue:10:3
441+
}
442+
}
443+
}
444+
}
445+
t3: (_|_){
446+
// [eval]
447+
#X: (#struct){
448+
}
449+
Y: (_|_){
450+
// [eval]
451+
x: (_|_){
452+
// [eval]
453+
x: (_|_){
454+
// [eval] shareCycle.t3.Y.x.x: field not allowed:
455+
// ./sharecycle.cue:16:10
456+
// ./sharecycle.cue:16:3
457+
}
458+
}
459+
}
460+
}
461+
}
372462
}
373463
-- diff/-out/evalalpha<==>+out/eval --
374464
diff old new
375465
--- old
376466
+++ new
377-
@@ -16,102 +16,75 @@
467+
@@ -1,11 +1,16 @@
468+
Errors:
469+
-shareCycle.t1.Y.x.x: structural cycle
470+
shareCycle.t2.Y.x: conflicting values int and {x:(#X & Y)} (mismatched types int and struct):
471+
./sharecycle.cue:8:6
472+
./sharecycle.cue:9:5
473+
+shareCycle.t1.Y.x.x: field not allowed:
474+
+ ./sharecycle.cue:4:11
475+
+ ./sharecycle.cue:4:3
476+
+shareCycle.t2.Y.x.x: field not allowed:
477+
./sharecycle.cue:10:11
478+
-shareCycle.t2.Y.x.x: structural cycle
479+
-shareCycle.t3.Y.x.x: structural cycle
480+
+ ./sharecycle.cue:10:3
481+
+shareCycle.t3.Y.x.x: field not allowed:
482+
+ ./sharecycle.cue:16:10
483+
+ ./sharecycle.cue:16:3
484+
485+
Result:
486+
(_|_){
487+
@@ -27,102 +32,75 @@
378488
}
379489
}
380490
#Config1: (#struct){
@@ -546,7 +656,7 @@ diff old new
546656
}
547657
Config: (#struct){
548658
cfg: (#struct){
549-
@@ -137,24 +110,13 @@
659+
@@ -148,24 +126,13 @@
550660
}
551661
}
552662
#Config1: (#struct){
@@ -574,7 +684,7 @@ diff old new
574684
}
575685
#Config: (#struct){
576686
cfg: (#struct){
577-
@@ -162,12 +124,7 @@
687+
@@ -173,12 +140,7 @@
578688
}
579689
}
580690
}
@@ -588,7 +698,7 @@ diff old new
588698
out: (#struct){
589699
sch: (#struct){
590700
cfg: (#struct){
591-
@@ -236,9 +193,7 @@
701+
@@ -247,9 +209,7 @@
592702
}
593703
debug: (struct){
594704
sharingOn: (struct){
@@ -599,8 +709,87 @@ diff old new
599709
b: (struct){
600710
c: (int){ 1 }
601711
}
712+
@@ -284,15 +244,17 @@
713+
shareCycle: (_|_){
714+
// [eval]
715+
t1: (_|_){
716+
- // [structural cycle]
717+
- #X: (#struct){
718+
- }
719+
- Y: (_|_){
720+
- // [structural cycle]
721+
- x: (_|_){
722+
- // [structural cycle]
723+
- x: (_|_){
724+
- // [structural cycle] shareCycle.t1.Y.x.x: structural cycle
725+
+ // [eval]
726+
+ #X: (#struct){
727+
+ }
728+
+ Y: (_|_){
729+
+ // [eval]
730+
+ x: (_|_){
731+
+ // [eval]
732+
+ x: (_|_){
733+
+ // [eval] shareCycle.t1.Y.x.x: field not allowed:
734+
+ // ./sharecycle.cue:4:11
735+
+ // ./sharecycle.cue:4:3
736+
}
737+
}
738+
}
739+
@@ -306,23 +268,29 @@
740+
// [eval] shareCycle.t2.Y.x: conflicting values int and {x:(#X & Y)} (mismatched types int and struct):
741+
// ./sharecycle.cue:8:6
742+
// ./sharecycle.cue:9:5
743+
+ // shareCycle.t2.Y.x.x: field not allowed:
744+
// ./sharecycle.cue:10:11
745+
- x: (_|_){
746+
- // [structural cycle] shareCycle.t2.Y.x.x: structural cycle
747+
+ // ./sharecycle.cue:10:3
748+
+ x: (_|_){
749+
+ // [eval] shareCycle.t2.Y.x.x: field not allowed:
750+
+ // ./sharecycle.cue:10:11
751+
+ // ./sharecycle.cue:10:3
752+
}
753+
}
754+
}
755+
}
756+
t3: (_|_){
757+
- // [structural cycle]
758+
- #X: (#struct){
759+
- }
760+
- Y: (_|_){
761+
- // [structural cycle]
762+
- x: (_|_){
763+
- // [structural cycle]
764+
- x: (_|_){
765+
- // [structural cycle] shareCycle.t3.Y.x.x: structural cycle
766+
+ // [eval]
767+
+ #X: (#struct){
768+
+ }
769+
+ Y: (_|_){
770+
+ // [eval]
771+
+ x: (_|_){
772+
+ // [eval]
773+
+ x: (_|_){
774+
+ // [eval] shareCycle.t3.Y.x.x: field not allowed:
775+
+ // ./sharecycle.cue:16:10
776+
+ // ./sharecycle.cue:16:3
777+
}
778+
}
779+
}
602780
-- out/eval --
603-
(struct){
781+
Errors:
782+
shareCycle.t1.Y.x.x: structural cycle
783+
shareCycle.t2.Y.x: conflicting values int and {x:(#X & Y)} (mismatched types int and struct):
784+
./sharecycle.cue:8:6
785+
./sharecycle.cue:9:5
786+
./sharecycle.cue:10:11
787+
shareCycle.t2.Y.x.x: structural cycle
788+
shareCycle.t3.Y.x.x: structural cycle
789+
790+
Result:
791+
(_|_){
792+
// [eval]
604793
issue3679: (struct){
605794
b: (#list){
606795
0: (string){ "bar" }
@@ -872,6 +1061,53 @@ diff old new
8721061
}
8731062
}
8741063
}
1064+
shareCycle: (_|_){
1065+
// [eval]
1066+
t1: (_|_){
1067+
// [structural cycle]
1068+
#X: (#struct){
1069+
}
1070+
Y: (_|_){
1071+
// [structural cycle]
1072+
x: (_|_){
1073+
// [structural cycle]
1074+
x: (_|_){
1075+
// [structural cycle] shareCycle.t1.Y.x.x: structural cycle
1076+
}
1077+
}
1078+
}
1079+
}
1080+
t2: (_|_){
1081+
// [eval]
1082+
#X: (int){ int }
1083+
Y: (_|_){
1084+
// [eval]
1085+
x: (_|_){
1086+
// [eval] shareCycle.t2.Y.x: conflicting values int and {x:(#X & Y)} (mismatched types int and struct):
1087+
// ./sharecycle.cue:8:6
1088+
// ./sharecycle.cue:9:5
1089+
// ./sharecycle.cue:10:11
1090+
x: (_|_){
1091+
// [structural cycle] shareCycle.t2.Y.x.x: structural cycle
1092+
}
1093+
}
1094+
}
1095+
}
1096+
t3: (_|_){
1097+
// [structural cycle]
1098+
#X: (#struct){
1099+
}
1100+
Y: (_|_){
1101+
// [structural cycle]
1102+
x: (_|_){
1103+
// [structural cycle]
1104+
x: (_|_){
1105+
// [structural cycle] shareCycle.t3.Y.x.x: structural cycle
1106+
}
1107+
}
1108+
}
1109+
}
1110+
}
8751111
}
8761112
-- out/compile --
8771113
--- acrossdisjunction.cue
@@ -1071,3 +1307,30 @@ diff old new
10711307
}
10721308
}
10731309
}
1310+
--- sharecycle.cue
1311+
{
1312+
shareCycle: {
1313+
t1: {
1314+
#X: {}
1315+
Y: {
1316+
x: (〈1;#X〉 & 〈1;Y〉)
1317+
}
1318+
}
1319+
}
1320+
shareCycle: {
1321+
t2: {
1322+
#X: int
1323+
Y: {
1324+
x: (〈1;#X〉 & 〈1;Y〉)
1325+
}
1326+
}
1327+
}
1328+
shareCycle: {
1329+
t3: {
1330+
#X: {}
1331+
Y: {
1332+
x: (〈1;Y〉 & 〈1;#X〉)
1333+
}
1334+
}
1335+
}
1336+
}

‎internal/core/adt/eval_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ var needFix = map[string]string{
7676
// counter errors.
7777
// TODO: These counters should all go to zero.
7878
var skipDebugDepErrors = map[string]int{
79-
"cycle/disjunction": 1,
80-
"cycle/structural": 1,
8179
"disjunctions/elimination": 4,
8280
"eval/issue545": 1,
8381
"eval/notify": 3,

‎internal/core/adt/tasks.go

+3
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ func processResolver(ctx *OpContext, t *task, mode runMode) {
119119
// we are done computing and we can return the arc as is.
120120
ci, skip := t.node.detectCycleV3(d, t.env, r, ci)
121121
if skip {
122+
// Either we have a structure cycle or we are unifying with another
123+
// conjunct. In either case, we are no longer structure sharing here.
124+
t.node.unshare()
122125
return
123126
}
124127

0 commit comments

Comments
 (0)
Please sign in to comment.