nx_twinreport_lib.nx
buildroot/runtime/nx_twinreport_lib.nx
about
nx_twinreport_lib.nx -- FROM A CARD TO A VISIBLE RESULT IN ONE CALL (aesthetictwin AT42, 2026-09-17).
Operator 2026-09-17: "just get all of it to mcp and api and workflow and agent powered its better to see what you have
rendered". A reference card's axes go in; the estate's fit loop solves the genes, the fitted face is rendered from three
views, and the result rows are APPENDED to the board's results file in the grammar nx_compare_results renders
(result|slug|kind|date|class|title|report|image|headline), so the next publish shows them. Nothing here is specific to
one person: any card the fit can read is a slug. The seeds verb does the same for synthetic people drawn from the gene
ranges. Rows are slug-keyed, so a re-run supersedes its own earlier rows instead of duplicating them.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 2 importers
imports: nx_syscalls.nxnx_civil_date.nxnx_twinfit_lib.nx
imported by: nx_twinreport.nxnx_twinreport_gate.nx
structs
| none |
consts
| 13 | const TWR_YAW_THREEQUARTER: i64 = 2145 // thirty degrees in the renderer's angle unit (radians times 4096) |
| 14 | const TWR_CAMZ_CLOSE: i64 = 2 |
| 15 | const TWR_PATHB: i64 = 1024 |
| 16 | const TWR_ROWB: i64 = 4096 |
| 17 | const TWR_VIEWS: i64 = 3 |
| 18 | const TWR_MODE644: i64 = 420 |
| 19 | const TWR_DATE_FIELDS: i64 = 8 |
| 20 | const TWR_DATE_YEAR: i64 = 0 |
| 21 | const TWR_DATE_MONTH: i64 = 1 |
| 22 | const TWR_DATE_DAY: i64 = 2 |
| 23 | const TWR_TEN: i64 = 10 |
| 24 | const TWR_CLASS: *u8 = "face-synthetic" |
| 25 | const TWR_E_NOTARGET: i64 = 0 - 3 |
| 26 | const TWR_E_RENDER: i64 = 0 - 4 |
| 27 | const TWR_E_APPEND: i64 = 0 - 5 |
| 28 | const TWR_E_RANGE: i64 = 0 - 6 |
| 30 | const TWR_R_EVALS: i64 = 0 |
| 31 | const TWR_R_REACHED: i64 = 1 |
| 32 | const TWR_R_UNREACHED: i64 = 2 |
| 33 | const TWR_R_UNSTATED: i64 = 3 |
| 34 | const TWR_R_CONFIRMED: i64 = 4 |
| 35 | const TWR_R_RENDERS: i64 = 5 |
| 36 | const TWR_R_ROWS: i64 = 6 |
| 37 | const TWR_R_ROW_BYTES: i64 = 7 |
| 38 | const TWR_R_PNG_BYTES: i64 = 8 |
| 39 | const TWR_R_UNCHANGED: i64 = 9 |
| 40 | const TWR_R_N: i64 = 10 |
| 82 | const TWR_PIPE: i64 = 124 |
| 83 | const TWR_BYTE: i64 = 255 |
| 84 | const TWR_NL: i64 = 10 |
| 85 | const TWR_DATE_FIELD: i64 = 3 |
functions
| 42 | func twr_cat2(out: *u8, o: i64, n: i64) -> i64 { // a two-digit field, zero padded called by 1: twr_today |
| 48 | func twr_today(out: *u8) -> i64 called by 2: twr_fit_reporttwr_seed_report calls 4: sys_mmapcivil_from_unixsys_now_realtime_sectwr_cat2 |
| 59 | func twr_view_name(v: i64) -> *u8 called by 1: twr_fit_report |
| 64 | func twr_view_words(v: i64) -> *u8 called by 1: twr_fit_report |
| 69 | func twr_view_yaw(v: i64) -> i64 { if v == 1 { return TWR_YAW_THREEQUARTER } return TW_YAW_FRONTAL } called by 1: twr_fit_report |
| 70 | func twr_view_camz(v: i64) -> i64 { if v == 2 { return TW_CAMZ_UNITS } return TWR_CAMZ_CLOSE } called by 1: twr_fit_report |
| 71 | func twr_append(path: *u8, buf: *u8, n: i64) -> i64 |
| 87 | func twr_after_pipe(buf: *u8, s: i64, e: i64, k: i64) -> i64 |
| 96 | func twr_span_eq(a: *u8, as0: i64, ae: i64, b: *u8, bs: i64, be: i64) -> i64 |
| 103 | func twr_same_but_date(a: *u8, as0: i64, ae: i64, b: *u8, bs: i64, be: i64) -> i64 |
| 112 | func twr_last_row(file: *u8, fn: i64, row: *u8, rs: i64, re: i64, out: *i64) -> i64 |
| 126 | func twr_append_changed(path: *u8, rows: *u8, ro: i64, rep: *i64) -> i64 called by 2: twr_fit_reporttwr_seed_report calls 5: sys_mmapsys_read_filetwr_last_rowtwr_same_but_datetwr_append |
| 163 | func twr_row_head(row: *u8, o: i64, slug: *u8, suffix: *u8, kind: *u8, date: *u8, title_a: *u8, title_b: *u8, title_c: *u8, hrefpfx: *u8, file: *u8) -> i64 |
| 175 | func twr_fit_report(base: i64, slug: *u8, target_path: *u8, outdir: *u8, hrefpfx: *u8, results_path: *u8, rep: *i64) -> i64 called by 2: mainmain calls 18: sys_mmaptw_load_targettw_all_canon_filltw_fittw_axis_statetw_build_all+12 |
| 249 | func twr_seed_report(base: i64, seed_lo: i64, seed_hi: i64, outdir: *u8, hrefpfx: *u8, results_path: *u8, rep: *i64) -> i64 called by 2: mainmain calls 6: sys_mmaptwr_todaypersongen_build_eyesdfmt_rendertwr_row_headtwr_append_changed |