code wiki / (root) / nx_verdict_phrase.nx

nx_verdict_phrase.nx

buildroot/runtime/nx_verdict_phrase.nx

20020 B480 linesdepth 3pulls 3 transitivereach 7 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_verdict_phrase.nx nx_image_grade_v0.nx nx_image_grade_v1.nx nx_image_grade_v2.nx

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

main nx_verdict_phrase_for _vp_skin_tone_phrase _vp_undertone_phrase _vp_skin_texture_phrase _vp_vein_signal_phrase _vp_micro_expression_phras _vp_finger_count_phrase _vp_aperture_phrase _vp_strlen sys_mmap nx_verdict_blend_render sys_mmap ↻ _vp_q10_to_percent _vp_format_int sys_mmap ↻ _vp_strcpy _vp_strlen ↻ _vp_format_int ↻

structs

80struct NxVerdictBlend

consts

52const NX_VP_Q10: nx_int = 1024
53const NX_VP_MAX_PHRASE_LEN: nx_int = 512
54const NX_VP_BLEND_MAX_CLASSES: nx_int = 16
55const NX_VP_BLEND_MIN_PERCENT_Q10: nx_int = 51 // 5% Q10
59const NX_VP_MODE_TERSE: nx_int = 0
60const NX_VP_MODE_VERBOSE: nx_int = 1
64const NX_VP_AXIS_T1_SKIN_TONE_ITA: nx_int = 4
65const NX_VP_AXIS_T2_GLCM_TEXTURE: nx_int = 5
66const NX_VP_AXIS_T2_PORE_DETAIL: nx_int = 7
67const NX_VP_AXIS_T4_UNDERTONE: nx_int = 12
68const NX_VP_AXIS_T5_VEIN_SIGNAL: nx_int = 16
69const NX_VP_AXIS_T5_SUBSURFACE_SIGNAL: nx_int = 17
70const NX_VP_AXIS_T5B_MICRO_EXPRESSION: nx_int = 22
71const NX_VP_AXIS_T6_SHADOW_DIRECTION: nx_int = 23
72const NX_VP_AXIS_T6_FINGER_COUNT: nx_int = 24
73const NX_VP_AXIS_T6_LIMB_COUNT: nx_int = 25
74const NX_VP_AXIS_T6_POSE_NATURALNESS: nx_int = 26
75const NX_VP_AXIS_T6_SURFACE_PLANE: nx_int = 27
76const NX_VP_AXIS_T6_SILHOUETTE_INTEG: nx_int = 28
87const NX_VP_BLEND_BYTES: nx_size = 40

functions

91func _vp_strlen(s: *u8) -> nx_int
called by 2: _vp_strcpymain
102func _vp_strcpy(dst: *u8, src: *u8, dst_pos: nx_int) -> nx_int
called by 1: nx_verdict_blend_render calls 1: _vp_strlen
114func _vp_format_int(dst: *u8, pos: nx_int, value: nx_int) -> nx_int
150func _vp_q10_to_percent(q10: nx_int) -> nx_int
163func _vp_skin_tone_phrase(verdict: nx_int, mode: nx_int) -> *u8
182func _vp_undertone_phrase(verdict: nx_int, mode: nx_int) -> *u8
195func _vp_skin_texture_phrase(verdict: nx_int, mode: nx_int) -> *u8
208func _vp_vein_signal_phrase(verdict: nx_int, mode: nx_int) -> *u8
223func _vp_micro_expression_phrase(verdict: nx_int, mode: nx_int) -> *u8
238func _vp_finger_count_phrase(verdict: nx_int, mode: nx_int) -> *u8
255func _vp_aperture_phrase(verdict: nx_int, mode: nx_int) -> *u8
277func nx_verdict_phrase_for(axis_id: nx_int, verdict: nx_int, mode: nx_int) -> *u8
309func nx_verdict_blend_render(
377func main() -> nx_int