code wiki / _hdl_build / nx_swebv_ingest.nx

nx_swebv_ingest.nx

buildroot/runtime/_hdl_build/nx_swebv_ingest.nx

8087 B193 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic swebv
docsdependenciesstructsconstsfunctions

about

nx_swebv_ingest.nx -- F787 rung-2: parse the five fetched SWE-bench Verified /rows pages (knowledge/fetched/swebv_rows_{000..400}.raw, ingested by nx_swebv_research_fetch) into the per-instance INDEX plane knowledge/store/swebvinst- : one 6-col row per instance instance_id<TAB>repo<TAB>base_commit<TAB>version<TAB>difficulty<TAB>page-tag The plane is the queryable index; the big fields (patch/test_patch/problem_statement/ FAIL_TO_PASS/PASS_TO_PASS) STAY in the .raw corpus, addressed by page-tag + instance_id. PARSER SOUNDNESS: anchors start with a BARE quote byte; inside any JSON string value every quote is escaped (backslash-quote), so a bare-quote needle can never match inside a value -- plus a prev-byte backslash check. Field order per row (features 0..12) means sequential forward scanning; difficulty is the last field before the next row anchor. TOOTH (D001 verdict contract): exactly 500 rows parsed + seeded -> verdict=GREEN, else RED. ONE sts_seed commit = idempotent re-run. Envelope: page cap 4MiB/file, out cap 256KiB. expect_exit: 0 license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_store_seed_lib.nx nx_seg_store.nx nx_syscalls.nx nx_swebv_ingest.nx

imports: nx_store_seed_lib.nxnx_seg_store.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sv_page sv_read sys_openat_rd sys_read sys_close sv_werr sys_write sv_scan sys_mmap ↻ sv_find sv_slen sv_field sv_find ↻ sv_slen ↻ sv_emit sv_emitc sv_werr ↻ sv_wn sys_write ↻ sys_mmap ↻ sys_exit sts_seed ss_begin_cap sys_mmap ↻ sts_mm sys_mmap ↻ sts_werr sys_write ↻ sys_exit ↻ sts_rowkey ss_catn sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ss_catn ↻ ss_commit

structs

none

consts

22const SVI_PREFIX: *u8 = "knowledge/store/swebvinst-" as *u8
23const SVI_FCAP: i64 = 4194304
24const SVI_OCAP: i64 = 262144
25const SVI_VCAP: i64 = 256
26const SVI_TAB: i64 = 9
27const SVI_NL: i64 = 10
28const SVI_Q: i64 = 34
29const SVI_BSL: i64 = 92
30const SVI_STDERR: i64 = 2
31const SVI_WANT: i64 = 500
32const SVI_EXIT_IO: i64 = 1
33const SVI_EXIT_RED: i64 = 3
34const SVI_D0: i64 = 48
35const SVI_B10: i64 = 10
36const SVI_NUMB: i64 = 24

functions

38func sv_werr(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(SVI_STDERR, s, n); return 0 }
called by 2: sv_pagemain calls 1: sys_write
39func sv_wn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
51func sv_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: sv_findsv_field
53func sv_read(path: *u8, buf: *u8, cap: i64) -> i64
68func sv_find(buf: *u8, n: i64, needle: *u8, from: i64) -> i64
called by 2: sv_fieldsv_scan calls 1: sv_slen
84func sv_field(buf: *u8, n: i64, needle: *u8, from: i64, val: *u8) -> i64
called by 1: sv_scan calls 2: sv_findsv_slen
104func sv_emit(s: *u8) -> i64
called by 1: sv_scan
109func sv_emitc(c: i64) -> i64
called by 1: sv_scan
114func sv_scan(buf: *u8, n: i64, tag: *u8) -> i64
164func sv_page(path: *u8, tag: *u8, fbuf: *u8) -> i64
called by 1: main calls 3: sv_readsv_werrsv_scan
171func main() -> i64