code wiki / _hdl_build / nx_capaxes_derive_test.nx
nx_capaxes_derive_test.nx source
↩ module page · 34 lines · 1357 B
1// nx_capaxes_derive_test.nx -- runs the axis-derivation and prints its rock list.
2// Exists for the same reason as nx_rebuild_plan_test: /api/gate_run is the only on-demand exec route and
3// it admits VERIFIERS ONLY (name ends gate|test|kat) -- which is exactly what makes it never-brick. A new
4// MCP tool needs a client reconnect before a stub exists, so a thin verifier is the sanctioned way to run
5// a non-verifier organ in the session that built it.
6// license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
7import "nx_tool_run.nx"
8
9const CDT_CAP: i64 = 262144
10const CDT_ELF: *u8 = "/volume1/homes/elderwesto/nishihost/nx_capaxes_derive.elf" as *u8
11
12func cdt_w(s: *u8) {
13 var n: i64 = 0
14 while s[n] != (0 as u8) { n = n + 1 }
15 sys_write(1, s, n)
16}
17
18func main(argc: i64, argv: *i64) -> i64 {
19 let out: *u8 = sys_mmap(CDT_CAP + 16)
20 let olen: *i64 = sys_mmap(16) as *i64
21 let rc: i64 = tr_run1(CDT_ELF, "14" as *u8, out, CDT_CAP, olen)
22 let n: i64 = olen[0]
23 if rc == 127 {
24 cdt_w("CAPAXES-DERIVE-TEST verdict=RED exec-127\n" as *u8)
25 return 1
26 }
27 if n <= 0 {
28 cdt_w("CAPAXES-DERIVE-TEST verdict=RED empty-capture\n" as *u8)
29 return 1
30 }
31 sys_write(1, out, n)
32 cdt_w("\nCAPAXES-DERIVE-TEST verdict=GREEN derivation ran against LIVE nx_sota_status.\n" as *u8)
33 return 0
34}