mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
Each AHD worker allocated scratch for a full 38-row band while develop's memory check budgets h.min(32) + 6 rows, so short images allocated more than was approved: a 262144 x 1 strip was budgeted ~106 MB and allocated ~580 MB (5.4x). The scratch is now sized from the same row count as the budget, and the budget also counts the two u32 vertical-sum rows, so budget == allocation (~109 MB there). Pixels are unchanged. Tests: ahd_scratch_fits_its_budget (budget equals the real scratch for h = 1..5000), ahd_matches_reference_with_reused_scratch (1100 rows, jobs 1 and 2, all four phases: one scratch serves many bands). Co-authored-by: vangel76 <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> (cherry picked from commit 630e32c4238df452d9d5e70357bdb968045ab8c3)