Skip to content

Commit e56d550

Browse files
committed
internal/core/adt: carry over more task types over disjunction boundaries
With the old closedness it was very hard to carry over tasks as this would often lead to counter issues. With new closedness this is more straightforward. This may fix 3770, but this CL only fixes a reducer, so this should still be verified. Issue #3770 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ib3b0a7af2a15038f9b4fc3a3917b376c3c4fe763 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1211753 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent 62a5dd0 commit e56d550

File tree

2 files changed

+12
-33
lines changed

2 files changed

+12
-33
lines changed

cue/testdata/eval/counters.txtar

+10-29
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,14 @@ issue3770: task: {
197197
}
198198
}
199199
-- out/evalalpha/stats --
200-
Leaks: 225
200+
Leaks: 229
201201
Freed: 0
202202
Reused: 0
203-
Allocs: 225
203+
Allocs: 229
204204
Retain: 0
205205

206-
Unifications: 172
207-
Conjuncts: 257
206+
Unifications: 176
207+
Conjuncts: 265
208208
Disjuncts: 34
209209
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
210210
diff old new
@@ -216,17 +216,17 @@ diff old new
216216
-Reused: 138
217217
-Allocs: 13
218218
-Retain: 35
219-
+Leaks: 225
219+
+Leaks: 229
220220
+Freed: 0
221221
+Reused: 0
222-
+Allocs: 225
222+
+Allocs: 229
223223
+Retain: 0
224224

225225
-Unifications: 125
226226
-Conjuncts: 229
227227
-Disjuncts: 186
228-
+Unifications: 172
229-
+Conjuncts: 257
228+
+Unifications: 176
229+
+Conjuncts: 265
230230
+Disjuncts: 34
231231
-- out/eval/stats --
232232
Leaks: 0
@@ -360,12 +360,10 @@ Disjuncts: 186
360360
}
361361
x: (struct){
362362
b: (int){ 1 }
363+
a: (int){ 1 }
363364
}
364365
}
365-
out: (_|_){
366-
// [incomplete] issue3770.task.out: undefined field: a:
367-
// ./issue3770.cue:10:11
368-
}
366+
out: (int){ 1 }
369367
}
370368
}
371369
issue3780: (struct){
@@ -501,23 +499,6 @@ diff old new
501499
a: (struct){
502500
b: (_){ _ }
503501
}
504-
@@ -95,10 +119,12 @@
505-
}
506-
x: (struct){
507-
b: (int){ 1 }
508-
- a: (int){ 1 }
509-
- }
510-
- }
511-
- out: (int){ 1 }
512-
+ }
513-
+ }
514-
+ out: (_|_){
515-
+ // [incomplete] issue3770.task.out: undefined field: a:
516-
+ // ./issue3770.cue:10:11
517-
+ }
518-
}
519-
}
520-
issue3780: (struct){
521502
-- out/eval --
522503
(struct){
523504
issue3750: (struct){

internal/core/adt/overlay.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,8 @@ func (ctx *overlayContext) cloneScheduler(dst, src *nodeContext) {
241241
ds.tasks = append(ds.tasks, t)
242242

243243
case taskRUNNING:
244-
if t.run != handleResolver && t.run != handleExpr {
245-
// TODO: consider whether this is also necessary for other
246-
// types of tasks.
247-
break
244+
if t.run == handleDisjunctions {
245+
continue
248246
}
249247

250248
t.defunct = true

0 commit comments

Comments
 (0)