Say a draw group holds a reference path, and correct the stale hold wording

This commit is contained in:
2026-09-29 14:41:46 +02:00
committed by Lillem4n
parent b99966fe19
commit f1b0cda818
4 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -23,8 +23,9 @@ package fejkdata
// `Generator.Fake`, `FakeRecord`, `Template.Fake` and `RecordTemplate.Fake` // `Generator.Fake`, `FakeRecord`, `Template.Fake` and `RecordTemplate.Fake`
// start one each, `FakeStruct` one per record, and `expandAnew` one per // start one each, `FakeStruct` one per record, and `expandAnew` one per
// iteration of a `template.repeat`. // iteration of a `template.repeat`.
// - hold — one expansion keeping one draw of a name, so every route to it reads // - hold — keeping one draw of a name, so every route to it reads that value:
// that value: `formatOps.held`, `formatOps.keepsHold`, `heldCheck`. // an expansion holds a sibling path's head and an operand's field, its draw
// group a reference path's: `formatOps.held`, `formatOps.keepsHold`, `heldCheck`.
// - memo — what a hold or a draw group keeps its draws in, the variant drawn at // - memo — what a hold or a draw group keeps its draws in, the variant drawn at
// each level and the value each path read: `drawMemo`, `readMemo`. // each level and the value each path read: `drawMemo`, `readMemo`.
// - draw group — reference draws kept apart inside one render: // - draw group — reference draws kept apart inside one render:
+1 -1
View File
@@ -680,7 +680,7 @@ Re-tested 2026-09-29 by collapsing them into one loop switching on a mode field.
Goals 2 and 11: `pathCheck`, `pathCover`, `pathProbe` and `pathDraw` stay four loops. Goals 2 and 11: `pathCheck`, `pathCover`, `pathProbe` and `pathDraw` stay four loops.
One loop fails `perf_test.go`: the check's leaves, the probe's selectors and the errors One loop fails `perf_test.go`: the check's leaves, the probe's selectors and the errors
naming a level leak the walker's contents, and Go tracks a struct's fields as one, so naming a level leak the walker's contents, and Go tracks a struct's fields as one, so
the draw's pins, arm and hold leak with them. Held by pointer, a repeat of a reference 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, path rose from 66 to 106 allocations; copied into the walker by value,
`BenchmarkHeld` rose from 5 to 9. A call through an interface or a type parameter leaks `BenchmarkHeld` rose from 5 to 9. A call through an interface or a type parameter leaks
the walker the same way. Valid while Go's escape analysis tracks a struct's fields as the walker the same way. Valid while Go's escape analysis tracks a struct's fields as
+1 -1
View File
@@ -37,7 +37,7 @@ type renderDraws struct {
// renderScope is where a render reads its reference paths: its reference draws, in the draw group of the // renderScope is where a render reads its reference paths: its reference draws, in the draw group of the
// template rendering; and row, the row of the table rendering, which its columns read. It passes // template rendering; and row, the row of the table rendering, which its columns read. It passes
// by value, and what is read from it reaches a map key, an interface or a func value only as a // by value, and what is read from it reaches a map key, an interface or a func value only as a
// copy; else sc, and with it every render's draws, move to the heap. // copy; else sc, and with it every render's draws, moves to the heap.
type renderScope struct { type renderScope struct {
draws *renderDraws draws *renderDraws
group string group string
+1 -1
View File
@@ -260,7 +260,7 @@ func recordOf(n node) (*template, []Column, error) {
} }
// renderRecord draws each column once, in the name order recordOf fixed, as one render // renderRecord draws each column once, in the name order recordOf fixed, as one render
// over sc's hold; a table's columns read the row pinned there. // over sc's draws; a table's columns read the row pinned there.
func renderRecord(s *generatorState, t *template, columns []Column, sc renderScope) *Record { func renderRecord(s *generatorState, t *template, columns []Column, sc renderScope) *Record {
sc = sc.in(t) sc = sc.in(t)
if t.site.row == formatRow { if t.site.row == formatRow {