Skip to content

fix: bound formula arrays before dimension arithmetic - #1066

Merged
andiwand merged 3 commits into
mainfrom
review/48-formula-array-bounds
Oct 5, 2026
Merged

andiwand merged 3 commits into
mainfrom
review/48-formula-array-bounds

Conversation

@andiwand

@andiwand andiwand commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Formula array-size checks multiplied dimensions in size_t, allowing 32-bit overflow before enforcing the existing one-million-cell limit. Share one bounded, 64-bit dimension check across range expansion, array literals and broadcast results, then narrow only validated dimensions. Apply the same overflow-safe arithmetic to conditional aggregates, and reuse their four-million-cell work limit for lookups.

Validation: rebuilt odr_test; all 165 formula and recalculation tests passed, including the cached-result corpus. One regression covers a 65536-by-65536 range and the same shape produced by broadcasting, conditional aggregation over that range, and an oversized lookup. Tests ran on the local 64-bit host; no 32-bit runtime was available.

@andiwand
andiwand force-pushed the review/47-formula-references branch from e0b85f1 to 599d21f Compare October 5, 2026 14:34
Base automatically changed from review/47-formula-references to main October 5, 2026 14:47
andiwand and others added 3 commits October 5, 2026 16:47
position_of now refuses a scan of more than the work limit of a lookup.
A whole column fits, so an exact MATCH over A:A still finds its hit. The
CHANGELOG entry is two lines.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gb1fLafqqzehpqPuU6uBfn
@andiwand
andiwand force-pushed the review/48-formula-array-bounds branch from 152d37d to 88cb4dd Compare October 5, 2026 14:51
@andiwand
andiwand merged commit cf861ef into main Oct 5, 2026
30 checks passed
@andiwand
andiwand deleted the review/48-formula-array-bounds branch October 5, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant