nx_asset_autotag.nx
buildroot/runtime/nx_asset_autotag.nx
about
nx_asset_autotag.nx -- PERCEPTUAL NEAR-DUPLICATE detection (R3 of the universal org-tooling arc).
Makes the catalog know which media are NEAR-duplicates -- the ones exact-CID dedup CANNOT catch.
Content-addressing (ar_cid) gives EXACT dedup: identical bytes collapse to one CID, but ONE changed
pixel / a recompression / a resize yields a DIFFERENT CID while the image is visually the same. A
PERCEPTUAL hash fingerprints what the media LOOKS like, so near-identical media land a tiny Hamming
distance apart and cluster together (org_research.tsv CONFIRMED perceptual-autotag: perceptual
hashing groups near-dups that exact-hash/CID misses; machines pre-tag, humans curate).
ZERO NEW ALGORITHMS -- pure COMPOSITION over the media-studio kernels:
* perceptual fingerprint (dHash, brightness/recompression-robust) -> nx_phash (nx_phash_dhash)
* bit-distance + near-dup clustering -> nx_simhash (nx_simhash_hamming)
dHash takes a grayscale (w x h, row-major u8) buffer and is FORMAT-AGNOSTIC by design, so at_phash
fingerprints any decoded grayscale media plane (the decode step is the caller's; this layer is the
fingerprint + grouping, kept pure/deterministic).
No hardware/persistent-firmware writes (Rule 26). license_tier: ORIGINAL
dependencies 3 imports · 3 importers
imports: nx_syscalls.nxnx_phash.nxnx_simhash.nx
imported by: nx_asset_meta_gate.nxnx_asset_signals.nxnx_asset_signals_gate.nx
structs
| none |
consts
| none |
functions
| 26 | func at_phash(gray: *u8, w: i64, h: i64) -> i64 |
| 32 | func at_hamming(h1: i64, h2: i64) -> i64 |
| 43 | func at_neardup(hashes: *i64, n: i64, threshold: i64, out_groups: *i64) -> i64 |
| 70 | func at_in_same_group(out_groups: *i64, a: i64, b: i64) -> i64 called by 1: main |