code wiki / (root) / nx_outfit_vocabulary.nx

nx_outfit_vocabulary.nx source

↩ module page · 271 lines · 10929 B

1// nx_outfit_vocabulary.nx -- typed outfit registry with multi-language phrase variants. 2// 3// Cardinal: certain outfit kinds (micro string thong, T-back, micro 4// bikini, etc.) fail consistently when prompted in English because the 5// underlying text encoder has weak English token associations for them. 6// CJK languages — particularly Japanese fashion vocabulary — have 7// PRECISE single-token concepts (ヒモパン / 紐パンティ / Tバック) that the 8// model renders much more reliably. 9// 10// The substrate stores typed OutfitKind + per-kind language-tagged 11// phrase variants. The scene composer emits ALL variants together so 12// the text encoder has multiple language anchors for the same concept, 13// and the empirical-value cardinal will eventually weight whichever 14// language renders this kind best. 15// 16// Companion to feedback-natural-director-phrases cardinal and 17// feedback-no-negative-prompts-no-weights cardinal: positive-only, 18// no weight syntax, each language phrase is a natural-text fragment. 19 20// nx_safety_envelope: 21// intended_use: AUTO_APPLIED -- primitive-specific tuning queued 22// sil_target: SIL1 23// evidence: [bulk_applied_2026-05-16, see-file-comment-for-detail] 24// verdict: NOT_YET_EVALUATED 25 26import "nx_syscalls.nx" 27 28// Sealed OutfitKind ids. 29const NX_OUTFIT_UNKNOWN: i64 = 0 30const NX_OUTFIT_MICRO_STRING_THONG: i64 = 1 31const NX_OUTFIT_T_BACK_THONG: i64 = 2 32const NX_OUTFIT_G_STRING: i64 = 3 33const NX_OUTFIT_C_STRING: i64 = 4 34const NX_OUTFIT_BRAZILIAN_BIKINI: i64 = 5 35const NX_OUTFIT_MICRO_BIKINI: i64 = 6 36const NX_OUTFIT_STRING_BIKINI: i64 = 7 37const NX_OUTFIT_PANTYHOSE_SHEER: i64 = 8 38const NX_OUTFIT_FISHNET_BODYSTOCKING: i64 = 9 39const NX_OUTFIT_BODYCON_DRESS_TIGHT: i64 = 10 40const NX_OUTFIT_GYM_BOOTY_SHORTS: i64 = 11 41const NX_OUTFIT_SPORTS_BRA_TIGHT: i64 = 12 42 43// Sealed LanguageTag ids. 44const NX_LANG_UNKNOWN: i64 = 0 45const NX_LANG_EN: i64 = 1 // English 46const NX_LANG_JA: i64 = 2 // Japanese 47const NX_LANG_KO: i64 = 3 // Korean 48const NX_LANG_ZH_CN: i64 = 4 // Chinese (simplified) 49const NX_LANG_ZH_TW: i64 = 5 // Chinese (traditional) 50const NX_LANG_FR: i64 = 6 // French 51const NX_LANG_IT: i64 = 7 // Italian 52const NX_LANG_DE: i64 = 8 // German 53 54// Lookup: phrase variant for (kind, language). 55// Returns 0-pointer if no variant exists for that combination. 56// variant 0 is the primary phrase; variant 1+ are alternates. 57func nx_outfit_phrase(kind: i64, language: i64, variant: i64) -> *u8 { 58 // MICRO_STRING_THONG --------------------------------------------- 59 if kind == NX_OUTFIT_MICRO_STRING_THONG { 60 if language == NX_LANG_EN { 61 if variant == 0 { return "micro string thong, narrow string fabric, threadlike sides" } 62 if variant == 1 { return "thread thong, micro string panty" } 63 return 0 as *u8 64 } 65 if language == NX_LANG_JA { 66 if variant == 0 { return "ヒモパン" } 67 if variant == 1 { return "紐パンティ" } 68 if variant == 2 { return "極小ヒモパン" } 69 return 0 as *u8 70 } 71 if language == NX_LANG_KO { 72 if variant == 0 { return "끈팬티" } 73 if variant == 1 { return "줄팬티" } 74 return 0 as *u8 75 } 76 if language == NX_LANG_ZH_CN { 77 if variant == 0 { return "细绳丁字裤" } 78 if variant == 1 { return "微型绳丁字裤" } 79 return 0 as *u8 80 } 81 } 82 // T_BACK_THONG --------------------------------------------------- 83 if kind == NX_OUTFIT_T_BACK_THONG { 84 if language == NX_LANG_EN { 85 if variant == 0 { return "T-back thong, T-back panty" } 86 return 0 as *u8 87 } 88 if language == NX_LANG_JA { 89 if variant == 0 { return "Tバック" } 90 if variant == 1 { return "ティーバック" } 91 return 0 as *u8 92 } 93 if language == NX_LANG_KO { 94 if variant == 0 { return "티백" } 95 return 0 as *u8 96 } 97 } 98 // G_STRING ------------------------------------------------------- 99 if kind == NX_OUTFIT_G_STRING { 100 if language == NX_LANG_EN { 101 if variant == 0 { return "G-string, narrow waist string with thread back" } 102 return 0 as *u8 103 } 104 if language == NX_LANG_JA { 105 if variant == 0 { return "Gストリング" } 106 return 0 as *u8 107 } 108 } 109 // C_STRING ------------------------------------------------------- 110 if kind == NX_OUTFIT_C_STRING { 111 if language == NX_LANG_EN { 112 if variant == 0 { return "C-string, strapless thong without waistband" } 113 return 0 as *u8 114 } 115 if language == NX_LANG_JA { 116 if variant == 0 { return "Cストリング" } 117 return 0 as *u8 118 } 119 } 120 // BRAZILIAN_BIKINI ----------------------------------------------- 121 if kind == NX_OUTFIT_BRAZILIAN_BIKINI { 122 if language == NX_LANG_EN { 123 if variant == 0 { return "Brazilian bikini, tiny triangular cups, narrow string bottom" } 124 return 0 as *u8 125 } 126 if language == NX_LANG_JA { 127 if variant == 0 { return "ブラジリアンビキニ" } 128 return 0 as *u8 129 } 130 } 131 // MICRO_BIKINI --------------------------------------------------- 132 if kind == NX_OUTFIT_MICRO_BIKINI { 133 if language == NX_LANG_EN { 134 if variant == 0 { return "micro bikini, minimal coverage swimwear" } 135 return 0 as *u8 136 } 137 if language == NX_LANG_JA { 138 if variant == 0 { return "マイクロビキニ" } 139 if variant == 1 { return "極小ビキニ" } 140 return 0 as *u8 141 } 142 if language == NX_LANG_KO { 143 if variant == 0 { return "마이크로 비키니" } 144 return 0 as *u8 145 } 146 if language == NX_LANG_ZH_CN { 147 if variant == 0 { return "微型比基尼" } 148 return 0 as *u8 149 } 150 } 151 // STRING_BIKINI -------------------------------------------------- 152 if kind == NX_OUTFIT_STRING_BIKINI { 153 if language == NX_LANG_EN { 154 if variant == 0 { return "string bikini, tie-side string bottom" } 155 return 0 as *u8 156 } 157 if language == NX_LANG_JA { 158 if variant == 0 { return "ヒモ水着" } 159 if variant == 1 { return "ストリングビキニ" } 160 return 0 as *u8 161 } 162 } 163 // PANTYHOSE_SHEER ------------------------------------------------ 164 if kind == NX_OUTFIT_PANTYHOSE_SHEER { 165 if language == NX_LANG_EN { 166 if variant == 0 { return "sheer pantyhose, nude pantyhose, transparent tights" } 167 return 0 as *u8 168 } 169 if language == NX_LANG_JA { 170 if variant == 0 { return "シアーパンスト" } 171 if variant == 1 { return "肌色パンスト" } 172 return 0 as *u8 173 } 174 } 175 // FISHNET_BODYSTOCKING ------------------------------------------- 176 if kind == NX_OUTFIT_FISHNET_BODYSTOCKING { 177 if language == NX_LANG_EN { 178 if variant == 0 { return "fishnet bodystocking, mesh bodysuit covering torso and legs" } 179 return 0 as *u8 180 } 181 if language == NX_LANG_JA { 182 if variant == 0 { return "フィッシュネットボディストッキング" } 183 if variant == 1 { return "網タイツボディースーツ" } 184 return 0 as *u8 185 } 186 } 187 // BODYCON_DRESS_TIGHT -------------------------------------------- 188 if kind == NX_OUTFIT_BODYCON_DRESS_TIGHT { 189 if language == NX_LANG_EN { 190 if variant == 0 { return "body-con dress, tight stretch dress hugging the curves" } 191 return 0 as *u8 192 } 193 if language == NX_LANG_JA { 194 if variant == 0 { return "ボディコンドレス" } 195 if variant == 1 { return "タイトドレス" } 196 return 0 as *u8 197 } 198 } 199 // GYM_BOOTY_SHORTS ---------------------------------------------- 200 if kind == NX_OUTFIT_GYM_BOOTY_SHORTS { 201 if language == NX_LANG_EN { 202 if variant == 0 { return "high-cut booty shorts, gym shorts that ride up and lift the glutes" } 203 return 0 as *u8 204 } 205 if language == NX_LANG_JA { 206 if variant == 0 { return "ジムショートパンツ" } 207 return 0 as *u8 208 } 209 } 210 // SPORTS_BRA_TIGHT ---------------------------------------------- 211 if kind == NX_OUTFIT_SPORTS_BRA_TIGHT { 212 if language == NX_LANG_EN { 213 if variant == 0 { return "tight athletic sports bra, compression top" } 214 return 0 as *u8 215 } 216 if language == NX_LANG_JA { 217 if variant == 0 { return "スポーツブラ" } 218 return 0 as *u8 219 } 220 } 221 return 0 as *u8 222} 223 224// Build a composite prompt-ready phrase concatenating ALL available 225// language variants for one OutfitKind. Caller pre-allocates out buffer. 226// Returns the number of bytes written. 227// 228// Format: "variant_0, variant_1, variant_2, ..., variant_N" 229// Each variant is a different language's term for the same concept. 230// Encoder sees multi-language anchors -> stronger semantic latching. 231func nx_outfit_compose_multilang(kind: i64, out: *u8, out_cap: i64) -> i64 { 232 var pos: i64 = 0 233 var first: i64 = 1 234 var lang: i64 = NX_LANG_EN 235 while lang <= NX_LANG_DE { 236 var variant: i64 = 0 237 while variant < 4 { 238 let phrase: *u8 = nx_outfit_phrase(kind, lang, variant) 239 if phrase != (0 as *u8) { 240 if first == 0 { 241 if pos + 2 < out_cap { 242 out[pos] = 44 // ',' 243 out[pos + 1] = 32 // ' ' 244 pos = pos + 2 245 } 246 } 247 first = 0 248 var i: i64 = 0 249 while phrase[i] != 0 { 250 if pos + 1 < out_cap { 251 out[pos] = phrase[i] 252 pos = pos + 1 253 } 254 i = i + 1 255 } 256 } 257 variant = variant + 1 258 } 259 lang = lang + 1 260 } 261 if pos < out_cap { out[pos] = 0 } 262 return pos 263} 264 265// Helper: return number of bytes (excluding null terminator) of a string. 266func nx_outfit_strlen(s: *u8) -> i64 { 267 if s == (0 as *u8) { return 0 } 268 var n: i64 = 0 269 while s[n] != 0 { n = n + 1 } 270 return n 271}