feat(joinir): Phase 240-EX - Pattern2 header condition ExprLowerer integration

Implementation:
- Add make_pattern2_scope_manager() helper for DRY
- Header conditions use ExprLowerer for supported patterns
- Legacy fallback for unsupported patterns
- Fail-Fast on supported patterns that fail

Tests:
- 4 new tests (all pass)
- test_expr_lowerer_supports_simple_header_condition_i_less_literal
- test_expr_lowerer_supports_header_condition_var_less_var
- test_expr_lowerer_header_condition_generates_expected_instructions
- test_pattern2_header_condition_via_exprlowerer

Also: Archive old phase documentation (34k lines removed)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-11 00:33:04 +09:00
parent 448bf3d8c5
commit a7dbc15878
116 changed files with 401 additions and 18 deletions

View File

@ -1,3 +1,5 @@
Status: Historical
# 🧹 プロジェクト大掃除計画 2025-11-04 # 🧹 プロジェクト大掃除計画 2025-11-04
**作成日**: 2025-11-04 **作成日**: 2025-11-04

View File

@ -1,3 +1,5 @@
Status: Historical
# 🧹 プロジェクト大掃除実行レポート 2025-11-04 # 🧹 プロジェクト大掃除実行レポート 2025-11-04
**実行日時**: 2025-11-04 16:25 **実行日時**: 2025-11-04 16:25

View File

@ -1,3 +1,5 @@
Status: Historical
# Hakorune Rustコードベース 重複コード・共通化調査レポート # Hakorune Rustコードベース 重複コード・共通化調査レポート
## 概要 ## 概要

View File

@ -1,3 +1,5 @@
Status: Historical
# Hakorune Legacy Code Investigation Report # Hakorune Legacy Code Investigation Report
**調査日**: 2025-11-06 **調査日**: 2025-11-06
@ -489,4 +491,3 @@ cargo test
**調査担当**: Claude Code **調査担当**: Claude Code
**次のアクション**: Phase A (Safe削除) の実行 **次のアクション**: Phase A (Safe削除) の実行

View File

@ -1,3 +1,5 @@
Status: Historical
# 🧹 Phase 2 実行レポート 2025-11-04 # 🧹 Phase 2 実行レポート 2025-11-04
**実行日時**: 2025-11-04 16:45 **実行日時**: 2025-11-04 16:45

View File

@ -1,3 +1,5 @@
Status: Historical
# Nyash ドキュメント再編成計画 📚 # Nyash ドキュメント再編成計画 📚
## 📊 現状の分析結果 ## 📊 現状の分析結果
@ -273,4 +275,4 @@ archive/
- **検索時間短縮**: 必要な情報への到達が3クリック以内に - **検索時間短縮**: 必要な情報への到達が3クリック以内に
- **メンテナンス性向上**: 新規ドキュメントの追加場所が明確 - **メンテナンス性向上**: 新規ドキュメントの追加場所が明確
- **重複削減**: 18個のREADME → 5個程度に集約 - **重複削減**: 18個のREADME → 5個程度に集約
- **整理度**: 283ファイル → 適切に分類された構造 - **整理度**: 283ファイル → 適切に分類された構造

View File

@ -1,3 +1,5 @@
Status: Historical
# Nyash ドキュメント再編成報告書 📋 # Nyash ドキュメント再編成報告書 📋
## 実行日時 ## 実行日時

View File

@ -1,3 +1,5 @@
Status: Historical
# call() Replacement Report - lang/src # call() Replacement Report - lang/src
**Date:** 2025-11-01 **Date:** 2025-11-01

View File

@ -0,0 +1,8 @@
# Phase 170197 Archive
Status: Historical
Scope: JsonParser / JoinIR 実戦フェーズPhase 170〜197の詳細メモ・設計・調査ログのアーカイブ。
Phase 170〜197 に関する設計や調査の詳細ドキュメントは、このディレクトリに集約しているよ。
現行ラインからは、必要なものだけを `docs/development/current/main` 側で参照する前提だよ。

View File

@ -184,3 +184,4 @@ src/mir/join_ir/lowering/
2. **差し替え容易**: 名前 → AST → MIR と段階的に精度向上可能 2. **差し替え容易**: 名前 → AST → MIR と段階的に精度向上可能
3. **テスト容易**: LoopUpdateSummary を直接テスト可能 3. **テスト容易**: LoopUpdateSummary を直接テスト可能
4. **後方互換**: LoopFeatures.update_summary は Option なので影響最小 4. **後方互換**: LoopFeatures.update_summary は Option なので影響最小
Status: Historical

View File

@ -224,3 +224,4 @@ NYASH_JOINIR_STRUCTURE_ONLY=1 \
--- ---
**End of Report** **End of Report**
Status: Historical

View File

@ -253,3 +253,4 @@ loop(pos < len) {
⚠️ **Next Blockers**: Method calls in loops (Pattern 5+ features, not bugs) ⚠️ **Next Blockers**: Method calls in loops (Pattern 5+ features, not bugs)
**Overall Impact**: Significant progress - variable scope classification is now correct. Remaining errors are legitimate feature gaps, not misclassification bugs. **Overall Impact**: Significant progress - variable scope classification is now correct. Remaining errors are legitimate feature gaps, not misclassification bugs.
Status: Historical

View File

@ -458,3 +458,4 @@ true // ✅ FIX: Default to OuterLocal for function parameters
- Extended scope heuristics - Extended scope heuristics
- Condition simplification analysis - Condition simplification analysis
- Method call support in loop conditions - Method call support in loop conditions
Status: Historical

View File

@ -108,3 +108,4 @@ LoopBodyLocal を含む条件式を扱いたくなった場合は:
- それを新しい Pattern5 として設計すれば、既存 Pattern2/4 の仕様を崩さずに拡張できる。 - それを新しい Pattern5 として設計すれば、既存 Pattern2/4 の仕様を崩さずに拡張できる。
このドキュメントは設計メモのみであり、実装は別フェーズPhase 170Dimpl など)で行う。 このドキュメントは設計メモのみであり、実装は別フェーズPhase 170Dimpl など)で行う。
Status: Historical

View File

@ -250,3 +250,4 @@ JoinInlineBoundary::new_inputs_only(
2. Update all 4 patterns 2. Update all 4 patterns
3. Re-run Phase 170 validation tests 3. Re-run Phase 170 validation tests
4. Document the "always include condition variables in boundary" pattern 4. Document the "always include condition variables in boundary" pattern
Status: Historical

View File

@ -316,3 +316,4 @@ CURRENT_TASK.md に Phase 170 セクションを追加1-2 段落):
**Phase**: 170.hako JSON ライブラリ設計) **Phase**: 170.hako JSON ライブラリ設計)
**予定工数**: 2-3 時間 **予定工数**: 2-3 時間
**難易度**: 低(調査 + ドキュメント化) **難易度**: 低(調査 + ドキュメント化)
Status: Historical

View File

@ -207,3 +207,4 @@ Proceed to Phase 171-2 for design decision.
- Phase 170 Analysis: `phase170-valueid-boundary-analysis.md` - Phase 170 Analysis: `phase170-valueid-boundary-analysis.md`
- Phase 170 Completion: `phase170-completion-report.md` - Phase 170 Completion: `phase170-completion-report.md`
- JoinIR Design: `docs/development/current/main/phase33-10-if-joinir-design.md` - JoinIR Design: `docs/development/current/main/phase33-10-if-joinir-design.md`
Status: Historical

View File

@ -416,3 +416,4 @@ This follows the "Fail-Fast" principle from CLAUDE.md.
- Phase 171-1 Analysis: `phase171-1-boundary-analysis.md` - Phase 171-1 Analysis: `phase171-1-boundary-analysis.md`
- JoinInlineBoundary: `src/mir/join_ir/lowering/inline_boundary.rs` - JoinInlineBoundary: `src/mir/join_ir/lowering/inline_boundary.rs`
- Merge Logic: `src/mir/builder/control_flow/joinir/merge/mod.rs` - Merge Logic: `src/mir/builder/control_flow/joinir/merge/mod.rs`
Status: Historical

View File

@ -447,3 +447,4 @@ Phase 171-2 完了後:
**実工数**: 2 時間実装完了、using 制限発見) **実工数**: 2 時間実装完了、using 制限発見)
**難易度**: 中(統合 + テスト確認) **難易度**: 中(統合 + テスト確認)
**状態**: 実装完了using 制限により Phase 173 で動作確認予定) **状態**: 実装完了using 制限により Phase 173 で動作確認予定)
Status: Historical

View File

@ -276,3 +276,4 @@ Finished `release` profile [optimized] target(s) in 0.07s
- Phase 171-1 Analysis: `phase171-1-boundary-analysis.md` - Phase 171-1 Analysis: `phase171-1-boundary-analysis.md`
- Phase 171-2 Design: `phase171-2-condition-inputs-design.md` - Phase 171-2 Design: `phase171-2-condition-inputs-design.md`
- JoinIR Design: `docs/development/current/main/phase33-10-if-joinir-design.md` - JoinIR Design: `docs/development/current/main/phase33-10-if-joinir-design.md`
Status: Historical

View File

@ -422,3 +422,4 @@ LoopBodyCarrierPromoter::try_promote()
- [ ] Phase 172-2: JsonParser loops への展開 - [ ] Phase 172-2: JsonParser loops への展開
- Similar pattern recognition - Similar pattern recognition
- Generalized carrier promotion - Generalized carrier promotion
Status: Historical

View File

@ -491,3 +491,4 @@ Phase 171 MVP は正確性 > 速度を優先。最適化は Phase 173+ へ。
**予定工数**: 3-4 時間 **予定工数**: 3-4 時間
**難易度**: 中JSON パーサ実装 + .hako での Box 設計) **難易度**: 中JSON パーサ実装 + .hako での Box 設計)
**期待削減**: hako_check 行数 60%、コード共通化 100% **期待削減**: hako_check 行数 60%、コード共通化 100%
Status: Historical

View File

@ -343,3 +343,4 @@ Phase 172 will **replace this early return** with actual lowering logic.
- **Phase 171-C-5**: TrimLoopHelper design - **Phase 171-C-5**: TrimLoopHelper design
- **Pattern2 Lowerer**: `src/mir/builder/control_flow/joinir/patterns/pattern2_with_break.rs` - **Pattern2 Lowerer**: `src/mir/builder/control_flow/joinir/patterns/pattern2_with_break.rs`
- **Test File**: `local_tests/test_trim_main_pattern.hako` - **Test File**: `local_tests/test_trim_main_pattern.hako`
Status: Historical

View File

@ -292,3 +292,4 @@ box ProgramJSONBox {
**実装者**: Claude Code (AI 協働開発) **実装者**: Claude Code (AI 協働開発)
**レビュー日**: 2025-12-04 **レビュー日**: 2025-12-04
**Phase 状態**: 172 実装完了 ✅、173+ 提案あり **Phase 状態**: 172 実装完了 ✅、173+ 提案あり
Status: Historical

View File

@ -489,3 +489,4 @@ for def in defs {
**予定工数**: 2-3 時間 **予定工数**: 2-3 時間
**難易度**: 低-中(既存実装の適用 + 薄いラッパー追加) **難易度**: 低-中(既存実装の適用 + 薄いラッパー追加)
**期待効果**: JSON 処理 SSOT 確立、selfhost depth-2 基盤完成 **期待効果**: JSON 処理 SSOT 確立、selfhost depth-2 基盤完成
Status: Historical

View File

@ -178,3 +178,4 @@ User/stakeholder should decide:
**Outcome**: Investigation complete, two implementation options proposed **Outcome**: Investigation complete, two implementation options proposed
**Recommendation**: Option 1 (minimal parser fix) **Recommendation**: Option 1 (minimal parser fix)
**Estimated Completion**: 2-3 hours (Option 1) or 30 minutes (Option 2) **Estimated Completion**: 2-3 hours (Option 1) or 30 minutes (Option 2)
Status: Historical

View File

@ -209,3 +209,4 @@ The core using resolver + MIR lowering integration is **functionally complete**
**Investigation Time**: 2 hours **Investigation Time**: 2 hours
**Complexity**: Medium (Runtime debugging required) **Complexity**: Medium (Runtime debugging required)
**Blocking**: No (workarounds available) **Blocking**: No (workarounds available)
Status: Historical

View File

@ -198,3 +198,4 @@ JsonParserBox.parse/1("{}")
**Phase**: 173-2 Investigation **Phase**: 173-2 Investigation
**Outcome**: Strategy revision required **Outcome**: Strategy revision required
**Recommendation**: Minimal parser fix (Option 1) **Recommendation**: Minimal parser fix (Option 1)
Status: Historical

View File

@ -444,3 +444,4 @@ JsonParserBox が「正式な標準ライブラリ」として完全に機能す
**予定工数**: 4-6 時間 **予定工数**: 4-6 時間
**難易度**: 高名前解決・MIR lowering の統合) **難易度**: 高名前解決・MIR lowering の統合)
**前提**: Phase 173 前半Task 1-3完了 **前提**: Phase 173 前半Task 1-3完了
Status: Historical

View File

@ -381,3 +381,4 @@ Phase 171 で実装した Trim パイプラインが、JsonParser の `_trim`
- `_unescape_string` - Pattern1、LoopBodyLocal 問題なし(対象外) - `_unescape_string` - Pattern1、LoopBodyLocal 問題なし(対象外)
**Phase 173-3 での設計方針**: 既存の Trim パイプラインをそのまま活用 **Phase 173-3 での設計方針**: 既存の Trim パイプラインをそのまま活用
Status: Historical

View File

@ -308,3 +308,4 @@ loop(p < s.length()) {
**ドキュメント成果物**: **ドキュメント成果物**:
- `phase173-jsonparser-p5-impl.md` - 実装結果レポート - `phase173-jsonparser-p5-impl.md` - 実装結果レポート
- `CURRENT_TASK.md` - Phase 173 成果記録 - `CURRENT_TASK.md` - Phase 173 成果記録
Status: Historical

View File

@ -329,3 +329,4 @@ NYASH_JOINIR_CORE=1 NYASH_LEGACY_LOOPBUILDER=0 \
- 複雑なループへの拡張 - 複雑なループへの拡張
- MethodCall 対応 - MethodCall 対応
- Execution 問題の解決 - Execution 問題の解決
Status: Historical

View File

@ -228,3 +228,4 @@ NYASH_CLI_VERBOSE=1
**更新日**: 2025-12-04 **更新日**: 2025-12-04
**Phase**: 173using + 静的 Box メソッド解決) **Phase**: 173using + 静的 Box メソッド解決)
**進捗**: Task 1-2 完了25%/ Task 3-8 残り75% **進捗**: Task 1-2 完了25%/ Task 3-8 残り75%
Status: Historical

View File

@ -330,3 +330,4 @@ local parser = new JsonLib.JsonParserBox()
**Phase**: 173using + 静的 Box メソッド解決) **Phase**: 173using + 静的 Box メソッド解決)
**進捗**: Task 1-2 完了25% **進捗**: Task 1-2 完了25%
**次タスク**: Task 3JsonParserBox バグ修正)または Task 4using resolver 修正) **次タスク**: Task 3JsonParserBox バグ修正)または Task 4using resolver 修正)
Status: Historical

View File

@ -262,3 +262,4 @@ local parser = new JsonLib.JsonParserBox()
**作成日**: 2025-12-04 **作成日**: 2025-12-04
**調査時間**: 約2時間 **調査時間**: 約2時間
**次のタスク**: Task 3JsonParserBox バグ修正)または Task 2仕様固定 **次のタスク**: Task 3JsonParserBox バグ修正)または Task 2仕様固定
Status: Historical

View File

@ -385,3 +385,4 @@ Phase 173 完了後:
**予定工数**: 4-6 時間 **予定工数**: 4-6 時間
**難易度**: 高名前解決・MIR lowering の修正) **難易度**: 高名前解決・MIR lowering の修正)
**Rust VM 変更**: なし(.hako/using 側のみ) **Rust VM 変更**: なし(.hako/using 側のみ)
Status: Historical

View File

@ -115,3 +115,4 @@
- **Ready for Phase 34+**: No technical debt from this refactoring - **Ready for Phase 34+**: No technical debt from this refactoring
**Answer to user's question**: "It's simpler now, not complex!" ✨ **Answer to user's question**: "It's simpler now, not complex!" ✨
Status: Historical

View File

@ -343,3 +343,4 @@ loop(pos < len) {
3. Phase 176: エスケープ処理追加continue 対応) 3. Phase 176: エスケープ処理追加continue 対応)
4. Phase 177: _parse_number 対応indexOf パターン) 4. Phase 177: _parse_number 対応indexOf パターン)
5. Phase 178+: _parse_array/_parse_object複雑ループ 5. Phase 178+: _parse_array/_parse_object複雑ループ
Status: Historical

View File

@ -360,3 +360,4 @@ NYASH_JOINIR_CORE=1 NYASH_LEGACY_LOOPBUILDER=0 \
**成功すれば**: **成功すれば**:
- Trim P5 パイプラインが「Trim 専用」ではなく「文字比較ループ汎用」であることが証明される - Trim P5 パイプラインが「Trim 専用」ではなく「文字比較ループ汎用」であることが証明される
- Phase 175+ での拡張複数キャリア・continue 等)の基盤が確立される - Phase 175+ での拡張複数キャリア・continue 等)の基盤が確立される
Status: Historical

View File

@ -278,3 +278,4 @@ bb12: // Exit block
- **Phase 174**: P5 minimal PoC (quote detection only) - **Phase 174**: P5 minimal PoC (quote detection only)
- **Phase 176**: Pattern2 multi-carrier implementation ([phase176-completion-report.md](phase176-completion-report.md)) - **Phase 176**: Pattern2 multi-carrier implementation ([phase176-completion-report.md](phase176-completion-report.md))
- **Pattern Space**: [docs/development/current/main/loop_pattern_space.md](loop_pattern_space.md) - **Pattern Space**: [docs/development/current/main/loop_pattern_space.md](loop_pattern_space.md)
Status: Historical

View File

@ -234,3 +234,4 @@ The problem is that `lower_loop_with_break_minimal()` completely ignores `Carrie
3. **Integration Test**: Pattern 3 (trim) with Pattern 2 shape 3. **Integration Test**: Pattern 3 (trim) with Pattern 2 shape
- Test case: `loop(pos < len) { if ch == ' ' { break } pos = pos + 1 }` - Test case: `loop(pos < len) { if ch == ' ' { break } pos = pos + 1 }`
- Verify sum/count carriers survive through break exits - Verify sum/count carriers survive through break exits
Status: Historical

View File

@ -163,3 +163,4 @@ _parse_string の制御フロー:
- **Production 適用**: 構造は変えず、制御フローのみ追加Phase 177+ - **Production 適用**: 構造は変えず、制御フローのみ追加Phase 177+
**「Carrier 数を固定して制御フローを段階的に複雑化」が正解** **「Carrier 数を固定して制御フローを段階的に複雑化」が正解**
Status: Historical

View File

@ -176,3 +176,4 @@ static box JsonParserStringTest3 {
## まとめ ## まとめ
**Phase 177-A では、min2 と同型の Simple Case を Production 環境に適用する。** **Phase 177-A では、min2 と同型の Simple Case を Production 環境に適用する。**
エスケープ処理は Phase 178 以降に回し、まず「2-carrier + break」の動作確認を優先する。 エスケープ処理は Phase 178 以降に回し、まず「2-carrier + break」の動作確認を優先する。
Status: Historical

View File

@ -69,3 +69,4 @@ To support string loops, either:
2. Process loop body statements in MIR alongside JoinIR control flow (Option B) 2. Process loop body statements in MIR alongside JoinIR control flow (Option B)
Phase 178 provides the detection foundation for future string support. Phase 178 provides the detection foundation for future string support.
Status: Historical

View File

@ -372,3 +372,4 @@ Pattern 2 has complex Trim pattern logic (~100 lines) that:
- **LoopScopeShapeBuilder**: `src/mir/builder/control_flow/joinir/patterns/loop_scope_shape_builder.rs` - **LoopScopeShapeBuilder**: `src/mir/builder/control_flow/joinir/patterns/loop_scope_shape_builder.rs`
- **ConditionEnvBuilder**: `src/mir/builder/control_flow/joinir/patterns/condition_env_builder.rs` - **ConditionEnvBuilder**: `src/mir/builder/control_flow/joinir/patterns/condition_env_builder.rs`
- **JoinIRConversionPipeline**: `src/mir/builder/control_flow/joinir/patterns/conversion_pipeline.rs` - **JoinIRConversionPipeline**: `src/mir/builder/control_flow/joinir/patterns/conversion_pipeline.rs`
Status: Historical

View File

@ -321,3 +321,4 @@ return Err(format!(
- Focus is on code organization and maintainability - Focus is on code organization and maintainability
- Trim pattern logic remains identical, just relocated - Trim pattern logic remains identical, just relocated
- Future Phase 181+ can build on this clean foundation - Future Phase 181+ can build on this clean foundation
Status: Historical

View File

@ -415,3 +415,4 @@ cargo test --release --lib pattern4
**Phase**: 182CharComparison 汎用化の準備・設計) **Phase**: 182CharComparison 汎用化の準備・設計)
**ステータス**: ドキュメント・計画のみ(コード変更なし) **ステータス**: ドキュメント・計画のみ(コード変更なし)
**次フェーズ**: Phase 183実装・リネーム **次フェーズ**: Phase 183実装・リネーム
Status: Historical

View File

@ -126,3 +126,4 @@ Success criteria:
- Phase 181: JsonParser loop analysis - Phase 181: JsonParser loop analysis
- Pattern detection: `src/mir/builder/control_flow/joinir/patterns/detection.rs` - Pattern detection: `src/mir/builder/control_flow/joinir/patterns/detection.rs`
- P1/P2 lowerers: `src/mir/builder/control_flow/joinir/patterns/pattern{1,2}_*.rs` - P1/P2 lowerers: `src/mir/builder/control_flow/joinir/patterns/pattern{1,2}_*.rs`
Status: Historical

View File

@ -238,3 +238,4 @@ To support `_parse_number` and `_atoi` fully, we need:
- Phase 181: JsonParser loop inventory - Phase 181: JsonParser loop inventory
- Phase 171-C: LoopBodyCarrierPromoter original design - Phase 171-C: LoopBodyCarrierPromoter original design
- Phase 170-D: LoopConditionScopeBox implementation - Phase 170-D: LoopConditionScopeBox implementation
Status: Historical

View File

@ -372,3 +372,4 @@ loop(i < 5) {
- **Phase 171-C**: LoopBodyCarrierPromoter original design - **Phase 171-C**: LoopBodyCarrierPromoter original design
- **carrier_update_emitter.rs**: Current update emission logic - **carrier_update_emitter.rs**: Current update emission logic
- **condition_env.rs**: Condition variable environment design - **condition_env.rs**: Condition variable environment design
Status: Historical

View File

@ -674,3 +674,4 @@ If full expression lowering is too complex, **Phase 186-simple** could:
2. **Testing earlier would have caught this**: Phase 184 should have had E2E test 2. **Testing earlier would have caught this**: Phase 184 should have had E2E test
3. **Phase 185 assumption was wrong**: Assumed init lowering was done, it wasn't 3. **Phase 185 assumption was wrong**: Assumed init lowering was done, it wasn't
4. **Clear scope boundaries needed**: "Infrastructure" vs "Full implementation" 4. **Clear scope boundaries needed**: "Infrastructure" vs "Full implementation"
Status: Historical

View File

@ -529,3 +529,4 @@ loop(...) {
## Changelog ## Changelog
- **2025-12-09**: Initial design document created - **2025-12-09**: Initial design document created
Status: Historical

View File

@ -410,3 +410,4 @@ Phase 187 establishes a clear design for string update handling in JoinIR:
**No code changes in Phase 187**—all design decisions documented for Phase 188+ implementation. **No code changes in Phase 187**—all design decisions documented for Phase 188+ implementation.
**Next Phase**: Phase 188 - Implement StringAppendChar/Literal lowering (3-4 hours estimate). **Next Phase**: Phase 188 - Implement StringAppendChar/Literal lowering (3-4 hours estimate).
Status: Historical

View File

@ -412,3 +412,4 @@ Three minimal test files created for verification:
**Report Status**: ✅ Complete **Report Status**: ✅ Complete
**Next Action**: Update CURRENT_TASK.md and roadmap documents **Next Action**: Update CURRENT_TASK.md and roadmap documents
Status: Historical

View File

@ -350,3 +350,4 @@ static box Main {
🤖 **Created by**: Claude Code 🤖 **Created by**: Claude Code
📅 **Date**: 2025-12-05 📅 **Date**: 2025-12-05
🎯 **Target**: Phase 189 - Select Instruction MIR Bridge Implementation 🎯 **Target**: Phase 189 - Select Instruction MIR Bridge Implementation
Status: Historical

View File

@ -980,3 +980,4 @@ Assignment {
- **E2E 結果**: `phase190_atoi_impl.hako` → 12 ✅、`phase190_parse_number_impl.hako` → 123 ✅ - **E2E 結果**: `phase190_atoi_impl.hako` → 12 ✅、`phase190_parse_number_impl.hako` → 123 ✅
- **制約**: body-local 変数 assignment は JoinIR 未対応Phase 186 残タスク) - **制約**: body-local 変数 assignment は JoinIR 未対応Phase 186 残タスク)
- ExitLine contract Verifier 追加(`#[cfg(debug_assertions)]` - ExitLine contract Verifier 追加(`#[cfg(debug_assertions)]`
Status: Historical

View File

@ -289,3 +289,4 @@ Phase 191 で以下が達成されました:
- `apps/tests/phase191_body_local_atoi.hako`(新規作成) - `apps/tests/phase191_body_local_atoi.hako`(新規作成)
- `apps/tests/phase190_atoi_impl.hako`(退行確認) - `apps/tests/phase190_atoi_impl.hako`(退行確認)
- `apps/tests/phase190_parse_number_impl.hako`(退行確認) - `apps/tests/phase190_parse_number_impl.hako`(退行確認)
Status: Historical

View File

@ -598,3 +598,4 @@ When running a test with complex addend pattern:
- **2025-12-09**: Initial design document (Section 1-8) - **2025-12-09**: Initial design document (Section 1-8)
- **2025-12-09**: Implementation complete (Section 9) - **2025-12-09**: Implementation complete (Section 9)
Status: Historical

View File

@ -105,4 +105,5 @@ No pattern depends on function names (e.g. `"main"`) or specific variable names
- Multiple carrier variables - Multiple carrier variables
- More complex continue/break combinations - More complex continue/break combinations
- Align LoopForm/LoopScopeShape-based detection with this AST-based pipeline so both views are consistent. - Align LoopForm/LoopScopeShape-based detection with this AST-based pipeline so both views are consistent.
Status: Historical

View File

@ -665,3 +665,4 @@ Phase 193 では **ConditionEnv を「ループパラメータ専用 view」と
> 「テーブル+メソッド呼び出し」のような複合パターンは、次の箱(または .hako 側のリライト)案件にする。 > 「テーブル+メソッド呼び出し」のような複合パターンは、次の箱(または .hako 側のリライト)案件にする。
→ **Phase 194+ は Option C実戦投入優先を推奨** → **Phase 194+ は Option C実戦投入優先を推奨**
Status: Historical

View File

@ -201,3 +201,4 @@ Phase 193 achieves complete modularization and enhancement of JoinIR loop loweri
- **ValueId Allocation**: Currently uses `max(variable_map) + 1` strategy. Future: delegate to builder's proper ValueId allocator. - **ValueId Allocation**: Currently uses `max(variable_map) + 1` strategy. Future: delegate to builder's proper ValueId allocator.
- **Debugging**: Environment variable `NYASH_TRACE_EXIT_BINDING=1` will be useful for debugging Phase 193-5 integration. - **Debugging**: Environment variable `NYASH_TRACE_EXIT_BINDING=1` will be useful for debugging Phase 193-5 integration.
- **Next Phase**: Phase 194 can now focus on advanced pattern detection without carrier handling complexity. - **Next Phase**: Phase 194 can now focus on advanced pattern detection without carrier handling complexity.
Status: Historical

View File

@ -362,3 +362,4 @@ Output example:
- [ ] loop_continue_multi_carrier.hako test passes with correct output - [ ] loop_continue_multi_carrier.hako test passes with correct output
- [ ] Variable map correctly reflects post-loop carrier state - [ ] Variable map correctly reflects post-loop carrier state
- [ ] Debugging environment variable works as expected - [ ] Debugging environment variable works as expected
Status: Historical

View File

@ -572,3 +572,4 @@ let structure_only = match std::env::var("NYASH_JOINIR_STRUCTURE_ONLY") {
3. Multiple MethodCalls 未対応 3. Multiple MethodCalls 未対応
**全体評価**: Phase 194 は「検証フェーズ」として大成功。次の Phase への明確な道筋を示した。 **全体評価**: Phase 194 は「検証フェーズ」として大成功。次の Phase への明確な道筋を示した。
Status: Historical

View File

@ -319,3 +319,4 @@ Phase 194 is about **validating existing infrastructure**, not adding new functi
- **Multiple MethodCalls**: Needs Phase 195+ design - **Multiple MethodCalls**: Needs Phase 195+ design
This inventory provides a clear roadmap for future JoinIR expansion based on real-world loop patterns. This inventory provides a clear roadmap for future JoinIR expansion based on real-world loop patterns.
Status: Historical

View File

@ -86,4 +86,5 @@ pub fn trace() -> &'static JoinLoopTrace
- Phase 194 は **挙動を変えない** リファクタフェーズ(観測レイヤーの整形)として扱う。 - Phase 194 は **挙動を変えない** リファクタフェーズ(観測レイヤーの整形)として扱う。
- Loop パターンや ExitBinding まわりは Phase 193/196/197 で安定しているので、それを壊さない形でログだけを寄せることが目的。 - Loop パターンや ExitBinding まわりは Phase 193/196/197 で安定しているので、それを壊さない形でログだけを寄せることが目的。
Status: Historical

View File

@ -625,3 +625,4 @@ Section 7.2 の Phase 195 を完了マークに更新:
- 設計書に基づく実装 - 設計書に基づく実装
- 単一責任の原則維持 - 単一責任の原則維持
- ドキュメント駆動開発 - ドキュメント駆動開発
Status: Historical

View File

@ -692,3 +692,4 @@ MIR (壊れている):
- P3 Lowerer は複数キャリア対応完了 ✅ - P3 Lowerer は複数キャリア対応完了 ✅
- ExitLine/CarrierVar は既に対応済み(変更不要)✅ - ExitLine/CarrierVar は既に対応済み(変更不要)✅
- JoinIR→MIR bridge の Select バグは別 Issue として分離 ✅ - JoinIR→MIR bridge の Select バグは別 Issue として分離 ✅
Status: Historical

View File

@ -219,3 +219,4 @@ RC: 0
### 成果 ### 成果
- Phase 195 の Multi-carrier Pattern 3 が完全動作 - Phase 195 の Multi-carrier Pattern 3 が完全動作
- 既存 Pattern 1/2/3 に退行なし - 既存 Pattern 1/2/3 に退行なし
Status: Historical

View File

@ -597,3 +597,4 @@ bb10:
### コミット ### コミット
- **[996925eb]** fix(joinir): Phase 196 Select double-remap bug in instruction_rewriter - **[996925eb]** fix(joinir): Phase 196 Select double-remap bug in instruction_rewriter
Status: Historical

View File

@ -213,3 +213,4 @@ for idx in 1..=carrier_info.carriers.len() {
- Created Phase 196 documentation (Task 196-1) - Created Phase 196 documentation (Task 196-1)
- Identified root cause: hardcoded ExitMeta::single() and join_inputs - Identified root cause: hardcoded ExitMeta::single() and join_inputs
- Task investigation completed by Agent - Task investigation completed by Agent
Status: Historical

View File

@ -443,3 +443,4 @@ NYASH_JOINIR_CORE=1 ./target/release/hakorune apps/tests/phase182_p1_match_liter
- `docs/development/current/main/phase194-loop-inventory.md`(ループ一覧) - `docs/development/current/main/phase194-loop-inventory.md`(ループ一覧)
- `docs/development/current/main/joinir-architecture-overview.md`(実戦適用状況表) - `docs/development/current/main/joinir-architecture-overview.md`(実戦適用状況表)
- `CURRENT_TASK.md`Phase 197 セクション) - `CURRENT_TASK.md`Phase 197 セクション)
Status: Historical

View File

@ -141,3 +141,4 @@ After implementation:
- Test case: `apps/tests/loop_continue_multi_carrier.hako` - Test case: `apps/tests/loop_continue_multi_carrier.hako`
- Lowerer: `src/mir/join_ir/lowering/loop_with_continue_minimal.rs` - Lowerer: `src/mir/join_ir/lowering/loop_with_continue_minimal.rs`
- Pattern detection: `src/mir/builder/control_flow/joinir/patterns/pattern4_with_continue.rs` - Pattern detection: `src/mir/builder/control_flow/joinir/patterns/pattern4_with_continue.rs`
Status: Historical

View File

@ -0,0 +1,9 @@
# Phase 33 Archive (JoinIR 初期フェーズ)
Status: Historical
Scope: Phase 33 の JoinIR 初期フェーズに関する設計/分析/実装メモを集約。
Phase 33 で書かれた JoinIR の初期ドキュメントはこのフォルダに集めたよ。
現行設計は `docs/development/current/main/joinir-architecture-overview.md`SSOT
`docs/development/current/main/01-JoinIR-Selfhost-INDEX.md`(入口)を参照してね。

View File

@ -253,3 +253,4 @@ bb10:
**Created**: 2025-12-06 **Created**: 2025-12-06
**Status**: Analysis Complete, Ready for Implementation **Status**: Analysis Complete, Ready for Implementation
**Priority**: HIGH (Correctness Issue) **Priority**: HIGH (Correctness Issue)
Status: Historical

View File

@ -164,3 +164,4 @@ bb10:
``` ```
The PHI instruction for `sum_merged = Select(continue_cond, sum_param, sum_next)` (line 304 in loop_with_continue_minimal.rs) is being lost during merge. The PHI instruction for `sum_merged = Select(continue_cond, sum_param, sum_next)` (line 304 in loop_with_continue_minimal.rs) is being lost during merge.
Status: Historical

View File

@ -628,3 +628,4 @@ if merge_block.instructions.iter().any(|inst| {
**Phase 33-10完了判定**: PHIチェック追加のみで完了とする **Phase 33-10完了判定**: PHIチェック追加のみで完了とする
**次のフェーズ**: Phase 33-11IfMerge実装、またはPhase 34へ移行 **次のフェーズ**: Phase 33-11IfMerge実装、またはPhase 34へ移行
Status: Historical

View File

@ -397,3 +397,4 @@ if let Some(phi_dst) = carrier_phis.get(&binding.carrier_name) {
## Date: 2025-12-07 ## Date: 2025-12-07
## Status: In Progress - Design Phase Complete! ## Status: In Progress - Design Phase Complete!
Status: Historical

View File

@ -502,3 +502,4 @@ Phase 33-16 transforms exit value handling from "skip and hope" to "SSA-correct
5. Passing correct values to ExitLineOrchestrator (Phase 6) 5. Passing correct values to ExitLineOrchestrator (Phase 6)
This eliminates SSA-undef errors while maintaining clear separation of concerns and backward compatibility. This eliminates SSA-undef errors while maintaining clear separation of concerns and backward compatibility.
Status: Historical

View File

@ -242,4 +242,5 @@ Boundary 構造体自体には新フィールドを足さず、
4. 上記テスト戦略に沿って回帰テスト・SSA 検証を行う。 4. 上記テスト戦略に沿って回帰テスト・SSA 検証を行う。
実装時に設計が変わった場合は、このファイルと `joinir-architecture-overview.md` を SSOT として必ず更新すること。 実装時に設計が変わった場合は、このファイルと `joinir-architecture-overview.md` を SSOT として必ず更新すること。
Status: Historical

View File

@ -299,3 +299,4 @@ merge_joinir_mir_blocks() {
**Replace skip logic**: Yes, with fallback mechanism for backward compatibility **Replace skip logic**: Yes, with fallback mechanism for backward compatibility
**The magic**: Loop header PHI dst (allocated in Phase 3.5, finalized in Phase 4.5) is SSA-defined and can be safely used in exit values instead of parameters! **The magic**: Loop header PHI dst (allocated in Phase 3.5, finalized in Phase 4.5) is SSA-defined and can be safely used in exit values instead of parameters!
Status: Historical

View File

@ -137,3 +137,4 @@ The original code worked but required deep knowledge to maintain. The refactorin
**Related Files**: **Related Files**:
- `src/mir/builder/control_flow/joinir/merge/instruction_rewriter.rs` (refactored) - `src/mir/builder/control_flow/joinir/merge/instruction_rewriter.rs` (refactored)
- `docs/development/current/main/phase33-16-self-loop-fix.md` (original bug fix) - `docs/development/current/main/phase33-16-self-loop-fix.md` (original bug fix)
Status: Historical

View File

@ -465,3 +465,4 @@ jq '.functions[0].blocks[0].instructions[0:3]' mir.json # First 3 instructions
| 6 | ExitLineOrchestrator | carrier_phis | var_map updated | existing | | 6 | ExitLineOrchestrator | carrier_phis | var_map updated | existing |
**Total changes**: ~6 locations, ~100 lines added/modified, 0 lines removed (backward compat) **Total changes**: ~6 locations, ~100 lines added/modified, 0 lines removed (backward compat)
Status: Historical

View File

@ -207,3 +207,4 @@ instruction_rewriter.rs (589行)
**Build**: Success1m 03s **Build**: Success1m 03s
**Tests**: All Pass **Tests**: All Pass
**Next**: Phase 33-17-B 実施検討 **Next**: Phase 33-17-B 実施検討
Status: Historical

View File

@ -207,3 +207,4 @@ pub fn classify(features: &LoopFeatures) -> LoopPatternKind {
**作成日**: 2025-12-07 **作成日**: 2025-12-07
**Phase**: 33-18 (Design Only) **Phase**: 33-18 (Design Only)
Status: Historical

View File

@ -140,4 +140,5 @@ LoopBuilder 完全削除後の JoinIR ループラインにおいて、
このフェーズで「LoopBuilder 無しの JoinIR ループ出口ラインの基礎」は固まったので、 このフェーズで「LoopBuilder 無しの JoinIR ループ出口ラインの基礎」は固まったので、
今後は continue 系と JsonParserBox のような実アプリ側ロジックを順番に乗せていく段階に入る。** 今後は continue 系と JsonParserBox のような実アプリ側ロジックを順番に乗せていく段階に入る。**
Status: Historical

View File

@ -384,3 +384,4 @@ sum=9, RC: 0 ✅
- JoinIRConversionPipeline: `src/mir/builder/control_flow/joinir/patterns/conversion_pipeline.rs` - JoinIRConversionPipeline: `src/mir/builder/control_flow/joinir/patterns/conversion_pipeline.rs`
- Phase 33-23 fix: boundary.loop_var_name setting - Phase 33-23 fix: boundary.loop_var_name setting
- Pattern 1-4: `src/mir/builder/control_flow/joinir/patterns/pattern*.rs` - Pattern 1-4: `src/mir/builder/control_flow/joinir/patterns/pattern*.rs`
Status: Historical

View File

@ -222,3 +222,4 @@ Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
**作成者**: Claude Code (Sonnet 4.5) **作成者**: Claude Code (Sonnet 4.5)
**承認**: 要ユーザーレビュー **承認**: 要ユーザーレビュー
Status: Historical

Some files were not shown because too many files have changed in this diff Show More