nx_anchor_feature.nx source
↩ module page · 428 lines · 18861 B
1// nx_anchor_feature.nx -- singular landmark-feature contributions.
2//
3// Solves the "generic FBM noise" problem for procgen worlds. Pure
4// fractional Brownian motion gives terrain that LOOKS LIKE A WORLD
5// in the abstract but has no signature features. Real worlds have
6// landmarks that POP: Olympus Mons (22 km shield volcano, single
7// massive cone), Hellas Basin (7 km deep impact crater 2300 km
8// across), Valles Marineris (4000 km canyon system), Mt Everest,
9// Mariana Trench, Caloris Basin on Mercury.
10//
11// This primitive ships the SHAPE FUNCTIONS for those features.
12// Caller queries a feature's contribution at a (px, py) world coord;
13// composer adds the contribution to the base FBM height. Body-
14// specific anchor lists (Olympus Mons at 18 N 226 E, etc.) ship in
15// nishi-engine/nx as the per-body data layer that composes this
16// primitive into the surface generator.
17//
18// V1 kinds shipped (3):
19// VOLCANIC_DOME -- Olympus Mons style: single radial peak with
20// parabolic falloff (smooth shield-volcano profile)
21// IMPACT_BASIN -- Hellas style: large circular depression with
22// optional raised rim (negative magnitude)
23// RIDGE -- mountain-range linear feature, 4-cardinal
24// orientations (N-S or E-W in v1; arbitrary
25// angle in v2 via nx_camera_q14 sin/cos import)
26//
27// V2 kinds queued (2):
28// CANYON -- Valles Marineris style: linear depression with
29// optional inner ridge / chasma structure
30// PLATEAU -- Tharsis Bulge style: smooth flat-topped uplift
31//
32// Per cardinal `feedback-procgen-causal-growth-not-direct-sampling`:
33// anchor features ARE the causal layer that makes one world feel
34// distinct from another. Without them you get noise; with them you
35// get geography.
36//
37// Loss audit: Q14 integer arithmetic throughout. Parabolic falloff
38// is exact in Q14. Linear-feature distance is exact for the 2
39// cardinal orientations supported in v1.
40//
41// genealogy_id: lengyel_2003_math_for_3d_games + planetary_geology_canon +
42// nasa_mars_global_surveyor_topography
43// lineage_id: nx_anchor_feature_q14_v1
44
45// nx_safety_envelope:
46// intended_use: AUTO_APPLIED -- primitive-specific tuning queued
47// sil_target: SIL1
48// evidence: [bulk_applied_2026-05-16, see-file-comment-for-detail]
49// verdict: NOT_YET_EVALUATED
50
51import "nx_syscalls.nx"
52import "nx_tier.nx"
53const NX_MAGIC_22000: i64 = 22000
54const NX_MAGIC_7000: i64 = 7000
55const NX_MAGIC_8000: i64 = 8000
56const NX_MAGIC_6395: i64 = 6395
57const NX_MAGIC_6405: i64 = 6405
58const NX_MAGIC_5000: i64 = 5000
59const NX_MAGIC_3000: i64 = 3000
60
61// ===== Q14 ==========================================================
62const NX_ANCHOR_Q: nx_int = 16384
63
64// ===== Feature kinds (sealed enum) =================================
65// IDs reserved additively; v2 adds CANYON + PLATEAU at 3 + 4.
66const NX_ANCHOR_VOLCANIC_DOME: nx_int = 0
67const NX_ANCHOR_IMPACT_BASIN: nx_int = 1
68const NX_ANCHOR_RIDGE: nx_int = 2
69const NX_ANCHOR_CANYON: nx_int = 3 // queued v2
70const NX_ANCHOR_PLATEAU: nx_int = 4 // queued v2
71
72const NX_ANCHOR_KIND_COUNT: nx_int = 5
73
74// Ridge orientations (v1 -- cardinal only).
75const NX_ANCHOR_ORIENT_NS: nx_int = 0 // N-S running; varies in Y
76const NX_ANCHOR_ORIENT_EW: nx_int = 1 // E-W running; varies in X
77
78// ===== Validity predicates =========================================
79func nx_anchor_kind_is_valid(k: nx_int) -> nx_int {
80 if k == NX_ANCHOR_VOLCANIC_DOME { return 1 }
81 if k == NX_ANCHOR_IMPACT_BASIN { return 1 }
82 if k == NX_ANCHOR_RIDGE { return 1 }
83 if k == NX_ANCHOR_CANYON { return 1 } // valid enum value; v1 contribution is 0
84 if k == NX_ANCHOR_PLATEAU { return 1 }
85 return 0
86}
87
88func nx_anchor_orient_is_valid(o: nx_int) -> nx_int {
89 if o == NX_ANCHOR_ORIENT_NS { return 1 }
90 if o == NX_ANCHOR_ORIENT_EW { return 1 }
91 return 0
92}
93
94// ===== Volcanic dome (Olympus Mons style) ==========================
95// Parabolic radial bell: height contribution = magnitude * (1 - r2/s2)
96// inside scale radius, 0 outside. Magnitude is the peak elevation in
97// Q14 metres above baseline (positive number for an uplift).
98//
99// For Olympus Mons reference: cx, cy = (18 N, 226 E) projected to
100// world coords; scale ~ 300 km radius; magnitude ~ 22000 m peak.
101func nx_anchor_volcanic_dome(
102 cx_q14: nx_int,
103 cy_q14: nx_int,
104 px_q14: nx_int,
105 py_q14: nx_int,
106 scale_q14: nx_int,
107 magnitude_q14_m: nx_int
108) -> nx_int {
109 let dx: nx_int = px_q14 - cx_q14
110 let dy: nx_int = py_q14 - cy_q14
111 let d2: nx_int = dx * dx + dy * dy
112 let s2: nx_int = scale_q14 * scale_q14
113 if d2 >= s2 { return 0 }
114 // Parabolic falloff in Q14: fall = (s2 - d2) / s2 in [0, 1].
115 // contribution = magnitude * fall.
116 return magnitude_q14_m * (s2 - d2) / s2
117}
118
119// ===== Impact basin (Hellas style) =================================
120// Same parabolic radial profile as the dome, but negative -- a
121// depression. For Hellas reference: cx, cy = (43 S, 70 E); scale ~
122// 1150 km radius; magnitude ~ 7000 m depth. Pass magnitude as a
123// POSITIVE depth value; the function applies the sign.
124func nx_anchor_impact_basin(
125 cx_q14: nx_int,
126 cy_q14: nx_int,
127 px_q14: nx_int,
128 py_q14: nx_int,
129 scale_q14: nx_int,
130 magnitude_q14_m: nx_int
131) -> nx_int {
132 let dx: nx_int = px_q14 - cx_q14
133 let dy: nx_int = py_q14 - cy_q14
134 let d2: nx_int = dx * dx + dy * dy
135 let s2: nx_int = scale_q14 * scale_q14
136 if d2 >= s2 { return 0 }
137 // Negative parabolic falloff: contribution = -magnitude * (1 - r2/s2).
138 return 0 - magnitude_q14_m * (s2 - d2) / s2
139}
140
141// ===== Ridge (mountain-range linear feature) =======================
142// V1: 2 cardinal orientations. Half-width is 1/8 of the scale length
143// (long-thin ridge typical of mountain ranges).
144//
145// For Himalayan-class reference: scale ~ 2500 km length, magnitude ~
146// 8000 m peak. Tharsis Bulge would be modelled as PLATEAU (v2);
147// Atlas Mountains as ridge.
148func nx_anchor_ridge(
149 cx_q14: nx_int,
150 cy_q14: nx_int,
151 px_q14: nx_int,
152 py_q14: nx_int,
153 scale_q14: nx_int,
154 magnitude_q14_m: nx_int,
155 orient: nx_int
156) -> nx_int {
157 if nx_anchor_orient_is_valid(orient) == 0 { return 0 }
158
159 // Half-width is scale / 8.
160 let half_width: nx_int = scale_q14 / 8
161 let half_width_sq: nx_int = half_width * half_width
162
163 var d_along: nx_int = 0
164 var d_perp: nx_int = 0
165 if orient == NX_ANCHOR_ORIENT_NS {
166 d_along = py_q14 - cy_q14 // length along Y
167 d_perp = px_q14 - cx_q14 // perpendicular across X
168 }
169 if orient == NX_ANCHOR_ORIENT_EW {
170 d_along = px_q14 - cx_q14
171 d_perp = py_q14 - cy_q14
172 }
173
174 // Length check.
175 var along_abs: nx_int = d_along
176 if along_abs < 0 { along_abs = 0 - along_abs }
177 if along_abs >= scale_q14 { return 0 }
178
179 // Width check.
180 let perp_sq: nx_int = d_perp * d_perp
181 if perp_sq >= half_width_sq { return 0 }
182
183 // Length taper: smooth fade toward the ends.
184 let length_taper: nx_int = (scale_q14 - along_abs) * NX_ANCHOR_Q / scale_q14 // [0, Q]
185 // Width parabolic falloff.
186 let width_fall: nx_int = (half_width_sq - perp_sq) * NX_ANCHOR_Q / half_width_sq // [0, Q]
187
188 return magnitude_q14_m * length_taper / NX_ANCHOR_Q * width_fall / NX_ANCHOR_Q
189}
190
191// ===== Canyon (Valles Marineris style) =============================
192// Linear depression along an orientation; like RIDGE but the magnitude
193// carves DOWN instead of UP, and the half-width is narrower (chasma-
194// like proportions). For Valles Marineris reference: length ~ 4000
195// km along the equatorial axis, depth ~ 7000 m. Pass magnitude as
196// POSITIVE depth value; function applies the sign.
197//
198// Half-width is 1/16 of length (rather than 1/8 for ridges) so canyons
199// look canyon-shaped instead of valley-shaped.
200func nx_anchor_canyon(
201 cx_q14: nx_int,
202 cy_q14: nx_int,
203 px_q14: nx_int,
204 py_q14: nx_int,
205 scale_q14: nx_int,
206 magnitude_q14_m: nx_int,
207 orient: nx_int
208) -> nx_int {
209 if nx_anchor_orient_is_valid(orient) == 0 { return 0 }
210
211 let half_width: nx_int = scale_q14 / 16
212 let half_width_sq: nx_int = half_width * half_width
213
214 var d_along: nx_int = 0
215 var d_perp: nx_int = 0
216 if orient == NX_ANCHOR_ORIENT_NS {
217 d_along = py_q14 - cy_q14
218 d_perp = px_q14 - cx_q14
219 }
220 if orient == NX_ANCHOR_ORIENT_EW {
221 d_along = px_q14 - cx_q14
222 d_perp = py_q14 - cy_q14
223 }
224
225 var along_abs: nx_int = d_along
226 if along_abs < 0 { along_abs = 0 - along_abs }
227 if along_abs >= scale_q14 { return 0 }
228
229 let perp_sq: nx_int = d_perp * d_perp
230 if perp_sq >= half_width_sq { return 0 }
231
232 let length_taper: nx_int = (scale_q14 - along_abs) * NX_ANCHOR_Q / scale_q14
233 let width_fall: nx_int = (half_width_sq - perp_sq) * NX_ANCHOR_Q / half_width_sq
234
235 let depth: nx_int = magnitude_q14_m * length_taper / NX_ANCHOR_Q * width_fall / NX_ANCHOR_Q
236 return 0 - depth
237}
238
239// ===== Plateau (Tharsis Bulge style) ===============================
240// Smooth flat-topped uplift. Inside the plateau-top radius (60% of
241// total scale): full magnitude as a flat surface. Between the
242// plateau-top and the outer edge: linear ramp from magnitude down to
243// 0. Outside the outer edge: 0.
244//
245// Reference: Tharsis Bulge on Mars (5500 km across, 7000 m above
246// datum, flat-ish top); High Plains in North America.
247func nx_anchor_plateau(
248 cx_q14: nx_int,
249 cy_q14: nx_int,
250 px_q14: nx_int,
251 py_q14: nx_int,
252 scale_q14: nx_int,
253 magnitude_q14_m: nx_int
254) -> nx_int {
255 let dx: nx_int = px_q14 - cx_q14
256 let dy: nx_int = py_q14 - cy_q14
257 let d2: nx_int = dx * dx + dy * dy
258 let s2: nx_int = scale_q14 * scale_q14
259 if d2 >= s2 { return 0 }
260
261 // Plateau-top inner radius = 60% of scale. Squared.
262 let top_radius: nx_int = scale_q14 * 6 / 10
263 let top_r2: nx_int = top_radius * top_radius
264
265 if d2 <= top_r2 {
266 // Flat plateau-top: full magnitude.
267 return magnitude_q14_m
268 }
269
270 // Ramp zone: linear interpolation from magnitude (at top_r) down
271 // to 0 (at outer scale). progress = (s2 - d2) / (s2 - top_r2)
272 // in Q14.
273 let span: nx_int = s2 - top_r2
274 if span <= 0 { return magnitude_q14_m }
275 let ramp_q: nx_int = (s2 - d2) * NX_ANCHOR_Q / span
276 return magnitude_q14_m * ramp_q / NX_ANCHOR_Q
277}
278
279// ===== Dispatch entry =============================================
280// One-stop entry that routes to the right kind. All 5 shape kinds
281// now ship in v2 (CANYON + PLATEAU upgraded from v1 stubs). orient
282// is only consulted for RIDGE / CANYON; ignored otherwise.
283func nx_anchor_feature_contribution(
284 kind: nx_int,
285 cx_q14: nx_int,
286 cy_q14: nx_int,
287 px_q14: nx_int,
288 py_q14: nx_int,
289 scale_q14: nx_int,
290 magnitude_q14_m: nx_int,
291 orient: nx_int
292) -> nx_int {
293 if kind == NX_ANCHOR_VOLCANIC_DOME {
294 return nx_anchor_volcanic_dome(cx_q14, cy_q14, px_q14, py_q14, scale_q14, magnitude_q14_m)
295 }
296 if kind == NX_ANCHOR_IMPACT_BASIN {
297 return nx_anchor_impact_basin(cx_q14, cy_q14, px_q14, py_q14, scale_q14, magnitude_q14_m)
298 }
299 if kind == NX_ANCHOR_RIDGE {
300 return nx_anchor_ridge(cx_q14, cy_q14, px_q14, py_q14, scale_q14, magnitude_q14_m, orient)
301 }
302 if kind == NX_ANCHOR_CANYON {
303 return nx_anchor_canyon(cx_q14, cy_q14, px_q14, py_q14, scale_q14, magnitude_q14_m, orient)
304 }
305 if kind == NX_ANCHOR_PLATEAU {
306 return nx_anchor_plateau(cx_q14, cy_q14, px_q14, py_q14, scale_q14, magnitude_q14_m)
307 }
308 return 0
309}
310
311// ===== Self-test ====================================================
312func main() -> i64 {
313 let q: nx_int = NX_ANCHOR_Q
314
315 // T1: Validity predicates.
316 if nx_anchor_kind_is_valid(NX_ANCHOR_VOLCANIC_DOME) != 1 { return __syscall(93, 1, 0, 0, 0, 0, 0) }
317 if nx_anchor_kind_is_valid(NX_ANCHOR_IMPACT_BASIN) != 1 { return __syscall(93, 2, 0, 0, 0, 0, 0) }
318 if nx_anchor_kind_is_valid(NX_ANCHOR_RIDGE) != 1 { return __syscall(93, 3, 0, 0, 0, 0, 0) }
319 if nx_anchor_kind_is_valid(NX_ANCHOR_CANYON) != 1 { return __syscall(93, 4, 0, 0, 0, 0, 0) }
320 if nx_anchor_kind_is_valid(NX_ANCHOR_PLATEAU) != 1 { return __syscall(93, 5, 0, 0, 0, 0, 0) }
321 if nx_anchor_kind_is_valid(99) != 0 { return __syscall(93, 6, 0, 0, 0, 0, 0) }
322 if nx_anchor_orient_is_valid(NX_ANCHOR_ORIENT_NS) != 1 { return __syscall(93, 7, 0, 0, 0, 0, 0) }
323 if nx_anchor_orient_is_valid(NX_ANCHOR_ORIENT_EW) != 1 { return __syscall(93, 8, 0, 0, 0, 0, 0) }
324 if nx_anchor_orient_is_valid(99) != 0 { return __syscall(93, 9, 0, 0, 0, 0, 0) }
325
326 // T2: Volcanic dome -- peak height at exact centre = magnitude.
327 let h_centre: nx_int = nx_anchor_volcanic_dome(100 * q, 200 * q, 100 * q, 200 * q, 50 * q, NX_MAGIC_22000)
328 if h_centre != NX_MAGIC_22000 { return __syscall(93, 20, 0, 0, 0, 0, 0) }
329
330 // T3: Volcanic dome -- height at half-radius = 0.75 * magnitude
331 // (parabolic profile: 1 - 0.25 = 0.75). Allow +/- 1 for integer
332 // rounding.
333 let h_half: nx_int = nx_anchor_volcanic_dome(100 * q, 200 * q, 100 * q + 25 * q, 200 * q, 50 * q, NX_MAGIC_22000)
334 let expected_half: nx_int = NX_MAGIC_22000 * 3 / 4
335 if h_half < expected_half - 4 { return __syscall(93, 30, 0, 0, 0, 0, 0) }
336 if h_half > expected_half + 4 { return __syscall(93, 31, 0, 0, 0, 0, 0) }
337
338 // T4: Outside scale -- 0.
339 let h_out: nx_int = nx_anchor_volcanic_dome(100 * q, 200 * q, 1000 * q, 1000 * q, 50 * q, NX_MAGIC_22000)
340 if h_out != 0 { return __syscall(93, 40, 0, 0, 0, 0, 0) }
341 // Exactly at scale boundary -- 0.
342 let h_edge: nx_int = nx_anchor_volcanic_dome(100 * q, 200 * q, 150 * q, 200 * q, 50 * q, NX_MAGIC_22000)
343 if h_edge != 0 { return __syscall(93, 41, 0, 0, 0, 0, 0) }
344
345 // T5: Impact basin -- depression at centre = -magnitude.
346 let b_centre: nx_int = nx_anchor_impact_basin(100 * q, 100 * q, 100 * q, 100 * q, 100 * q, NX_MAGIC_7000)
347 if b_centre != (0 - NX_MAGIC_7000) { return __syscall(93, 50, 0, 0, 0, 0, 0) }
348
349 // T6: Impact basin outside scale = 0.
350 let b_out: nx_int = nx_anchor_impact_basin(100 * q, 100 * q, 500 * q, 500 * q, 100 * q, NX_MAGIC_7000)
351 if b_out != 0 { return __syscall(93, 60, 0, 0, 0, 0, 0) }
352
353 // T7: Ridge N-S orientation -- on the line (perp = 0), midway
354 // along the length, full magnitude.
355 let r_on: nx_int = nx_anchor_ridge(0, 0, 0, 100 * q, 500 * q, NX_MAGIC_8000, NX_ANCHOR_ORIENT_NS)
356 // length_taper at d_along=100q vs scale=500q: (500-100)/500 = 0.8 Q.
357 // width_fall at d_perp=0: full Q.
358 // Result: 8000 * 0.8 * 1 = 6400.
359 if r_on < NX_MAGIC_6395 { return __syscall(93, 70, 0, 0, 0, 0, 0) }
360 if r_on > NX_MAGIC_6405 { return __syscall(93, 71, 0, 0, 0, 0, 0) }
361
362 // T8: Ridge -- outside length = 0.
363 let r_far_along: nx_int = nx_anchor_ridge(0, 0, 0, 1000 * q, 500 * q, NX_MAGIC_8000, NX_ANCHOR_ORIENT_NS)
364 if r_far_along != 0 { return __syscall(93, 80, 0, 0, 0, 0, 0) }
365 // Outside width = 0. half_width = 500/8 = 62.5, so at perp=100q far outside.
366 let r_far_perp: nx_int = nx_anchor_ridge(0, 0, 100 * q, 100 * q, 500 * q, NX_MAGIC_8000, NX_ANCHOR_ORIENT_NS)
367 if r_far_perp != 0 { return __syscall(93, 81, 0, 0, 0, 0, 0) }
368
369 // T9: Ridge E-W orientation -- on the line varies in X, not Y.
370 let r_ew: nx_int = nx_anchor_ridge(0, 0, 100 * q, 0, 500 * q, NX_MAGIC_8000, NX_ANCHOR_ORIENT_EW)
371 if r_ew < NX_MAGIC_6395 { return __syscall(93, 90, 0, 0, 0, 0, 0) }
372 if r_ew > NX_MAGIC_6405 { return __syscall(93, 91, 0, 0, 0, 0, 0) }
373
374 // T10: Dispatch entry routes correctly.
375 let d_dome: nx_int = nx_anchor_feature_contribution(
376 NX_ANCHOR_VOLCANIC_DOME, 0, 0, 0, 0, 50 * q, NX_MAGIC_5000, 0)
377 if d_dome != NX_MAGIC_5000 { return __syscall(93, 100, 0, 0, 0, 0, 0) }
378
379 let d_basin: nx_int = nx_anchor_feature_contribution(
380 NX_ANCHOR_IMPACT_BASIN, 0, 0, 0, 0, 50 * q, NX_MAGIC_3000, 0)
381 if d_basin != (0 - NX_MAGIC_3000) { return __syscall(93, 101, 0, 0, 0, 0, 0) }
382
383 let d_ridge: nx_int = nx_anchor_feature_contribution(
384 NX_ANCHOR_RIDGE, 0, 0, 0, 100 * q, 500 * q, NX_MAGIC_8000, NX_ANCHOR_ORIENT_NS)
385 if d_ridge < NX_MAGIC_6395 { return __syscall(93, 102, 0, 0, 0, 0, 0) }
386 if d_ridge > NX_MAGIC_6405 { return __syscall(93, 103, 0, 0, 0, 0, 0) }
387
388 // T11: CANYON shape function (full implementation).
389 // On-line midway through canyon length -> negative depth.
390 let d_canyon: nx_int = nx_anchor_canyon(
391 0, 0, 0, 100 * q, 500 * q, NX_MAGIC_7000, NX_ANCHOR_ORIENT_NS)
392 if d_canyon >= 0 { return __syscall(93, 110, 0, 0, 0, 0, 0) }
393 // Outside canyon length -> 0.
394 let d_canyon_far: nx_int = nx_anchor_canyon(
395 0, 0, 0, 1000 * q, 500 * q, NX_MAGIC_7000, NX_ANCHOR_ORIENT_NS)
396 if d_canyon_far != 0 { return __syscall(93, 111, 0, 0, 0, 0, 0) }
397 // E-W orientation: varies along X.
398 let d_canyon_ew: nx_int = nx_anchor_canyon(
399 0, 0, 100 * q, 0, 500 * q, NX_MAGIC_7000, NX_ANCHOR_ORIENT_EW)
400 if d_canyon_ew >= 0 { return __syscall(93, 112, 0, 0, 0, 0, 0) }
401 // PLATEAU centre -> full magnitude (flat top).
402 let d_plat: nx_int = nx_anchor_plateau(0, 0, 0, 0, 100 * q, NX_MAGIC_5000)
403 if d_plat != NX_MAGIC_5000 { return __syscall(93, 113, 0, 0, 0, 0, 0) }
404 // PLATEAU within top radius (60% inner) -> still flat magnitude.
405 let d_plat_top: nx_int = nx_anchor_plateau(0, 0, 40 * q, 0, 100 * q, NX_MAGIC_5000)
406 if d_plat_top != NX_MAGIC_5000 { return __syscall(93, 114, 0, 0, 0, 0, 0) }
407 // PLATEAU in ramp zone -> intermediate value.
408 let d_plat_ramp: nx_int = nx_anchor_plateau(0, 0, 80 * q, 0, 100 * q, NX_MAGIC_5000)
409 if d_plat_ramp <= 0 { return __syscall(93, 115, 0, 0, 0, 0, 0) }
410 if d_plat_ramp >= NX_MAGIC_5000 { return __syscall(93, 116, 0, 0, 0, 0, 0) }
411 // PLATEAU outside scale -> 0.
412 let d_plat_out: nx_int = nx_anchor_plateau(0, 0, 200 * q, 0, 100 * q, NX_MAGIC_5000)
413 if d_plat_out != 0 { return __syscall(93, 117, 0, 0, 0, 0, 0) }
414 // Dispatch routes CANYON + PLATEAU correctly.
415 let d_disp_canyon: nx_int = nx_anchor_feature_contribution(
416 NX_ANCHOR_CANYON, 0, 0, 0, 100 * q, 500 * q, NX_MAGIC_7000, NX_ANCHOR_ORIENT_NS)
417 if d_disp_canyon >= 0 { return __syscall(93, 118, 0, 0, 0, 0, 0) }
418 let d_disp_plat: nx_int = nx_anchor_feature_contribution(
419 NX_ANCHOR_PLATEAU, 0, 0, 0, 0, 100 * q, NX_MAGIC_5000, 0)
420 if d_disp_plat != NX_MAGIC_5000 { return __syscall(93, 119, 0, 0, 0, 0, 0) }
421
422 // T12: Unknown kind via dispatch -> 0 (no crash).
423 let d_unknown: nx_int = nx_anchor_feature_contribution(
424 99, 0, 0, 0, 0, 50 * q, NX_MAGIC_5000, 0)
425 if d_unknown != 0 { return __syscall(93, 120, 0, 0, 0, 0, 0) }
426
427 return 0
428}