Commit bc3ea827

bc3ea827e489Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 1 file · ~1 modified

Description

docs(promote): record 932->937 safe-group wins (bound-method args, cvar write infer, poly-dispatch unbox, splat box)

Co-Authored-By: Claude Opus 4.8 [email protected]

Details

Commit
bc3ea827e489
Parent
d10a84c4718c

docs/promote-mode-plan.mdmodifiedView file

@@ -98,7 +98,8 @@
9898 - **★決め手 = fixpoint 後に `for id: infer_type(c,id)` で node-type cache を再構築**。codegen の `.call` は `comp_ntype(call node)`(node cache)を読むので、proc_ret を更新しても cache が stale だと `.call` が古い int slot 経路を出す。再 infer は scope local 型を読むだけで変えないので widen 不変。
9999 - 結果: proc / proc_closure / case_local_in_lambda / enum_for_each / lowered_block_given が緑、**proc の 6→0 FAIL も解消**。当初推測の「side-channel 非再入」「ABI 全面改修」は**いずれも不要だった**(真因は node-cache の refresh 漏れ)。
100100 2. **node-cache stale**: `emit_hash_key` 等が `comp_ntype(key)` の widen 前 int を読み coerce を飛ばす(int-keyed hash の poly key=bundle_class_06)。local read は `scope_local()->type` が正、generic ヘルパーは node 型依存。中央解決要。
101- 3. **残 ERR=42(932 時点、`/tmp/perr5.txt`)の散在 one-off / 深い codegen バグ**:
101+ 3. **932→937 の安全グループ landed**: bound-method 直接 `.call` の arg を `emit_arg_or_default` で param 型 coerce(method/i960)/ ClassVariableWriteNode 推論を cvar 型返し=二重 box 解消(cvar_method_first_assign)/ poly-receiver dispatch の poly arg→scalar param unbox(8313, `<=>` 前進)/ splat 展開要素を poly param へ box(splat_call)。各 g_promote_mode gate 内、default 992/0/0+optcarrot 59662 維持。
102+ **残 ERR=37(937 時点、`/tmp/perr5.txt` ≈)の散在 one-off / 深い codegen バグ**:
102103 - **poly-receiver dispatch の arg coerce 双方向**: `8313` で poly arg→scalar param の unbox arm 追加済(`<=>` 等、回帰0)。だが user `<=>`(comparable_between_user_type 等 3)は**第2ブロッカー = between?/clamp の arg-hoist g_pre 再入バグ**で残る:`sp_Temp * _t7 = sp_RbVal _t10 = ...`(`Temp.new(5)` の boxed arg hoist が外側 arg-temp decl の初期化子内に混入)。emit_dispatch(codegen_fold.c:3389)で arg を側 buffer 評価→prelude flush 後に temp decl、の順序修正が要る。
103104 - **closure_capture_float 系(3, sp_runtime.h:187 `mrb_int=sp_RbVal`)**: poly cell 導入で capture が通るようになったが、proc 本体の captured 変数の**算術が `sp_int_add(poly cell, 1)`**(comp_ntype が int、cell は poly)。proc 本体 scope の captured-var 型一致が要る。
104105 - **bound-method `.call` 直接 dispatch の raw arg**(method=sp_double / i960=sp_dbl / splat_call=sp_mix / bound_method_single_eval=sp_poly_puts / cvar_method_first_assign=sp_box_int): poly param へ int arg を box せず。