code wiki / (root) / nx_galx_lora_export.nx

nx_galx_lora_export.nx

buildroot/runtime/nx_galx_lora_export.nx

9330 B178 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic galx
docsdependenciesstructsconstsfunctions

about

nx_galx_lora_export.nx -- SOVEREIGN LoRA dataset export. Reads the favorite flag set (galx_fav.log, latest-vote-per-cid, keep v==1), resolves each favorited image to its source path (sidecar) and its prompt caption (PNG tEXt/iTXt "prompt" key), and writes a training manifest: knowledge/lora/favorites/manifest.tsv -> <image_path>\t<caption> (one line per favorite) This is the ready-to-train dataset a LoRA / i2i pipeline consumes (the next rung). NishiLang only. Usage: nx_galx_lora_export [favlog] [sidecar] -- license_tier: ORIGINAL Default signal = the GALLERY-SIDE SSOT (/volume1/ai/galx/knowledge/status/*) when readable: the fav log is WRITTEN by the gallery daemon across the GALLERY!=VAULT boundary; absolute reads cross it. Falls back to the nishihost-relative pair when the gallery volume is unreadable. The summary line ALWAYS prints favsrc= -- the source actually read announces itself.

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_galx_lora_export.nx

imports: nx_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_openat_rd sys_close le_mkdir 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 ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ sys_openat_wr le_p sys_write ↻ sys_exit ↻ le_cideq le_sidecar sys_mmap ↻ sys_read_file ↻ sys_read ↻ le_prompt le_be32 le_is_prompt sys_write ↻ le_n

structs

none

consts

12const FAV_MAGIC_200000: i64 = 200000
13const FAV_MAGIC_2048: i64 = 2048
14const FAV_MAGIC_16384: i64 = 16384
15const FAV_MAGIC_262144: i64 = 262144
17const FAV_LOG: *u8 = "knowledge/status/galx_fav.log" as *u8
18const SIDECAR: *u8 = "knowledge/status/galx_cid_paths.tsv" as *u8
19const OUT: *u8 = "knowledge/lora/favorites/manifest.tsv" as *u8
20const FAV_LOG_GX: *u8 = "/volume1/ai/galx/knowledge/status/galx_fav.log" as *u8
21const SIDECAR_GX: *u8 = "/volume1/ai/galx/knowledge/status/galx_cid_paths.tsv" as *u8

functions

23func le_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
24func le_n(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1}; sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
25func le_mkdir(path: *u8) -> i64 { return __syscall(258, 0-100, path as i64, 0x1ff, 0, 0, 0) }
called by 1: main
26func le_be32(b: *u8, o: i64) -> i64 { return ((b[o] as i64)<<24)|((b[o+1] as i64)<<16)|((b[o+2] as i64)<<8)|(b[o+3] as i64) }
called by 1: le_prompt
27func le_cideq(a: *u8, ao: i64, b: *u8, bo: i64) -> i64 { var k: i64=0; while k<69 { if a[ao+k]!=b[bo+k] { return 0 } k=k+1 } return 1 }
called by 1: main
30func le_is_prompt(buf: *u8, ko: i64, ke: i64) -> i64
called by 1: le_prompt
38func le_prompt(png: *u8, n: i64, out: *u8, cap: i64) -> i64
called by 1: main calls 2: le_be32le_is_prompt
87func le_sidecar(sc: *u8, cid: *u8, out: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
106func main(argc: i64, argv: *i64) -> i64