Stream Renderer.page children as Seq.t for bounded peak memory
Previously html-generate built the entire tree of Html.elt values for
all pages in a library before writing anything. For core.odocl (11k
pages) peak RSS reached ~2 GB, problematic for CI environments with
limited memory (e.g., GitHub Actions).
Change Renderer.page.children from `page list Lazy.t` to `page Seq.t`
and switch subpage generators to Seq.map. Each child's Html.elt tree
is now built only when traverse pulls it, and the previous sibling's
tree becomes unreachable as traverse moves on. Peak memory during
rendering is now bounded by the ancestor chain (O(depth)) rather than
the whole library (O(pages)).
Impact on core.odocl html-generate:
- Peak RSS: 2.00 GB -> 1.81 GB (-190 MB, -10%)
- Incremental rendering cost (above unmarshal baseline):
730 MB -> 250 MB (-66%)
The remaining ~1.27 GB floor comes from unmarshaling the full
Lang.Compilation_unit (148 MB on disk -> ~1.3 GB in memory, typical
for Marshal-deserialised OCaml records).
HTML output bit-for-bit identical (verified).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>