code wiki / (root) / nx_twintruth_gate.nx

nx_twintruth_gate.nx

buildroot/runtime/nx_twintruth_gate.nx

19846 B270 linesdepth 12pulls 65 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_twintruth_gate.nx -- the referee for the eye unit's landmark truth in nx_twinfit_lib (aesthetictwin AT39, 2026-09-17; split out of nx_twinfit_gate 2026-09-18). The projection is held to the renderer's own ray set-up; the canon face has truth on both eyes, mirrored about the frame centre, tilted as the canon gene says and confirmed on the surface inside the corner window; the eye genes leave the canon untouched, move the truth with the tilt gene and break the mirror with the difference gene; a face without lid shells has no truth and says why by name; seed 42 keeps its identity and its eye genes; the judge scores a planted ruler against planted truth. WHY A GATE OF ITS OWN: the truth scans march the surface at a fixed two-unit step because the lid-shell field is steep and discontinuous at the canthus (a distance-stepped march could skip the thin lid), so these teeth cost more than the rest of the twin loop together -- measured 13.3 s of a 22.8 s laptop run, 178 s on the NAS against the roster's 180 s per-gate deadline. One subject per gate lets each fit the roster. AT44 (2026-09-18) adds the MOUTH's truth and judge, which cost a few surface marches and no render (17 ms on the laptop): the lip judge exact on a planted case with a decoy in the stated-ratio slot, and the canon face's five lip points in anatomical order, the stomion on the lip sweep's front (the seam is seen at its opening, not its slit floor) and the vermilion lines on the marched surface. Values are printed with gv_kv. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_twinfit_lib.nx nx_twintruth_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_twinfit_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_now_ms sys_mmap ↻ sys_clock_gettime_mono sys_mmap ↻ tg_at39 sys_mmap ↻ gv_check_eq gv_check gv_puts ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap tw_project it_cos4096 it_sin4096 it_sin4096 ↻ tg39_canon_genes tw_build

structs

none

consts

18const TG_I64: i64 = 8
21const TG_G_W: i64 = 89
22const TG_G_C: i64 = 106
23const TG_SKIN_R: i64 = 130
24const TG_SKIN_G: i64 = 98
25const TG_SKIN_B: i64 = 70
27const TG39_CANON_PCT: i64 = 100
28const TG39_PAGE: i64 = 4096
29const TG39_PROJ_PX: i64 = 1000 // a planted model point right of and above the axis, at the origin plane
30const TG39_PROJ_PY: i64 = 500
31const TG39_PROJ_X_DECI: i64 = 3985 // 10*HW + 10*FOCAL*1000/4096 - 5 = 2560 + 1430 - 5
32const TG39_PROJ_Y_DECI: i64 = 1200 // 10*HH - 10*FOCAL*500/4096 - 5 = 1920 - 715 - 5
33const TG39_BEHIND_Z: i64 = 0 - 5000 // behind a camera that stands 4096 in front of the origin
34const TG39_TILT_TOL: i64 = 10 // one degree: the scan step and the perspective of a corner that sits back from the apex
35const TG39_TILT_HIGH: i64 = 90
36const TG39_DTILT: i64 = 10
37const TG39_PRE_LID_PARTS: i64 = 27
38const TG39_SEED: i64 = 42
39const TG39_SEED_TILT: i64 = 97 // seed 42's eye genes as the stream draws them after the seven morphs and the tone
40const TG39_SEED_OPEN: i64 = 104
41const TG39_SEED_WIDTH: i64 = 98
42const TG39_SEED_UPSHARE: i64 = 597
43const TG39_SEED_DTILT: i64 = 0 - 5
44const TG39_SEED_DOPEN: i64 = 0 - 4
46const TG39_J_EXO: i64 = 1500
48const TG39_J_T_RLAT_X: i64 = 1000
49const TG39_J_T_RMED_X: i64 = 1500
50const TG39_J_T_LMED_X: i64 = 2000
51const TG39_J_T_LLAT_X: i64 = 2500
52const TG39_J_T_ROW_Y: i64 = 1000
53const TG39_J_R_RLAT_X: i64 = 100
54const TG39_J_R_RMED_X: i64 = 153
55const TG39_J_R_LMED_X: i64 = 200
56const TG39_J_R_LLAT_X: i64 = 250
57const TG39_J_R_ROW_Y: i64 = 100
58const TG39_J_R_RMED_Y: i64 = 98
59const TG39_J_DX: i64 = 30
60const TG39_J_DY: i64 = 0 - 20
61const TG39_J_NME: i64 = 24 // isqrt(30*30 + 20*20) = 36 deci-px; 36 * 1000 / 1500
62const TG39_J_NMEAN: i64 = 6 // 24 / 4
67const TG44_T_MID_X: i64 = 1000
68const TG44_T_LS_Y: i64 = 900
69const TG44_T_STO_Y: i64 = 1000
70const TG44_T_LI_Y: i64 = 1150
71const TG44_T_CHR_X: i64 = 800
72const TG44_T_CHL_X: i64 = 1200
73const TG44_T_EXO: i64 = 1500
74const TG44_T_RATIO_PIXEL: i64 = 667 // (1000 - 900) over (1150 - 1000)
75const TG44_DECOY: i64 = 9999
76const TG44_R_MID_X: i64 = 100
77const TG44_R_LS_Y: i64 = 90
78const TG44_R_STO_Y: i64 = 100
79const TG44_R_LI_Y: i64 = 118
80const TG44_R_CHR_X: i64 = 80
81const TG44_R_CHL_X: i64 = 124
82const TG44_R_LIP: i64 = 555
83const TG44_J_LI_DY: i64 = 30 // 118 px is 1180 deci against 1150
84const TG44_J_LI_NME: i64 = 20 // 30 * 1000 / 1500
85const TG44_J_CHL_DX: i64 = 40
86const TG44_J_CHL_NME: i64 = 26 // 40 * 1000 / 1500
87const TG44_J_NMEAN: i64 = 9 // (0 + 0 + 20 + 0 + 26) / 5
88const TG44_LI_SLOT: i64 = 2 // labrale inferius is the third landmark of the judge's record
89const TG44_CHL_SLOT: i64 = 4

functions

90func tg44_judge(ctr: *i64, vals: *i64) -> i64
121func tg44_truth(ctr: *i64, vals: *i64) -> i64
146func tg39_canon_genes(g: *i64) -> i64 { var k: i64 = 0; while k < TW_GENES { g[k] = TG39_CANON_PCT; k = k + 1 } return 0 }
called by 1: tg_at39
147func tg39_canon_eye(eg: *i64) -> i64 { var k: i64 = 0; while k < FA_EG_N { eg[k] = fa_eye_gene_canon(k); k = k + 1 } return 0 }
called by 1: tg_at39 calls 1: fa_eye_gene_canon
148func tg_at39(ctr: *i64, vals: *i64) -> i64
249func main(argc: i64, argv: *i64) -> i64