diff --git a/docs/development/current/main/10-Now.md b/docs/development/current/main/10-Now.md index 15ad1585..672b4743 100644 --- a/docs/development/current/main/10-Now.md +++ b/docs/development/current/main/10-Now.md @@ -1,8 +1,8 @@ # Self Current Task — Now (main) -## Current Focus: Phase 29y(post self-host, docs-first)/ Phase 285(lifecycle follow-ups) +## Current Focus: Phase 285 P3(LLVM one-pass)/ Phase 29y(post self-host, docs-first) -Phase 285 は weak conformance を固めて hidden root まで根治済み。次は post self-host の Phase 29y(MIR lifecycle vocab freeze相談)を docs-first で進めつつ、Phase 285 の残差分(finalizer/GC/LLVM parity)を小刻みに潰す。 +Phase 285 は VM 側の weak conformance と hidden root を根治済み。次は “LLVM backend を有効化して integration を一気通貫で通す” を最小ゲートとして固定する(P3)。その後に post self-host の Phase 29y(MIR lifecycle vocab freeze相談)を docs-first で進める。 **2025-12-26: Phase 285 P2 完了** ✅ - weak の意味論(`weak ` + `weak_to_strong()` 成功)を integration smoke で固定 diff --git a/docs/development/current/main/30-Backlog.md b/docs/development/current/main/30-Backlog.md index d2d54cf6..e24f460b 100644 --- a/docs/development/current/main/30-Backlog.md +++ b/docs/development/current/main/30-Backlog.md @@ -41,6 +41,7 @@ Related: - P0/P1/P2 ✅ 完了(weak 成功パターンは smoke 固定) - P2.1 ✅ 完了: hidden root を根治し、weak-fail smoke を PASS に復帰 - P2.2 ✅ 完了: KeepAlive の二重責務を命令分離で解消(`KeepAlive`/`ReleaseStrong`) + - P3(planned): LLVM one-pass(`--features llvm` で integration を通す最小ゲート) - 参考(現状の入口候補): - weakref 表現: `src/value.rs`(`NyashValue::WeakBox`) - finalization: `src/finalization.rs` diff --git a/docs/development/current/main/phases/phase-285/P3-INSTRUCTIONS.md b/docs/development/current/main/phases/phase-285/P3-INSTRUCTIONS.md new file mode 100644 index 00000000..8f933b86 --- /dev/null +++ b/docs/development/current/main/phases/phase-285/P3-INSTRUCTIONS.md @@ -0,0 +1,39 @@ +# Phase 285 P3: LLVM One-Pass(VM/LLVM 一気通貫の最小ゲート) + +目的: VM/LLVM の差分が “SKIPのまま固定” にならないように、LLVM を有効化したビルドで integration smoke を 1 回通す導線を SSOT 化する。 + +## 前提 + +- quick gate は常に緑: `./tools/smokes/v2/run.sh --profile quick` +- LLVM backend が無効なビルドでは、LLVM smoke は理由付き SKIP になる(想定挙動)。 + +## Step 1: LLVM を有効化してビルド + +```bash +cargo build --release --features llvm +``` + +## Step 2: 既存 fixture を LLVM で一気通貫(integration) + +この Phase では “新しい fixture を増やさず”、既に作った以下を使う: + +- return-in-loop: `apps/tests/phase286_pattern5_return_min.hako`(Phase 284 P2 再利用) +- weak upgrade success/fail: `apps/tests/phase285_weak_basic.hako`, `apps/tests/phase285_p2_weak_upgrade_fail_min.hako` + +実行(integration の該当 smoke をまとめて流す): + +```bash +./tools/smokes/v2/run.sh --profile integration --filter "*phase284_p2_return_in_loop_llvm*|*phase285_p2_weak_upgrade_*_llvm*" +``` + +## Step 3: 結果の分類(SSOT) + +- PASS: VM/LLVM parity が成立 +- SKIP: 「LLVM backend not available」など、ビルド条件に起因(P3 では許容。ただし “llvm feature を有効にしても SKIP” は要調査) +- FAIL: 実装差分。Phase 285 の差分分類(A/B/C/D)へ追加して次の小タスクに切る + +## 受け入れ条件 + +- `cargo build --release --features llvm` が通る +- 上記 integration filter が PASS または理由付き SKIP +- quick gate が緑(154/154 PASS) diff --git a/docs/development/current/main/phases/phase-285/README.md b/docs/development/current/main/phases/phase-285/README.md index 28d8ad46..b0029a52 100644 --- a/docs/development/current/main/phases/phase-285/README.md +++ b/docs/development/current/main/phases/phase-285/README.md @@ -5,6 +5,7 @@ Status: P0/P1/P2/P2.1/P2.2 ✅ COMPLETE (2025-12-26) ## Next (P0 docs-only → P1/P2) - P0 手順書: `docs/development/current/main/phases/phase-285/P0-INSTRUCTIONS.md` +- P3 手順書(LLVM one-pass): `docs/development/current/main/phases/phase-285/P3-INSTRUCTIONS.md` - 言語レベルSSOT: - lifecycle/weak/fini/GC: `docs/reference/language/lifecycle.md` - `null`/`void`/truthiness: `docs/reference/language/types.md` @@ -20,10 +21,10 @@ P2 の weak-fail fixture(明示 drop `x = null`)が “失敗→null” に ### Fix(要旨) -MIR 命令 `KeepAlive` を “スコープ維持 / 上書きdrop” の両方に使い分ける。 +MIR 命令を “スコープ維持 / 上書きdrop” に分離して、言語スコープを優先しつつ hidden root を根治する。 -- `drop_after=false`(scope-end keepalive): スコープ終端まで値を生存維持(language scope semantics) -- `drop_after=true`(overwrite drop): 変数上書き前の旧値を解放(weak-fail を成立させる) +- `KeepAlive { values }`(scope-end keepalive): スコープ終端まで値を生存維持(language scope semantics) +- `ReleaseStrong { values }`(overwrite drop): 変数上書き前の旧値を解放(weak-fail を成立させる) - SSA `Copy` により同一 `Arc` を複数 `ValueId` が参照するため、VM は **alias も含めて** `regs` から除去する 実装の責務分離(hygiene):