Make Renderer.page children lazy to defer subtree construction
render previously built the entire tree of Html.elt values for all
pages before any output was written. For large libraries like core
(11,000+ pages), peak RSS reached ~2 GB during html-generate.
Make the `children` field of Renderer.page a lazy thunk, so each
level's subpages are only constructed when traverse reaches them.
In combination with traverse's updated iteration pattern (which
destructures and discards the parent page record before descending),
this reduces peak memory and allows GC to collect processed pages.
Effect is modest on its own (~5% peak RSS) because siblings at each
level are still built eagerly when the lazy is forced. Fuller
streaming would require refactoring subpage generation to produce
children one at a time. This commit establishes the API shape for
that future work.
HTML output is bit-for-bit identical — verified deterministic
between two runs of the same input.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>