nx_codec_perceptual_grader.nx
buildroot/runtime/nx_codec_perceptual_grader.nx
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
imports: nx_syscalls.nxnx_perceptual_profile.nxnx_perceptual_judge.nxnx_signal_compensator.nxnx_perceptual_dataset.nx
imported by: nx_realism_score.nx
structs
| 105 | struct NxCpgGradeCard |
consts
| 63 | const NX_CPG_GRADE_F: i64 = 0 // any axis INCONCLUSIVE/PROTOCOL_ERROR |
| 64 | const NX_CPG_GRADE_D: i64 = 1 // >=2 LOSE rows for target profile |
| 65 | const NX_CPG_GRADE_C: i64 = 2 // 1 LOSE with named improvement |
| 66 | const NX_CPG_GRADE_B: i64 = 3 // no LOSE; <=1 UNMEASURED |
| 67 | const NX_CPG_GRADE_A: i64 = 4 // all measured; >=4 WIN |
| 68 | const NX_CPG_GRADE_S: i64 = 5 // all measured; >=6 WIN |
| 70 | const NX_CPG_GRADE_DEPENDENCY_MISSING: i64 = 6 // PARTIAL_WIRED default |
| 85 | const NX_CPG_AXIS_WIN: i64 = 1 |
| 86 | const NX_CPG_AXIS_TIE: i64 = 2 |
| 87 | const NX_CPG_AXIS_LOSE: i64 = 3 // codec loses content this profile perceives |
| 88 | const NX_CPG_AXIS_UNMEASURED: i64 = 4 |
| 89 | const NX_CPG_AXIS_INCONCLUSIVE: i64 = 5 |
functions
| 72 | func nx_cpg_grade_name(g: i64) -> *u8 |
| 91 | func nx_cpg_axis_verdict_name(v: i64) -> *u8 |
| 128 | func nx_cpg_grade_codec_round_trip(codec_name_ptr: *u8, codec_name_len: i64, calls 1: nx_perceptual_profile_is_valid |
| 145 | func nx_cpg_grade_codec_against_all_profiles(codec_name_ptr: *u8, codec_name_len: i64, |
| 160 | func nx_cpg_grade_get_per_axis_loss_explanation(card_ptr: *NxCpgGradeCard, |
| 174 | func nx_cpg_grade_persist_to_dataset(card_ptr: *NxCpgGradeCard) -> i64 |
| 180 | func nx_cpg_grade_get_last_verdict() -> i64 |