code wiki / (root) / nx_mhtarget_lib.nx

nx_mhtarget_lib.nx

buildroot/runtime/nx_mhtarget_lib.nx

8469 B224 linesdepth 4pulls 4 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_mhtarget_lib.nx -- MAKEHUMAN TARGET FACT EXTRACTION CORE (the CC0 morph-target dialect; /compare/koikatsu card-class lane, admitted 2026-08-30). A MakeHuman .target is a text file: comment lines starting with a hash byte, blank lines, and DATA rows of exactly four whitespace-separated tokens -- vertex index (uint) then dx dy dz as signed decimals which may carry a LEADING DOT (measured on the real corpus 2026-08-30: 1675 rows, 4 fields each, max 3 fractional digits, 637 negatives, no exponents, max index 18001). SCHEMA GROUND TRUTH is the fetched real corpus itself (makehumancommunity/makehuman, assets CC0 per LICENSE.ASSETS.md and each file's own header) -- the licence-clean control oracle beside the per-author BodySlide/Nexus lane. Offsets decode to MICRO units (value x 1000000, integer, sign carried, up to six fractional digits kept, extras declared truncated -- numbers, not verdicts). Byte access composes kk_b from the sibling dialect lib; line walking is this dialect's own, and every scan is a BOUNDED FLAG LOOP -- a loop-exit sentinel written into the cursor erases the answer (standing law; the first draft of this very file committed it and was rewritten). Slots: [0] is_target [1] data_rows [2] comment_rows [3] blank_rows [4] max_vert_index [5] bad_rows [6..9] reserved -1 license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_kkfacts_lib.nx nx_mhtarget_lib.nx nx_mhtarget.nx nx_mhtarget_gate.nx

imports: nx_syscalls.nxnx_kkfacts_lib.nx

imported by: nx_mhtarget.nxnx_mhtarget_gate.nx

structs

none

consts

20const MHT_N_SLOTS: i64 = 10
21const MHT_MICRO: i64 = 1000000
22const MHT_FRAC_KEEP: i64 = 6 // fractional digits kept; beyond this consumed but truncated (declared)
23const MHT_BAD: i64 = 0 - 1000000000000 // impossible offset (-1e6 model units); decode stops on it
24const MHT_CH_HASH: i64 = 35
25const MHT_CH_NL: i64 = 10
26const MHT_CH_CR: i64 = 13
27const MHT_CH_SP: i64 = 32
28const MHT_CH_TAB: i64 = 9
29const MHT_CH_MINUS: i64 = 45
30const MHT_CH_DOT: i64 = 46
31const MHT_CH_0: i64 = 48
32const MHT_CH_9: i64 = 57
35const MHT_ROW_COMMENT: i64 = 0
36const MHT_ROW_BLANK: i64 = 1
37const MHT_ROW_DATA: i64 = 2
38const MHT_ROW_BAD: i64 = 3

functions

40func mht_is_ws(c: i64) -> i64 { if c == MHT_CH_SP { return 1 } if c == MHT_CH_TAB { return 1 } if c == MHT_CH_CR { return 1 } return 0 }
41func mht_is_digit(c: i64) -> i64 { if c < MHT_CH_0 { return 0 } if c > MHT_CH_9 { return 0 } return 1 }
44func mht_skip_ws(buf: *u8, p: i64, le: i64) -> i64
called by 1: mht_row calls 2: mht_is_wskk_b
55func mht_tok_end(buf: *u8, p: i64, le: i64) -> i64
called by 1: mht_row calls 2: mht_is_wskk_b
66func mht_line_end(buf: *u8, ls: i64, end: i64) -> i64
called by 2: mht_probemht_decode calls 1: kk_b
78func mht_uint(buf: *u8, off: i64, len: i64) -> i64
called by 1: mht_row calls 2: kk_bmht_is_digit
92func mht_num_micro(buf: *u8, off: i64, len: i64) -> i64
called by 1: mht_row calls 2: kk_bmht_is_digit
123func mht_row(buf: *u8, ls: i64, le: i64, out4: *i64) -> i64
152func mht_probe(buf: *u8, n: i64, file_size: i64, facts: *i64) -> i64
202func mht_decode(buf: *u8, n: i64, idxs: *i64, dxs: *i64, dys: *i64, dzs: *i64, outcap: i64, meta: *i64) -> i64