From 42fd72815675642277432674a3ced37640b24664 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 21 Sep 2026 16:27:31 +0200 Subject: [PATCH] Enter the ancestor rows the render pins into the walk's row set --- draw.go | 18 +++++++++++++++--- todo.md | 4 ---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/draw.go b/draw.go index b9cdd7d..21d0d55 100644 --- a/draw.go +++ b/draw.go @@ -301,7 +301,8 @@ type drawAt struct { // rowSet is the rows a walk entered, one per table: only one row of a table renders, so reads in // two rows of one table never meet, while reads in one row, across its columns and whatever they -// reach, do. +// reach, do. It simulates what the render pins: enter is (*draws).pin and rowOf is its pinned, and +// TestRowSetSimulatesPinning holds the two to one answer. type rowSet []tablePin func (s rowSet) rowOf(t *table) (int, bool) { @@ -313,12 +314,23 @@ func (s rowSet) rowOf(t *table) (int, bool) { return 0, false } -// enter is s with row r of t, where t is not in it yet; the set is copied, since walks branch. +// enter is s with row r of t and the ancestor rows it links to, where t is not in it yet; the set +// is copied, since walks branch. func (s rowSet) enter(t *table, r int) rowSet { if _, in := s.rowOf(t); in { return s } - out := append(append(make(rowSet, 0, len(s)+1), s...), tablePin{t, r}) + out := append(make(rowSet, 0, len(s)+1), s...) + for { + if _, in := out.rowOf(t); in { + break + } + out = append(out, tablePin{t, r}) + if t.parentT == nil { + break + } + t, r = t.parentT, t.parentRow(r) + } sort.Slice(out, func(i, j int) bool { return out[i].t.category < out[j].t.category }) return out } diff --git a/todo.md b/todo.md index a774a92..b43f905 100644 --- a/todo.md +++ b/todo.md @@ -21,10 +21,6 @@ name says whether a unit runs at `New` or at `Fake`. This round, in order: -- State on `rowSet` that it simulates `(*draws).pin` and `rowOf`, and prove the two - agree with a test: the load-time walk reimplements the render-time pinning, nothing - catches them drifting, and the failure is data that loads and then renders a family - that disagrees. - Put `draws` and its methods in one file: it is declared in `hold.go:262` and all eight of its methods sit in `family.go`, so a jump to the type lands where none of the behaviour is.