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/omega-mv/blob/main/om/blackwell_arboris_qmd.om # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / om / blackwell_arboris_qmd.om` 149 lines ยท 4234 bytes Raw Blame History 1 note SPDX-License-Identifier: AGPL-3.0-only 2 note Offline SM121 sparse-wave descriptor packing. Compose after om/gpu/bw_qmd.om. 3 note Internal slot pairs are GPU VA and mapped extent, obtained by the allocator. 4 note Order: code, driver bank, scratch, semaphore, QMD0, QMD1, ART1 CSR, 5 note conductance, ping, pong. The public graph contains no GPU addresses. 6 note Shape: emitted node count, CSR node count, arc count, query count, 7 note active bank, decay and threshold bits. A zero decay is a host no-op. 8 note This serializer produces host bytes and does not grant submission rights. 9 10 fn wave_shape_ok shape view ulong 7 compound bool to bool 11 n = get shape 1 12 if or ne n get shape 0 or eq n 0 gt n 0x1fffffff 13 ret false 14 end 15 if or gt get shape 2 0xffffffff or eq get shape 3 0 gt get shape 3 65535 16 ret false 17 end 18 if or gt get shape 4 1 and not compound eq get shape 5 0 19 ret false 20 end 21 if and compound ne get shape 6 0 22 ret false 23 end 24 ret and le get shape 5 0x3f800000 le get shape 6 0x3f800000 25 end 26 27 fn wave_mapped slots view ulong 20 required view ulong 10 to bool 28 note QMD linkage words encode VA[39:8]. Use the native allocator's low VA range. 29 limit = ulong 0x10000000000 30 for i ulong 10 31 va = get slots mul i 2 32 extent = get slots add mul i 2 1 33 if or eq va 0 ge va limit 34 ret false 35 end 36 if or lt extent get required i gt extent sub limit va 37 ret false 38 end 39 align = ulong 128 40 if or eq i 0 or eq i 4 eq i 5 41 align = ulong 256 42 end 43 if ne and va sub align 1 0 44 ret false 45 end 46 for j ulong i bound 10 47 other = get slots mul j 2 48 finish = add other get slots add mul j 2 1 49 if and lt va finish lt other add va extent 50 ret false 51 end 52 end 53 end 54 ret true 55 end 56 57 fn wave_regions_ok shape view ulong 7 slots view ulong 20 compound bool to bool 58 req = new ulong 10 0 59 put req 0 896 60 put req 1 1024 61 put req 2 65536 62 put req 3 16 63 put req 4 384 64 put req 5 384 65 words = add 4 add get shape 1 get shape 2 66 put req 6 mul words 4 67 put req 7 mul get shape 2 4 68 state = mul mul get shape 1 get shape 3 8 69 if compound 70 state = div state 2 71 end 72 put req 8 state 73 put req 9 state 74 ret wave_mapped slots req 75 end 76 77 fn wave_bank_va bank edit uint 236 index ulong va ulong to void 78 put bank index u32lo va 79 put bank add index 1 u32lo shr va 32 80 end 81 82 fn wave_pack shape view ulong 7 slots view ulong 20 driver view uint 224 bank edit uint 236 q0 edit uint 96 q1 edit uint 96 to ulong 83 m = new ulong 16 0 84 for i ulong 5 85 put m i get slots mul i 2 86 end 87 put m 8 128 88 put m 9 1 89 put m 10 div add get shape 1 127 128 90 put m 11 get shape 3 91 put m 12 32 92 if ne bw_qmd1 m q1 0 93 ret 3 94 end 95 if ne bw_qmd_verify q1 0 96 ret 3 97 end 98 if ne bw_qmd0 q0 get slots 10 0 99 ret 3 100 end 101 for i ulong 224 102 put bank i get driver i 103 end 104 cb = get m 1 105 put bank 68 u32lo shr cb 32 106 put bank 69 u32lo cb 107 put bank 210 u32lo shr add cb 0x380 32 108 put bank 211 u32lo add cb 0x380 109 put bank 212 u32lo shr add cb 0x39c 32 110 put bank 213 u32lo add cb 0x39c 111 put bank 216 128 112 put bank 217 1 113 put bank 218 1 114 put bank 220 u32lo get m 10 115 put bank 221 u32lo get m 11 116 put bank 222 1 117 csr = get slots 12 118 wave_bank_va bank 224 add csr 12 119 wave_bank_va bank 226 add csr mul add get shape 1 4 4 120 wave_bank_va bank 228 get slots 14 121 active = get shape 4 122 read_slot = add ulong 16 mul active 2 123 write_slot = xor read_slot 2 124 wave_bank_va bank 230 get slots read_slot 125 wave_bank_va bank 232 get slots write_slot 126 put bank 234 u32lo get shape 5 127 put bank 235 u32lo get shape 6 128 ret 0 129 end 130 131 export fn arboris_wave_qmd shape view ulong 7 slots view ulong 20 driver view uint 224 bank edit uint 236 q0 edit uint 96 q1 edit uint 96 to ulong 132 if not wave_shape_ok shape false 133 ret 1 134 end 135 if not wave_regions_ok shape slots false 136 ret 2 137 end 138 ret wave_pack shape slots driver bank q0 q1 139 end 140 141 export fn arboris_relax_qmd shape view ulong 7 slots view ulong 20 driver view uint 224 bank edit uint 236 q0 edit uint 96 q1 edit uint 96 to ulong 142 if not wave_shape_ok shape true 143 ret 1 144 end 145 if not wave_regions_ok shape slots true 146 ret 2 147 end 148 ret wave_pack shape slots driver bank q0 q1 149 end