Files
WAFER/crates/core
ok 4cc71666d5 Enable stack-to-local promotion for DO/LOOP and IF/ELSE
Three bugs fixed to safely enable promotion for control flow:

1. compute_stack_needs now recurses into IF/DoLoop/Begin bodies,
   correctly calculating preload counts for promoted words with
   nested control flow (was flat, causing stack underflow).

2. BeginDoubleWhileRepeat rejected from promotion (boot.fth's
   -TRAILING uses this pattern, handler had structural bugs).

3. IF/ELSE branches must have same net stack effect for promotion
   (BITSSET? has asymmetric branches: 2 items vs 1).

Performance with promotion enabled:
- Factorial: 0.50x (2x faster than gforth)
- Collatz: 0.38x (2.6x faster than gforth)
- All 427 unit tests, 10/11 compliance, 35/35 behavioral pass
2026-04-09 19:26:00 +02:00
..