Delete the fresh-draw fence the self-reference rule made unreachable, and pay for the draw walks only where data binds a reference
Tests / vet + fmt + tests (pull_request) Successful in 1m6s

This commit is contained in:
2026-09-16 10:29:23 +02:00
parent 0443ecdf13
commit 0f645d7092
3 changed files with 52 additions and 81 deletions
+17 -6
View File
@@ -197,14 +197,25 @@ func checkRenders(s nodeScope) error {
return err
}
fence := &drawCheck{}
if err := s(fence.checkDrawGroup); err != nil {
// One pass refuses a draw group that splits nothing and notes whether the scope binds a
// reference at all: weighing what a render's draws hold walks every node it renders, and
// with nothing bound there is no draw to share, so the shipped set pays for neither walk.
refs := false
if err := s(func(path string, n node) error {
if t, ok := n.(*template); ok && len(t.refs) > 0 {
refs = true
}
return fence.checkDrawGroup(path, n)
}); err != nil {
return err
}
if err := s(fence.checkDraws); err != nil {
return err
}
if err := s(fence.checkRecordDraws); err != nil {
return err
if refs {
if err := s(fence.checkDraws); err != nil {
return err
}
if err := s(fence.checkRecordDraws); err != nil {
return err
}
}
return s((&valueProof{}).checkDatatype)
}