code wiki / (root) / nx_steam_reviews_gate.nx

nx_steam_reviews_gate.nx

buildroot/runtime/nx_steam_reviews_gate.nx

28728 B447 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic steam
docsdependenciesstructsconstsfunctions

about

nx_steam_reviews_gate.nx -- GATE for the review miner's decision core (/compare/intelmine R0-R3: the Steam page reader, the journal row codec, the dedupe set, the stats partitions and the complaint-vs-praise ranker). No network: the page is PLANTED at runtime (built byte by byte so the fixture carries real JSON escapes -- a quoted quote, a backslash, a newline, a pipe, an e-acute and a surrogate pair -- without any of them in a source literal), journaled into /tmp/nx_steam_reviews_gate/, read back, mined. Every number the teeth check is derived from the planted inputs and printed beside its expectation so an outside adjudicator can recompute it. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_reviewmine_lib.nx nx_gate_verdict.nx nx_steam_reviews_gate.nx

imports: nx_syscalls.nxnx_reviewmine_lib.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ rm_mkdirp rm_slen sys_mmap ↻ rm_catn rm_mkdir sys_mkdir sys_mmap ↻ rm_file_put sys_openat_wr rm_write_all sys_write ↻ sys_close g_build_page g_head g_kv_raw g_k g_q g_s rm_cat g_s ↻

structs

none

consts

12const G_DIR: *u8 = "/tmp/nx_steam_reviews_gate"
13const G_PAGE: *u8 = "/tmp/nx_steam_reviews_gate/page.json"
14const G_JRNL: *u8 = "/tmp/nx_steam_reviews_gate/fixture.jrnl"
15const G_SEEN: *u8 = "/tmp/nx_steam_reviews_gate/fixture.seen"
16const G_CORPUS: *u8 = "/tmp/nx_steam_reviews_gate/corpus.jrnl"
17const G_STOP: *u8 = "/tmp/nx_steam_reviews_gate/stop.conf"
18const G_CORPUS2: *u8 = "/tmp/nx_steam_reviews_gate/rubric.jrnl"
19const G_LEX_DEFECT: *u8 = "/tmp/nx_steam_reviews_gate/lex_defect.conf"
20const G_LEX_FEATURE: *u8 = "/tmp/nx_steam_reviews_gate/lex_feature.conf"
21const G_LEX_EXCEED: *u8 = "/tmp/nx_steam_reviews_gate/lex_exceed.conf"
22const G_LEX_NOTMEET: *u8 = "/tmp/nx_steam_reviews_gate/lex_notmeet.conf"
23const G_LEX_VALUE: *u8 = "/tmp/nx_steam_reviews_gate/lex_value.conf"
24const G_LEX_DEMAND: *u8 = "/tmp/nx_steam_reviews_gate/lex_demand.conf"
25const G_RUBRIC_DOCS: i64 = 7
26const G_BROKEN_LIFT: i64 = 1800 // (2+1)*1000*(7+2) / ((2+1)*(3+2))
27const G_CAP: i64 = 65536
28const G_TOTAL: i64 = 211103
29const G_POS: i64 = 208637
30const G_NEG: i64 = 2466
31const G_SCORE: i64 = 9
32const G_NUM: i64 = 3
33const G_R2_VOTES_UP: i64 = 7
34const G_R2_WVS: i64 = 523 // "0.523809552192687988" truncated to permil
35const G_R2_PT: i64 = 30 // minutes -> the under-one-hour band
36const G_R1_PT: i64 = 2381 // minutes -> the 10-100 h band
37const G_R3_PT: i64 = 9000 // minutes -> the over-100 h band
38const G_CURSOR_LEN: i64 = 20
39const G_CURSOR_ENC_LEN: i64 = 24 // two escapes of three bytes each replace two single bytes
40const G_TOP: i64 = 8
41const G_MIN_SUPPORT: i64 = 1
42const G_CRASH_RATIO: i64 = 4000 // (3+1)*1000*(3+2) / ((0+1)*(3+2))
43const G_GAME_RATIO: i64 = 1000 // equal share in both classes
44const G_MUSIC_COMPLAINT_RATIO: i64 = 250
45const G_UTF8_C3: i64 = 195
46const G_UTF8_A9: i64 = 169
47const G_SMALL_CAP: i64 = 4
49const G_NAME: *u8 = "/tmp/nx_steam_reviews_gate/620.name"
50const G_NAME_ABSENT: *u8 = "/tmp/nx_steam_reviews_gate/absent.name"
51const G_NAME_EMPTY: *u8 = "/tmp/nx_steam_reviews_gate/empty.name"
52const G_NAME_LEN: i64 = 16 // Caf + e-acute (2 bytes) + space + quote + Portal + quote + space + 2

functions

54func g_q(b: *u8, o: i64) -> i64 { b[o] = RM_Q as u8; return o + 1 }
55func g_bs(b: *u8, o: i64) -> i64 { b[o] = RM_BS as u8; return o + 1 }
called by 2: g_reviewg_expect2
56func g_s(b: *u8, o: i64, s: *u8) -> i64 { return rm_cat(b, o, s) }
58func g_k(b: *u8, o: i64, k: *u8) -> i64 { var p: i64 = g_q(b, o); p = g_s(b, p, k); p = g_q(b, p); b[p] = RM_COLON as u8; return p + 1 }
59func g_kv_s(b: *u8, o: i64, k: *u8, v: *u8) -> i64 { var p: i64 = g_k(b, o, k); p = g_q(b, p); p = g_s(b, p, v); p = g_q(b, p); b[p] = 44 as u8; return p + 1 }
called by 2: g_reviewg_head calls 3: g_kg_qg_s
60func g_kv_raw(b: *u8, o: i64, k: *u8, v: *u8) -> i64 { var p: i64 = g_k(b, o, k); p = g_s(b, p, v); b[p] = 44 as u8; return p + 1 }
called by 2: g_reviewg_head calls 2: g_kg_s
61func g_review(b: *u8, o: i64, recid: *u8, steamid: *u8, pt: *u8, lang: *u8, textbuilder: i64, up: *u8, votes: *u8, wvs: *u8, free: *u8, ea: *u8, deck: *u8, last: i64) -> i64
110func g_head(b: *u8, total: *u8, num: *u8) -> i64
125func g_tail(b: *u8, o: i64, cursor: *u8) -> i64
132func g_build_page(b: *u8) -> i64
147func g_build_empty(b: *u8) -> i64
called by 1: main calls 2: g_headg_tail
152func g_build_bad(b: *u8) -> i64
called by 1: main calls 3: g_headg_reviewg_tail
159func g_expect2(b: *u8) -> i64
called by 1: main calls 3: g_sg_qg_bs
168func g_expect3(b: *u8) -> i64
called by 1: main
173func g_bytes_eq(a: *u8, b: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { if a[i] != b[i] { return 0 } i = i + 1 } return 1 }
called by 1: main
174func g_file_size(path: *u8) -> i64 { let lp: *i64 = sys_mmap(16) as *i64; lp[0] = 0; let b: *u8 = sys_read_file(path, lp); if (b as i64) == 0 { return 0 } return lp[0] }
called by 1: main calls 2: sys_mmapsys_read_file
176func g_corpus_row(recid: i64, up: i64, text: *u8) -> i64
185func g_slot_of(tok: *u8) -> i64 { return rm_vocab_slot(tok, rm_slen(tok)) }
called by 1: main calls 2: rm_vocab_slotrm_slen
186func g_corpus2_row(recid: i64, up: i64, pt: i64, text: *u8) -> i64
195func g_put(path: *u8, s: *u8) -> i64 { return rm_file_put(path, s, rm_slen(s)) }
called by 1: main calls 2: rm_file_putrm_slen
197func main() -> i64