code wiki / (root) / nx_render_target_match.nx

nx_render_target_match.nx

buildroot/runtime/nx_render_target_match.nx

8498 B209 linesdepth 9pulls 17 transitivereach 1 importersview sourcekind librarytopic render
docsdependenciesstructsconstsfunctions

about

nx_render_target_match.nx -- did the generated image match the target? Universal RENDERED-VS-TARGET verdict primitive. Given two 16-element feature vectors (target image + rendered image), emits a sealed-enum verdict + per-axis divergence + actionable next-axis pinpoint. USE CASES (all the same substrate, different target sources): 1. RETAIL VIRTUAL TRY-ON (Google Shopping AI Mode pattern): target = product image (lingerie / dress / jacket / shoes) render = model wearing the product (via gen-img) verdict = did the rendered model faithfully wear the product? action = which visual axis (color / texture / silhouette / etc.) needs another iteration? 2. VIDEO-GAME ASSET RENDER: target = concept art reference for a weapon / armor / character render = in-engine model the procgen produced verdict = does the asset match the brief? 3. STORY-DRIVEN SCENE RENDER (legal adult or all-ages): target = reference image for the desired scene mood render = generated scene image verdict = does the render hit the mood? All three use the SAME primitive. Different in the prompt + concept- embedding upstream; identical at the measure-the-output layer. COMPOSES: nx_cosine_similarity -- overall vector alignment per-axis delta math -- normalized |target - rendered| per axis sealed verdict bands -- substrate-honest routing worst-axis pinpoint -- which axis to refactor next render genealogy_id: salton_1971_smart + clip_score_hessel_2021 + ip_adapter_ye_2023 + lpips_zhang_2018 + fid_heusel_2017 lineage_id: render_target_match_q10

dependencies 4 imports · 1 importers

nx_syscalls.nx nx_tier.nx nx_image_feature_extract.nx nx_cosine_similarity.nx nx_render_target_match.nx nx_render_target_match_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_image_feature_extract.nxnx_cosine_similarity.nx

imported by: nx_render_target_match_test.nx

structs

81struct RenderTargetMatchReport

consts

51const NX_RTM_Q: nx_int = 1024
54const NX_RTM_MATCH_FAILED: nx_int = 0 // cos < 256 or fidelity below floor
55const NX_RTM_MATCH_POOR: nx_int = 1 // 256 <= cos < 512
56const NX_RTM_MATCH_PARTIAL: nx_int = 2 // 512 <= cos < 768
57const NX_RTM_MATCH_GOOD: nx_int = 3 // 768 <= cos < 921
58const NX_RTM_MATCH_EXCELLENT: nx_int = 4 // cos >= 921 AND worst-axis-delta tight
59const NX_RTM_N_VERDICTS: nx_int = 5
63const NX_RTM_ACTION_SHIP: nx_int = 0
64const NX_RTM_ACTION_REFINE_COLOR: nx_int = 1
65const NX_RTM_ACTION_REFINE_LIGHTING: nx_int = 2
66const NX_RTM_ACTION_REFINE_COMPOSITION: nx_int = 3
67const NX_RTM_ACTION_REFINE_CLARITY: nx_int = 4
68const NX_RTM_ACTION_REFINE_SHARPNESS: nx_int = 5
69const NX_RTM_ACTION_REFINE_FRACTAL: nx_int = 6
70const NX_RTM_ACTION_REFINE_SYMMETRY: nx_int = 7
71const NX_RTM_ACTION_RESTART_FROM_SCRATCH: nx_int = 8
72const NX_RTM_N_ACTIONS: nx_int = 9
75const NX_RTM_AXIS_TOLERANCE_Q10: nx_int = 200 // 20% of full scale
79const NX_RTM_EXCELLENT_MAX_AXIS_DELTA: nx_int = 100

functions

95func _rtm_axis_to_action(axis: nx_int) -> nx_int
110func _rtm_abs(x: nx_int) -> nx_int
117func nx_render_target_match(target_features: *nx_int,
199func nx_render_target_match_verdict_is_valid(v: nx_int) -> nx_int
called by 1: main
205func nx_render_target_match_action_is_valid(a: nx_int) -> nx_int
called by 1: main