fix(satisfying_sort): drop dead source_region gate that hid triangle pixels#289
Merged
Conversation
…f triangle pixels The source_region != region check in pixel_style_at mixed a 1D source_x (derived from a shuffled array index) with the current pixel's 2D local_y, which has no geometric meaning and incorrectly hid ~27.7% of triangle pixels during the Idle and Sorting phases. The shuffled_idx was never actually used to color pixels (styling uses nominal_index), so the gate was effectively dead code that only removed pixels. Drop the gate, simplify pixel_style_at to map nominal_index directly to a BandStyle, and delete helpers that were only used to support it. Add a regression test that walks the full viewport during Idle and asserts every TopTriangle/BottomTriangle pixel renders as Base. Fixes #268 Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
pixel_style_atran asource_region != regioncheck that mixed a 1Dsource_x(computed from a shuffled array index) with the current pixel's 2Dlocal_y. That comparison has no geometric meaning and was hiding ~27.7% of triangle pixels during the Idle and Sorting phases of the satisfying-sort animation. The holes only "disappeared" during Completion becausevisual_source_index_for_nominalhappened to returnnominal_indexonce the scan finished, accidentally makingsource_x ≈ local_x.nominal_indexviastyle_for_index_with_min_window— so the gate was effectively dead code that only removed pixels. Dropped the gate and the helpers that exclusively supported it (shuffled_index_for_nominal,source_local_x_for_index,visual_source_index_for_nominal, plus theSortStateaccessors used only by them).idle_phase_populates_every_triangle_pixel) that walks the full viewport during Idle and asserts everyTopTriangle/BottomTrianglepixel renders asBase.Fixes #268. Detail bug:
bug_85d5ca30-433d-43d9-9ffd-5e80c7d4e8aa.Test plan
cargo fmt --checkcargo clippy -- -D warningscargo test(288 passed, including the new regression test)cargo xtask check🤖 Generated with Claude Code