Skip to content

Comments

feat(fused): relax Pass 0 to allow balanced SP save/restore#52

Open
avrabe wants to merge 1 commit intomainfrom
feat/fused-component-optimization
Open

feat(fused): relax Pass 0 to allow balanced SP save/restore#52
avrabe wants to merge 1 commit intomainfrom
feat/fused-component-optimization

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Feb 20, 2026

Summary

  • Replace has_global_writes (rejects ALL GlobalSet) with has_unsafe_global_writes, which permits the balanced single-global save/restore pattern used by meld's stack pointer prologue/epilogue
  • Adds sp_save_restore_collapse_correct Rocq theorem proving the relaxed predicate is safe
  • 3 new tests + existing regression test covering all edge cases

Test plan

  • test_collapse_allows_sp_save_restore — balanced SP pattern collapses
  • test_collapse_skips_multiple_global_indices — multi-global rejected
  • test_collapse_skips_write_only_global — write-only rejected
  • test_collapse_skips_global_writes — existing regression guard passes
  • Full test suite (348+ tests, 0 failures)

🤖 Generated with Claude Code

Replace has_global_writes (rejects ALL GlobalSet) with
has_unsafe_global_writes, which permits the single-global
save/restore pattern used by meld's stack pointer
prologue/epilogue. This lets Pass 0 collapse more adapters
without sacrificing provable correctness.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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