code wiki / _hdl_build / nx_uiq_visual_lib.nx

nx_uiq_visual_lib.nx

buildroot/runtime/_hdl_build/nx_uiq_visual_lib.nx

8456 B180 linesdepth 9pulls 14 transitivereach 2 importersview sourcekind librarytopic uiq
docsdependenciesstructsconstsfunctions

about

nx_uiq_visual_lib.nx -- SOVEREIGN visual-render metrics: the deterministic-pixel half of the perceptual axis, computed on a REAL rendered PNG. Attacks the marker-vs-rendered gap no other sovereign UI tool can (none execute CSS): a page that passes every structural/console check yet renders BLANK (the banked "google scored 97% while rendering nothing" failure). DRY (rule 15): reuses the shipped sovereign PNG decoder via nx_visual_diff's vd_load (VdImg{px,w,h,nc}) + its vd_content_extent (rendered height / layout parity) -- ZERO new decode code. nx_png_write for KAT fixtures. HONEST ENVELOPE (declared in output): measures the pixels of WHATEVER png it is given; render FIDELITY is the input's property (a Chrome screenshot = real CSS/JS; the sovereign br_shot_png = no-JS). Deterministic GUARDRAILS half; perceptual "premium" judging stays partnership-gated (VLM, will-not-fake). license_tier: ORIGINAL genealogy: experiential visual; composes nx_visual_diff + nx_png_decoder + nx_png_write

dependencies 3 imports · 2 importers

nx_visual_diff.nx nx_itoa_lib.nx nx_png_write.nx nx_uiq_visual_lib.nx nx_uiq_visual.nx nx_uiq_visual_gate.nx

imports: nx_visual_diff.nxnx_itoa_lib.nxnx_png_write.nx

imported by: nx_uiq_visual.nxnx_uiq_visual_gate.nx

structs

none

consts

14const UV_MAGIC_1024: i64 = 1024
16const UV_BLANK_PERMILLE: i64 = 20
17const UV_SPARSE_PERMILLE: i64 = 50
18const UV_INK_DELTA: i64 = 24
19const UV_STEP: i64 = 6

functions

21func uv_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: mainuv_analyze
22func uv_abs(v: i64) -> i64 { if v<0 { return 0-v } return v }
called by 1: uv_metrics
23func uv_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
24func uv_streq(s: *u8, sl: i64, lit: *u8) -> i64 { var i: i64=0; while lit[i]!=(0 as u8){ if i>=sl { return 0 } if s[i]!=lit[i] { return 0 } i=i+1 } if i!=sl { return 0 } return 1 }
called by 1: main
29func uv_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
30func uv_catn(d: *u8, off: i64, v: i64) -> i64
called by 1: uv_analyze
35func uv_cat(d: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; var o: i64=off; while s[i]!=(0 as u8){d[o]=s[i]; o=o+1; i=i+1} return o }
38func uv_metrics(im: *VdImg, out: *i64) -> i64
called by 3: mainuv_analyzeuv_selftest calls 1: uv_abs
83func uv_verdict(d: *u8, off: i64, ink: i64) -> i64
called by 1: uv_analyze calls 1: uv_cat
90func uv_analyze(path: *u8, emit: i64) -> i64
127func uv_mk_solid(path: *u8, w: i64, h: i64, r: i64, g: i64, b: i64) -> i64
called by 2: mainuv_selftest calls 1: nx_png_write_rgb
134func uv_mk_rich(path: *u8, w: i64, h: i64) -> i64
called by 2: mainuv_selftest calls 1: nx_png_write_rgb
143func uv_mk_band(path: *u8, w: i64, h: i64, y0: i64, y1: i64) -> i64
called by 2: mainuv_selftest calls 1: nx_png_write_rgb
151func uv_selftest() -> i64