Cover the ancestor clash and name what drawCheck compares by
This commit is contained in:
+2
-1
@@ -226,7 +226,8 @@ func newDrawWalk() *drawWalk {
|
|||||||
|
|
||||||
// walk follows what rendering n renders. A repeat renders over draws of its own, so the walk stops
|
// walk follows what rendering n renders. A repeat renders over draws of its own, so the walk stops
|
||||||
// there. A cell whose row the pins keep out has no case: a pinned table renders its pinned row
|
// there. A cell whose row the pins keep out has no case: a pinned table renders its pinned row
|
||||||
// alone, so that cell never renders on this route.
|
// alone and an unpinned one draws a row inside its nearest pinned ancestor's, so that cell never
|
||||||
|
// renders on this route.
|
||||||
func (w *drawWalk) walk(n node, at drawAt) {
|
func (w *drawWalk) walk(n node, at drawAt) {
|
||||||
v := nodeVisit{n, at.group, at.rowsKey()}
|
v := nodeVisit{n, at.group, at.rowsKey()}
|
||||||
if w.seen[v] {
|
if w.seen[v] {
|
||||||
|
|||||||
@@ -102,10 +102,10 @@ func checkFamilies(reads []pathRead) error {
|
|||||||
return replayPairs(reads)
|
return replayPairs(reads)
|
||||||
}
|
}
|
||||||
|
|
||||||
// replayPairs replays every two reads of one draw group that can render together into
|
// replayPairs replays every two reads that can render together into one draws, the earlier
|
||||||
// one draws, the earlier read first. Pairs find every conflict a full replay would: a
|
// read first. Pairs find every conflict a full replay would: clash judges a row against one
|
||||||
// read pins a row's ancestors with it, and clash judges a row against one pinned table,
|
// pinned table, and the read that pinned it holds that pin itself, since a read's pins carry
|
||||||
// so a conflict is between two reads' pins and a third read adds nothing to it.
|
// its rows' ancestors, so the pair of those two reads clashes the same way.
|
||||||
func replayPairs(reads []pathRead) error {
|
func replayPairs(reads []pathRead) error {
|
||||||
for i, r := range reads {
|
for i, r := range reads {
|
||||||
if r.tr == nil {
|
if r.tr == nil {
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ func heldCheck(path string, n node) error {
|
|||||||
readers := boundReaders(t.ops, t.bound)
|
readers := boundReaders(t.ops, t.bound)
|
||||||
for _, head := range heldHeads(t) {
|
for _, head := range heldHeads(t) {
|
||||||
if _, isPath := t.bound[head]; isPath && isRef(head) {
|
if _, isPath := t.bound[head]; isPath && isRef(head) {
|
||||||
continue // held for the render: drawCheck compares it across the render and its groups
|
continue // held for the render: drawCheck compares every read of it, by path, across the render and its groups
|
||||||
}
|
}
|
||||||
if err := checkHeadHeld(t, head, readers); err != nil {
|
if err := checkHeadHeld(t, head, readers); err != nil {
|
||||||
return fmt.Errorf("%s: %w", path, err)
|
return fmt.Errorf("%s: %w", path, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user