code wiki / _hdl_build / nx_critic_visual.nx

nx_critic_visual.nx

buildroot/runtime/_hdl_build/nx_critic_visual.nx

11591 B204 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind tooltopic critic
docsdependenciesstructsconstsfunctions

about

nx_critic_visual.nx -- the PHOTOREAL image critic WIRED UNDER the epistemic Nishi Critic (nx_critic), so the critic GROWS in capability under guidance (operator 2026-07-04: "wired to the critic so the critic can grow in capabilities under your guidance"). Each measurement axis is a scientific BELIEF held provisionally: nx_critic grades it LAW / THEORY / CONTESTED / REFUTED from reproductions + counter-strength + whether it was RED-TEAMED, and queues the un-red-teamed axes as BLIND SPOTS = the critic's own improvement worklist. ★THE FIRST GROWTH (motivated by wiring): naive local stats are GAMED BY NOISE -- random noise has high fine_detail/chroma/'specular' but is NOT photoreal (the PSNR blind-spot the Critic exists to catch). So we ADD a STRUCTURE axis (low-frequency coherence: a real object has form; noise averages to flat) that REJECTS noise, red-teaming fine_detail. GATE GREEN = the GROWN critic correctly rejects BOTH flat clay AND noise (a strictly better discriminator than v1), and honestly grades + queues its own weak metrics. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_critic.nx nx_sdfrender.nx nx_critic_visual.nx

imports: nx_syscalls.nxnx_critic.nxnx_sdfrender.nx

imported by: nobody (leaf or entry point)

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

main ww hh hw sys_write sys_mmap sdf_bytes sdf_body sdf_clear_ops sdf_set_floor sdf_set_mtx_amp sdf_set_kb sdf_render sdf_render_rows it_cos4096 it_sin4096 it_sin4096 ↻ sdf_isqrt sdf_shade_ray sdf_eval sdf_ellip sdf_isqrt ↻ sdf_ellip_rot sdf_isqrt ↻ sdf_smax sdf_smin sdf_smin ↻ sdf_isqrt ↻ sdf_softshadow sdf_eval ↻ sdf_gi sdf_abs sdf_isqrt ↻ sdf_eval ↻ sdf_aces sdf_eval_part sdf_ellip ↻ mat_height sk_vnoise sk_hash

structs

none

consts

16const K_MAGIC_65536: i64 = 65536
17const K_MAGIC_2654435761: i64 = 2654435761
18const K_MAGIC_1013904223: i64 = 1013904223

functions

20func hw(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 1: main calls 1: sys_write
21func pn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
33func cv_lum(g: i64) -> i64 { return ((g & 255) + ((g >> 8) & 255) + ((g >> 16) & 255)) / 3 }
34func cv_pl(g: i64) -> i64 { let r: i64 = g & 255; let b: i64 = (g >> 16) & 255; if r >= b { return 1 } return 0 }
35func cv_chroma(g: i64) -> i64
called by 1: ax_chroma
41func cv_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
42func cv_clamp(v: i64) -> i64 { if v < 0 { return 0 } if v > 1000 { return 1000 } return v }
called by 1: cv_score
46func ax_fine_detail(fb: *i64, w: i64, h: i64) -> i64
called by 2: cv_scoremain calls 3: cv_plcv_lumcv_abs
67func ax_structure(fb: *i64, w: i64, h: i64) -> i64
called by 2: cv_scoremain calls 2: sys_mmapcv_lum
93func ax_chroma(fb: *i64, w: i64, h: i64) -> i64
called by 1: cv_score calls 3: cv_plcv_chromacv_abs
106func cv_score(fb: *i64, w: i64, h: i64) -> i64
115func cv_verdict(s: i64) -> *u8
called by 1: main
120func cv_statusname(s: i64) -> *u8
called by 1: main
127func main() -> i64