Files
hakorune/docs/development/current/main/investigations
nyash-codex a955dd6b18 feat(llvm): Phase 131-15 - print/concat segfault 根治修正
## P1-1/P1-2: TypeFacts 優先化
- binop.py: operand facts が dst_type ヒントより優先
- mir_json_emit.rs: Unknown 時に dst_type を出さない
- function_lower.py: value_types を metadata から読み込み

## P2: handle concat 統一(根治)
- print シグネチャ修正: i64(i64) → void(i8*)
- Mixed concat を handle ベースに統一:
  - concat_si/concat_is → concat_hh
  - box.from_i64 で integer を handle 化
  - Everything is Box 哲学に統一
- legacy 関数は互換性のために保持

## 結果
-  print("Result: " + 3) → Result: 3
-  segfault 解消
-  Everything is Box 統一

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 01:36:34 +09:00
..

Investigations Folder

This folder contains investigation notes and analysis for debugging sessions.

Active Investigations

Phase 131-12: LLVM Wrong Result (Case C)

Status: Root cause identified Problem: LLVM backend returns wrong results for loop exit values Root Cause: vmap object identity mismatch between Pass A and Pass C

Key Documents:

  1. phase131-12-case-c-llvm-wrong-result.md - Initial investigation scope
  2. phase131-12-p1-vmap-identity-analysis.md - Detailed trace analysis
  3. phase131-12-p1-trace-summary.md - Executive summary with fix recommendations

Quick Summary:

  • Bug: Pass A deletes _current_vmap before Pass C runs
  • Impact: Terminators use wrong vmap object, missing all Pass A writes
  • Fix: Store vmap_cur in deferred_terminators tuple (Option 3)

Next Steps:

  1. Implement Option 3 fix in block_lower.py
  2. Add Fail-Fast check in instruction_lower.py
  3. Verify with NYASH_LLVM_VMAP_TRACE=1
  4. Run full test suite

Trace Environment Variables

Phase 131-12-P1 Traces

NYASH_LLVM_VMAP_TRACE=1    # Object identity and vmap keys tracing
NYASH_LLVM_USE_HARNESS=1   # Enable llvmlite harness
NYASH_LLVM_DUMP_IR=<path>  # Save LLVM IR to file

Investigation Workflow

  1. Scope - Define problem and test case (phase131-12-case-c-*.md)
  2. Trace - Add instrumentation and collect data (phase131-12-p1-vmap-identity-*.md)
  3. Analysis - Identify root cause with evidence (phase131-12-p1-trace-summary.md)
  4. Fix - Implement solution with validation
  5. Document - Update investigation notes with results

Archive

Completed investigations are kept for reference and pattern recognition.