nx_mhtarget_lib.nx
buildroot/runtime/nx_mhtarget_lib.nx
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
imports: nx_syscalls.nxnx_kkfacts_lib.nx
imported by: nx_mhtarget.nxnx_mhtarget_gate.nx
structs
| none |
consts
| 20 | const MHT_N_SLOTS: i64 = 10 |
| 21 | const MHT_MICRO: i64 = 1000000 |
| 22 | const MHT_FRAC_KEEP: i64 = 6 // fractional digits kept; beyond this consumed but truncated (declared) |
| 23 | const MHT_BAD: i64 = 0 - 1000000000000 // impossible offset (-1e6 model units); decode stops on it |
| 24 | const MHT_CH_HASH: i64 = 35 |
| 25 | const MHT_CH_NL: i64 = 10 |
| 26 | const MHT_CH_CR: i64 = 13 |
| 27 | const MHT_CH_SP: i64 = 32 |
| 28 | const MHT_CH_TAB: i64 = 9 |
| 29 | const MHT_CH_MINUS: i64 = 45 |
| 30 | const MHT_CH_DOT: i64 = 46 |
| 31 | const MHT_CH_0: i64 = 48 |
| 32 | const MHT_CH_9: i64 = 57 |
| 35 | const MHT_ROW_COMMENT: i64 = 0 |
| 36 | const MHT_ROW_BLANK: i64 = 1 |
| 37 | const MHT_ROW_DATA: i64 = 2 |
| 38 | const MHT_ROW_BAD: i64 = 3 |
functions
| 40 | func 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 } |
| 41 | func mht_is_digit(c: i64) -> i64 { if c < MHT_CH_0 { return 0 } if c > MHT_CH_9 { return 0 } return 1 } |
| 44 | func mht_skip_ws(buf: *u8, p: i64, le: i64) -> i64 |
| 55 | func mht_tok_end(buf: *u8, p: i64, le: i64) -> i64 |
| 66 | func mht_line_end(buf: *u8, ls: i64, end: i64) -> i64 |
| 78 | func mht_uint(buf: *u8, off: i64, len: i64) -> i64 |
| 92 | func mht_num_micro(buf: *u8, off: i64, len: i64) -> i64 |
| 123 | func mht_row(buf: *u8, ls: i64, le: i64, out4: *i64) -> i64 |
| 152 | func mht_probe(buf: *u8, n: i64, file_size: i64, facts: *i64) -> i64 |
| 202 | func mht_decode(buf: *u8, n: i64, idxs: *i64, dxs: *i64, dys: *i64, dzs: *i64, outcap: i64, meta: *i64) -> i64 |