code wiki / (root) / nx_descriptor.nx

nx_descriptor.nx

buildroot/runtime/nx_descriptor.nx

2210 B50 linesdepth 7pulls 9 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_descriptor.nx -- WRITING arc, rung W-ING-2: the scene -> IMAGE-GEN descriptor profiler. Rides on the scene structure from nx_ingest (W-ING-1): given a DESCRIPTOR LEXICON (packed terms + a parallel category id per term), it reports, per scene, how many descriptor hits fall in each category -> the structured fields image-gen turns into a prompt (setting / time-of-day / mood / weather / outfit / ... -- the categories are the caller's DATA, not baked in here). The LEXICON is DATA (rule 25): the SFW lane and the operator's local-LLM lane each extend it (outfit/MPL terms, register-specific terms) WITHOUT touching this organ. This file ships only the content-agnostic MECHANISM; the gate proves it with benign terms (forest/castle/night/dawn/...). Matching reuses nx_ingest's WHOLE-WORD, case-insensitive counter (DRY), so "forestry" does not count as "forest" and "midnight" does not count as "night". dx_profile(t, a, b, terms, cats, nterms, ncat, prof) prof[c] = total descriptor hits in category c over t[a..b) returns total hits across all categories. Pipeline: ig_extract (segment) -> dx_profile per scene range -> image-gen. Pure integer, NO syscalls. Reuses nx_ingest (-> nx_writecraft). license_tier: ORIGINAL module: nishi-core.write.descriptor depends: nishi-core.write.ingest capability: WRITE_SCENE_DESCRIPTORS

dependencies 2 imports · 2 importers

nx_ingest.nx nx_ingest_scene.nx nx_descriptor.nx nx_descriptor_gate.nx nx_write_exceed_gate.nx

imports: nx_ingest.nxnx_ingest_scene.nx

imported by: nx_descriptor_gate.nxnx_write_exceed_gate.nx

structs

none

consts

none

functions

32func dx_profile(t: *u8, a: i64, b: i64, terms: *u8, cats: *i64, nterms: i64, ncat: i64, prof: *i64) -> i64