code wiki / (root) / nx_seg_store.nx

nx_seg_store.nx

buildroot/runtime/nx_seg_store.nx

252513 B5113 linesdepth 2pulls 2 transitivereach 1743 importersview sourcekind librarytopic seg
docsdependenciesstructsconstsfunctions

about

nx_seg_store.nx -- PART A of the sovereign storage substrate rung 1 (knowledge/specs/2026-06-09-tutoring-storage-substrate-rung1.md). Append-only IMMUTABLE segment store, pure NishiLang, NO SQL. Model: - a segment is written once (seg-<id>.docs) and never mutated - new data => a NEW segment; deletes => tombstone entries (ADDITIVE law: history is never destroyed, old versions stay readable) - THE COMMIT POINT: segment temp file -> rename(2), then manifest temp -> rename(2). Readers only see segments listed in manifest.txt, so a half-written segment (crash before commit) is INVISIBLE by construction. That is the crash-safety claim the gate proves by fault injection. Entry format inside .docs: u8 kind (1=put 2=tombstone) | u32be klen | key | u32be vlen | value-bytes Values are nx_canon_cid canonical record bytes (content-addressed upstream). "Directory" = a path PREFIX string (e.g. "/tmp/im123-"), so no mkdir is needed (sys_mkdir landmine avoided); a durable store uses a knowledge/ prefix. Rung-2 additions 2026-06-10: sys_fsync (probe-proven x86 74) on every file write + directory fsync after the commit renames = the IM3 power-loss debt CLOSED at the code level; per-segment sorted key index seg-<id>.keys with binary-search reads (ss_get_idx), scan path kept as the ORACLE the gate races it against. Honest remaining scope (flagged, NOT silent caps): term-postings for text search (IM2 full: delta+bitpack), manifest cap 256 segments + 4096 keys/segment (compaction/merge = IM4). license_tier: ORIGINAL

dependencies 1 imports · 469 importers

nx_syscalls.nx nx_seg_store.nx _gallery_serve_ref.nx _galx_bulk_ingest.nx _galx_ingest_gate.nx _galx_prod_ingest.nx _galx_serve_setup.nx _ixprof.nx _queue_load_gate_authored.nx _ss_compact_cap_gate.nx _wiki_archive_gate.nx _wiki_search_gate.nx

diagram shows first 10 each side; +0 more imports, +459 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: _gallery_serve_ref.nx_galx_bulk_ingest.nx_galx_ingest_gate.nx_galx_prod_ingest.nx_galx_serve_setup.nx_ixprof.nx_queue_load_gate_authored.nx_ss_compact_cap_gate.nx_wiki_archive_gate.nx_wiki_search_gate.nxnx_accept_lib.nxnx_account_admin_exceed_gate.nxnx_acct_admin_handoff.nxnx_activities.nxnx_activities_gate.nxnx_ad_feedback_gate.nxnx_ad_intake.nxnx_ad_ivt_gate.nxnx_ad_store.nxnx_ad_store_seed.nxnx_ads.nxnx_adversarial_sov.nxnx_aid.nxnx_aid_federation.nxnx_aid_federation_gate.nxnx_aid_gate.nxnx_algo_registry.nxnx_algo_registry_migrate.nxnx_algo_retire.nxnx_analyst_store.nxnx_app_store.nxnx_arch_board.nxnx_archcensus.nxnx_ask_lib.nxnx_asset_catalog.nxnx_asset_catalog_gate.nxnx_asset_record.nxnx_asset_record_gate.nxnx_asset_signals.nxnx_asset_signals_gate.nxnx_asset_status_gate.nxnx_atlas_discover.nxnx_atlas_discover_gate.nxnx_atlas_gapscan.nxnx_atlas_gapscan_gate.nxnx_audio_census.nxnx_autofix_cascade_gate.nxnx_autofix_ensemble.nxnx_backlog_feeder.nxnx_battery_grade.nxnx_bench_ingest.nxnx_bills_store.nxnx_blocklist_store.nxnx_browser_census.nxnx_browser_profile_store.nxnx_build_reg_sov.nxnx_cap_gap_sov.nxnx_cap_harvest.nxnx_cap_provision_gate.nxnx_capability_no_regression.nxnx_carflip_deal.nxnx_census_load.nxnx_chart_migrate.nxnx_chat_demo_api.nxnx_chat_demo_unicode_t59.nxnx_chat_store.nxnx_chat_unicode_store_t60.nxnx_ciaaw_gate.nxnx_ciaaw_ingest.nxnx_ciq_analyst.nxnx_ciq_field_clinical.nxnx_ciq_field_connect.nxnx_ciq_field_games.nxnx_ciq_field_imagegen.nxnx_ciq_field_maintenance.nxnx_ciq_field_omniforge.nxnx_ciq_publish.nxnx_ciq_quadrant.nxnx_ciq_sclass_gate.nxnx_ciq_visual.nxnx_clawf_route.nxnx_clean_market.nxnx_clean_market_gate.nxnx_climbout_progress.nxnx_coach_curriculum_lib.nxnx_coach_exceed.nxnx_coach_rubric.nxnx_coach_serve.nxnx_codata_gate.nxnx_codata_ingest.nxnx_collision_watchdog_gate.nxnx_commitbench.nxnx_common_tasks.nxnx_companion_gate.nxnx_comparewatch_census.nxnx_conductor_recall_gate.nxnx_conductor_registry.nxnx_consol_apply.nxnx_consol_apply_gate.nxnx_consol_apply_mc.nx +369 more (shown cap 100 declared)

structs

none

consts

29const SS_MAGIC_16777619: i64 = 16777619
30const SS_MAGIC_65536: i64 = 65536
31const SS_MAGIC_1048576: i64 = 1048576
32const SS_MAGIC_4096: i64 = 4096
37const SS_MADV_WILLNEED: i64 = 3
38const SS_MAGIC_1024: i64 = 1024
39const SS_MAGIC_1039: i64 = 1039
40const SS_MAGIC_1040: i64 = 1040
41const SS_MAGIC_1071: i64 = 1071
42const SS_MAGIC_1072: i64 = 1072
43const SS_MAGIC_1279: i64 = 1279
44const SS_MAGIC_12352: i64 = 12352
45const SS_MAGIC_12543: i64 = 12543
46const SS_MAGIC_3040: i64 = 3040
47const SS_MAGIC_13312: i64 = 13312
48const SS_MAGIC_19903: i64 = 19903
49const SS_MAGIC_3400: i64 = 3400
50const SS_MAGIC_19968: i64 = 19968
51const SS_MAGIC_40959: i64 = 40959
52const SS_MAGIC_44032: i64 = 44032
53const SS_MAGIC_55215: i64 = 55215
54const SS_MAGIC_63744: i64 = 63744
55const SS_MAGIC_64255: i64 = 64255
56const SS_MAGIC_1469598103934665603: i64 = 1469598103934665603
57const SS_MAGIC_1099511628211: i64 = 1099511628211
105const SS_READALL_PAD: i64 = 64
149const SS_ERR_DURABILITY: i64 = -10
211const SS_SR_SLOTS: i64 = 40 // max mappings one builder records (build_terms makes 25; head-room named)
212const SS_SR_STRIDE: i64 = 2 // (ptr, len) per slot
318const SS_KEYS_REFUSE_KEY: i64 = 0 - 2 // a record's key length runs past the writer buffer
319const SS_KEYS_REFUSE_VALUE: i64 = 0 - 3 // a record's value length runs past the writer buffer
534const SS_LOWER_A: i64 = 97
535const SS_LOWER_Z: i64 = 122
536const SS_UPPER_A: i64 = 65
537const SS_UPPER_Z: i64 = 90
538const SS_DIG_0: i64 = 48
539const SS_DIG_9: i64 = 57
540const SS_UNDERSCORE: i64 = 95
541const SS_SP: i64 = 32
542const SS_IDENT_MIN: i64 = 2 // a collapsed anchor shorter than this is noise (an underscore beside one letter)
591const SS_DEF_PREFIX: *u8 = "def"
1100const SS_IMP_K: i64 = 512
1374const SS_SEGID_PTRBAND_LO: i64 = 10000000000000
1375const SS_SEGID_PTRBAND_HI: i64 = 140737488355328
1408const SS_LOCK_EX: i64 = 2
1409const SS_LOCK_UN: i64 = 8
1410const SS_LOCK_NB: i64 = 4 // flock LOCK_NB -- ORed with LOCK_EX to poll instead of block
1411const SS_LOCK_SLEEP_MS: i64 = 50 // backoff between attempts
1412const SS_LOCK_TRIES: i64 = 2400 // 2400 x 50ms = 120s ceiling. RAISED FROM 30s BY MEASUREMENT: nx_segrace_gate stresses 7 processes doing fsync-per-commit on one plane, and at 30s FOUR writers were refused while merely QUEUED (not wedged) on a disk at IO load ~15. A bound must exceed legitimate worst-case contention or it manufactures the failure it exists to report; 120s still bounds the hang, and the >10min stall this was built for is still caught.
1413const SS_LOCKMODE: i64 = 420
1414const SS_LOCKPATHCAP: i64 = 512
1587const SS_CAS_ANY: i64 = 0 - 2
1588const SS_ERR_STALE: i64 = 0 - 9
1724const SS_MANIFEST_LEGACY_CAP: i64 = 256
1725const SS_VER_SLOTS: i64 = 260 // per-key version buffer allocation (kinds/ptrs/lens/srcs slots)
1726const SS_VER_WINDOW: i64 = 256 // versions of ONE key a scan retains; on overflow the OLDEST slides out
1781const SS_MF_MAGIC: i64 = 0x53534D46
2054const SS_IDX_U32: i64 = 4
2055const SS_IDX_HEADER: i64 = SS_IDX_U32 * 2
2056const SS_IDX_ENTRY_FIXED: i64 = 1 + SS_IDX_U32 * 3
2133const SS3_SLOT_NAMES: i64 = 7
2134const SS3_SLOT_TSEG: i64 = 8
2135const SS3_SLOT_TEO: i64 = 9
2136const SS3_SLOT_CAP: i64 = 10
2137const SS3_SLOT_INS: i64 = 11
2138const SS3_SLOT_MODE: i64 = 12
2149const SS3_SLOT_AUX: i64 = 13
2150const SS_AUXW: i64 = 8
2151const SS_TSAMPLE: i64 = 64
2152const SS_TPREFIX: i64 = 7
2153const SS3_MODE_FULL: i64 = 0
2154const SS3_MODE_INCR: i64 = 1
2155const SS3_STATBUF: i64 = 160
2156const SS3_ST_SIZE_OFF: i64 = 48
2157const SS3_ANN_CAP: i64 = 256
2158const SS3_PATHCAP: i64 = 512
2159const SS3_KEYMAX: i64 = 500
2164const SS3_LOAD_NUM: i64 = 3
2165const SS3_LOAD_DEN: i64 = 4
2210const SS_AUX_DOCN: i64 = 4
2456const SSL_EMPTY: i64 = 0
2459const SSL_TOMB: i64 = 0 - 1
3421const SSC_SLOTS: i64 = 16
3422const SSC_W: i64 = 4
3424const SSC_RETIRE: i64 = 32
3433const SSC_ST_HIT: i64 = 0
3434const SSC_ST_REOPEN: i64 = 1
3435const SSC_ST_NEWSLOT: i64 = 2
3436const SSC_ST_FALLBACK: i64 = 3 // slots exhausted -> per-call open (now retired, formerly leaked)
3437const SSC_ST_DROP: i64 = 4 // retire ring full -> pointer dropped (the documented bounded leak)
3438const SSC_ST_SLOTS: i64 = 8
4583const SS_CUR_SLOTS: i64 = 8

functions

59func ss_len(s: *u8) -> i64
65func ss_cat(dst: *u8, off: i64, s: *u8) -> i64
72func ss_catn(dst: *u8, off: i64, v: i64) -> i64
85func ss_w32(p: *u8, off: i64, v: i64) -> i64
93func ss_r32(p: *u8, off: i64) -> i64
106func ss_readall(path: *u8, szout: *i64) -> *u8
125func ss_freeall(buf: *u8, len: i64) -> i64
139func ss_loadfile(path: *u8, szout: *i64, usemmap: i64) -> *u8
151func ss_writefile(path: *u8, bytes: *u8, n: i64) -> i64
170func ss_syncdir(prefix: *u8) -> i64
213func ss_sr_new() -> *i64 { let l: *i64 = sys_mmap(8 * (1 + SS_SR_SLOTS * SS_SR_STRIDE)) as *i64; l[0] = 0; return l }
214func ss_sr_map(l: *i64, n: i64) -> *u8
225func ss_sr_release(l: *i64) -> i64
233func ss_begin_cap(cap: i64) -> *i64
241func ss_begin() -> *i64
called by 249: mainmainbuild_storemainmainmain+243 calls 1: ss_begin_cap
245func ss_add(w: *i64, kind: i64, key: *u8, val: *u8, vlen: i64) -> i64
250func ss_add2(w: *i64, kind: i64, key: *u8, kl: i64, val: *u8, vlen: i64) -> i64
267func ss_segname(prefix: *u8, segid: i64, tmp: i64, out: *u8) -> i64
285func ss_khash(k: *u8, kl: i64) -> i64
295func ss_kcmp(a: *u8, al: i64, b: *u8, bl: i64) -> i64
316func ss_keyblob_cap(w: *i64) -> i64 { return w[1] * 3 + SS_MAGIC_65536 }
called by 2: ss_write_segmain
320func ss_build_keys(w: *i64, kout: *u8) -> i64
464func ss_crashwrite(prefix: *u8, w: *i64, segid: i64) -> i64
482func ss_vw(p: *u8, off: i64, v: i64) -> i64
496func ss_vr(p: *u8, pos: *i64) -> i64
513func ss_tok_table(tbl: *u8) -> i64
543func ss_is_ident_byte(c: i64) -> i64
550func ss_ident_anchors(src: *u8, n: i64, out: *u8, cap: i64) -> i64
574func ss_ident_collapse(term: *u8, out: *u8, cap: i64) -> i64
called by 1: es_query
592func ss_def_token(name: *u8, nlen: i64, out: *u8, cap: i64) -> i64
609func ss_fold_cp(cp: i64) -> i64
626func ss_u8cp(b: *u8, sz: i64, i: i64) -> i64
651func ss_fold_word_cp(cp: i64) -> i64
662func ss_is_cjk(cp: i64) -> i64
676func ss_tok_next2(b: *u8, sz: i64, pos: *i64, tout: *u8, tbl: *u8) -> i64
763func ss_tok_next(b: *u8, sz: i64, pos: *i64, tout: *u8) -> i64
770func ss_tok_has(b: *u8, sz: i64, term: *u8) -> i64
794func ss_fnv(s: *u8) -> i64
819func ss_build_terms(w: *i64, tblob: *u8, pblob: *u8, qblob: *u8, louts: *i64) -> i64
1105func ss_imp_thresh(tfs: *i64, n: i64, k: i64, outs: *i64) -> i64
called by 1: ss_build_imp calls 1: sys_mmap
1134func ss_build_imp(tb: *u8, tsz: i64, pb: *u8, psz: i64, qb: *u8, qsz: i64, wblob: *u8) -> i64
1207func ss_auxname(prefix: *u8, segid: i64, ext: *u8, tmp: i64, out: *u8) -> i64
1227func ss_write_seg(prefix: *u8, w: *i64, segid: i64) -> i64
1312func ss_load_aux(prefix: *u8, segname: *u8, outs: *i64) -> i64
called by 2: ss_idx_lookupsc_stat calls 1: ss_load_aux2
1315func ss_load_aux2(prefix: *u8, segname: *u8, outs: *i64, usemmap: i64) -> i64
1378func ss_segid_ok(v: i64) -> i64
1418func ss_plane_lock(prefix: *u8) -> i64
1482func ss_name_eq(a: *u8, b: *u8) -> i64
1489func ss_plane_unlock(fd: i64) -> i64
1503func ss_max_segid(prefix: *u8) -> i64
1533func ss_commit_body(prefix: *u8, w: *i64, segid: i64) -> i64
1589func ss_commit_cas(prefix: *u8, w: *i64, segid: i64, expect_max: i64) -> i64
1610func ss_commit(prefix: *u8, w: *i64, segid: i64) -> i64
1651func ss_commit_deferred_body(prefix: *u8, w: *i64, segid: i64) -> i64
1694func ss_sync_now(prefix: *u8) -> i64
called by 2: cb_armreg_batch_sync calls 1: ss_syncdir
1708func ss_commit_deferred(prefix: *u8, w: *i64, segid: i64) -> i64
1733func ss_manifest_file(prefix: *u8, fname: *u8, segs: *i64) -> i64
1762func ss_manifest(prefix: *u8, segs: *i64) -> i64
1782func ss_manifest_file_dyn(prefix: *u8, fname: *u8, out_segs: *i64) -> i64
1832func ss_manifest_free(segs: *i64, n: i64) -> i64
called by 3: ss_closess3_movemain calls 1: sys_munmap
1843func ss_manifest_dyn(prefix: *u8, out_segs: *i64) -> i64
1853func ss_next_segid(prefix: *u8) -> i64
1865func ss_next_segid_oracle(prefix: *u8) -> i64
1903func ss_manifest_file_cap(prefix: *u8, fname: *u8, segs: *i64, cap: i64) -> i64
1931func ss_manifest_cap(prefix: *u8, segs: *i64, cap: i64) -> i64
1939func ss_scan_cap(prefix: *u8, key: *u8, kinds: *i64, ptrs: *i64, lens: *i64, cap: i64) -> i64
1949func ss_get_cap(prefix: *u8, key: *u8, ptrout: *i64, lenout: *i64, cap: i64) -> i64
1968func ss_scan_seglist(prefix: *u8, segs: *i64, ns: i64, key: *u8, kinds: *i64, ptrs: *i64, lens: *i64, srcs: *i64, srcval: i64, cnt0: i64, cap: i64) -> i64
2023func ss_scan(prefix: *u8, key: *u8, kinds: *i64, ptrs: *i64, lens: *i64) -> i64
2037func ss_scan_all(prefix: *u8, key: *u8, kinds: *i64, ptrs: *i64, lens: *i64, srcs: *i64) -> i64
2057func ss_idx_find(b: *u8, sz: i64, key: *u8, voffout: *i64, vlenout: *i64) -> i64
2096func ss_idx_lookup(prefix: *u8, segname: *u8, key: *u8, voffout: *i64, vlenout: *i64) -> i64
2169func ss_aux(h: *i64) -> *i64
called by 2: ss_aux_rowss3_move
2175func ss_aux_row(h: *i64, s: i64) -> *i64
2183func ss_aux_free_row(h: *i64, s: i64) -> i64
2194func ss_tpack(p: *u8, n: i64) -> i64
2211func ss_is_doc_key(kb: *u8, eo: i64) -> i64
called by 1: ss_doccount_build calls 1: ss_r32
2226func ss_doccount_build(h: *i64, s: i64) -> i64
2244func ss_tsample_build(h: *i64, s: i64) -> i64
2277func ss_tsample_window(h: *i64, s: i64, pk: i64, n: i64, lohi: *i64) -> i64
2302func ss_terms_ordinal_h(h: *i64, s: i64, term: *u8, outs: *i64) -> i64
2332func ss_terms_find_h(h: *i64, s: i64, term: *u8, outs: *i64) -> i64
2340func ss_key_of_doc(h: *i64, s: i64, d: i64, kpout: *i64, klout: *i64) -> i64
2358func ss_close_seg(h: *i64, ns: i64, s: i64) -> i64
2392func ss_close(h: *i64) -> i64
2433func ss_open(prefix: *u8) -> *i64
2461func ssl_pow2(n: i64) -> i64
2467func ssl_total_keys(h: *i64, ns: i64) -> i64
called by 1: ss_open3 calls 1: ss_r32
2479func ssl_key_eq(h: *i64, seg: i64, eo: i64, kb2: *u8, eo2: i64) -> i64
2492func ssl_hash_entry(kb: *u8, eo: i64) -> i64
2506func ssl_hash_i32(v: i64) -> i64
2519func ssl_build(h: *i64, ns: i64, tbl_seg: *i64, tbl_eo: *i64, cap: i64) -> i64
2556func ssl_lookup(h: *i64, tbl_seg: *i64, tbl_eo: *i64, cap: i64, kb: *u8, eo: i64) -> i64
2580func ss_open_trace(v: i64) -> i64 { ss_trace = v; return 0 }
called by 1: main
2581func ss_tr(lbl: *u8, us: i64) -> i64
2607func ss_open_seg_absent(segname: *u8) -> i64
2641func ss3_streq(a: *u8, b: *u8) -> i64
called by 1: ss3_admit
2648func ss_open_mode(h: *i64) -> i64
called by 1: main
2654func ss_open_segname(h: *i64, s: i64) -> *u8
2663func ss_open_table(h: *i64, outs: *i64) -> i64
called by 2: si_table_diffmain
2680func ss3_ann(kind: *u8, k1: *u8, v1: i64, k2: *u8, v2: i64, k3: *u8, v3: i64, reason: *u8, us: i64) -> i64
2702func ss3_docs_size(prefix: *u8, segname: *u8) -> i64
2722func ss3_admit(prefix: *u8, segs: *i64, ns: i64, prev: *i64, reuse: *i64, t0: i64) -> i64
2759func ss3_move(h: *i64, ns: i64, prev: *i64, reuse: *i64, remap: *i64) -> i64
called by 1: ss_open3 calls 2: ss_auxss_manifest_free
2804func ss3_remap_table(tseg: *i64, cap: i64, remap: *i64, pn: i64) -> i64
called by 1: ss_open3
2819func ssl_total_keys_range(h: *i64, a: i64, b: i64) -> i64
calls 1: ss_r32
2830func ssl_total_keys_mask(h: *i64, ns: i64, newmask: *i64) -> i64
called by 1: ss_open3 calls 1: ss_r32
2846func ss3_clear_mark(h: *i64, ns: i64, oseg: i64, oeo: i64, dhk: *i64, dhv: *i64, dhc: *i64) -> i64
2904func ss3_insert_new(h: *i64, ns: i64, newmask: *i64, tseg: *i64, teo: *i64, cap: i64, outs: *i64) -> i64
2964func ss3_tomb_count(tseg: *i64, cap: i64) -> i64
called by 1: ss_open3
2972func ss3_load_range(prefix: *u8, segs: *i64, h: *i64, a: i64, b: i64, usemmap: i64, dp: *u8, dszp: *i64, aouts: *i64) -> i64
2998func ss_open2(prefix: *u8, usemmap: i64) -> *i64
called by 13: mainmainmaines_querymainpb_run+7 calls 1: ss_open3
3003func ss_open_incr(prefix: *u8, usemmap: i64, prev: *i64) -> *i64
called by 1: dss_open_maybe_cached calls 1: ss_open3
3006func ss_open3(prefix: *u8, usemmap: i64, prev: *i64, retain: i64) -> *i64
3443func ssc_init() -> i64
3453func ss_cache_stat(idx: i64) -> i64
called by 1: main calls 1: ssc_init
3477func ssc_retire_handle(h: i64) -> i64
called by 1: ss_open_cached
3493func ss_cache_reap() -> i64
called by 3: mainmainmain calls 2: ssc_initss_close
3509func ss_cache_retired() -> i64
called by 2: mainmain calls 1: ssc_init
3513func ssc_streq(a: *u8, b: *u8) -> i64
called by 1: ss_open_cached
3524func ssc_sig_of(prefix: *u8, sig: *i64) -> i64
called by 1: ss_open_cached calls 2: ss_catsys_fstatat
3544func ss_open_cached(prefix: *u8) -> *i64
3626func ssl_hash_raw(key: *u8, kl: i64) -> i64
called by 1: ss_hlocate
3646func ss_hlocate(h: *i64, key: *u8, kl: i64, outs: *i64) -> i64
3678func ss_hget(h: *i64, key: *u8, ptrout: *i64, lenout: *i64) -> i64
3718func ss_terms_find(tb: *u8, tsz: i64, term: *u8, outs: *i64) -> i64
called by 1: cmd_probe calls 3: ss_r32ss_lenss_kcmp
3752func ss_term(h: *i64, term: *u8, kpout: *i64, klout: *i64, max: i64) -> i64
3807func ss_term_and(h: *i64, terms: *i64, nterms: i64, kpout: *i64, klout: *i64, max: i64) -> i64
3902func ss_term_dcount(h: *i64, term: *u8) -> i64
3923func ss_term_count(h: *i64, s: i64) -> i64
3930func ss_term_at(h: *i64, s: i64, idx: i64, tp_out: *i64, tl_out: *i64, dc_out: *i64) -> i64
3954func ss_term_lb(h: *i64, s: i64, pfx: *u8, pfxlen: i64) -> i64
4000func ss_doc_count_walk(h: *i64) -> i64
called by 2: mainss_doc_count calls 1: ss_r32
4031func ss_doc_count(h: *i64) -> i64
4047func ss_terms_ordinal(tb: *u8, tsz: i64, term: *u8, outs: *i64) -> i64
4075func ss_q_positions(qb: *u8, qsz: i64, ord: i64, rank: i64, posout: *i64, maxpos: i64) -> i64
called by 1: ss_phrase calls 3: ss_r32sys_mmapss_vr
4139func ss_term_top_mask(prefix: *u8, h: *i64, mask: *u8, term: *u8, kpout: *i64, klout: *i64, tfout: *i64, max: i64, satout: *i64) -> i64
4344func ss_term_top(prefix: *u8, h: *i64, term: *u8, kpout: *i64, klout: *i64, tfout: *i64, max: i64, satout: *i64) -> i64
4353func ss_phrase(prefix: *u8, h: *i64, terms: *i64, nterms: i64, kpout: *i64, klout: *i64, max: i64, exactout: *i64) -> i64
4510func ss_get_idx(prefix: *u8, key: *u8, ptrout: *i64, lenout: *i64) -> i64
4515func ss_get_idx_required(prefix: *u8, key: *u8, ptrout: *i64, lenout: *i64) -> i64
4518func ss_get_idx_mode(prefix: *u8, key: *u8, ptrout: *i64, lenout: *i64, allow_scan: i64) -> i64
4556func ss_get(prefix: *u8, key: *u8, ptrout: *i64, lenout: *i64) -> i64
4585func ss_cur_open(prefix: *u8) -> *i64
4599func ss_cur_next(prefix: *u8, st: *i64,
4689func ss_verify_merged(prefix: *u8, segid: i64, tkp: *i64, tkl: *i64, tkind: *i64, tvp: *i64, tvl: *i64, nk: i64, hidx: *i64, hcap: i64) -> i64
4737func ss_compact(prefix: *u8, segid: i64) -> i64 { // THE COMPACTOR IS THE MOST DESTRUCTIVE WRITER ON THE PLANE, so it takes the same lock.
4942func ss_compact_cap(prefix: *u8, segid: i64, cap: i64) -> i64