internal/core/adt: handle dependencies fully in overlay
After cleaning up the dependency code a bit, it is
a bit clearer how to make a sound copy of all data
structures involved into counter and dependency
handling.
Note the slight differences in handling notifications
versus arcs. The reason for this is that arcs
always point "down" into a graph, whereas
notifications can point in any direction, including
pointing from within the copied graph to one
outside of it.
Also note that externalDeps are created one to
one with arcs and notifications. So it was
relatively simple to reproduce them.
The main effect of this new logic is that
dependency cycle breaking now also works within
disjunctions. This seems to mostly fix bugs in
the jsonschema package.
It also solves a bunch of counter issues, as
expected and improves the performance counters
of one test.
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I9d6b5885119424bb9e5230384eca32ccc3df79eb
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207455
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>