fix(helpers): OFFSET/_dynRange answer #REF! (NaN) past sheet bounds — the mid-pass OOM root#75
Merged
Merged
Conversation
… the mid-pass OOM root The instrumented canonical A-1 run pinned the crash class: heap steady at 6.5GB through pass 4, death MID-PASS-5 needing >13GB in one spike — an allocation proportional to a cell VALUE, fatal at any heap cap (identical ~56-min deaths under 12GB and 20GB). _offsetAddr and _offset had no upper bounds: a displacement (or OFFSET height/width) fed by a poisoned/oscillating cell (~1e7-scale, the observed pass-4 maxDelta magnitude) produced addresses like row 20,000,000 and _dynRange/ctx.range happily materialized the rectangle — billions of cells. Past Excel hard sheet bounds (1,048,576 rows x 16,384 cols) Excel itself says #REF!; the helpers now answer honest NaN there (scalar OFFSET previously returned a SILENT 0 for an out-of-bounds read; SUM over an out-of-bounds computed-endpoint range returned a confident finite number after a multi-million-row materialization). Also: cluster-child telemetry now names the max-delta cell, so the e7 oscillation (1.5e7 -> 3.0e7 -> 2.0e7, cell unknown) is attributable on the next run. Diagnosis context committed to CHANGELOG: GPP Promote!C465 is the workbook s own #DIV/0! (0/0, absent from GT) — the persistent non-finite is CORRECT behavior; the probe s 2-pass converged verdict was a stride-20 sampling illusion. Negative-controlled test-offset-ref-bounds.mjs (7 asserts, red pre-fix with exactly the predicted silent values). cargo build --release done. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The instrumented canonical A-1 run pinned the mid-pass OOM class: heap steady at 6.5GB through pass 4, death mid-pass-5 needing >13GB in one spike — an allocation proportional to a cell VALUE, fatal at any heap cap (identical ~56-min deaths under 12GB and 20GB).
_offsetAddr/_offsethad no upper bounds: a displacement (or OFFSET height/width) fed by a poisoned/oscillating cell (~1e7 scale — the observed pass-4 maxDelta magnitude) produced addresses like row 20,000,000, and_dynRange/ctx.rangematerialized the rectangle — billions of cells. Past Excel's hard sheet bounds (1,048,576 × 16,384) Excel itself answers#REF!; the helpers now answer honest NaN there. Pre-fix, scalar OFFSET returned a silent 0 for an out-of-bounds read, and SUM over an out-of-bounds computed-endpoint range returned a confident finite number.Also: cluster-child telemetry now names the max-delta cell, so the e7 oscillation is attributable on the next run.
Diagnosis context (posted to #33 as a correction)
GPP Promote!C465(persistent non-finite) is the workbook's own#DIV/0!(0/0, absent from GT) — our NaN is correct.Tests
test-offset-ref-bounds.mjs— 7 asserts, negative-controlled via stash + rebuild: red pre-fix with exactly the predicted silent values (0,6); in-bounds OFFSET/computed-endpoint shapes byte-unchanged. Fullnpm testgreen on this tree.🤖 Generated with Claude Code