f6adf2a43f
phase29ao(p35): ssot tag coverage and pattern1 negative gate
2025-12-30 16:55:38 +09:00
7307ff76f6
phase29ao(p34): prevent pattern2 shadow-adopt on negative cases
2025-12-30 16:06:24 +09:00
59a29a86d3
phase29ao(p33): planner-derive pattern2 loopbodylocal smokes
2025-12-30 15:58:19 +09:00
dd7f923b88
phase29ao(p32): strict adopt pattern2 realworld from facts
2025-12-30 15:28:40 +09:00
ac5231555f
phase29ao(p29): require shadow adopt tags for all gate patterns
2025-12-30 14:11:17 +09:00
ab745e958a
phase29ao(p28): add shadow adopt tags + gate smokes for p6/p7
2025-12-30 13:57:07 +09:00
52fc3f9353
phase29ao(p26): strict/dev adopt pattern2 break subset from facts
2025-12-30 13:30:28 +09:00
45369ba763
phase29ao(p25): strict/dev adopt pattern5 from facts
2025-12-30 10:58:08 +09:00
ac03b83ae6
phase29ao(p21): tighten pattern1 subset to step-only body
2025-12-30 09:38:27 +09:00
98d8eef8cb
phase29ao(p19): gate pattern1 strict shadow in regression pack
2025-12-30 09:10:35 +09:00
090a0dbbaa
phase29ao(p16): use block_params for pattern5 exit join
2025-12-30 08:31:00 +09:00
5be0ec1c66
phase29ao(p15): add pattern3 vm to joinir regression pack
2025-12-30 08:16:00 +09:00
14013cbe1f
phase29ak(p5): ctx-aware planner candidates; fix phase1883 routing
2025-12-29 15:50:57 +09:00
d673bd4fbd
docs(phase29aj): isolate phase286 pattern9 legacy smoke
2025-12-29 14:18:31 +09:00
d819fe0dae
docs(phase29aj): define joinir regression gate; isolate phase143 legacy
2025-12-29 13:44:53 +09:00
2e1bb938b4
phase29ai(p15): observe pattern2 promotion hint under strict
2025-12-29 11:37:31 +09:00
0cf6749b4a
phase29ai(p11): planner-first pattern2 break subset
2025-12-29 09:55:00 +09:00
92fd459a7c
phase29ah(p0): add phase263 pattern2 to joinir regression pack
2025-12-29 06:45:34 +09:00
bd4937d89d
phase29af(p2+p3): regression entrypoint + carrier layout ssot
2025-12-29 05:44:59 +09:00
dd8c2709bd
fix(joinir): stabilize phase1883 latch/entry preds
2025-12-28 23:39:51 +09:00
d8786ebab9
phase29ad(p3): finalize pattern6/7 fixture naming ssot
2025-12-28 17:51:11 +09:00
9c44e990a9
phase29ad(p0): split pattern6 ok vs contract fixtures
2025-12-28 17:30:34 +09:00
432a8436c7
phase29ac(p3): keep Pattern7 contract freeze; add fixup OK fixture+smoke; closeout docs
2025-12-28 17:16:36 +09:00
44e9b88930
phase29ac(p2): defreeze pattern6 matchscan by fixing fixture
2025-12-28 17:00:29 +09:00
1e1679f361
phase29ac(p1): normalize pattern6 reverse scan and flip smoke to PASS
2025-12-28 16:54:01 +09:00
720468c3a5
phase29ab(p8): add pattern6/7 ok fixtures and smokes
2025-12-28 16:00:19 +09:00
4a67757170
phase29ab(p7): add pattern6 reverse+matchscan negative smokes
2025-12-28 15:41:34 +09:00
b52788b3f6
phase29ab(p6): freeze pattern6 scan-with-init near-miss with fixture+smoke
2025-12-28 15:38:19 +09:00
bea2a8d9bb
phase29ab(p5): freeze pattern7 split-scan near-miss with fixture+smoke
2025-12-28 14:32:19 +09:00
5757eb740e
runner: preserve UTF-8 in text-merge normalization
2025-12-28 13:51:44 +09:00
fe3eb9f1f7
config: centralize NYASH_STR_CP and add cp smoke
2025-12-28 13:44:53 +09:00
10e6a15552
refactor: unify string helpers and pattern2 derived slot
2025-12-28 13:22:02 +09:00
84e1cd7c7b
phase29ab(p3): fix PromoteDecision contract and add negative smokes
2025-12-28 10:57:55 +09:00
bf9c5105c3
phase29ab(p2): add seg trim fixture+smoke and docs
2025-12-28 09:03:56 +09:00
3bd0c817be
phase29ab(p1): pattern2 carrier binding policy + loopbodylocal fixture
2025-12-28 07:19:03 +09:00
d0527bcc2a
feat(joinir): Phase 188.3-P3.3 - Pattern6 continuation generation + Call callee fix
...
Phase 3-3 完了: 4関数モデル JoinIR 生成
- nested_loop_minimal.rs (337行, 新規): 4関数モデル実装
- main(): エントリーポイント
- loop_step(i, sum): outer loop header
- inner_step(j, i_outer, sum): inner loop (tail recursion)
- k_inner_exit(i, sum): outer continuation after inner loop
- k_exit(sum): 最終 exit
- pattern6_nested_minimal.rs: lowering pipeline 実装
- boundary 構築 (continuation_func_ids 設定)
- JoinIRConversionPipeline 呼び出し
- instruction_rewriter.rs: latch incoming 拡張
- continuation→header 呼び出し対応
Call callee 修正:
- call_generator.rs: callee フィールドを Callee::Global に設定
- joinir_block_converter.rs: emit_call_pair 使用に統一
smoke test 追加:
- phase1883_nested_minimal_vm.sh (integration)
既知の問題 (次タスク):
- ValueId(104) undefined: PHI/merge 問題
- JoinIR 関数パラメータの MIR マッピングが不完全
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2025-12-27 06:51:43 +09:00
a2c5fd90fe
feat(joinir): Phase 188.3 - Pattern6 (NestedLoopMinimal) 選択ロジック実装
...
## Phase 188.3 進捗: Phase 2 完了 (6/13 tasks)
### 実装完了 ✅
**Phase 1: Fixture作成**
- apps/tests/phase1883_nested_minimal.hako 追加
- Add/Compare のみ(乗算なし)
- 期待 exit code: 9 (3×3 nested loops)
- 既存 lowering で fallback 動作確認
**Phase 2: 選択ロジック (SSOT)**
- LoopPatternContext に step_tree_max_loop_depth フィールド追加
- choose_pattern_kind() に Pattern6 選択ロジック実装:
1. Cheap check (has_inner_loop)
2. StepTree 構築 (max_loop_depth 取得)
3. AST validation (is_pattern6_lowerable)
- pattern6_nested_minimal.rs モジュール作成 (stub)
- LOOP_PATTERNS に Pattern6 entry 追加
- **検証**: Pattern6 が正しく選択される ✅
### 設計原則 (確認済み)
1. **Fail-Fast**: Pattern6 選択後は Ok(None) で逃げない
2. **outer 変数 write-back 検出 → validation false** (Phase 188.4+)
3. **最小実装**: inner local だけ、Pattern1 モデル二重化
4. **cfg! 依存なし**: production で動作
### 検証結果
```
[choose_pattern_kind] has_inner_loop=true
[choose_pattern_kind] max_loop_depth=2
[choose_pattern_kind] is_pattern6_lowerable=true
✅ Pattern6 SELECTED!
```
Stub からの期待エラー:
```
[ERROR] ❌ [Pattern6] Nested loop lowering not yet implemented
```
### 次: Phase 3 (Lowering 実装 - 推定4時間)
残りタスク:
- Phase 3-1: AST 抽出ヘルパー
- Phase 3-2: Validation ヘルパー
- Phase 3-3: Continuation 生成 (outer_step, inner_step, k_inner_exit)
- Phase 3-4: fixture が exit=9 を返すことを検証
### 変更ファイル
**新規**:
- apps/tests/phase1883_nested_minimal.hako
- src/mir/builder/control_flow/joinir/patterns/pattern6_nested_minimal.rs
- docs/development/current/main/phases/phase-188.{1,2,3}/README.md
**変更**:
- src/mir/builder/control_flow/joinir/routing.rs (Pattern6 選択)
- src/mir/builder/control_flow/joinir/patterns/router.rs (Context 拡張)
- src/mir/builder/control_flow/joinir/patterns/mod.rs (module 宣言)
🎯 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2025-12-27 05:45:12 +09:00
2e99b14e24
phase-29y.1: add lifecycle pilot plumbing (ABI shim, rc pass skeleton, root summary)
2025-12-27 02:07:10 +09:00
095213c580
refactor(smoke): Clarify auto_detect.conf responsibilities with profile parameter
...
**Problem**:
- detect_optimal_config() took no arguments (line 11)
- Quick profile SSOT forcing scattered outside function (line 134-137)
- Profile-specific logic split between detect_optimal_config() and auto_configure()
- Hard to understand flow: "why is this logic duplicated?"
**Solution** (Task 4 - Low Priority):
- Accept profile parameter: `detect_optimal_config(profile)`
- Move quick profile SSOT forcing inside function (top priority)
- Eliminate duplicate logic in auto_configure()
- Update show_auto_config() to pass profile parameter
**Changes**:
- detect_optimal_config(): Add `local profile="${1:-quick}"`
- Quick SSOT check: Move to function top (early return)
- auto_configure(): Pass `"$profile"` to detect_optimal_config
- show_auto_config(): Pass `"${SMOKES_CURRENT_PROFILE:-quick}"`
- Remove 6 lines of duplicate quick forcing logic
**Benefits**:
- Single responsibility: Profile logic inside detect_optimal_config
- Clearer flow: All detection in one function
- Maintainability: One place to modify profile behavior
- Readability: Intent is explicit (profile parameter)
**Verification**:
- ✅ detect_optimal_config "quick": returns rust_vm_dynamic (SSOT)
- ✅ detect_optimal_config "integration": returns llvm_static
- ✅ Quick profile: 154/154 PASS
**Note**: This is a low-impact refactoring (code organization only)
- Behavior unchanged (same logic, better location)
- No performance impact
- Future-proof for profile-specific detection
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2025-12-26 17:32:48 +09:00
1869396fd7
refactor(smoke): Consolidate LLVM detection to can_run_llvm() SSOT
...
**Problem**:
- LLVM availability check scattered across 9+ test files
- Duplicate grep patterns: `--version | grep -q "features.*llvm"`
- Hard to maintain when detection logic changes
- Potential SKIP hell when conditions diverge
**Solution** (Task 3 - Medium Priority):
- Create `can_run_llvm()` function in test_runner.sh (SSOT)
- Consolidate both detection methods:
1. Primary: `--version | grep features.*llvm`
2. Fallback: `strings | grep ny-llvmc|NYASH_LLVM_USE_HARNESS`
- Replace all inline checks with function call
**Files Changed**:
- test_runner.sh: Add can_run_llvm() + update run_nyash_llvm()
- 9 test files: Replace inline grep with can_run_llvm()
- quick: phase285_weak_basic_llvm.sh
- integration: phase284/285, json_{lint,pp,query}, parity tests
**Benefits**:
- Single point of maintenance (SSOT)
- Consistent LLVM detection across all tests
- Easy to extend (e.g., add Python llvmlite check)
- Prevents future SKIP divergence
**Verification**:
- ✅ phase284_p2_return_in_loop_llvm: PASS
- ✅ phase285_weak_basic_llvm: PASS
- ✅ Quick profile: 154/154 PASS
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2025-12-26 17:31:19 +09:00
d7c6df3675
refactor(smoke): Phase 284 P2 - LLVM harness exit code SSOT
...
**Problem**:
- phase284_p2_return_in_loop_llvm.sh used fallback: exit code OR output grep
- Inconsistent with exit code SSOT policy for LLVM harness tests
- Output pollution from harness logs makes grep unreliable
**Solution** (Task 1 - High Priority):
- Remove `|| echo "$OUTPUT" | grep -qE "(^7$|RC: 7$)"` fallback
- Pure exit code validation: `if [ "$EXIT_CODE" -eq 7 ]`
- OUTPUT kept for error debugging only (line 40)
- Align with phase285_p2 tests (already using exit code SSOT)
**Verification**:
- ✅ phase284_p2_return_in_loop_llvm: PASS (exit 7)
- ✅ phase285_p2_weak_upgrade_success_llvm: PASS (exit 2)
- ✅ phase285_p2_weak_upgrade_fail_llvm: PASS (exit 1)
- ✅ Quick profile: 154/154 PASS
**Impact**:
- 1 file changed, 5 lines modified
- More reliable LLVM test validation
- No regression in existing tests
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2025-12-26 17:25:25 +09:00
606e236d6d
fix(phase-285): restore weak_basic_llvm + complete LLVM detection/quick SSOT
2025-12-26 16:32:37 +09:00
3bf0dee2b0
feat(mir): Phase 285 P2.1 - KeepAlive instruction for weak ref semantics
...
Add KeepAlive instruction to fix hidden root problem where x = null
doesn't properly drop the strong reference.
Key changes:
- Add KeepAlive { values, drop_after } instruction to MIR
- Emit KeepAlive[drop=true] in build_assignment() before variable overwrite
- Emit KeepAlive[drop=false] in pop_lexical_scope() at scope end
- VM handler: when drop_after=true, remove ALL ValueIds pointing to
the same Arc (handles SSA Copy chains)
Test results:
- weak_upgrade_fail: exit 1 ✅ (weak_to_strong returns null after x=null)
- weak_basic: exit 2 ✅ (weak_to_strong succeeds while x alive)
- quick smoke: 154/154 PASS ✅
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2025-12-26 13:08:32 +09:00
58ceb3de2f
feat(smoke): Phase 285 P2 - weak conformance smokes (success pattern)
...
Phase 285 P2: weak の意味論(weak <expr> + weak_to_strong() 成功/失敗)を integration smoke で固定
実装内容:
- Fixture A(成功パターン): exit 0 → exit 2 に変更(fail=1, success=2 で明確化)
- Fixture B(失敗パターン): 明示 drop (x = null) 方式で作成
- VM smoke success: PASS
- LLVM smoke success: SKIP(backend unavailable)
- VM/LLVM smoke fail: SKIP(hidden root 問題で理由付き)
既知の問題:
- x = null で明示 drop しても weak_to_strong が成功(hidden root が strong ref を保持)
- Phase 285 P2.1 (investigation) で root 保持箇所を棚卸し予定
スコープ:
- Block scope drop conformance は別タスク(未整合の可能性あり)
- P2 では明示 drop 方式で weak の最小意味論(non-owning)のみを検証
検証:
- quick smoke 154/154 PASS 維持
- integration smoke 4本(success 2本 PASS/SKIP、fail 2本 SKIP)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2025-12-26 11:33:12 +09:00
03f9bbe1aa
feat(smoke): Phase 284 P2 - return-in-loop VM/LLVM parity smoke
...
- VM smoke: phase284_p2_return_in_loop_vm.sh (PASS)
- LLVM smoke: phase284_p2_return_in_loop_llvm.sh (SKIP if no LLVM feature)
- Reuse existing fixture: phase286_pattern5_return_min.hako (exit 7)
- P2-INSTRUCTIONS.md: 手順書作成
- quick smoke 154/154 PASS
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2025-12-26 10:45:54 +09:00
22945c190c
feat(joinir): Phase 286 P3.2 - Pattern5 Plan line (loop(true) + early exit)
...
- Pattern5InfiniteEarlyExitPlan (Return/Break variants)
- extract_pattern5_plan() for loop(true) literal only
- normalize_pattern5_return(): 5 blocks CFG (header→body→found/step)
- normalize_pattern5_break(): 6 blocks CFG with carrier PHI
- NormalizationPlanBox exclusion for Pattern5-style loops
- Fixtures: phase286_pattern5_{return,break}_min.hako
- quick smoke 154/154 PASS
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2025-12-26 09:56:34 +09:00
b235a5b6db
feat(joinir): Phase 286 P3.1 - Pattern2 Plan line 完走(after_bb PHI)
...
Pattern2(Loop with Break)を Plan/Frag SSOT へ移行。
主な変更:
- Pattern2BreakPlan 追加(DomainPlan variant)
- extract_pattern2_plan() 実装(PoC サブセット厳守)
- normalize_pattern2_break() 実装(6-block CFG, 3 PHI)
- after_bb PHI が本質: carrier_out = PHI(header: carrier_current, break_then: carrier_break)
- router に Pattern2 追加(Pattern1 より前、より具体的)
テスト:
- Fixture B (break without update): PASS (出力 11)
- quick smoke: 154/154 PASS
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2025-12-26 05:56:30 +09:00
65304ec0c4
docs(joinir): Phase 286 Pattern2調査・設計相談パケット追加
...
- phase286_pattern2_frag_poc.hako: Pattern2 PoC fixture
- phase286_pattern2_frag_poc.sh: integration smoke
- phase-286-plan-normalization-consult.md: Plan正規化の設計相談
- 10-Now.md, 30-Backlog.md: 進捗更新
- pattern2-deferred.md: 更新
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2025-12-26 04:58:38 +09:00
064cae169e
feat(joinir): Phase 286 P2.4 - Pattern8 BoolPredicateScan Plan化 PoC
...
## 概要
Pattern8 (BoolPredicateScan) を Plan extraction routing に追加。
static box 除外(Phase 269 決定)を尊重し、非 static box fixture で PoC。
## 実装内容
- Pattern8BoolPredicateScanPlan struct + DomainPlan variant
- extract_pattern8_plan(): 条件・predicate check・increment 抽出
- normalize_pattern8_bool_predicate_scan(): PoC stub(CoreExitPlan::Return 未統合)
- PLAN_EXTRACTORS テーブルに Pattern8 追加(3rd priority)
- エラーフォールバック: Plan normalization 失敗時 → legacy Pattern8 へ
## 動作フロー
Plan extraction MATCHED → normalization failed (PoC stub) → legacy Pattern8 MATCHED
## 検証結果
- Integration: phase286_pattern8_plan_poc_vm PASS (exit 7)
- Regression: quick 154 PASS, 0 FAILED
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2025-12-26 03:01:11 +09:00
1d24e9a106
feat(joinir): Phase 286 P2.3 + Phase 287 - Pattern9 Plan化 + Router table-driven
...
## Phase 286 P2.3: Pattern9 AccumConstLoop Plan化 PoC
- DomainPlan::Pattern9AccumConstLoop 追加
- PlanNormalizer::normalize_pattern9_accum_const_loop() 実装
- PHI 2本(loop_var, acc_var)
- const/var 両方 OK(sum = sum + 1 または sum = sum + i)
- Pattern9 は Pattern1 より優先(より具体的なパターン)
- Integration test: phase286_pattern9_frag_poc PASS (return: 3)
- Regression: quick 154 PASS
## Phase 287: Router table-driven Plan extraction
- PLAN_EXTRACTORS static table で Pattern6/7/4/9/1 を統一管理
- PlanExtractorEntry/PlanExtractorVariant 構造体追加
- try_plan_extractors() で ~100行 → 3行に集約
- メンテナンス性向上(新 Pattern 追加はテーブル1行追加のみ)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2025-12-26 02:38:09 +09:00