code wiki / _hdl_build / nx_critic_kernel.nx

nx_critic_kernel.nx

buildroot/runtime/_hdl_build/nx_critic_kernel.nx

11787 B220 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind tooltopic critic
docsdependenciesstructsconstsfunctions

about

nx_critic_kernel.nx -- the SOVEREIGN, DOMAIN-AGNOSTIC, self-growing CRITIC KERNEL (operator 2026-07-04: "the critic needs to intelligently grow with your tutoring so this whole thing becomes state of the art not just for [photoreal] but audio and industrial design and all kinds of projects"). ONE kernel; every domain plugs in AXES; every axis is held under the epistemic Nishi Critic ([[nx_critic]]) and -- crucially -- CANNOT be trusted (LAW) until it SURVIVES A RED-TEAM: the tutor supplies a GOOD sample AND an ADVERSARY the axis must reject. The kernel RUNS the red-team and only marks the axis red-teamed if it DISCRIMINATES; a gameable axis (adversary not rejected) is caught and queued for the tutor -- so the critic grows intelligently, never self-flatters, and generalizes to visuals + audio + design + anything. PROOF: 3 real domains (VISUAL structure / AUDIO periodicity / DESIGN symmetry), each with a real measurement + a real adversary, all graded by the SAME kernel; PLUS one deliberately WEAK axis (design "detail=variance", which noise games) that the kernel CATCHES and refuses to bless. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_critic.nx nx_itrig.nx nx_sdfrender.nx nx_critic_kernel.nx

imports: nx_syscalls.nxnx_critic.nxnx_itrig.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 hw sys_write sys_mmap m_vis_structure sys_mmap ↻ kc it_sin4096 m_aud_periodicity kc ↻ m_des_symmetry kabs kc ↻ m_des_variance kc ↻ grade_axis kernel_redteam crit_status2 crit_settledness hw ↻ pn sys_mmap ↻ sys_write ↻ statusname crit_is_blindspot pn ↻ kernel_redteam ↻ 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

structs

none

consts

17const K_MAGIC_4096: i64 = 4096
18const K_MAGIC_20000: i64 = 20000
19const K_MAGIC_1024: i64 = 1024
20const K_MAGIC_2654435761: i64 = 2654435761
21const K_MAGIC_40503: i64 = 40503
22const K_MAGIC_8191: i64 = 8191

functions

24func 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 2: grade_axismain calls 1: sys_write
25func pn(v: i64) -> i64
called by 2: grade_axismain calls 2: sys_mmapsys_write
37func kc(v: i64) -> i64 { if v < 0 { return 0 } if v > 1000 { return 1000 } return v }
38func kabs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
39func klum(g: i64) -> i64 { return ((g & 255) + ((g >> 8) & 255) + ((g >> 16) & 255)) / 3 }
called by 1: our_fine_detail
40func kfg(g: i64) -> i64 { let r: i64 = g & 255; let b: i64 = (g >> 16) & 255; if r >= b { return 1 } return 0 }
called by 1: our_fine_detail
42func our_fine_detail(fb: *i64, w: i64, h: i64) -> i64
called by 1: main calls 3: kfgklumkabs
63func m_vis_structure(lum: *i64) -> i64
called by 1: main calls 2: sys_mmapkc
85func m_aud_periodicity(s: *i64, n: i64, lag: i64) -> i64
called by 1: main calls 1: kc
95func m_des_symmetry(hgt: *i64, n: i64) -> i64
called by 1: main calls 2: kabskc
103func m_des_variance(hgt: *i64, n: i64) -> i64
called by 1: main calls 1: kc
114func kernel_redteam(good: i64, adv: i64) -> i64
called by 2: grade_axismain
118func statusname(s: i64) -> *u8
called by 1: grade_axis
126func grade_axis(dom: *u8, ax: *u8, good: i64, adv: i64) -> i64
143func main() -> i64