code wiki / (root) / nx_f32_q14_encode_test.nx

nx_f32_q14_encode_test.nx

buildroot/runtime/nx_f32_q14_encode_test.nx

3829 B75 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic f32
docsdependenciesstructsconstsfunctions

about

nx_f32_q14_encode_test.nx -- KAT gate for f32_from_q14, the EXACT Q14->IEEE-754 units bridge the arbitrary-mesh STL writer needs. Proves: (a) hand-verified bit patterns for whole-mm and sub-mm values, (b) sign handling, (c) it is the precise inverse of the reader's nx_fp32_bytes_to_q14 (write Q14 -> f32 bytes -> read back == original Q14, exact, for print-bed-range values). expect_exit: 0.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_le.nx nx_f32_encode.nx nx_fp32_q14.nx nx_f32_q14_encode_test.nx

imports: nx_syscalls.nxnx_le.nxnx_f32_encode.nxnx_fp32_q14.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap w sys_write chk w ↻ eqi f32_from_q14 f32_from_i64 f32_from_i64 ↻ roundtrip sys_mmap ↻ nx_le_write_u32 f32_from_q14 ↻ nx_fp32_bytes_to_q14 nx_fp32_bits_to_q14 wn sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

12func w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: chkmain calls 1: sys_write
13func wn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
22func chk(cond: i64, pass: *i64, fail: *i64, label: *u8) -> i64
called by 1: main calls 1: w
27func eqi(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
30func roundtrip(q14: i64) -> i64
39func main() -> i64