Step a table's routes past its selector, and panic on an arm with no bound head
This commit is contained in:
+2
-3
@@ -846,9 +846,8 @@ the direct chain is the one a reader can predict from the tables' parents.
|
||||
|
||||
2026-09-28, larv-review on systems-architect's finding; approved 2026-09-28 by lilleman.
|
||||
Re-tested 2026-09-29 by collapsing them into one loop switching on a mode field.
|
||||
Goals 2 and 11: `pathCheck`, `pathProbe` and `pathDraw` stay separate loops; `pathCover`
|
||||
became the cover `pathCheck` compiles, on 2026-09-30.
|
||||
One loop fails `perf_test.go`: the check's leaves, the probe's selectors and the errors
|
||||
Goals 2 and 11: `pathCheck`, `pathProbe` and `pathDraw` stay separate loops.
|
||||
One loop fails `perf_test.go`: the check's leaves and the errors
|
||||
naming a level leak the walker's contents, and Go tracks a struct's fields as one, so
|
||||
the draw's pins, arm and memo leak with them. Held by pointer, a repeat of a reference
|
||||
path rose from 66 to 106 allocations; copied into the walker by value,
|
||||
|
||||
@@ -278,6 +278,7 @@ func (w *pathCheck) tableSteps(t *table, r tableRoute, tail []string) error {
|
||||
}
|
||||
row, _ := w.pins.pinned(t)
|
||||
w.emit(pathStep{kind: stepSelect, name: r.sel, row: row}, tail)
|
||||
tail = tail[1:]
|
||||
}
|
||||
if r.draw {
|
||||
w.emit(pathStep{kind: stepDraw}, tail)
|
||||
|
||||
+5
-3
@@ -113,10 +113,12 @@ func compileArms(t *template) {
|
||||
}
|
||||
|
||||
func compileArm(t *template, a *arm) {
|
||||
if head := t.head(a.head); head != nil {
|
||||
w := compilePath(head, a.tail)
|
||||
a.steps, a.leaves, a.cover = w.steps, w.leaves, w.cover
|
||||
head := t.head(a.head)
|
||||
if head == nil {
|
||||
panic(internalError("{%s} reads a head nothing bound", a.spelling))
|
||||
}
|
||||
w := compilePath(head, a.tail)
|
||||
a.steps, a.leaves, a.cover = w.steps, w.leaves, w.cover
|
||||
}
|
||||
|
||||
// resolveLink binds every reference t reads, refusing one to t's own category, and keys
|
||||
|
||||
Reference in New Issue
Block a user