phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0

This commit is contained in:
nyash-codex
2025-11-06 15:41:52 +09:00
parent 2dc370223d
commit 77d4fd72b3
1658 changed files with 6288 additions and 2612 deletions

View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
# gen_v1_compare_branch.sh — minimal 2-block v1 JSON generator (compare/branch)
# Program: if (3 < 5) return 1 else return 2
set -euo pipefail
cat <<'JSON'
{
"schema_version": "1.0",
"functions": [
{"name": "main", "blocks": [
{"id": 0, "instructions": [
{"op":"const","dst":0,"value":{"type":"i64","value":3}},
{"op":"const","dst":1,"value":{"type":"i64","value":5}},
{"op":"compare","dst":2,"lhs":0,"rhs":1,"cmp":"Lt"},
{"op":"branch","cond":2,"then":1,"else":2}
]},
{"id": 1, "instructions": [
{"op":"const","dst":3,"value":{"type":"i64","value":1}},
{"op":"ret","value":3}
]},
{"id": 2, "instructions": [
{"op":"const","dst":4,"value":{"type":"i64","value":2}},
{"op":"ret","value":4}
]}
]}
]
}
JSON

View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
# gen_v1_const42.sh — minimal v1 JSON generator example (emit-only skeleton)
# Prints a small v1 program that returns 42.
set -euo pipefail
cat <<'JSON'
{
"schema_version": "1.0",
"functions": [
{"name": "main", "blocks": [
{"id": 0, "instructions": [
{"op": "const", "dst": 0, "value": {"type": "i64", "value": 42}},
{"op": "ret", "value": 0}
]}
]}
]
}
JSON

View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
# gen_v1_logical_nested.sh — v1 JSON: ( (1<2) && (3<2) ) || (4<5 )
set -euo pipefail
cat <<'JSON'
{
"schema_version": "1.0",
"functions": [
{"name": "main", "blocks": [
{"id":0,"instructions":[
{"op":"const","dst":1,"value":{"type":"i64","value":1}},
{"op":"const","dst":2,"value":{"type":"i64","value":2}},
{"op":"compare","dst":3,"lhs":1,"rhs":2,"cmp":"Lt"},
{"op":"const","dst":4,"value":{"type":"i64","value":3}},
{"op":"const","dst":5,"value":{"type":"i64","value":2}},
{"op":"compare","dst":6,"lhs":4,"rhs":5,"cmp":"Lt"},
{"op":"const","dst":7,"value":{"type":"i64","value":4}},
{"op":"const","dst":8,"value":{"type":"i64","value":5}},
{"op":"compare","dst":9,"lhs":7,"rhs":8,"cmp":"Lt"},
{"op":"branch","cond":9,"then":10,"else":11}
]},
{"id":10,"instructions":[{"op":"const","dst":20,"value":{"type":"i64","value":1}},{"op":"ret","value":20}]},
{"id":11,"instructions":[{"op":"branch","cond":3,"then":12,"else":13}]},
{"id":12,"instructions":[{"op":"branch","cond":6,"then":14,"else":13}]},
{"id":14,"instructions":[{"op":"const","dst":21,"value":{"type":"i64","value":1}},{"op":"ret","value":21}]},
{"id":13,"instructions":[{"op":"const","dst":22,"value":{"type":"i64","value":0}},{"op":"ret","value":22}]}
]}
]
}
JSON

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# gen_v1_loop_ne_sentry_continue_rc.sh — v1 JSON: safe '!=' sentinel → continue rc=4
set -euo pipefail
cat <<'JSON'
{
"schema_version": "1.0",
"functions": [
{"name": "main", "blocks": [
{"id":0,"instructions":[
{"op":"const","dst":1,"value":{"type":"i64","value":1}},
{"op":"const","dst":2,"value":{"type":"i64","value":2}},
{"op":"compare","dst":3,"lhs":1,"rhs":2,"cmp":"Ne"},
{"op":"branch","cond":3,"then":1,"else":2}
]},
{"id":1,"instructions":[{"op":"const","dst":4,"value":{"type":"i64","value":4}},{"op":"ret","value":4}]},
{"id":2,"instructions":[{"op":"const","dst":5,"value":{"type":"i64","value":0}},{"op":"ret","value":5}]}
]}
]
}
JSON

View File

@ -0,0 +1,28 @@
#!/usr/bin/env bash
# gen_v1_threeblock_collect.sh — v1 JSON: 3-block collect → rc=44 on then-path
set -euo pipefail
cat <<'JSON'
{
"schema_version": "1.0",
"functions": [
{"name": "main", "blocks": [
{"id":0,"instructions":[
{"op":"const","dst":1,"value":{"type":"i64","value":3}},
{"op":"const","dst":2,"value":{"type":"i64","value":5}},
{"op":"compare","dst":3,"lhs":1,"rhs":2,"cmp":"Lt"},
{"op":"branch","cond":3,"then":1,"else":2}
]},
{"id":1,"instructions":[
{"op":"const","dst":4,"value":{"type":"i64","value":44}},
{"op":"jump","target":3}
]},
{"id":2,"instructions":[
{"op":"const","dst":4,"value":{"type":"i64","value":40}},
{"op":"jump","target":3}
]},
{"id":3,"instructions":[{"op":"ret","value":4}]}
]}
]
}
JSON

View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
# gen_v1_typeop_check_integer.sh — minimal v1 JSON generator (const+typeop check integer)
set -euo pipefail
cat <<'JSON'
{
"schema_version": "1.0",
"functions": [
{"name": "main", "blocks": [
{"id": 0, "instructions": [
{"op": "const", "dst": 0, "value": {"type": "i64", "value": 7}},
{"op": "typeop", "operation": "check", "src": 0, "target_type": "integer", "dst": 1},
{"op": "ret", "value": 1}
]}
]}
]
}
JSON