code wiki / _hdl_build / nx_lossless_language.nx

nx_lossless_language.nx

buildroot/runtime/_hdl_build/nx_lossless_language.nx

2864 B52 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic lossless
docsdependenciesstructsconstsfunctions

about

nx_lossless_language.nx -- building a LOSSLESS LANGUAGE to interface with generators (Z-Image, LTX video, music AI): a conditioning language where terms map to intent so precisely that "Diora Baird golfing as a video" generates EXACTLY that, net-new. Fidelity-to-spec is the DISTORTION signal; building the language is RATE-DISTORTION OPTIMIZATION of the conditioning -- the LOSSY-generation sibling of our Kolmogorov/Levin governor (lossless shortest-description). The closed loop the SYSTEM runs (not the human hunting LoRAs by hand): spec -> generate -> MEASURE fidelity-to-spec (nx_image_fidelity / a semantic scorer) -> REFINE the language (better term / caption / identity embedding / control / LoRA) -> repeat until distortion falls below the Council floor = the language is LOSSLESS for that intent. This module models that convergence: given the fidelity attained at each refinement step, it finds WHEN the language became lossless and at what RATE (how much refinement it cost) -- the rate-distortion curve of the language. Each refinement should not regress (a sound search). license_tier: ORIGINAL Refs: Shannon rate-distortion; the precision-measurement loop.

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_lossless_language.nx nx_lossless_language_test.nx

imports: nx_syscalls.nx

imported by: nx_lossless_language_test.nx

structs

none

consts

18const LL_LOSSLESS_FLOOR: i64 = 950 // fidelity-to-spec >= 95% (permil) = effectively lossless

functions

21func ll_distortion(fidelity_permil: i64) -> i64 { return 1000 - fidelity_permil }
called by 1: main
23func ll_is_lossless(fidelity_permil: i64, floor: i64) -> i64 { if fidelity_permil >= floor { return 1 } return 0 }
called by 1: main
27func ll_converge_step(scores: *i64, n: i64, floor: i64) -> i64
called by 1: main
35func ll_is_monotone(scores: *i64, n: i64) -> i64
called by 1: main
42func ll_distortion_removed(scores: *i64, n: i64) -> i64
called by 1: main
49func ll_marginal(scores: *i64, k: i64) -> i64
called by 1: main