mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-28 20:37:10 -06:00
Audit finding 7: flow() laid the head box's whole story out again at every distinct box line length in the chain and kept each layout while splitting, so a chain of many one-line boxes of different widths multiplied the story's layout work and memory by the chain length. Past MAX_FLOW_WIDTHS (16) distinct lengths the text stops: the box that would need another layout and the rest of the chain show nothing, as overflow past the last box is hidden. Work is now at most 16x the story. Test: tests_budget::a_linked_chain_lays_its_story_out_at_a_bounded_number_of_widths. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>