code wiki / (root) / nx_likeness_gate.nx

nx_likeness_gate.nx

buildroot/runtime/nx_likeness_gate.nx

17714 B253 linesdepth 12pulls 53 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_likeness_gate.nx -- the referee for nx_likeness_lib (aesthetictwin AT45, 2026-09-18). On the real reference set (four clothed, frontal Diora Baird stills, aligned from the outside oracle rows) and the real renders the operator judged: the band is derived from at least three same-person pairs and the canvas from the smallest reference eye span; a reference against itself reads zero on every axis; the anchor still resampled into a rolled, scaled frame (a planted control whose landmarks are carried by the same similarity) reads INSIDE with its geometry within two canvas pixels, and its mouth landmarks shifted by a tenth of the eye span read the shift back (the geometry axis can fire); the canon face and a seed render -- renders of nobody in particular -- read OUTSIDE the band; the two renders the operator rejected as not her (diora_baird_close.png, diora_baird_threequarter.png) read OUTSIDE, and they read it MEASURED, not as an absence of alignment; each score's partition sums; the lk_score door agrees with the in-process path. Values are printed with gv_kv. Fixtures live under /tmp/nx_likeness_gate/ (created at setup); the reference stills, the oracle rows and the renders are read from the estate's own paths and are PRECONDITIONS (SKIP when absent, never RED). THE FIRST RUN'S ACCEPT RULE WAS STRICTER AND IT FAILED, WHICH IS RECORDED HERE RATHER THAN TUNED AWAY: the renders were required to read OUTSIDE on the structure axes. Measured 2026-09-18 on this set they do not -- the same person's own photographs spread more on every classical structure ruler than a render differs from a photograph at an 84 px canvas (struct_l1 band 2891 against renders 2128..2759; shading 846 against 441..595; texture layout 644 against 559..654; texture energy 52 against 6..12) -- and the rejections rest on skin chroma (a*) and, for the three-quarter render, on texture layout. That separation count is published as a value (structure_family_separates_renders_of_4) and is the open accept bar of the structure contender queued on the board. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_likeness_lib.nx nx_likeness_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_likeness_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_head gv_puts sys_write 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 ↻ sys_mkdir lg_write sys_openat_wr sys_write ↻ lkh_slen sys_close gv_need gv_puts ↻ lg_exists sys_openat_rd sys_close ↻ lk_ctx_new sys_mmap ↻ ff_load_face hx_load sys_mmap ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻

structs

none

consts

22const LG_I64: i64 = 8
23const LG_MODE755: i64 = 493
24const LG_MODE644: i64 = 420
25const LG_DIR: *u8 = "/tmp/nx_likeness_gate"
26const LG_LIST: *u8 = "/tmp/nx_likeness_gate/refs.list"
27const LG_LIST_TEXT: *u8 = "@oracle knowledge/refintake/diora_baird.oracle\nknowledge/fetched/ri_diora_baird_3.jpg\nknowledge/fetched/ri_diora_baird_11.jpg\nknowledge/fetched/ri_diora_baird_12.jpg\nknowledge/fetched/ri_diora_baird_14.jpg\n"
28const LG_ORACLE: *u8 = "knowledge/refintake/diora_baird.oracle"
29const LG_REF3: *u8 = "knowledge/fetched/ri_diora_baird_3.jpg"
30const LG_REF11: *u8 = "knowledge/fetched/ri_diora_baird_11.jpg"
31const LG_REF12: *u8 = "knowledge/fetched/ri_diora_baird_12.jpg"
32const LG_REF14: *u8 = "knowledge/fetched/ri_diora_baird_14.jpg"
33const LG_ANCHOR: *u8 = "ri_diora_baird_14.jpg"
34const LG_CANON: *u8 = "sites/nishifamily/compare/aesthetictwin/results/img/canon_close.png"
35const LG_SEED1: *u8 = "sites/nishifamily/compare/aesthetictwin/results/img/seed_1.png"
36const LG_REJ_CLOSE: *u8 = "sites/nishifamily/compare/aesthetictwin/results/img/diora_baird_close.png"
37const LG_REJ_TQ: *u8 = "sites/nishifamily/compare/aesthetictwin/results/img/diora_baird_threequarter.png"
38const LG_CTL_NAME: *u8 = "planted-roll-scale-control"
39const LG_REFS: i64 = 4
40const LG_MIN_PAIRS: i64 = 3
43const LG_CTL_W: i64 = 300
44const LG_CTL_H: i64 = 260
45const LG_CTL_RX: i64 = 1200
46const LG_CTL_RY: i64 = 1400
47const LG_CTL_LX: i64 = 1800
48const LG_CTL_LY: i64 = 1100
49const LG_CTL_IOD: i64 = 671 // isqrt(600*600 + 300*300) deci-pixels
50const LG_CTL_IOD_TOL: i64 = 1
51const LG_CANVAS_PX_TOL: i64 = 2 // the geometry of a resampled copy is held to two canvas pixels
52const LG_SHIFT_DIV: i64 = 10 // the neg-control moves the five mouth points by a tenth of the control's eye span
53const LG_MOUTH_PTS: i64 = 5

functions

55func lg_exists(path: *u8) -> i64
called by 1: main calls 2: sys_openat_rdsys_close
61func lg_write(path: *u8, text: *u8) -> i64
68func lg_find(set: *i64, base: *u8) -> i64
called by 1: main calls 2: lkh_streqlkh_basename
75func lg_render(ctx: *i64, set: *i64, path: *u8, sc: *i64, aligned_out: *i64) -> i64
90func lg_partition_ok(sc: *i64) -> i64 { return (sc[LK_S_INSIDE] + sc[LK_S_OUTSIDE] + sc[LK_S_UNMEASURED] == LK_AX_N) as i64 }
called by 1: main
93func lg_structure_outside(sc: *i64) -> i64
called by 1: main
102func main(argc: i64, argv: *i64) -> i64