code wiki / (root) / nx_twincard_gate.nx

nx_twincard_gate.nx

buildroot/runtime/nx_twincard_gate.nx

20355 B247 linesdepth 7pulls 9 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_twincard_gate.nx -- the referee for nx_twincard_lib (aesthetictwin AT23, 2026-09-16). In-process, on fixtures built at runtime under /tmp/twincard_gate/ (never the production schema, canon or a real card): a good card is accepted with its method partition, coverage and completed left-right pairs exact, and a bad card is refused with every defect class counted and the first offender named -- the group-label neg-control (an "ancestry" axis) is refused BY NAME, a face id not in the canon is undeclared, a paired axis without a side and an unpaired axis with one are refused, a feature of unknown kind, unknown region or outside its chart is refused, a signed value parses, a class word outside its declared set is refused. Values are printed with gv_kv; the verdict line stays LAST. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_twincard_lib.nx nx_twincard_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_twincard_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 gv_need gv_puts ↻ tg_write sys_openat_wr sys_write ↻ sys_close sys_unlinkat sys_openat_rd sys_close ↻ sys_mmap ↻ ri_load sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ gv_check

structs

none

consts

13const TG_DIR: *u8 = "/tmp/twincard_gate"
14const TG_SCHEMA: *u8 = "/tmp/twincard_gate/twincard.axes"
15const TG_CANON: *u8 = "/tmp/twincard_gate/facecanon.conf"
16const TG_GOOD: *u8 = "/tmp/twincard_gate/good.card"
17const TG_BAD: *u8 = "/tmp/twincard_gate/bad.card"
18const TG_BAD2: *u8 = "/tmp/twincard_gate/bad2.card"
19const TG_BAD2_TEXT: *u8 = "card|gamma|Gamma Fixture|real|F|REVIEW|1\naxis|ident|ancestry|C|anything|observed|r1|2026-09-16\n"
20const TG_NEG20: i64 = 0 - 20
21const TG_SCHEMA_TEXT: *u8 = "axis|ident|stature|cm10|1200|2200|0|standing height\naxis|ident|sex|class|0|0|0|sex\nclass|ident|sex|F\nclass|ident|sex|M\nclass|ident|sex|X\naxis|skin|freckle_density|class|0|0|0|freckles\nclass|skin|freckle_density|none\nclass|skin|freckle_density|moderate\naxis|soft|areola_over_breast|permil|50|400|1|areola over breast base\naxis|eyes|canthal_tilt|deg10|-150|150|1|lateral canthus above medial is positive\nregion|face|the face chart\nregion|chest|the chest chart\nruler|soft|areola_over_breast|/tmp/twincard_gate/organ_present.nx|am_areola\nruler|face|*|/tmp/twincard_gate/organ_nosymbol.nx|pm_landmarks\nclass|shot|presentation|nude-art\nclass|shot|presentation|glamour\nclass|shot|makeup|none\nclass|shot|makeup|full\nclass|shot|hair_state|natural\nclass|shot|hair_state|styled\nclass|shot|retouch|raw\nclass|shot|retouch|unknown\n"
22const TG_CANON_TEXT: *u8 = "canon|facial_index|bizygomatic|trichion-menton|744|0|0|A|permil|BRIEF|BRIEF\ncanon|vthird_upper|trichion-glabella|trichion-menton|333|0|0|A|permil|BRIEF|BRIEF\n"
23const TG_GOOD_TEXT: *u8 = "card|alpha|Alpha Fixture|real|F|REVIEW|1\nref|r1|knowledge/fetched/fx.jpg|0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|REVIEW|mirrored\nref|r2|-|-|REVIEW|unmirrored paste\nshot|r1|2019-05|22|seated|neutral|dappled|wicker|eye-level|necklace|nude-art|none|natural|raw\nshot|r2|-|-|standing|smile|soft|studio|eye-level|-|glamour|full|styled|unknown\naxis|ident|stature|C|1680|measured|r1|2026-09-16\naxis|ident|sex|C|F|declared|operator|2026-09-16\naxis|skin|freckle_density|C|moderate|observed|r2|2026-09-16\naxis|soft|areola_over_breast|L|180|observed|r2|2026-09-16\naxis|soft|areola_over_breast|R|172|observed|r2|2026-09-16\naxis|eyes|canthal_tilt|L|-20|measured|r1|2026-09-16\naxis|face|facial_index|C|744|measured|r1|2026-09-16\nfeature|freckle|L|face|412|388|120|620|180|210|observed|r2\nfeature|mole|C|chest|500|300|450|350|150|120|measured|r1\n"
24const TG_BAD_TEXT: *u8 = "card|beta|Beta Fixture|human|F|REVIEW|1\naxis|ident|ancestry|C|anything|observed|r1|2026-09-16\naxis|face|golden_ratio|C|618|measured|r1|2026-09-16\naxis|ident|stature|C|3000|measured|r1|2026-09-16\naxis|ident|stature|C|1700|measured|r1|2026-09-16\naxis|skin|freckle_density|C|lots|observed|r1|2026-09-16\naxis|eyes|canthal_tilt|L|10|guessed|r1|2026-09-16\naxis|soft|areola_over_breast|C|200|observed|r1|2026-09-16\naxis|ident|stature|L|1650|measured|r1|2026-09-16\nref|r1|-|abc|REVIEW|bad sha\nshot|r9|-|-|-|-|-|-|-|-|nude-art|none|natural|raw\nshot|r1|-|-|-|-|-|-|-|-|beach|none|natural|raw\nfeature|wart|L|face|10|10|10|500|0|0|observed|r1\nfeature|freckle|L|nowhere|10|10|10|500|0|0|observed|r1\nfeature|freckle|L|face|2000|10|10|500|0|0|observed|r1\n"
25const TG_GOOD_AXES: i64 = 7
26const TG_GOOD_MEASURED: i64 = 3
27const TG_GOOD_OBSERVED: i64 = 3
28const TG_GOOD_DECLARED: i64 = 1
29const TG_GOOD_REFS: i64 = 2
30const TG_GOOD_SHOTS: i64 = 2
31const TG_GOOD_FEATURES: i64 = 2
32const TG_SCHEMA_SECTIONS: i64 = 4
33const TG_FACE_DECLARED: i64 = 2
34const TG_SOFT_DECLARED: i64 = 2
35const TG_EYES_DECLARED: i64 = 2
36const TG_TOTAL_DECLARED: i64 = 9
37const TG_TOTAL_FILLED: i64 = 7
38const TG_PAIRS_DECLARED: i64 = 2
39const TG_HALF: i64 = 500
40const TG_BAD_DEFECTS: i64 = 15
41const TG_BAD_SHOTS: i64 = 2
42const TG_COV_AXES: i64 = 7
43const TG_COV_RULED: i64 = 3
44const TG_COV_UNRULED: i64 = 4
45const TG_BAD_UNDECLARED: i64 = 2
46const TG_BAD_SIDE: i64 = 2
47const TG_BAD_FEATURES: i64 = 3
48const TG_BAD_AXES: i64 = 8
49const TG_CENSUS_N: i64 = 4
53const TG_CEN_SCHEMA: *u8 = "/tmp/twincard_gate/census.axes"
54const TG_ORGAN_PRESENT: *u8 = "/tmp/twincard_gate/organ_present.nx"
55const TG_ORGAN_NOSYMBOL: *u8 = "/tmp/twincard_gate/organ_nosymbol.nx"
56const TG_ORGAN_MISSING: *u8 = "/tmp/twincard_gate/organ_missing.nx"
57const TG_ORGAN_PRESENT_TEXT: *u8 = "func am_areola(x: i64) -> i64 {\n return x\n}\n"
58const TG_ORGAN_NOSYMBOL_TEXT: *u8 = "func tg_unrelated(x: i64) -> i64 {\n return x\n}\n"
59const TG_CEN_SCHEMA_TEXT: *u8 = "ruler|soft|areola_over_breast|/tmp/twincard_gate/organ_present.nx|am_areola\nruler|face|*|/tmp/twincard_gate/organ_nosymbol.nx|pm_landmarks\nruler|eyes|canthal_tilt|/tmp/twincard_gate/organ_missing.nx|ct_tilt\n"
60const TG_CEN_ROWS: i64 = 3
61const TG_CEN_ABSENT_AFTER: i64 = 2

functions

63func tg_write(path: *u8, text: *u8) -> i64
71func main(argc: i64, argv: *i64) -> i64