fix: 4d sparse statistics crashed on an undefined accumulator (closes #812) - #814
Open
sotashimozono wants to merge 1 commit into
Open
fix: 4d sparse statistics crashed on an undefined accumulator (closes #812)#814sotashimozono wants to merge 1 commit into
sotashimozono wants to merge 1 commit into
Conversation
sotashimozono
force-pushed
the
fix/galley-4d-dcs-init
branch
from
August 21, 2026 08:45
2218b66 to
18e5f03
Compare
…loses finch-tensor#812) The first @finch block of _4d_structure_to_dcs initializes d_ijk while the declared accumulator is d_ijkl — an UndefVarError on first touch, so DCStats could never be built for any rank-4 sparse input (reproduced for SparseCOO and for nested SparseList formats alike). Adds a regression test constructing DCStats for a rank-4 sparse tensor. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sotashimozono
force-pushed
the
fix/galley-4d-dcs-init
branch
from
August 21, 2026 08:46
18e5f03 to
e515a88
Compare
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.
The first
@finchblock of_4d_structure_to_dcsinitializesd_ijkwhile the declared accumulator isd_ijkl:so
DCStatscould never be built for any rank-4 sparse input. Closes #812.Reproduction, restated here so the PR stands alone:
The same error fires for nested
SparseListformats too — this function is the statistics entry for every rank-4 sparse input, whatever the level types.One-line fix, plus a regression test in the DCStats suite constructing statistics for a rank-4 sparse tensor.
Validated on this branch:
Dense(SparseList(SparseList(SparseList(Element))))rank-4 operand plans, and the output preserves sparsity (stored count = the exact product support).The generic rank >= 5 statistics path (subset enumeration) is a separate concern and not touched here.