Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core-mv/blob/main/om/qwen-native/flash/common.om # aien-sovereign-core-mv AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-sovereign-core-mv / om / qwen-native / flash / common.om` 89 lines ยท 1431 bytes Raw Blame History 1 note Argument, token-list and counter helpers shared by the command-line engine and the server. 2 global qids uint 8192 3 global qnids ulong 1 4 global qidmode ulong 1 5 global qintbuf uchar 32 6 fn qnumber buf view uchar * n ulong to ulong 7 if or eq n 0 gt n 7 8 qwfail 56 9 end 10 v = ulong 0 11 for i ulong n 12 c = get buf i 13 if or lt c 48 gt c 57 14 qwfail 56 15 end 16 v = add mul v 10 sub ulong c 48 17 end 18 ret v 19 end 20 21 fn qnumericarg a ulong to ulong 22 b = new uchar 8 0 23 n = argread a b 0 8 24 if le n 0 25 qwfail 56 26 end 27 ret qnumber b ulong n 28 end 29 30 fn outid id ulong to void 31 n = get qnids 0 32 if or ge n len qids ge id len sizes 33 qwfail 56 34 end 35 put qids n uint id 36 put qnids 0 add n 1 37 end 38 39 fn qprintid id ulong to void 40 v = id 41 p = ulong 31 42 put qintbuf p 10 43 while true bound 8 44 p = sub p 1 45 put qintbuf p uchar add 48 rem v 10 46 v = div v 10 47 if eq v 0 48 break 49 end 50 end 51 while lt p 32 bound 32 52 w = write 1 qintbuf p sub 32 p 53 if le w 0 54 qwfail 57 55 end 56 p = add p ulong w 57 end 58 end 59 60 text fstat0 "expert loads " 61 text fstat1 " evictions " 62 text fstat2 " device launches " 63 fn fstatnum v ulong to void 64 b = new uchar 24 0 65 p = ulong 23 66 x = v 67 put b p 32 68 while true bound 22 69 p = sub p 1 70 put b p uchar add 48 rem x 10 71 x = div x 10 72 if eq x 0 73 break 74 end 75 end 76 r = write 2 b p sub 24 p 77 end 78 79 fn fstats to void 80 r = write 2 fstat0 0 len fstat0 81 fstatnum get qecfg 4 82 r = write 2 fstat1 0 len fstat1 83 fstatnum get qecfg 5 84 r = write 2 fstat2 0 len fstat2 85 fstatnum get qecfg 6 86 b = new uchar 1 10 87 r = write 2 b 0 1 88 end 89