M8: Grid auto-placement on an occupancy bitmap (#1593)

* M8: grid auto-placement on an occupancy bitmap (#1083)

Grid placement tested every cell of a child's span at every position it tried. The taken cells are now a bitmap: spans are checked a 64-bit word at a time, the search jumps past the blocking cell, a row's search ORs the span's rows once, and a column-anchored child looks on from where the last one with the same column and spans found room. Placements are unchanged (checked against the old search on random grids); a crafted 1000 x 1000 grid takes 0.3 ms instead of 192 ms.

* M8: grid occupancy stores rows only once a cell in them is taken

An empty or sparse grid no longer allocates the whole bitmap up front (CodeRabbit on #1593).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
BFlat
2026-10-30 08:56:43 +07:00
committed by GitHub
co-authored by Claude Opus 5.5 Brandon Thomas
parent bc11197c21
commit 393abf8075
6 changed files with 263 additions and 32 deletions
+2 -1
View File
File diff suppressed because one or more lines are too long