code wiki / (root) / nx_fidelity_gate.nx

nx_fidelity_gate.nx

buildroot/runtime/nx_fidelity_gate.nx

4347 B128 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_fidelity_gate.nx -- REFEREE for the fidelity metric (nx_segsnr). A reference sine; four reconstructions of decreasing quality: exact copy -> capped ~99 dB + small noise (200)-> high SegSNR + large noise(4000)-> lower SegSNR unrelated (noise) -> near 0 dB (neg-control) The metric must rank them MONOTONICALLY (exact > small > large > unrelated), and the unrelated case must be low -- otherwise it can't tell good from bad. Evidence -> stdout + knowledge/status/fidelity_gate.log. Exit 0 GREEN / 1 RED. Sovereign x86_64 throughout. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls_x86_64.nx nx_fidelity.nx nx_polypitch.nx nx_fidelity_gate.nx

imports: nx_syscalls_x86_64.nxnx_fidelity.nxnx_polypitch.nx

imported by: nobody (leaf or entry point)

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

main sys_openat_append gp gen_sine store16 nx_pp_sinfull nx_pp_cosfull nx_pp_cosq16 copy_plus_noise store16 ↻ load16 nx_segsnr _fid_i16 _fid_log2_q16 gn

structs

none

consts

17const N: i64 = 2048
18const FRAME: i64 = 256
19const FS: i64 = 8000
20const TWO_PI: i64 = 411775

functions

22func gp(logfd: i64, s: *u8) -> i64
called by 1: main
29func gn(logfd: i64, v: i64) -> i64
called by 1: main
43func store16(buf: *u8, i: i64, v: i64) -> i64
52func load16(buf: *u8, i: i64) -> i64
called by 1: copy_plus_noise
60func gen_sine(buf: *u8, f: i64, amp: i64) -> i64
called by 1: main calls 2: store16nx_pp_sinfull
73func copy_plus_noise(ref: *u8, dst: *u8, mag: i64, seed0: i64) -> i64
called by 1: main calls 2: store16load16
86func main() -> i64