vm(hako): add v1 reader/dispatcher (flagged), commonize mir_call handler, share block scan; smokes: add v1 hakovm canary; docs: 20.37/20.38 plans, OOB policy; runner: v1 hakovm toggle; include SKIP summary

This commit is contained in:
nyash-codex
2025-11-03 23:21:48 +09:00
parent a4f30ae827
commit 06a729ff40
67 changed files with 3340 additions and 1520 deletions

View File

@ -17,7 +17,7 @@ static box NyVmJsonV0Reader {
// Return substring for the first function object
first_function(json) {
local p = JsonCursorBox.find_key_dual(json, "\"functions\":[", r#"\"functions\":\["#, 0)
local p = JsonCursorBox.find_key_dual(json, "\"functions\":[", "\"functions\":[", 0)
if p < 0 { return "" }
local lb = json.indexOf("[", p)
if lb < 0 { return "" }
@ -30,7 +30,7 @@ static box NyVmJsonV0Reader {
// Return substring for the first block object
first_block(func_json) {
local p = JsonCursorBox.find_key_dual(func_json, "\"blocks\":[", r#"\"blocks\":\["#, 0)
local p = JsonCursorBox.find_key_dual(func_json, "\"blocks\":[", "\"blocks\":[", 0)
if p < 0 { return "" }
local lb = func_json.indexOf("[", p)
if lb < 0 { return "" }
@ -43,7 +43,7 @@ static box NyVmJsonV0Reader {
// Return substring for the instructions array content (without the surrounding brackets)
block_instructions_json(block_json) {
local p = JsonCursorBox.find_key_dual(block_json, "\"instructions\":[", r#"\"instructions\":\["#, 0)
local p = JsonCursorBox.find_key_dual(block_json, "\"instructions\":[", "\"instructions\":[", 0)
if p < 0 { return "" }
local lb = block_json.indexOf("[", p)
if lb < 0 { return "" }
@ -54,7 +54,7 @@ static box NyVmJsonV0Reader {
// Read function entry id if present; returns -1 when missing
read_entry_id(func_json) {
local p = JsonCursorBox.find_key_dual(func_json, "\"entry\":", r#"\"entry\":"#, 0)
local p = JsonCursorBox.find_key_dual(func_json, "\"entry\":", "\"entry\":", 0)
if p < 0 { return -1 }
p = func_json.indexOf(":", p)
if p < 0 { return -1 }
@ -68,7 +68,7 @@ static box NyVmJsonV0Reader {
// Parse block id from a block JSON object; returns -1 on failure
read_block_id(block_json) {
local p = JsonCursorBox.find_key_dual(block_json, "\"id\":", r#"\"id\":"#, 0)
local p = JsonCursorBox.find_key_dual(block_json, "\"id\":", "\"id\":", 0)
if p < 0 { return -1 }
p = block_json.indexOf(":", p)
if p < 0 { return -1 }
@ -84,7 +84,7 @@ static box NyVmJsonV0Reader {
build_block_map(func_json) {
local out = new MapBox()
// locate blocks array
local p = JsonCursorBox.find_key_dual(func_json, "\"blocks\":[", r#"\"blocks\":\["#, 0)
local p = JsonCursorBox.find_key_dual(func_json, "\"blocks\":[", "\"blocks\":[", 0)
if p < 0 { return out }
local lb = func_json.indexOf("[", p)
if lb < 0 { return out }