fix(stage-b): Add sh_core using + Stage-1 JSON support
## Fixed Issues
1. compiler_stageb.hako: Added 'using sh_core as StringHelpers'
- Resolved: call unresolved ParserStringUtilsBox.skip_ws/2
- Root cause: using chain resolution not implemented
- Workaround: explicit using in parent file
2. stageb_helpers.sh: Accept Stage-1 JSON format
- Modified awk pattern to accept both formats:
- MIR JSON v0: "version":0, "kind":"Program"
- Stage-1 JSON: "type":"Program"
## Remaining Issues
ParserBox VM crash: Invalid value: use of undefined value ValueId(5839)
- Cause: Complex nested loops in parse_program2()
- Workaround: Minimal Stage-B (without ParserBox) works
- Fallback: Rust compiler path available
## Verification
✅ Minimal Stage-B outputs JSON correctly
❌ ParserBox execution crashes VM (SSA bug)
Co-Authored-By: Task先生 (AI Agent)
This commit is contained in:
@ -58,7 +58,8 @@ Quick profile opt‑in switches (smokes)
|
||||
- `SMOKES_ENABLE_STAGEB_OOB=1` — Stage‑B OOB observation (array/map)
|
||||
- `SMOKES_ENABLE_OOB_STRICT=1` — Gate‑C(Core) strict OOB fail‑fast canary (`gate_c_oob_strict_fail_vm.sh`)
|
||||
- `SMOKES_ENABLE_LLVM_SELF_PARAM=1` — LLVM instruction boxes self‑param builder tests (const/binop/compare/branch/jump/ret)
|
||||
- `SMOKES_ENABLE_STAGEB=1` — Stage‑B positive canaries (emit→Gate‑C). Default OFF while v1 downconvert matures.
|
||||
- `SMOKES_ENABLE_STAGEB=1` — Stage‑B positive canaries(emit→Gate‑C)。既定OFF(安定化後に昇格予定)。
|
||||
必要に応じて各テスト内で `HAKO_STAGEB_ALLOW_FALLBACK=1` を付与(TTL; 既定OFF)。
|
||||
|
||||
Default quick canaries (regression)
|
||||
- apps/json_lint_vm.sh — JSON Lint expected outputs (OK×10 / ERROR×6)
|
||||
@ -70,11 +71,11 @@ Dispatch policy: length()
|
||||
- これにより、配列に対して誤って文字列長を返す回帰を防止する(2025‑11 修正)。
|
||||
|
||||
Deprecations
|
||||
- `NYASH_GATE_C_DIRECT` は移行中の互換トグル(TTL)だよ。将来は Gate‑C(Core)
|
||||
- `NYASH_GATE_C_DIRECT` は移行中の互換トグル(TTL)だよ。将来は Gate‑C(Core)
|
||||
直行(`HAKO_GATE_C_CORE=1`)に統一予定。新しい導線では Core の実行仕様(数値=rc,
|
||||
安定化した診断タグ)が適用されるよ。
|
||||
- 互換トグルを使うと起動時に警告が出るよ(`HAKO_GATE_C_DIRECT_SILENCE=1` で抑止可)。
|
||||
- Stage‑B fallback TTL: global既定はOFF。テスト内でのみ `HAKO_STAGEB_ALLOW_FALLBACK=1` を設定して使用する(TTL)。
|
||||
- Stage‑B fallback TTL: 既定OFF(撤退方針)。必要な場合はテスト内限定で `HAKO_STAGEB_ALLOW_FALLBACK=1` を付与する。
|
||||
|
||||
Diagnostics (stable tags)
|
||||
- 本フェーズでは、Gate‑C(Core) の境界で安定タグを整形して出力する:
|
||||
@ -109,7 +110,8 @@ Minimal mir_call semantics (Core)
|
||||
- Methods (Map): `size()/len()/iterator()/set()/get()`(エントリ数メタを返す/更新する/メタから取得する)
|
||||
- ModuleFunction: `ArrayBox.len/0` / `MapBox.len/0`(メタのサイズを返す)— 他はタグ付き Fail‑Fast
|
||||
- Global/Extern: `env.console.{log|warn|error}`(数値引数のみ印字)
|
||||
- Others are Fail‑Fast(安定文言を出力)
|
||||
- Others are Fail‑Fast(安定文言を出力)。Closure 生成は v1 bridge で受理(NewClosure 発行)するが、
|
||||
実行時の呼出は未実装(VM 側は Fail‑Fast)。
|
||||
|
||||
See also: docs/development/architecture/collection_semantics.md(Array/Map のSSOT集約)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user