nx_verdict_phrase.nx
buildroot/runtime/nx_verdict_phrase.nx
about
nx_verdict_phrase.nx -- human-legible phrasing for grader verdicts.
CAPABILITY_COMPLETENESS: FULL (for shipped tier-axis verdicts;
new graders register their phrasing via nx_verdict_phrase_set)
User direction 2026-05-16:
"also make sure the math is human legible like the skin is
too plastic or something even more explanatory or she is 50
percent asian in this pic etc"
The substrate's tier-axis verdicts are sealed integers + Q10
scores -- great for the closed-loop trainer + ledger, useless
for a human reading the report. This primitive bridges the
machine-readable verdict world with the human-readable
explanation world.
Two phrasing modes:
MODE_TERSE -- one short clause, suitable for batch
dashboards: "skin too plastic"
"background fragmented"
"vein signal absent"
MODE_VERBOSE -- one full sentence with the score reading:
"Skin texture verdict PLASTIC_SHEEN at
energy 0.83 (expected 0.4-0.7 for
natural skin); over-smoothed render."
Phrases are emitted as NUL-terminated UTF-8 byte sequences.
Caller passes a buffer of NX_VP_MAX_PHRASE_LEN bytes; primitive
writes the phrase and returns the byte count written.
CONTINUOUS-CLASS PHRASING (e.g., "30% east-asian / 50%
european / 20% african" -- the user's "50 percent asian"
example): the phrasing is done via NxVerdictBlend struct
(sealed-enum class list + per-class Q10 weight) -> phrase
rendering with thresholds (drop classes below 5% Q10, sort
descending, format "X% kind / Y% kind / Z% kind").
genealogy_id: substrate_legibility_layer_2026_05_16
lineage_id: nx_verdict_phrase_v1
dependencies 3 imports · 3 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nx
imported by: nx_image_grade_v0.nxnx_image_grade_v1.nxnx_image_grade_v2.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 80 | struct NxVerdictBlend |
consts
| 52 | const NX_VP_Q10: nx_int = 1024 |
| 53 | const NX_VP_MAX_PHRASE_LEN: nx_int = 512 |
| 54 | const NX_VP_BLEND_MAX_CLASSES: nx_int = 16 |
| 55 | const NX_VP_BLEND_MIN_PERCENT_Q10: nx_int = 51 // 5% Q10 |
| 59 | const NX_VP_MODE_TERSE: nx_int = 0 |
| 60 | const NX_VP_MODE_VERBOSE: nx_int = 1 |
| 64 | const NX_VP_AXIS_T1_SKIN_TONE_ITA: nx_int = 4 |
| 65 | const NX_VP_AXIS_T2_GLCM_TEXTURE: nx_int = 5 |
| 66 | const NX_VP_AXIS_T2_PORE_DETAIL: nx_int = 7 |
| 67 | const NX_VP_AXIS_T4_UNDERTONE: nx_int = 12 |
| 68 | const NX_VP_AXIS_T5_VEIN_SIGNAL: nx_int = 16 |
| 69 | const NX_VP_AXIS_T5_SUBSURFACE_SIGNAL: nx_int = 17 |
| 70 | const NX_VP_AXIS_T5B_MICRO_EXPRESSION: nx_int = 22 |
| 71 | const NX_VP_AXIS_T6_SHADOW_DIRECTION: nx_int = 23 |
| 72 | const NX_VP_AXIS_T6_FINGER_COUNT: nx_int = 24 |
| 73 | const NX_VP_AXIS_T6_LIMB_COUNT: nx_int = 25 |
| 74 | const NX_VP_AXIS_T6_POSE_NATURALNESS: nx_int = 26 |
| 75 | const NX_VP_AXIS_T6_SURFACE_PLANE: nx_int = 27 |
| 76 | const NX_VP_AXIS_T6_SILHOUETTE_INTEG: nx_int = 28 |
| 87 | const NX_VP_BLEND_BYTES: nx_size = 40 |
functions
| 91 | func _vp_strlen(s: *u8) -> nx_int |
| 102 | func _vp_strcpy(dst: *u8, src: *u8, dst_pos: nx_int) -> nx_int |
| 114 | func _vp_format_int(dst: *u8, pos: nx_int, value: nx_int) -> nx_int |
| 150 | func _vp_q10_to_percent(q10: nx_int) -> nx_int called by 1: nx_verdict_blend_render |
| 163 | func _vp_skin_tone_phrase(verdict: nx_int, mode: nx_int) -> *u8 called by 1: nx_verdict_phrase_for |
| 182 | func _vp_undertone_phrase(verdict: nx_int, mode: nx_int) -> *u8 called by 1: nx_verdict_phrase_for |
| 195 | func _vp_skin_texture_phrase(verdict: nx_int, mode: nx_int) -> *u8 called by 1: nx_verdict_phrase_for |
| 208 | func _vp_vein_signal_phrase(verdict: nx_int, mode: nx_int) -> *u8 called by 1: nx_verdict_phrase_for |
| 223 | func _vp_micro_expression_phrase(verdict: nx_int, mode: nx_int) -> *u8 called by 1: nx_verdict_phrase_for |
| 238 | func _vp_finger_count_phrase(verdict: nx_int, mode: nx_int) -> *u8 called by 1: nx_verdict_phrase_for |
| 255 | func _vp_aperture_phrase(verdict: nx_int, mode: nx_int) -> *u8 called by 1: nx_verdict_phrase_for |
| 277 | func nx_verdict_phrase_for(axis_id: nx_int, verdict: nx_int, mode: nx_int) -> *u8 |
| 309 | func nx_verdict_blend_render( |
| 377 | func main() -> nx_int |