docs: update normalized_shadow references and Phase 129 status

This commit is contained in:
nyash-codex
2025-12-18 08:18:20 +09:00
parent df23a52916
commit b2af9fb297
6 changed files with 35 additions and 34 deletions

View File

@ -154,10 +154,10 @@ Phase 121 is complete. Future work:
## Known Limitations
- **Stub implementation**: Returns empty JoinModule (contract check only)
- **Phase 121 scope**: contract parityexits/writesまでを固定値の一致や JoinModule の実行は対象外)
- **If-only scope**: Loops/breaks/continues rejected
- **No value comparison**: Only contracts compared (exits/writes)
- **LLVM test incomplete**: Harness configuration needed (VM tests validate core)
- **JoinModule emission**: Phase 122+ で段階的に追加Phase 121 自体は parity の足場)
## Files Modified
@ -165,7 +165,7 @@ Phase 121 is complete. Future work:
- `src/mir/control_tree/normalized_shadow/mod.rs`
- `src/mir/control_tree/normalized_shadow/contracts.rs`
- `src/mir/control_tree/normalized_shadow/builder.rs`
- `src/mir/control_tree/normalized_shadow/parity.rs`
- `src/mir/control_tree/normalized_shadow/parity_contract.rs`
- `tools/smokes/v2/profiles/integration/apps/phase121_shadow_if_only_vm.sh`
- `tools/smokes/v2/profiles/integration/apps/phase121_shadow_if_only_llvm_exe.sh`

View File

@ -60,7 +60,7 @@
**完了** - commit \`cc1a0946b\`P2-P3 統合)
**変更**:
- \`src/mir/control_tree/normalized_shadow/parity.rs\`
- \`src/mir/control_tree/normalized_shadow/normalized_verifier.rs\`
- \`verify_normalized_structure()\` 追加
- \`src/mir/builder/calls/lowering.rs\`
- Phase 122 検証呼び出し追加

View File

@ -79,7 +79,7 @@ join_k(env_phi):
## Implementation Plan
### P0: LLVM EXE smoke for Phase 128 ✅
### P0: LLVM EXE parity baseline (Phase 128)
- Add `phase128_if_only_partial_assign_normalized_llvm_exe.sh`
- Verify VM+LLVM parity for Phase 128 baseline
@ -87,29 +87,21 @@ join_k(env_phi):
**Status**: DONE (commit e7ad3d31b)
### P1: Materialize join_k Continuation
### P1-B: Materialize join_k (if-as-last) ✅
**Target**: `src/mir/control_tree/normalized_shadow/builder.rs`
**Target**:
- `src/mir/control_tree/normalized_shadow/if_as_last_join_k.rs`
- orchestrator: `src/mir/control_tree/normalized_shadow/builder.rs`
- structure verification: `src/mir/control_tree/normalized_shadow/normalized_verifier.rs`
- contract parity: `src/mir/control_tree/normalized_shadow/parity_contract.rs`
**Changes**:
1. **lower_if_node**: Generate join_k function
- Create JoinFunction with env parameter
- then: `TailCall(join_k, env_then)`
- else: `TailCall(join_k, env_else)`
- join_k body: process post-if statements
**What is supported**:
- if-only, and the `if` is the last statement (Phase 129-B)
- then/else: TailCall(join_k) with env argument (PHI禁止)
2. **verify_normalized_structure**: Add join_k checks
- If exists → join_k exists (by name or structure)
- then/else end with TailCall (not Ret)
- join_k has params (env fields)
- No PHI instructions anywhere
**Status**: DONE (Phase 129-B: fixture + VM smoke PASS)
**Acceptance**:
- `cargo test --lib` PASS
- Phase 128 VM smoke PASS
- Phase 129 LLVM EXE smoke PASS (new fixture)
### P2: Post-If Return Var Fixture
### P2: Post-if support (return-var) 🔜
**New fixture**: `apps/tests/phase129_if_only_post_if_return_var_min.hako`
```hako
@ -122,9 +114,9 @@ x=1; flag=1; if flag==1 { x=2 }; print(x); return "OK"
- `NYASH_JOINIR_DEV=1 HAKO_JOINIR_STRICT=1`
- Verify join_k continuation works
**Acceptance**:
- VM smoke PASS
- join_k actually used (not fallback path)
**Status**:
- Fixture + VM smoke exist.
- Not yet guaranteed to run through Normalized join_k path (can still fall back).
### P3: Documentation
@ -136,7 +128,8 @@ x=1; flag=1; if flag==1 { x=2 }; print(x); return "OK"
- ✅ P0: Phase 128 LLVM EXE smoke passes
- ✅ P1-B: join_k materialized for if-as-last (then/else tail-call join_k)
- ✅ P1-B: verify_normalized_structure enforces join_k tailcall + PHI禁止
- [ ] P2: Phase 129 fixture + VM smoke passes
- ✅ P2 (setup): fixture + VM smoke exist
- [ ] P2 (behavior): post-if path runs via Normalized (no fallback)
- [ ] P3: Documentation updated
- [ ] Regression: phase103, phase118, phase128 all PASS
- [ ] `cargo test --lib` PASS
@ -147,10 +140,10 @@ x=1; flag=1; if flag==1 { x=2 }; print(x); return "OK"
# Unit tests
cargo test --lib
# Smoke tests
# Smoke tests (baseline)
bash tools/smokes/v2/profiles/integration/apps/phase128_if_only_partial_assign_normalized_vm.sh
bash tools/smokes/v2/profiles/integration/apps/phase128_if_only_partial_assign_normalized_llvm_exe.sh
bash tools/smokes/v2/profiles/integration/apps/phase129_if_only_post_if_return_var_vm.sh
bash tools/smokes/v2/profiles/integration/apps/phase129_join_k_as_last_vm.sh
# Regression
bash tools/smokes/v2/profiles/integration/apps/phase103_if_only_llvm_exe.sh