code wiki / (root) / nx_view_transform_gate.nx

nx_view_transform_gate.nx

buildroot/runtime/nx_view_transform_gate.nx

6643 B143 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_view_transform_gate.nx -- IS THE VIEW TRANSFORM DERIVED, OR JUST TYPED? license_tier: ORIGINAL No hw writes (Rule 26). The claim under test is not "the curve looks nice". It is four mechanical properties, each of which the shipped page FAILED on 2026-08-28 and each of which nx_view_transform is supposed to make true BY CONSTRUCTION: 1. the exponent is COMPUTED from declared measurements, not hand-typed (the page carried 1.45, whose own comment claimed "half-way" while it moved the median 45.7%); 2. the anchor is an exact FIXED POINT, so the white point cannot drift; 3. the application PRESERVES HSV saturation exactly (the page raised S mean .313 -> .411, out of the .27-.32 band the measurement said saturation already sat inside); 4. the LUT size is SEARCHED against a declared tolerance, not chosen. THE NEG-CONTROL IS THE LOAD-BEARING TOOTH. T5 applies the OLD per-channel form to the same triple and requires that it RAISES saturation. Without it, T4 could pass on a transform that does nothing at all: a no-op preserves chroma perfectly. T5 is what proves this gate can tell the fix from the defect rather than merely tell quiet from loud.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_fixq30_lib.nx nx_view_transform_lib.nx nx_view_transform_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_fixq30_lib.nxnx_view_transform_lib.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ fq_ctx sys_mmap ↻ fq_atan_small fq_mul fq_atanh_small fq_mul ↻ fq_mul ↻ fq_div fq_sqrt fq_bitlen fq_isqrt vm_isqrt vt_exponent fq_from_micro vt_target_median fq_from_micro ↻ fq_div ↻ fq_ln fq_div ↻ fq_atanh_small ↻

structs

none

consts

23const VG_SLOTS: i64 = 3
24const VG_SLOT_BYTES: i64 = 8
25const VG_EPS: i64 = 1024 // Q30 slack: 1024/2^30 = 9.5e-7, far below one 8-bit code
26const VG_NONGREY_R: i64 = 800000 // a strongly non-grey probe triple, in micro
27const VG_NONGREY_G: i64 = 400000
28const VG_NONGREY_B: i64 = 200000
29const VG_MIDGREY_MICRO: i64 = 500000
30const VG_HALF: i64 = 2

functions

32func vg_near(a: i64, b: i64) -> i64
called by 1: main
40func vg_perchannel(ctx: *i64, g: i64, rgb: *i64) -> i64
called by 1: main calls 1: vt_curve
46func vg_fill(rgb: *i64) -> i64
called by 1: main calls 1: fq_from_micro
53func main(argc: i64, argv: **u8) -> i64