nyash-codex
91c7dfbf0b
refactor(normalization): Phase 135 P0 - Extend plan to zero post-loop assigns
Generalize NormalizationPlan suffix detection to accept zero post-loop assignments:
Goal: Improve entry point consistency by allowing `loop + assign* + return` (N >= 0)
Implementation:
- Modified plan_box.rs detection logic (only file changed)
- Removed `post_assign_count >= 1` requirement
- Unified Phase 131 (loop + return) and Phase 132-133 (loop + assign+ + return) paths
Changes:
- src/mir/builder/control_flow/normalization/plan_box.rs:
- Removed assignment count constraint
- Unified pattern detection: `loop + assign* + return` (N >= 0)
- apps/tests/phase135_loop_true_break_once_post_empty_return_min.hako (new fixture)
- tools/smokes/v2/profiles/integration/apps/phase135_*.sh (new smoke tests)
Pattern support:
- Phase 131/135: loop + return only (consumed: 2, post_assign_count: 0) ✅
- Phase 132: loop + 1 assign + return (consumed: 3, post_assign_count: 1) ✅
- Phase 133: loop + N assigns + return (consumed: 2+N, post_assign_count: N) ✅
Design principles maintained:
- **Minimal change**: Only plan_box.rs modified (execute_box unchanged)
- **SSOT**: Detection logic centralized in plan_box.rs
- **Box-First**: Responsibility separation preserved (Plan/Execute)
Test results:
- Unit tests (plan_box): 9/9 PASS (2 new tests added)
- Phase 135 VM/LLVM EXE: PASS (exit code 1)
- Phase 131 regression: 2/2 PASS (path now unified)
- Phase 133 regression: 2/2 PASS
- cargo test --lib: PASS
Benefits:
- Unified entry point for all loop + post patterns
- Easier maintenance (single detection logic)
- Future extensibility (easy to add new patterns)
- Clear separation of Phase 131 and Phase 132-135 paths
Default behavior unchanged: Dev-only guard maintained
Related: Phase 135 normalization pattern consistency improvement
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 22:46:32 +09:00
..
2025-12-18 08:18:20 +09:00
2025-12-15 06:00:48 +09:00
2025-12-03 13:42:05 +09:00
2025-12-18 22:29:29 +09:00
2025-12-14 18:27:24 +09:00
2025-12-18 09:13:19 +09:00
2025-12-18 22:46:32 +09:00
2025-12-13 17:26:15 +09:00
2025-12-18 09:13:19 +09:00
2025-12-14 09:47:23 +09:00
2025-12-05 16:08:56 +09:00
2025-12-04 06:02:03 +09:00
2025-12-04 06:02:03 +09:00
2025-12-03 13:59:06 +09:00
2025-12-05 23:33:06 +09:00
2025-12-05 23:33:06 +09:00
2025-12-13 22:21:04 +09:00
2025-12-14 18:27:24 +09:00
2025-12-08 04:14:28 +09:00
2025-12-02 21:52:18 +09:00
2025-12-10 00:01:53 +09:00
2025-12-04 06:02:03 +09:00
2025-12-14 19:34:02 +09:00
2025-12-08 06:14:03 +09:00
2025-12-08 00:09:45 +09:00
2025-12-03 14:33:04 +09:00
2025-12-06 16:22:38 +09:00
2025-12-08 18:36:13 +09:00
2025-12-04 17:47:19 +09:00
2025-12-11 20:54:33 +09:00
2025-12-11 00:33:04 +09:00
2025-12-11 00:33:04 +09:00
2025-12-12 03:15:45 +09:00
2025-12-12 04:06:03 +09:00
2025-12-12 03:31:58 +09:00
2025-12-12 04:40:46 +09:00
2025-12-12 07:13:34 +09:00
2025-12-12 04:50:26 +09:00
2025-12-12 16:40:20 +09:00
2025-12-12 17:12:58 +09:00
2025-12-12 22:15:41 +09:00
2025-12-12 23:02:40 +09:00
2025-12-12 23:02:40 +09:00
2025-12-13 02:22:29 +09:00
2025-12-13 03:47:54 +09:00
2025-12-13 03:41:20 +09:00
2025-12-13 03:41:26 +09:00
2025-12-13 03:23:02 +09:00
2025-12-13 03:41:40 +09:00
2025-12-13 03:41:40 +09:00
2025-12-13 03:41:40 +09:00
2025-12-13 05:34:56 +09:00
2025-12-13 05:34:56 +09:00
2025-12-13 05:35:04 +09:00
2025-12-13 05:35:14 +09:00
2025-12-13 05:35:35 +09:00
2025-12-13 21:32:35 +09:00
2025-12-13 16:20:33 +09:00
2025-12-13 19:01:14 +09:00
2025-12-13 19:01:14 +09:00
2025-12-13 19:01:14 +09:00
2025-12-14 05:24:31 +09:00
2025-12-14 05:55:21 +09:00
2025-12-14 05:27:39 +09:00
2025-12-14 05:24:31 +09:00
2025-12-14 05:24:31 +09:00
2025-12-15 11:47:58 +09:00
2025-12-14 06:25:42 +09:00
2025-12-14 09:19:00 +09:00
2025-12-14 09:19:00 +09:00
2025-12-15 06:00:48 +09:00
2025-12-12 03:15:45 +09:00
2025-12-08 21:26:57 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-12 04:19:06 +09:00
2025-12-12 04:19:06 +09:00
2025-12-11 02:35:31 +09:00
2025-12-12 03:15:45 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 13:13:08 +09:00
2025-12-12 03:15:45 +09:00
2025-12-12 04:19:06 +09:00
2025-12-12 04:19:06 +09:00
2025-12-11 15:08:14 +09:00
2025-12-11 15:08:14 +09:00
2025-12-07 21:02:20 +09:00
2025-12-07 21:02:20 +09:00
2025-12-12 05:07:01 +09:00
2025-12-12 17:51:53 +09:00
2025-12-12 18:08:00 +09:00
2025-12-12 18:45:08 +09:00
2025-12-12 22:51:21 +09:00
2025-12-12 22:51:21 +09:00
2025-12-12 23:02:40 +09:00
2025-12-13 03:23:02 +09:00
2025-12-13 05:34:56 +09:00
2025-12-13 05:35:04 +09:00
2025-12-13 05:35:35 +09:00
2025-12-13 05:35:35 +09:00
2025-12-05 16:06:39 +09:00
2025-12-06 11:10:38 +09:00
2025-12-12 04:19:06 +09:00
2025-12-10 18:45:04 +09:00
2025-12-10 19:08:18 +09:00
2025-12-10 22:48:45 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 02:35:31 +09:00
2025-12-11 15:08:14 +09:00
2025-11-23 05:53:27 +09:00
2025-12-07 21:02:20 +09:00
2025-12-14 03:36:45 +09:00
2025-12-14 21:28:41 +09:00
2025-12-14 21:28:41 +09:00
2025-12-15 22:12:33 +09:00
2025-12-10 21:53:27 +09:00
2025-12-12 23:11:45 +09:00
2025-12-10 00:29:25 +09:00
2025-12-04 03:58:02 +09:00
2025-12-04 12:40:01 +09:00
2025-11-21 07:00:05 +09:00
2025-11-21 08:03:03 +09:00
2025-11-21 08:03:03 +09:00
2025-12-08 15:17:53 +09:00
2025-11-20 17:10:03 +09:00
2025-11-20 17:10:03 +09:00
2025-11-20 17:10:03 +09:00