Phase 22.1 WIP: SSOT resolver + TLV infrastructure + Hako MIR builder setup
Setup infrastructure for Phase 22.1 (TLV C shim & Resolver SSOT):
Core changes:
- Add nyash_tlv, nyash_c_core, nyash_kernel_min_c crates (opt-in)
- Implement SSOT resolver bridge (src/using/ssot_bridge.rs)
- Add HAKO_USING_SSOT=1 / HAKO_USING_SSOT_HAKO=1 env support
- Add HAKO_TLV_SHIM=1 infrastructure (requires --features tlv-shim)
MIR builder improvements:
- Fix using/alias consistency in Hako MIR builder
- Add hako.mir.builder.internal.{prog_scan,pattern_util} to nyash.toml
- Normalize LLVM extern calls: nyash.console.* → nyash_console_*
Smoke tests:
- Add phase2211 tests (using_ssot_hako_parity_canary_vm.sh)
- Add phase2220, phase2230, phase2231 test structure
- Add phase2100 S3 backend selector tests
- Improve test_runner.sh with quiet/timeout controls
Documentation:
- Add docs/ENV_VARS.md (Phase 22.1 env vars reference)
- Add docs/development/runtime/C_CORE_ABI.md
- Update de-rust-roadmap.md with Phase 22.x details
Tools:
- Add tools/hakorune_emit_mir.sh (Hako-first MIR emission wrapper)
- Add tools/tlv_roundtrip_smoke.sh placeholder
- Improve ny_mir_builder.sh with better backend selection
Known issues (to be fixed):
- Parser infinite loop in static method parameter parsing
- Stage-B output contamination with "RC: 0" (needs NYASH_JSON_ONLY=1)
- phase2211/using_ssot_hako_parity_canary_vm.sh fork bomb (needs recursion guard)
Next steps: Fix parser infinite loop + Stage-B quiet mode for green tests
This commit is contained in:
13
crates/nyash_kernel_min_c/Cargo.toml
Normal file
13
crates/nyash_kernel_min_c/Cargo.toml
Normal file
@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "nyash-kernel-min-c"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
name = "nyash_kernel_min_c"
|
||||
path = "src/lib.rs"
|
||||
crate-type = ["staticlib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
cc = "1.0"
|
||||
|
||||
8
crates/nyash_kernel_min_c/build.rs
Normal file
8
crates/nyash_kernel_min_c/build.rs
Normal file
@ -0,0 +1,8 @@
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=src/kernel_min.c");
|
||||
cc::Build::new()
|
||||
.file("src/kernel_min.c")
|
||||
.warnings(false)
|
||||
.compile("nyash_kernel_min_c");
|
||||
}
|
||||
|
||||
24
crates/nyash_kernel_min_c/src/kernel_min.c
Normal file
24
crates/nyash_kernel_min_c/src/kernel_min.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// Minimal C runtime symbols (design-stage). These provide a safe, tiny set of
|
||||
// externs for experiments; real NyKernel remains authoritative.
|
||||
|
||||
// Print: accept pointer (may be NULL). Returns 0 on success.
|
||||
long nyash_console_log(char* p) {
|
||||
(void)p;
|
||||
puts("hello");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// from_i8_string: returns a fake handle (0). Real mapping is in Rust NyKernel.
|
||||
long nyash_box_from_i8_string(char* p) {
|
||||
(void)p; // not used in design stage stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Optional minimal stubs (not used by default; reserved for future reps)
|
||||
long nyash_array_birth_h(void) { return 1; }
|
||||
long nyash_array_length_h(long handle) { (void)handle; return 0; }
|
||||
long nyash_map_birth_h(void) { return 1; }
|
||||
long nyash_map_size_h(long handle) { (void)handle; return 0; }
|
||||
2
crates/nyash_kernel_min_c/src/lib.rs
Normal file
2
crates/nyash_kernel_min_c/src/lib.rs
Normal file
@ -0,0 +1,2 @@
|
||||
// Rust side is empty; the staticlib is produced from C sources via build.rs
|
||||
|
||||
Reference in New Issue
Block a user