code wiki / (root) / nx_quality_driver.nx

nx_quality_driver.nx

buildroot/runtime/nx_quality_driver.nx

3379 B100 linesdepth 6pulls 8 transitivereach 0 importersview sourcekind tooltopic quality
docsdependenciesstructsconstsfunctions

about

nx_quality_driver.nx -- MINIMAL substrate driver: real image -> verdict JSON. Reads /tmp/nx_img.raw (24-byte LE header + raw RGB bytes), runs the safest detectors that don't trip the codegen bug (single function call, no struct returns mid-chain), emits JSON to stdout. svc-quality invokes this as a subprocess per render. Inline-in-main pattern because nxc2 codegen bug forbids the wrapper pattern for some detector compositions. The driver does each detector inline; result fields packed into one flat-array and printed as JSON. Output: {"palette_kind":N,"warm_q10":N,"saturation_q10":N,"mean_r":N,"mean_g":N,"mean_b":N,"image_w":N,"image_h":N}

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_image.nx nx_image_load_raw.nx nx_color_palette.nx nx_quality_driver.nx

imports: nx_syscalls.nxnx_image.nxnx_image_load_raw.nxnx_color_palette.nx

imported by: nobody (leaf or entry point)

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

main nx_image_load_raw sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_image_load_read_i64_le sys_mmap ↻ sys_read_file ↻ nx_color_palette nx_image_get nx_qd_puts nx_qd_putint sys_write

structs

none

consts

25const K_MAGIC_2048: i64 = 2048

functions

28func nx_qd_puts(buf: *u8, pos: i64, s: *u8) -> i64
called by 1: main
40func nx_qd_putint(buf: *u8, pos: i64, v: i64) -> i64
called by 1: main
64func main() -> i64