code wiki / (root) / nx_semruler_gate.nx

nx_semruler_gate.nx

buildroot/runtime/nx_semruler_gate.nx

7960 B151 linesdepth 9pulls 18 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_semruler_gate.nx -- GATE for nx_semruler_lib (the semantic ruler's decision core, /compare/mediaingest). license_tier: ORIGINAL In-process, no fixtures, no network, no filesystem: every subject is arithmetic on planted numbers, so this gate cannot be poisoned by a shared fixture and has nothing to clean up. The subject is the one predicate that did not already exist in the estate -- admissibility -- plus the abstention and the partition, which are the two places a ruler like this normally starts lying. THE TWO TEETH THAT CARRY THE FILE, both written as neg-controls because a green from a subject that could never go red is decoration: neg-control-mirrored-duplicate-is-inadmissible the obvious one-line predicate tests only the copy distance. A mirrored re-upload has a LARGE copy distance and a TINY orient distance, so that version admits every mirrored duplicate and re-measures tier 1 while claiming to measure semantics. This tooth plants exactly that pair (copy 60, orient 2) and requires refusal. It is the tooth that fails if anyone "simplifies" sr_pair_admissible back to a single argument. neg-control-empty-admitted-set-abstains a rate over zero subjects must be UNOBSERVABLE, never 0 and never 1000. A tooth that passes on the empty set is not a tooth, and this is the direction that flatters.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_imgsearch_tier.nx nx_semruler_lib.nx nx_gate_verdict.nx nx_semruler_gate.nx

imports: nx_syscalls.nxnx_imgsearch_tier.nxnx_semruler_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 ↻ gv_check gv_puts ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap sr_min sr_pair_admissible sr_min ↻ sr_rate_permil sr_hit_is_semantic sr_hit_is_identity sr_klass_known sr_partition_sums sr_semantic_permil sr_rate_permil ↻ gv_verdict gv_note_bare_rate gv_bare_rate

structs

none

consts

28const G_FAR_COPY: i64 = 40 // comfortably above NX_IT_COPY_THRESH on both tiers: a genuine pair
29const G_FAR_ORIENT: i64 = 44
30const G_DUP_COPY: i64 = 3 // a plain near-duplicate: both tiers see it
31const G_DUP_ORIENT: i64 = 3
32const G_MIRROR_COPY: i64 = 60 // a MIRRORED duplicate: copy tier is blind to it by construction ...
33const G_MIRROR_ORIENT: i64 = 2 // ... and the dihedral-invariant tier is not. This pair is the trap.
34const G_BAD_CLASS: i64 = 99 // not NX_IT_CLASS_IDENTITY and not NX_IT_CLASS_SIMILAR
35const G_HITS: i64 = 3
36const G_ADMITTED: i64 = 4
37const G_EXPECT_PERMIL: i64 = 750 // 3/4 -- computed by hand so the assertion does not restate the code

functions

39func main() -> i64