Commit Graph

10 Commits

Author SHA1 Message Date
97c65a9e6f docs: Phase 107 plan (find_balanced_array_end) 2025-12-17 22:21:42 +09:00
712e1ad755 docs: update Phase104 status and JoinIR map 2025-12-17 21:47:37 +09:00
8ab95666c8 docs: Phase 100 pinned read-only captures plan 2025-12-17 05:03:07 +09:00
7ab459503b feat(joinir): Phase 94 - P5b escape full E2E (derived ch + +1/+2) 2025-12-17 00:59:33 +09:00
93e62b1433 docs(phase93): Phase 93 P0完了記録 & ドキュメント整理
## 追加
- docs/development/current/main/phases/phase-93/README.md
  - Phase 93 P0 (ConditionOnly Derived Slot) 完了記録
  - 実装内容・テスト結果の詳細

## 更新
- CURRENT_TASK.md: Phase 93 P0完了に伴う更新
- 10-Now.md: 現在の進捗状況更新
- 30-Backlog.md: Phase 92/93関連タスク整理
- phase-91/92関連ドキュメント: historical化・要約化

## 削減
- 735行削減(historical化により詳細をREADMEに集約)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-16 23:30:39 +09:00
ec1ff5b766 docs: update Phase 137-1 completion status and Phase 2 roadmap
## Summary
Loop Canonicalizer Phase 1(型定義)の完了と、Phase 2(dev-only 観測)への
ロードマップを記録。

## Changes

### loop-canonicalizer.md
- Status: Design (P0) → Phase 1 done(型定義まで)
- 実装の入口を明記(src/mir/loop_canonicalizer/mod.rs)
- NYASH_LOOP_ROUTING_TRACE → joinir_dev_enabled() に変更
  (新 ENV を増やさず、既存のスイッチに寄せる)

### CURRENT_TASK.md
- Phase 137-1 完了を追記
- P0 を「設計」→「Phase 2(dev-only 観測)」へ更新

### phases/README.md
- Phase 137 を追加

### phases/phase-137/README.md (NEW)
- Phase 1 完了サマリ
- Phase 2 予定を最小で記録

### joinir-design-map.md / 01-JoinIR-Selfhost-INDEX.md
- loop-canonicalizer への導線を追加

## Next Steps

Phase 2: dev-only 観測の導入
- canonicalize_loop_expr() の薄い入口を追加
- joinir_dev_enabled() 配下でログ出し
- 既定挙動は完全不変

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-16 05:10:29 +09:00
84ded8ca6c docs: add loop canonicalizer SSOT + MirBuilder entrypoint 2025-12-16 04:37:47 +09:00
b4ef8a0023 docs: Update JoinIR design map + organize CLAUDE.md (Phase 135 follow-up)
## Changes

### joinir-design-map.md
- Added "Allocator SSOT (Phase 135)" section
  - Principle: All ValueId allocation via single allocator (ConditionContext.alloc_value)
  - Prohibited: Internal counters in ConditionLoweringBox/ExprLowerer
  - Reason: Collisions with JoinIR params (ValueId(1000+)) overwrite header PHI dst
  - Detection: --verify catches "Value %N defined multiple times"

- Added "Boundary Injection SSA (Phase 135)" section
  - Principle: condition_bindings allow aliases, but injected Copy dst must be unique
  - Fail-Fast: Error on different sources to same dst
  - Reason: Breaks MIR SSA, causes undefined behavior in VM/LLVM

- Added "Box Implementation Checklist"
  - 4-point checklist for Box implementation/changes
  - Covers: --verify, smoke tests, allocator usage, boundary injection

### CLAUDE.md
- Organized "重要設計書" section with clearer structure
- Added "JoinIR 設計図" subsection with both documents:
  - JoinIR アーキテクチャ概要 (normative SSOT for contracts/invariants)
  - JoinIR 設計マップ (navigation SSOT for implementation)
- Grouped related documents: JoinIR, MIR・言語仕様

## Context
Phase 135 revealed that missing "what not to do" (invariants/contracts) in
design docs led to Allocator SSOT violations and ValueId collisions.
This update ensures future Box implementations can follow clear contracts.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 19:03:05 +09:00
413504d6de feat(mir): Phase 131-11-F - MIR JSON metadata 出力実装
## 実装内容
- mir_json_emit.rs に function-level metadata 追加
- PHI 命令に dst_type ヒント追加
- v0/v1 両 emitter で実装

## 成果物
-  metadata.value_types を JSON に出力
-  PHI dst_type を metadata から取得
-  ビルド成功(0 エラー)

## JSON 出力例
```json
{
  "functions": [{
    "metadata": {
      "value_types": {
        "1": "i64",
        "3": "i64"
      }
    }
  }]
}
```

## 既知の問題(Phase 131-11-E 再調査必要)
- MIR dump で PHI が String 型のまま
- Phase 131-11-E の TypeFacts 分離が完全に動作していない可能性

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-14 19:34:02 +09:00
d3b3bf5372 feat(mir): Phase 131-11-E - TypeFacts/TypeDemands 分離(SSOT)
## 実装内容

### 1) Rust MIR Builder (ops.rs + lifecycle.rs)
- OperandTypeClass で型分類(String/Integer/Unknown)
- BinOp 型推論: Integer + Unknown → Integer
- lifecycle.rs に repropagate_binop_types() パス追加
  - PHI 型解決後に BinOp 型を再計算

### 2) JSON Emission (mir_json_emit.rs)
- 結果ベースの dst_type 発行に変更
- Integer → "i64", String → {kind: handle, box_type: StringBox}

### 3) Python LLVM Backend (binop.py)
- dst_type を確実な情報として使用
- dst_type != None なら優先して処理

## 結果
-  MIR: PHI/BinOp が Integer として正しく型付け
-  VM: `Result: 3` (正しい出力)
-  JSON: `dst_type: "i64"` を発行
-  LLVM: 別の codegen 問題の可能性あり

## SSOT 設計達成
- TypeFacts(事実): 定義命令から推論
- TypeDemands(要求): 使用箇所の coercion で吸収
- 後方伝播なし: Fail-Fast に統一

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

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-14 18:55:05 +09:00