code wiki / _hdl_build / nx_prefix.nx

nx_prefix.nx

buildroot/runtime/_hdl_build/nx_prefix.nx

2172 B49 linesdepth 2pulls 2 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_prefix.nx -- R-UX-3 of the onsite-search S-class ladder: SOVEREIGN instant / as-you-type prefix autocomplete (LIBRARY). Typing "div" should instantly suggest "divorce" (cited srch_elastic.raw: autocomplete). Sorted vocab + binary-search lower bound -> the matching terms are a CONTIGUOUS run, so suggest is O(log n + k), not O(n) -- that's what makes it "instant" at vocab scale. Deterministic, integer, no third party. exports: vr_prefix_match, vr_prefix_lower, vr_prefix_collect. license_tier: ORIGINAL

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_prefix.nx nx_gallery_serve.nx nx_prefix_gate.nx nx_vocab_extract.nx

imports: nx_syscalls.nx

imported by: nx_gallery_serve.nxnx_prefix_gate.nxnx_vocab_extract.nx

structs

none

consts

none

functions

9func px_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
12func vr_prefix_match(term: *u8, pre: *u8, pl: i64) -> i64
called by 1: vr_prefix_collect
19func px_cmp_pre(a: *u8, pre: *u8, pl: i64) -> i64
called by 1: vr_prefix_lower
33func vr_prefix_lower(terms: *i64, n: i64, pre: *u8, pl: i64) -> i64
called by 2: vr_prefix_collectmain calls 1: px_cmp_pre
44func vr_prefix_collect(terms: *i64, n: i64, pre: *u8, pl: i64, out: *i64) -> i64