code wiki / _hdl_build / nx_token_counter_gate.nx
nx_token_counter_gate.nx
buildroot/runtime/_hdl_build/nx_token_counter_gate.nx
about
nx_token_counter_gate.nx -- proves the LLM token estimate is sane and, critically, that pack_text NEVER exceeds
the token budget (the guarantee that makes "fit a book into an LLM" safe) + marks truncation honestly when the
document doesn't fully fit (and does NOT mark it when it does). license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_token_counter.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 6 | func tg_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 7 | func tg_contains(b: *u8, n: i64, pat: *u8) -> i64 |
| 13 | func tg_w(s: *u8) -> i64 { sys_write(1, s, tg_slen(s)); return 0 } |
| 15 | func main() -> i64 |