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
aien-sovereign-core-mv / om / qwen-native / flash / session.om
| 1 | note Private pipe transport. All frames use little-endian u32. EOF at a frame boundary closes normally. |
| 2 | global qwire uchar 8 |
| 3 | fn qwireu n ulong to void |
| 4 | for j ulong 4 |
| 5 | tkpc and shr n mul 8 j 255 |
| 6 | end |
| 7 | end |
| 8 | |
| 9 | fn qrequest to ulong |
| 10 | seen = ulong 0 |
| 11 | while lt seen 4 bound 4 |
| 12 | r = read 0 qwire seen sub 4 seen |
| 13 | if lt r 0 |
| 14 | qwfail 60 |
| 15 | end |
| 16 | if eq r 0 |
| 17 | if ne seen 0 |
| 18 | qwfail 60 |
| 19 | end |
| 20 | ret 0 |
| 21 | end |
| 22 | seen = add seen ulong r |
| 23 | end |
| 24 | n = ulong 0 |
| 25 | for i ulong 4 |
| 26 | n = or n shl ulong get qwire i mul 8 i |
| 27 | end |
| 28 | if or eq n 0 gt n 1048576 |
| 29 | qwfail 60 |
| 30 | end |
| 31 | r = enlarge input n |
| 32 | if lt r 0 |
| 33 | qwfail 60 |
| 34 | end |
| 35 | seen = ulong 0 |
| 36 | while lt seen n bound 1048576 |
| 37 | r = read 0 input seen sub n seen |
| 38 | if le r 0 |
| 39 | qwfail 60 |
| 40 | end |
| 41 | seen = add seen ulong r |
| 42 | end |
| 43 | ret n |
| 44 | end |
| 45 | |
| 46 | fn qsessiontoken id ulong to void |
| 47 | qwireu id |
| 48 | if or eq id 248044 eq id 248046 |
| 49 | qwireu 0 |
| 50 | else |
| 51 | if ge id len sizes |
| 52 | qwfail 57 |
| 53 | end |
| 54 | w = ulong get sizes id |
| 55 | if eq w 0 |
| 56 | qwfail 57 |
| 57 | end |
| 58 | qwireu w |
| 59 | emitword id |
| 60 | end |
| 61 | tkpfl |
| 62 | end |
| 63 | |
| 64 | fn qsession cap ulong to void |
| 65 | qwireu 827216721 |
| 66 | tkpfl |
| 67 | while true bound 4294967295 |
| 68 | n = qrequest |
| 69 | if eq n 0 |
| 70 | ret |
| 71 | end |
| 72 | put qnids 0 0 |
| 73 | encodeinput n |
| 74 | count = get qnids 0 |
| 75 | if or eq count 0 gt add count sub cap 1 2048 |
| 76 | qwfail 56 |
| 77 | end |
| 78 | qdiskrecheck |
| 79 | qgenerate count cap |
| 80 | qwireu 4294967295 |
| 81 | qwireu get qrun 3 |
| 82 | qwireu count |
| 83 | qwireu get qrun 4 |
| 84 | tkpfl |
| 85 | end |
| 86 | end |