Apply Phase 256.8 SSOT fix to Pattern4/6/7: - Use join_module.entry.params.clone() instead of hardcoded ValueIds - Add fail-fast validation for params count mismatch - Remove ValueId(0), ValueId(PARAM_MIN + k) patterns - Clean up unused PARAM_MIN imports This prevents entry_param_mismatch errors structurally and maintains consistency with Pattern2/3. Changes: - pattern4_with_continue.rs: Lines 442-476 (SSOT extraction + validation) - pattern6_scan_with_init.rs: Lines 447-471 (SSOT extraction + validation) - pattern7_split_scan.rs: Lines 495-526 (SSOT extraction + validation) All patterns now use the same SSOT principle: 1. Extract entry function (priority: join_module.entry → fallback "main") 2. Use params as SSOT: join_inputs = entry_func.params.clone() 3. Build host_inputs in expected order (pattern-specific) 4. Fail-fast validation: join_inputs.len() == host_inputs.len() Verification: - cargo build --release: ✅ PASS (no PARAM_MIN warnings) - Quick profile: ✅ First FAIL still json_lint_vm (baseline maintained) - Pattern6 smoke: ✅ PASS (index_of test) - Pattern7 smoke: Pre-existing phi pred mismatch (not introduced by SSOT) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
66 lines
3.5 KiB
Markdown
66 lines
3.5 KiB
Markdown
# CURRENT_TASK (moved)
|
||
|
||
Status: SSOT
|
||
Scope: Repo root の旧リンク互換。現行の入口は `docs/development/current/main/10-Now.md`。
|
||
|
||
- Now: `docs/development/current/main/10-Now.md`
|
||
- Backlog: `docs/development/current/main/30-Backlog.md`
|
||
|
||
---
|
||
|
||
## Handoff (current)
|
||
|
||
### 状況(SSOT)
|
||
|
||
- 現行の入口: `docs/development/current/main/10-Now.md`
|
||
- 次の候補: `docs/development/current/main/30-Backlog.md`
|
||
- Design goal: `docs/development/current/main/design/join-explicit-cfg-construction.md`
|
||
|
||
### 直近の道筋(JoinIR / Normalized)
|
||
|
||
### 設計方針メモ(SSOT候補)
|
||
|
||
- ExprLowererBox(式SSOT)
|
||
- 役割: `AST(expr)` → `(prelude: Vec<Inst>, value: ValueId)`(ANF含む)
|
||
- pure/impure/whitelist/strict の契約を集約(入口SSOT)
|
||
- ConditionLowererBox(条件→分岐SSOT)
|
||
- 役割: `AST(cond)` → `BranchPlan`(短絡なら分岐語彙で組む)
|
||
- 評価順は ExprLowererBox に委譲(ANFで順序固定)
|
||
- `&&/||` は制御として扱い、式で無理しない
|
||
- ControlLowererBox(制御SSOT)
|
||
- 役割: `StepNode/ControlTree` → JoinIR(継続 + env)
|
||
- `if/loop` はここ、条件の中身は ConditionLowererBox に委譲
|
||
|
||
- Phase 139: if-only `post_k` の return lowering を `ReturnValueLowererBox` に統一(DONE)
|
||
- `docs/development/current/main/phases/phase-139/README.md`
|
||
- Phase 140: `NormalizedExprLowererBox` 初版(pure expression のみ)(DONE)
|
||
- SSOT: `docs/development/current/main/design/normalized-expr-lowering.md`
|
||
- `docs/development/current/main/phases/phase-140/README.md`
|
||
- Phase 141 P0: impure 拡張点(contract)を SSOT 化(Call/MethodCall はまだ out-of-scope)(DONE)
|
||
- `docs/development/current/main/phases/phase-141/README.md`
|
||
- Phase 141 P1: “既知 intrinsic だけ” を許可して段階投入(DONE)
|
||
- `docs/development/current/main/phases/phase-141/README.md`
|
||
- Phase 141 P1.5: known intrinsic registry + available_inputs 3-source merge + diagnostics(DONE)
|
||
- `docs/development/current/main/phases/phase-141/README.md`
|
||
- Phase 142-loopstmt P0: 正規化単位を statement(loop 1個)へ寄せる(DONE)
|
||
- `docs/development/current/main/phases/phase-142-loopstmt/README.md`
|
||
- Phase 142-loopstmt P1: LLVM EXE smoke(同 fixture)を追加(DONE)
|
||
- `docs/development/current/main/phases/phase-142-loopstmt/README.md`
|
||
- Phase 141 P2+: Call/MethodCall(effects + typing)を分離して段階投入
|
||
- Historical context: `docs/development/current/main/investigations/joinir-generalization-study.md`
|
||
- Phase 143-loopvocab P0/P1: loop 内 if/break/continue の語彙追加(DONE)
|
||
- `docs/development/current/main/phases/phase-143-loopvocab/README.md`
|
||
- Phase 143-loopvocab P2: else 対称化(B-C / C-B)(DONE)
|
||
- `docs/development/current/main/phases/phase-143-loopvocab/README.md`
|
||
- Phase 145-anf P0/P1/P2: ANF(impure hoist + 再帰的線形化)(DONE)
|
||
- `docs/development/current/main/phases/phase-145-anf/README.md`
|
||
- Phase 146(in progress): Loop/If 条件式へ ANF を横展開(順序固定と診断)
|
||
- `docs/development/current/main/phases/phase-146/README.md`
|
||
|
||
## Resolved (historical)
|
||
|
||
### WSL EXDEV / cargo build failure (resolved)
|
||
|
||
- 2025-12-18: `Invalid cross-device link (os error 18)` により `cargo build` が失敗する事象があったが、`wsl --shutdown` 再起動後に復旧。
|
||
- 再発時のワークアラウンド: `tools/build_llvm.sh` は EXDEV を避けるため `TMPDIR` を `target/...` 配下へ寄せる。
|