Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 6, 2026

Summary

  • Extend CaptureEffects with pre field for entry-point effects
  • Propagate pre effects to first instruction, post to last
  • Tagged alternations: emit Enum as pre_effect, EndEnum as post_effect
  • Untagged alternations: emit null injection as pre_effect on branch body

Why

Before: 3 instructions per tagged branch (Enum epsilon → match → EndEnum epsilon)
After: 1 instruction per branch with merged effects

Before: 2 instructions per untagged branch (Null Set epsilon → match)
After: 1 instruction with null injection as pre_effect

For 30-branch tagged alternation: ~99 → 39 instructions (~60% reduction).

@zharinov zharinov force-pushed the refactor/merge-enum-effects branch 2 times, most recently from 715e490 to c59f5ce Compare January 6, 2026 01:38
@zharinov zharinov changed the title refactor: merge Enum/EndEnum effects into tagged alternation body refactor: merge alternation wrapper effects into body instructions Jan 6, 2026
@zharinov zharinov force-pushed the refactor/merge-enum-effects branch from c59f5ce to edd7058 Compare January 6, 2026 01:39
@zharinov zharinov enabled auto-merge (squash) January 6, 2026 01:40
@zharinov zharinov force-pushed the refactor/merge-enum-effects branch from edd7058 to 7adc3f3 Compare January 6, 2026 01:41
@zharinov zharinov merged commit 2659aa2 into master Jan 6, 2026
4 checks passed
@zharinov zharinov deleted the refactor/merge-enum-effects branch January 6, 2026 01:43
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.

2 participants