code wiki / (root) / nx_codec_perceptual_grader.nx

nx_codec_perceptual_grader.nx

buildroot/runtime/nx_codec_perceptual_grader.nx

8904 B182 linesdepth 5pulls 8 transitivereach 1 importersview sourcekind librarytopic codec
docsdependenciesstructsconstsfunctions

about

nx_codec_perceptual_grader.nx -- codec round-trip × perceptual-judge integration. module: nishi-core.perception.codec_perceptual_grader depends: nishi-core.perception.profile + nishi-core.perception.judge + nishi-core.perception.signal_compensator + nishi-core.perception.perceptual_dataset + nishi-core.io.syscalls disk_kb: 5 capability: PERCEPTION wired_status: PARTIAL_WIRED MISSING_CAPABILITIES: - CODEC_DISPATCH (route to nx_voice_codec / nx_video_codec encoder + decoder per signal domain; queued, depends on those codec arcs finishing their Phase B residual + entropy coding) - ROUND_TRIP_DELTA_COMPUTE (compare original vs decoded; needs nx_fft for frequency-domain comparison) - PER_PROFILE_AXIS_BREAKDOWN (which perceptual axis the codec lost on for which species; e.g., "fine for HUMAN_NORMAL @ 20 kHz cutoff, LOSE on DOG_VIZSLA at 22-45 kHz band") - GRADER_LETTER_INTEGRATION (compose with nx_codec_grade letter scale F/D/C/B/A/S to produce a per-target-profile letter grade) license_tier: PUBLIC_NISHI_SUBSTRATE genealogy_id: feedback-multi-species-perceptual-substrate-not-anthropocentric_2026 + feedback-substrate-primitives-meta-not-one-off_2026 + feedback-bits-up-exceed-never-match + nx_codec_grade_q10 + nx_voice_codec_v1_q10 + feedback-honest-perf-verdict-no-aspirational-claims Per cardinal [[feedback-multi-species-perceptual-substrate-not-anthropocentric]]: "S-class codec" claims today rest on MOS / PESQ / VMAF -- metrics tuned to HUMAN perceptual masking. A codec can be S-class on those metrics and still fail every non-human listener (dog ignores it; cat ignores it; livestock-welfare monitoring loses the stress signature; conservation acoustic AI loses the species-call content). THIS primitive composes nx_voice_codec / nx_video_codec round-trip with nx_perceptual_judge against a declared target profile to produce a measurable per-species-per-axis grade. "Codec X is S-class for

dependencies 5 imports · 1 importers

nx_syscalls.nx nx_perceptual_profile.nx nx_perceptual_judge.nx nx_signal_compensator.nx nx_perceptual_dataset.nx nx_codec_perceptual_grader.nx nx_realism_score.nx

imports: nx_syscalls.nxnx_perceptual_profile.nxnx_perceptual_judge.nxnx_signal_compensator.nxnx_perceptual_dataset.nx

imported by: nx_realism_score.nx

structs

105struct NxCpgGradeCard

consts

63const NX_CPG_GRADE_F: i64 = 0 // any axis INCONCLUSIVE/PROTOCOL_ERROR
64const NX_CPG_GRADE_D: i64 = 1 // >=2 LOSE rows for target profile
65const NX_CPG_GRADE_C: i64 = 2 // 1 LOSE with named improvement
66const NX_CPG_GRADE_B: i64 = 3 // no LOSE; <=1 UNMEASURED
67const NX_CPG_GRADE_A: i64 = 4 // all measured; >=4 WIN
68const NX_CPG_GRADE_S: i64 = 5 // all measured; >=6 WIN
70const NX_CPG_GRADE_DEPENDENCY_MISSING: i64 = 6 // PARTIAL_WIRED default
85const NX_CPG_AXIS_WIN: i64 = 1
86const NX_CPG_AXIS_TIE: i64 = 2
87const NX_CPG_AXIS_LOSE: i64 = 3 // codec loses content this profile perceives
88const NX_CPG_AXIS_UNMEASURED: i64 = 4
89const NX_CPG_AXIS_INCONCLUSIVE: i64 = 5

functions

72func nx_cpg_grade_name(g: i64) -> *u8
91func nx_cpg_axis_verdict_name(v: i64) -> *u8
128func nx_cpg_grade_codec_round_trip(codec_name_ptr: *u8, codec_name_len: i64,
145func nx_cpg_grade_codec_against_all_profiles(codec_name_ptr: *u8, codec_name_len: i64,
160func nx_cpg_grade_get_per_axis_loss_explanation(card_ptr: *NxCpgGradeCard,
174func nx_cpg_grade_persist_to_dataset(card_ptr: *NxCpgGradeCard) -> i64
180func nx_cpg_grade_get_last_verdict() -> i64