Phase 21.7 normalization: optimization pre-work + bench harness expansion

- Add opt-in optimizations (defaults OFF)
  - Ret purity verifier: NYASH_VERIFY_RET_PURITY=1
  - strlen FAST enhancement for const handles
  - FAST_INT gate for same-BB SSA optimization
  - length cache for string literals in llvmlite
- Expand bench harness (tools/perf/microbench.sh)
  - Add branch/call/stringchain/arraymap/chip8/kilo cases
  - Auto-calculate ratio vs C reference
  - Document in benchmarks/README.md
- Compiler health improvements
  - Unify PHI insertion to insert_phi_at_head()
  - Add NYASH_LLVM_SKIP_BUILD=1 for build reuse
- Runtime & safety enhancements
  - Clarify Rust/Hako ownership boundaries
  - Strengthen receiver localization (LocalSSA/pin/after-PHIs)
  - Stop excessive PluginInvoke→BoxCall rewrites
- Update CURRENT_TASK.md, docs, and canaries

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-11-13 16:40:58 +09:00
parent 9e2fa1e36e
commit dda65b94b7
160 changed files with 6773 additions and 1692 deletions

View File

@ -24,6 +24,11 @@ if [ "${HAKO_DEBUG:-0}" = "1" ]; then
export HAKO_VERIFY_SHOW_LOGS=1
fi
# Tag silence toggle (default: silent=1)
# - HAKO_SILENT_TAGS=1 → filter noisy tag lines (default)
# - HAKO_SILENT_TAGS=0 → show raw logs (no filtering)
export HAKO_SILENT_TAGS="${HAKO_SILENT_TAGS:-1}"
# グローバル変数
export SMOKES_V2_LIB_LOADED=1
export SMOKES_START_TIME=$(date +%s.%N)
@ -61,8 +66,8 @@ log_error() {
# 共通イズフィルタVM実行時の出力整形
filter_noise() {
if [ "${HAKO_SHOW_CALL_LOGS:-0}" = "1" ]; then
# Show raw logs (no filtering) to allow call traces / diagnostics
# Show raw logs (no filtering) to allow call traces / diagnostics
if [ "${HAKO_SHOW_CALL_LOGS:-0}" = "1" ] || [ "${HAKO_SILENT_TAGS}" = "0" ]; then
cat
return
fi
@ -84,6 +89,8 @@ log_error() {
| grep -v "^\[using/text-merge\]" \
| grep -v "^\[builder\]" \
| grep -v "^\\[vm-trace\\]" \
| grep -v '^\[PluginBoxFactory\]' \
| grep -v '^\[using.dylib/autoload\]' \
| grep -v "^\[vm\] Stage-3" \
| grep -v "^\[DEBUG\]" \
| grep -v '^\{"ev":' \