mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-30 13:46:47 -06:00
edit.autoFill capped source and target at 5M cells separately, but fill() writes one cell per source lane per step, and it never checked the target held the source. Whole rows into whole columns (`2:3` into `A:A`) filled every one of 16,384 columns down a million rows: ~17 billion writes, then a 24-51 GB allocation abort that catch_unwind can't stop. Excel (observed via COM on a synthetic workbook) refuses AutoFill when the target doesn't contain the source or holds it away from every corner, and accepts any corner-sharing target. edit.autoFill now applies that rule (fill::holds_source_in_corner), and fill() bounds lanes x steps by MAX_FILL_CELLS as a backstop. The 5M literals in auto_fill and fill_dir use the shared constant. Regression test: fill::tests::autofill_refuses_targets_that_do_not_extend_the_source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>