nx_semruler.nx
buildroot/runtime/nx_semruler.nx
about
nx_semruler.nx -- THE SEMANTIC RULER, STEP 2: measure the EXISTING descriptors on a real
same-concept corpus. license_tier: ORIGINAL
nx_imgsearch publishes its own gap honestly and names the order of work:
{"class":"semantic-lookalike","permille":-1,"status":"UNMEASURED",
"note":"... (1) build a semantic ruler from labelled same-concept pairs, (2) measure the EXISTING
descriptors as the honest baseline, (3) only then a quantised learned image embedding."}
nx_semruler_lib is step (1)'s decision core. THIS is step (2), and it deliberately stops short of
step (3): it builds NO new descriptor and trains nothing.
WHERE THE LABELS COME FROM, AND WHY THEY ARE HONEST. knowledge/media/ is one directory per subject
(diora_baird, julia_kyoka, barack_obama...). Two images in the same directory are the SAME CONCEPT;
two in different directories are not. That is a weak label derived from the estate's own filing, not
an opinion, and it is the standard way a retrieval corpus is bootstrapped. NO LABEL IS INVENTED HERE.
THE ONE NUMBER THIS EXISTS TO PRODUCE, and why it has to come first:
A "SAME-CONCEPT" PAIR THAT IS ACTUALLY A NEAR-DUPLICATE MEASURES THE COPY TIER, NOT SEMANTICS.
Before anyone can report a semantic recall figure, they have to know how much of the same-subject
corpus is genuinely different photographs and how much is re-uploads, re-crops and re-encodes. Run
a recall benchmark over an unfiltered folder of one person and it will score near 1000 permil and
"prove" the engine is already semantic -- the number real, the subject wrong.
So this organ reports the ADMISSIBILITY CENSUS: of all within-subject pairs, how many survive
sr_pair_admissible (distinct photographs) and how many are duplicates under some dihedral
transform. THE SURVIVING SET IS THE ONLY VALID DENOMINATOR for step 3.
AND THE CONTROL THAT KEEPS IT HONEST. If the within-subject inadmissible count is ZERO, this corpus
contains no duplicates, the predicate was never exercised on real data, and the census says so rather
than reporting a clean sweep. Cross-subject pairs are sampled as the opposite control: they should be
overwhelmingly ADMISSIBLE, because two different people are never near-duplicates -- if they are not,
the distance is not measuring what it claims and no semantic figure built on it would mean anything.
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_dir.nxnx_image_gray.nxnx_imgsearch_tier.nxnx_semruler_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 37 | const SR_MAXCLASS: i64 = 32 |
| 38 | const SR_MAXIMG: i64 = 48 // per-class image cap -- ANNOUNCED, never silent (see coverage line) |
| 39 | const SR_PATHCAP: i64 = 1024 |
| 40 | const SR_ROWCAP: i64 = 512 |
| 41 | const SR_ARENA: i64 = 262144 |
| 42 | const SR_XPAIRS: i64 = 64 // cross-subject control pairs |
| 43 | const SR_DESCCAP: i64 = 16 // i64 slots per descriptor (copy=1, orient index=1, orient query=8) |
functions
| 45 | func sw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 46 | func sn(v: i64) -> i64 |
| 59 | func swn(p: *u8, n: i64) -> i64 { sys_write(1, p, n); return 0 } |
| 61 | func sr_is_image(name: *u8, nl: i64) -> i64 called by 1: main |
| 77 | func sr_join(a: *u8, b: *u8, out: *u8) -> i64 called by 1: main |
| 88 | func main(argc: i64, argv: *i64) -> i64 |