omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / seed / ng / target / gate.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note seed/ng/target/gate.om: Pure seeded OM-2 verification gate for Unified TargetDesc + Shared IPRA/RegAlloc + |
| 3 | note Multi-ISA Table-Driven ISel (AArch64, x86-64, RV64GC, SM121) + Proof-Gated Realization Cache. |
| 4 | |
| 5 | global gDig uchar 24 |
| 6 | text gMsgHdr "=== OMEGA NG UNIFIED TARGET-DESC + MULTI-ISA BACKEND GATE ===\n" |
| 7 | text gMsgPass "NG-TARGET-GATE PASS checks=" |
| 8 | text gMsgCtrl " controls=" |
| 9 | text gMsgNl "\n" |
| 10 | text gMsgFail "NG-TARGET-GATE FAIL at check=" |
| 11 | |
| 12 | fn gSay s ulong to void |
| 13 | if eq s 0 |
| 14 | w = write 1 gMsgHdr 0 len gMsgHdr |
| 15 | ret |
| 16 | end |
| 17 | if eq s 1 |
| 18 | w = write 1 gMsgPass 0 len gMsgPass |
| 19 | ret |
| 20 | end |
| 21 | if eq s 2 |
| 22 | w = write 1 gMsgCtrl 0 len gMsgCtrl |
| 23 | ret |
| 24 | end |
| 25 | if eq s 3 |
| 26 | w = write 1 gMsgNl 0 len gMsgNl |
| 27 | ret |
| 28 | end |
| 29 | w = write 1 gMsgFail 0 len gMsgFail |
| 30 | end |
| 31 | |
| 32 | fn gNum v ulong to void |
| 33 | x = v |
| 34 | p = ulong 24 |
| 35 | for i ulong 21 |
| 36 | p = sub p 1 |
| 37 | put gDig p uchar add 48 rem x 10 |
| 38 | x = div x 10 |
| 39 | if eq x 0 |
| 40 | w = write 1 gDig p sub 24 p |
| 41 | ret |
| 42 | end |
| 43 | end |
| 44 | end |
| 45 | |
| 46 | fn gFail id ulong to int |
| 47 | gSay 4 |
| 48 | gNum id |
| 49 | gSay 3 |
| 50 | ret int id |
| 51 | end |
| 52 | |
| 53 | fn gGetU32 off ulong to ulong |
| 54 | b0 = ulong get isBuf off |
| 55 | b1 = shl ulong get isBuf add off 1 8 |
| 56 | b2 = shl ulong get isBuf add off 2 16 |
| 57 | b3 = shl ulong get isBuf add off 3 24 |
| 58 | ret or or b0 b1 or b2 b3 |
| 59 | end |
| 60 | |
| 61 | note Populate 16 overlapping SSA live intervals to stress-test 12, 15, 30, and 64-register files! |
| 62 | fn gBuildStressIntervals to void |
| 63 | raReset |
| 64 | for i ulong 16 |
| 65 | id = raAddInterval i add i 15 RA_SPILL |
| 66 | end |
| 67 | end |
| 68 | |
| 69 | global gChk ulong 1 |
| 70 | global gCtrl ulong 1 |
| 71 | |
| 72 | fn gAddChk n ulong to void |
| 73 | put gChk 0 add get gChk 0 n |
| 74 | end |
| 75 | |
| 76 | fn gAddCtrl n ulong to void |
| 77 | put gCtrl 0 add get gCtrl 0 n |
| 78 | end |
| 79 | |
| 80 | fn gTestTargets to int |
| 81 | if ne get tdCount 0 10 |
| 82 | ret gFail 1 |
| 83 | end |
| 84 | if ne tdGet TID_X925 TDF_OOO 10 |
| 85 | ret gFail 2 |
| 86 | end |
| 87 | if ne tdGet TID_A725 TDF_OOO 5 |
| 88 | ret gFail 3 |
| 89 | end |
| 90 | if ne tdGet TID_X64_AVX2 TDF_TWOADDR 1 |
| 91 | ret gFail 4 |
| 92 | end |
| 93 | if ne tdGet TID_SM121 TDF_SMEM 101376 |
| 94 | ret gFail 5 |
| 95 | end |
| 96 | if ne tdGet TID_SPARK_RING TDF_COHNS 4500 |
| 97 | ret gFail 6 |
| 98 | end |
| 99 | gAddChk 6 |
| 100 | note 2. Compile-Time Physical Contract Checker + Negative Controls |
| 101 | tdSetReq EXEC_SIMT_WARP 16384 64 32 MMA_16816_BF16 FEAT_HMMA16816 |
| 102 | if ne tdCheckKernelContract TID_SM121 TDK_OK |
| 103 | ret gFail 10 |
| 104 | end |
| 105 | tdSet TID_SM121 TDF_SMEM 8192 |
| 106 | if ne tdCheckKernelContract TID_SM121 TDK_ERR_SMEM |
| 107 | ret gFail 11 |
| 108 | end |
| 109 | tdSet TID_SM121 TDF_SMEM 101376 |
| 110 | gAddCtrl 1 |
| 111 | tdSetReq EXEC_SIMT_WARP 0 16 32 0 0 |
| 112 | if ne tdCheckKernelContract TID_X925 TDK_ERR_EXEC |
| 113 | ret gFail 12 |
| 114 | end |
| 115 | gAddCtrl 1 |
| 116 | tdSetReq EXEC_SCALAR_SIMD 0 12 8 MMA_161616_AMX 0 |
| 117 | if ne tdCheckKernelContract TID_X64_AVX2 TDK_ERR_MMA |
| 118 | ret gFail 13 |
| 119 | end |
| 120 | gAddCtrl 1 |
| 121 | gAddChk 4 |
| 122 | note 3. Target-Parameterized Tile/Blocking Planner |
| 123 | tdDeriveTilePlan TID_X925 4 |
| 124 | x925Nc = get tdTileOut 2 |
| 125 | tdDeriveTilePlan TID_A725 4 |
| 126 | a725Nc = get tdTileOut 2 |
| 127 | if le x925Nc a725Nc |
| 128 | ret gFail 20 |
| 129 | end |
| 130 | tdDeriveTilePlan TID_X64_AVX512 4 |
| 131 | if ne get tdTileOut 3 16 |
| 132 | ret gFail 21 |
| 133 | end |
| 134 | tdDeriveTilePlan TID_SM121 2 |
| 135 | if ne get tdTileOut 0 64 |
| 136 | ret gFail 22 |
| 137 | end |
| 138 | gAddChk 3 |
| 139 | ret 0 |
| 140 | end |
| 141 | |
| 142 | fn gTestRegAlloc to int |
| 143 | gBuildStressIntervals |
| 144 | spCm55 = raRunForTarget TID_CM55 |
| 145 | if or eq spCm55 0 ne raVerifyColoring 0 |
| 146 | ret gFail 30 |
| 147 | end |
| 148 | spX64 = raRunForTarget TID_X64_AVX2 |
| 149 | if or ne spX64 1 ne raVerifyColoring 0 |
| 150 | ret gFail 31 |
| 151 | end |
| 152 | spA64 = raRunForTarget TID_X925 |
| 153 | if or ne spA64 0 ne raVerifyColoring 0 |
| 154 | ret gFail 32 |
| 155 | end |
| 156 | spSm121 = raRunForTarget TID_SM121 |
| 157 | if or ne spSm121 0 ne raVerifyColoring 0 |
| 158 | ret gFail 33 |
| 159 | end |
| 160 | put raPhys 1 get raPhys 0 |
| 161 | if eq raVerifyColoring 0 |
| 162 | ret gFail 34 |
| 163 | end |
| 164 | gAddCtrl 1 |
| 165 | gAddChk 5 |
| 166 | note 5. Whole-Program IPRA |
| 167 | raIpraReset 3 |
| 168 | raIpraSetDirect 2 3 |
| 169 | raIpraSetDirect 1 4 |
| 170 | raIpraSetDirect 0 8 |
| 171 | raIpraAddCall 0 1 |
| 172 | raIpraAddCall 1 2 |
| 173 | raIpraSolve |
| 174 | if ne get raFnProp 0 15 |
| 175 | ret gFail 40 |
| 176 | end |
| 177 | if ne raPopcount get raFnProp 1 3 |
| 178 | ret gFail 41 |
| 179 | end |
| 180 | if ge raPopcount get raFnProp 1 raPopcount tdGet TID_X925 TDF_CSAVE |
| 181 | ret gFail 42 |
| 182 | end |
| 183 | gAddChk 3 |
| 184 | ret 0 |
| 185 | end |
| 186 | |
| 187 | fn gTestIsel to int |
| 188 | if ne isSelect TID_X925 OIR_FMA 104 |
| 189 | ret gFail 50 |
| 190 | end |
| 191 | if ne isSelect TID_X925 OIR_SHA256 106 |
| 192 | ret gFail 51 |
| 193 | end |
| 194 | if ne isSelect TID_X64_AVX2 OIR_FMA 204 |
| 195 | ret gFail 52 |
| 196 | end |
| 197 | if ne isSelect TID_RV64_RVV OIR_SHA256 305 |
| 198 | ret gFail 53 |
| 199 | end |
| 200 | gAddChk 4 |
| 201 | note 7a. AArch64: ADD x0,x0,x1; MUL x0,x0,x2; RET |
| 202 | if not isCompileTestFn TID_X925 |
| 203 | ret gFail 60 |
| 204 | end |
| 205 | if ne get isLen 0 12 |
| 206 | ret gFail 61 |
| 207 | end |
| 208 | if ne gGetU32 0 2332098560 |
| 209 | ret gFail 62 |
| 210 | end |
| 211 | if ne gGetU32 4 2600631296 |
| 212 | ret gFail 62 |
| 213 | end |
| 214 | if ne gGetU32 8 3596551104 |
| 215 | ret gFail 62 |
| 216 | end |
| 217 | note 7b. Register-Allocated x86-64: 48 01 f8; 48 0f af c6; c3 |
| 218 | if not isCompileTestFn TID_X64_AVX2 |
| 219 | ret gFail 63 |
| 220 | end |
| 221 | if ne get isLen 0 8 |
| 222 | ret gFail 64 |
| 223 | end |
| 224 | if ne get isBuf 0 72 |
| 225 | ret gFail 65 |
| 226 | end |
| 227 | if ne get isBuf 1 1 |
| 228 | ret gFail 65 |
| 229 | end |
| 230 | if ne get isBuf 2 248 |
| 231 | ret gFail 65 |
| 232 | end |
| 233 | if ne get isBuf 7 195 |
| 234 | ret gFail 65 |
| 235 | end |
| 236 | if ne get isBuf 3 72 |
| 237 | ret gFail 66 |
| 238 | end |
| 239 | if ne get isBuf 4 15 |
| 240 | ret gFail 66 |
| 241 | end |
| 242 | if ne get isBuf 5 175 |
| 243 | ret gFail 66 |
| 244 | end |
| 245 | if ne get isBuf 6 198 |
| 246 | ret gFail 66 |
| 247 | end |
| 248 | note 7c. RV64GC: ADD a0,a0,a1; MUL a0,a0,a2; RET |
| 249 | if not isCompileTestFn TID_RV64_RVV |
| 250 | ret gFail 67 |
| 251 | end |
| 252 | if ne get isLen 0 12 |
| 253 | ret gFail 68 |
| 254 | end |
| 255 | if ne gGetU32 0 11863347 |
| 256 | ret gFail 69 |
| 257 | end |
| 258 | if ne gGetU32 4 46466355 |
| 259 | ret gFail 69 |
| 260 | end |
| 261 | if ne gGetU32 8 32871 |
| 262 | ret gFail 69 |
| 263 | end |
| 264 | note 7d. SM121 Blackwell 128-bit SASS (48 B, Antibody #14 stall>=6) |
| 265 | if not isCompileTestFn TID_SM121 |
| 266 | ret gFail 70 |
| 267 | end |
| 268 | if ne get isLen 0 48 |
| 269 | ret gFail 71 |
| 270 | end |
| 271 | if ne gGetU32 8 6 |
| 272 | ret gFail 72 |
| 273 | end |
| 274 | if ne gGetU32 24 6 |
| 275 | ret gFail 72 |
| 276 | end |
| 277 | gAddChk 12 |
| 278 | ret 0 |
| 279 | end |
| 280 | |
| 281 | fn gTestCache to int |
| 282 | if ne tdCacheInstall 12345 TID_SM121 3081 4 4096 3 999999 |
| 283 | ret gFail 80 |
| 284 | end |
| 285 | gAddCtrl 1 |
| 286 | slot = tdCacheInstall 12345 TID_SM121 3081 4 4096 7 |
| 287 | if eq slot 999999 |
| 288 | ret gFail 81 |
| 289 | end |
| 290 | slot2 = tdCacheInstall 12345 TID_SM121 3081 4 8192 7 |
| 291 | if or ne slot2 slot or ne get rcPtr slot 8192 ne get rcVer slot 2 |
| 292 | ret gFail 82 |
| 293 | end |
| 294 | gAddChk 3 |
| 295 | ret 0 |
| 296 | end |
| 297 | |
| 298 | fn gTestSm121Pe to int |
| 299 | note 9. Runtime Shape Partial Evaluator across M=1, M=4, M=8, M=512 + Cache Hit + SMEM Negative Control! |
| 300 | if ne peSpecializeW4Gemm 9001 TID_SM121 1 2048 9216 TDK_OK |
| 301 | ret gFail 90 |
| 302 | end |
| 303 | if or ne get peOut 0 PE_REGIME_GEMV_4R ne get peOut 1 8192 |
| 304 | ret gFail 91 |
| 305 | end |
| 306 | s1 = get peOut 4 |
| 307 | note M=4 MTP decode-verify -> auto-selects REG_TILE_M with exact SMEM=32768 B (zero HMMA padding waste!) |
| 308 | if ne peSpecializeW4Gemm 9001 TID_SM121 4 2048 9216 TDK_OK |
| 309 | ret gFail 92 |
| 310 | end |
| 311 | if or ne get peOut 0 PE_REGIME_REG_TILE_M ne get peOut 1 32768 |
| 312 | ret gFail 93 |
| 313 | end |
| 314 | s4 = get peOut 4 |
| 315 | if eq s4 s1 |
| 316 | ret gFail 94 |
| 317 | end |
| 318 | note Repeat M=4 lookup -> O(1) Realization Cache hit returns identical slot! |
| 319 | if ne peSpecializeW4Gemm 9001 TID_SM121 4 2048 9216 TDK_OK |
| 320 | ret gFail 95 |
| 321 | end |
| 322 | if ne get peOut 4 s4 |
| 323 | ret gFail 96 |
| 324 | end |
| 325 | note M=512 chunked prefill -> auto-selects HMMA_16816 Tensor Core regime! |
| 326 | if ne peSpecializeW4Gemm 9001 TID_SM121 512 2048 9216 TDK_OK |
| 327 | ret gFail 97 |
| 328 | end |
| 329 | if ne get peOut 0 PE_REGIME_HMMA_16816 |
| 330 | ret gFail 98 |
| 331 | end |
| 332 | note Negative control F: illegal M=8, K=4096 (reqSmem = 131072 > SM121 101376) MUST be refused pre-emit! |
| 333 | if ne peSpecializeW4Gemm 9001 TID_SM121 8 4096 2048 TDK_ERR_SMEM |
| 334 | ret gFail 99 |
| 335 | end |
| 336 | gAddCtrl 1 |
| 337 | note Negative control G: inject Antibody #14 violation (stall=2 < 6) -> peVerifySm121Antibodies MUST catch! |
| 338 | put isBuf 8 2 |
| 339 | if peVerifySm121Antibodies |
| 340 | ret gFail 100 |
| 341 | end |
| 342 | gAddCtrl 1 |
| 343 | gAddChk 8 |
| 344 | note 10. Orthogonal ELF64 container plugin across AArch64 (EM=183), x86-64 (EM=62), and RV64GC (EM=243) |
| 345 | if eq elfBuildExecDemo TID_X925 0 |
| 346 | ret gFail 101 |
| 347 | end |
| 348 | if ne get elfBuf 18 183 |
| 349 | ret gFail 102 |
| 350 | end |
| 351 | if eq elfBuildExecDemo TID_X64_AVX2 0 |
| 352 | ret gFail 103 |
| 353 | end |
| 354 | if ne get elfBuf 18 62 |
| 355 | ret gFail 104 |
| 356 | end |
| 357 | if not isCompileTestFn TID_RV64_RVV |
| 358 | ret gFail 105 |
| 359 | end |
| 360 | if eq elfEmitStatic TID_RV64_RVV 0 |
| 361 | ret gFail 106 |
| 362 | end |
| 363 | if ne get elfBuf 18 243 |
| 364 | ret gFail 107 |
| 365 | end |
| 366 | gAddChk 6 |
| 367 | ret 0 |
| 368 | end |
| 369 | |
| 370 | fn gTestFabric to int |
| 371 | fabInit |
| 372 | note 11. Heterogeneous apu-gb10 scheduler routes X925 / A725 / SM121 / Spark Ring |
| 373 | if ne fabScheduleApu TASK_CTRL_LATENCY TID_X925 |
| 374 | ret gFail 110 |
| 375 | end |
| 376 | if ne fabScheduleApu TASK_BG_METABOLIC TID_A725 |
| 377 | ret gFail 111 |
| 378 | end |
| 379 | if ne fabScheduleApu TASK_TENSOR_LOCAL TID_SM121 |
| 380 | ret gFail 112 |
| 381 | end |
| 382 | if ne fabScheduleApu TASK_TENSOR_MULTI_SPARK TID_SPARK_RING |
| 383 | ret gFail 113 |
| 384 | end |
| 385 | note Negative control H: unverified fabWtbl hot-swap (proofMask=5, missing ngrun bit1) MUST be refused! |
| 386 | if fabHotSwap 0 7777 4096 TID_SM121 FAB_MODE_GPU_NATIVE 5 |
| 387 | ret gFail 114 |
| 388 | end |
| 389 | if ne get fabVer 0 0 |
| 390 | ret gFail 115 |
| 391 | end |
| 392 | gAddCtrl 1 |
| 393 | note Install baseline neural/generic entry at slot 0, then trigger A725 Arboris metabolic specialization on M=4! |
| 394 | if not fabHotSwap 0 7777 4096 TID_SM121 FAB_MODE_NEURAL 7 |
| 395 | ret gFail 116 |
| 396 | end |
| 397 | for k ulong 4 |
| 398 | h = fabObserveShape 7777 4 2048 9216 |
| 399 | end |
| 400 | if ne fabMetabolicTick 0 TID_SM121 1 |
| 401 | ret gFail 117 |
| 402 | end |
| 403 | if or ne get fabMode 0 FAB_MODE_GPU_NATIVE ne get fabVer 0 2 |
| 404 | ret gFail 118 |
| 405 | end |
| 406 | gAddChk 8 |
| 407 | ret 0 |
| 408 | end |
| 409 | |
| 410 | fn gTestCrystallize to int |
| 411 | crInit |
| 412 | note 12. ΩIR v2 SLAB contracts: immutable write refused, alarmed slab rolls back on overflow! |
| 413 | crRegSlab 0 SLAB_IMMUTABLE 0 TID_SM121 |
| 414 | crRegSlab 1 SLAB_MUTABLE_ALARMED 100 TID_SM121 |
| 415 | crRegSlab 2 SLAB_SHARDED 0 TID_SPARK_RING |
| 416 | note Negative control I: write to immutable W4 core weight slab MUST fail! |
| 417 | if ne crUpdateSlab 0 1 CR_ERR_IMMUTABLE |
| 418 | ret gFail 120 |
| 419 | end |
| 420 | gAddCtrl 1 |
| 421 | note Alarmed fast-weight slab accepts bounded update, then trips alarm + rolls back on spike! |
| 422 | if ne crUpdateSlab 1 40 CR_OK |
| 423 | ret gFail 121 |
| 424 | end |
| 425 | if ne crUpdateSlab 1 80 CR_ERR_ALARM |
| 426 | ret gFail 122 |
| 427 | end |
| 428 | if ne get crSlabNorm 1 40 |
| 429 | ret gFail 123 |
| 430 | end |
| 431 | gAddCtrl 1 |
| 432 | note 13. Live Neural -> Portable ΩIR Crystallization Loop! |
| 433 | if not fabHotSwap 1 8888 8192 TID_SM121 FAB_MODE_NEURAL 7 |
| 434 | ret gFail 124 |
| 435 | end |
| 436 | if ne crCallOracle 1 2 3 15 |
| 437 | ret gFail 125 |
| 438 | end |
| 439 | if ne crCallOracle 1 4 1 15 |
| 440 | ret gFail 126 |
| 441 | end |
| 442 | if ne crCallOracle 1 7 5 36 |
| 443 | ret gFail 127 |
| 444 | end |
| 445 | if ne crCallOracle 1 10 2 36 |
| 446 | ret gFail 128 |
| 447 | end |
| 448 | if not crCrystallizeAndSwap 1 8888 |
| 449 | ret gFail 129 |
| 450 | end |
| 451 | if or ne get crOp1 0 OIR_ADD or ne get crOp2 0 OIR_MUL ne get crConstC 0 3 |
| 452 | ret gFail 130 |
| 453 | end |
| 454 | if or ne get fabMode 1 FAB_MODE_CRYSTALLIZED ge get fabCostNs 1 1000 |
| 455 | ret gFail 131 |
| 456 | end |
| 457 | note In-domain call hits crystallized exact path; out-of-domain (x0=200 > 100) trips alarm & falls back cleanly! |
| 458 | if ne crCallOracle 1 7 5 36 |
| 459 | ret gFail 132 |
| 460 | end |
| 461 | if ne crCallOracle 1 200 1 603 |
| 462 | ret gFail 133 |
| 463 | end |
| 464 | gAddChk 11 |
| 465 | ret 0 |
| 466 | end |
| 467 | |
| 468 | fn gDumpElf tid ulong to int |
| 469 | n = elfBuildExecDemo tid |
| 470 | if eq n 0 |
| 471 | ret 1 |
| 472 | end |
| 473 | w = write 1 elfBuf 0 n |
| 474 | if ne w long n |
| 475 | ret 2 |
| 476 | end |
| 477 | ret 0 |
| 478 | end |
| 479 | |
| 480 | fn gDumpCrystElf tid ulong to int |
| 481 | fabInit |
| 482 | crInit |
| 483 | ok = fabHotSwap 1 8888 8192 TID_SM121 FAB_MODE_NEURAL 7 |
| 484 | y = crCallOracle 1 2 3 |
| 485 | y = crCallOracle 1 7 5 |
| 486 | y = crCallOracle 1 10 2 |
| 487 | if not crSynthesizeFromTraces |
| 488 | ret 3 |
| 489 | end |
| 490 | n = crEmitCrystallizedElf tid |
| 491 | if eq n 0 |
| 492 | ret 4 |
| 493 | end |
| 494 | w = write 1 elfBuf 0 n |
| 495 | if ne w long n |
| 496 | ret 5 |
| 497 | end |
| 498 | ret 0 |
| 499 | end |
| 500 | |
| 501 | fn main to int |
| 502 | arg = new uchar 16 0 |
| 503 | tdInitAll |
| 504 | isInitRules |
| 505 | tdCacheInit |
| 506 | if gt argcnt 1 |
| 507 | al = argread 1 arg 0 16 |
| 508 | if and ge al 3 eq get arg 0 97 |
| 509 | ret gDumpElf TID_X925 |
| 510 | end |
| 511 | if and ge al 3 eq get arg 0 120 |
| 512 | ret gDumpElf TID_X64_AVX2 |
| 513 | end |
| 514 | if and ge al 4 eq get arg 0 99 |
| 515 | if eq get arg 1 97 |
| 516 | ret gDumpCrystElf TID_X925 |
| 517 | end |
| 518 | if eq get arg 1 120 |
| 519 | ret gDumpCrystElf TID_X64_AVX2 |
| 520 | end |
| 521 | end |
| 522 | end |
| 523 | gSay 0 |
| 524 | put gChk 0 0 |
| 525 | put gCtrl 0 0 |
| 526 | r = gTestTargets |
| 527 | if ne r 0 |
| 528 | ret r |
| 529 | end |
| 530 | r = gTestRegAlloc |
| 531 | if ne r 0 |
| 532 | ret r |
| 533 | end |
| 534 | r = gTestIsel |
| 535 | if ne r 0 |
| 536 | ret r |
| 537 | end |
| 538 | r = gTestCache |
| 539 | if ne r 0 |
| 540 | ret r |
| 541 | end |
| 542 | r = gTestSm121Pe |
| 543 | if ne r 0 |
| 544 | ret r |
| 545 | end |
| 546 | r = gTestFabric |
| 547 | if ne r 0 |
| 548 | ret r |
| 549 | end |
| 550 | r = gTestCrystallize |
| 551 | if ne r 0 |
| 552 | ret r |
| 553 | end |
| 554 | gSay 1 |
| 555 | gNum get gChk 0 |
| 556 | gSay 2 |
| 557 | gNum get gCtrl 0 |
| 558 | gSay 3 |
| 559 | ret 0 |
| 560 | end |