Skip to content

fix(satisfying_sort): drop dead source_region gate that hid triangle pixels#289

Merged
sachiniyer merged 1 commit into
mainfrom
siyer/fix-sort-animation-holes
May 9, 2026
Merged

fix(satisfying_sort): drop dead source_region gate that hid triangle pixels#289
sachiniyer merged 1 commit into
mainfrom
siyer/fix-sort-animation-holes

Conversation

@sachiniyer
Copy link
Copy Markdown
Contributor

Summary

  • pixel_style_at ran a source_region != region check that mixed a 1D source_x (computed from a shuffled array index) with the current pixel's 2D local_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 because visual_source_index_for_nominal happened to return nominal_index once the scan finished, accidentally making source_x ≈ local_x.
  • The shuffled-source path was never used to color pixels — styling reads nominal_index via style_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 the SortState accessors used only by them).
  • Added a regression test (idle_phase_populates_every_triangle_pixel) that walks the full viewport during Idle and asserts every TopTriangle/BottomTriangle pixel renders as Base.

Fixes #268. Detail bug: bug_85d5ca30-433d-43d9-9ffd-5e80c7d4e8aa.

Test plan

  • cargo fmt --check
  • cargo clippy -- -D warnings
  • cargo test (288 passed, including the new regression test)
  • cargo xtask check
  • Manual smoke: run the satisfying-sort animation and confirm Idle has no holes, Sorting shows the blue active sweep, and Completion turns everything green.

🤖 Generated with Claude Code

…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>
@sachiniyer sachiniyer temporarily deployed to integration-tests May 9, 2026 03:07 — with GitHub Actions Inactive
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@sachiniyer sachiniyer merged commit f5db2ea into main May 9, 2026
13 checks passed
@sachiniyer sachiniyer deleted the siyer/fix-sort-animation-holes branch May 9, 2026 04:03
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.

[Detail Bug] Sorting animation logo shows holes during Idle/Sorting due to incorrect region check

1 participant