internal/core/adt: document why toComplete hook must stay
Disabling the post-task toComplete hook in runTask causes
three categories of regressions:
1. Cycle detection: self-referential list indexing returns
the let-bound reference instead of _.
(TestEvalV3/eval/disjunctions/indexElimination)
2. Unexpanded references: existence-check comprehensions
leave references unresolved instead of substituting the
concrete value.
(TestEvalV3/cycle/compbottomnofinal/large)
3. Disjunction defaults: nested definition chains gain
spurious defaults, and some disjunctions collapse early.
(TestEvalV3/comprehensions/issue3929/{reduced,full})
Root cause: toComplete is set in scheduleVertexConjuncts
when the arc's evaluation is still in progress. Without the
deferred completeNodeTasks(attemptOnly) call those nodes
never signal allAncestorsProcessed or process remaining
valueKnown|fieldConjunctsKnown tasks.
Also update eval stats for issue3929 to reflect the
current state of the evaluator.
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I5a7793178532998821b75c6608115cdf0c0513ef
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1236179
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>