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/gpu/nvidia/om/pipeline/test_mccover.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 / gpu / nvidia / om / pipeline / test_mccover.om` 266 lines ยท 4607 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note HOST_ONLY SYNTHETIC policy controls, no receipt, admission, device or GPU. 3 fn test_cover to long 4 c = new ulong 16 0 5 roles = new ulong 4096 8 6 counts = new ulong 8 1 7 owner = new ulong 4 0 8 put c 0 1 9 put c 1 159 10 put c 2 6 11 put c 3 1 12 put c 4 1 13 put c 5 64 14 put c 6 1 15 put c 8 8 16 put c 9 7 17 put c 10 16 18 put owner 0 8 19 put owner 1 7 20 put owner 2 32 21 put roles 0 1 22 put roles 1 0 23 put roles 2 2 24 put roles 3 6 25 put roles 4 3 26 put roles 5 4 27 put roles 6 7 28 put roles 7 5 29 if ne mcc_cover c roles counts owner 0 30 ret 1 31 end 32 note A missing successful-add record cannot be replaced by an expected role. 33 put roles 3 8 34 if eq mcc_cover c roles counts owner 0 35 ret 2 36 end 37 put roles 3 6 38 put counts 6 0 39 if eq mcc_cover c roles counts owner 0 40 ret 3 41 end 42 put counts 6 1 43 note Same role set with the wrong actual order is refused. 44 put roles 3 3 45 put roles 4 6 46 if eq mcc_cover c roles counts owner 0 47 ret 4 48 end 49 put roles 3 6 50 put roles 4 3 51 put c 9 6 52 if eq mcc_cover c roles counts owner 0 53 ret 5 54 end 55 put c 9 7 56 put owner 0 7 57 if eq mcc_cover c roles counts owner 0 58 ret 6 59 end 60 put owner 0 8 61 put roles 8 5 62 if eq mcc_cover c roles counts owner 0 63 ret 7 64 end 65 put roles 8 8 66 put c 4 2 67 if eq mcc_cover c roles counts owner 0 68 ret 8 69 end 70 put c 4 1 71 if ne mcc_cover c roles counts owner 0 72 ret 9 73 end 74 ret 0 75 end 76 fn test_qword qmd edit uchar 1024 off ulong v ulong to void 77 for i ulong 4 78 put qmd add off i uchar and shr v mul i 8 255 79 end 80 end 81 fn test_intent to long 82 m = new ulong 32 0 83 bank = new uchar 1024 0 84 qmd = new uchar 1024 0 85 s = new ulong 16 0 86 seal = new uchar 32 0 87 put m 0 1 88 put m 1 159 89 put m 2 1 90 put m 3 6 91 put m 4 1 92 put m 5 16 93 put m 7 7 94 put m 10 4096 95 put m 11 8192 96 note Expected VA declared independently before writing the synthetic QMD. 97 put qmd 129 1 98 put s 0 1 99 put s 1 159 100 put s 2 4 101 put s 3 7 102 put s 6 1 103 put s 11 8 104 if ne mcc_seal bank qmd get m 4 edit seal 0 105 ret 18 106 end 107 if ne native_mcintent m bank qmd s seal 0 108 ret 10 109 end 110 put m 10 8192 111 if eq native_mcintent m bank qmd s seal 0 112 ret 11 113 end 114 put m 10 4096 115 put m 3 7 116 if ne native_mcintent m bank qmd s seal 0 117 ret 12 118 end 119 put s 3 6 120 if eq native_mcintent m bank qmd s seal 0 121 ret 13 122 end 123 put s 3 7 124 put m 6 8 125 if eq native_mcintent m bank qmd s seal 0 126 ret 14 127 end 128 put m 6 0 129 note Mutations of driver prefix, actual argument, QMD1 and QMD0 each refuse. 130 put bank 0 1 131 if eq native_mcintent m bank qmd s seal 0 132 ret 19 133 end 134 put bank 0 0 135 put bank 896 1 136 if eq native_mcintent m bank qmd s seal 0 137 ret 20 138 end 139 put bank 896 0 140 put qmd 0 1 141 if eq native_mcintent m bank qmd s seal 0 142 ret 21 143 end 144 put qmd 0 0 145 put qmd 512 1 146 if eq native_mcintent m bank qmd s seal 0 147 ret 22 148 end 149 put qmd 512 0 150 note Inactive bank tail/QMD gap are deliberately outside the seal. 151 put bank 900 1 152 put qmd 384 1 153 if ne native_mcintent m bank qmd s seal 0 154 ret 23 155 end 156 put bank 900 0 157 put qmd 384 0 158 note Exact PCAS to INLINE to PCAS reuse preserves seal, not unchecked modefields. 159 test_qword edit qmd 40 `1638400` 160 want = and shr add get m 11 512 8 `4294967295` 161 test_qword edit qmd 48 want 162 put s 4 1 163 if ne native_mcintent m bank qmd s seal 0 164 ret 24 165 end 166 put qmd 40 1 167 if eq native_mcintent m bank qmd s seal 0 168 ret 25 169 end 170 test_qword edit qmd 40 `1638400` 171 put m 11 8448 172 if eq native_mcintent m bank qmd s seal 0 173 ret 26 174 end 175 put m 11 8192 176 test_qword edit qmd 40 0 177 test_qword edit qmd 48 0 178 put s 4 0 179 if ne native_mcintent m bank qmd s seal 0 180 ret 27 181 end 182 put seal 0 xor get seal 0 1 183 if eq native_mcintent m bank qmd s seal 0 184 ret 28 185 end 186 if eq mcc_seal bank qmd 0 edit seal 0 187 ret 29 188 end 189 for i ulong 32 190 if ne get seal i 0 191 ret 30 192 end 193 end 194 ret 0 195 end 196 fn test_nwin n ulong to ulong 197 ret div add n sub div ulong 128 9 1 div ulong 128 9 198 end 199 fn test_windows to long 200 c = new ulong 16 0 201 roles = new ulong 4096 8 202 counts = new ulong 8 0 203 owner = new ulong 4 0 204 seq = new ulong 6 0 205 put seq 1 2 206 put seq 2 6 207 put seq 3 3 208 put seq 4 4 209 put seq 5 7 210 put c 0 1 211 put c 1 159 212 put c 2 6 213 put c 3 128 214 put c 4 test_nwin get c 3 215 put c 5 64 216 put c 9 77 217 put c 10 16 218 for i ulong 8 219 put counts i get c 4 220 end 221 put counts 1 div add get c 3 63 64 222 put counts 5 get c 3 223 off = ulong 0 224 for i ulong get counts 1 225 put roles off 1 226 off = add off 1 227 end 228 for w ulong get c 4 229 for j ulong 6 230 put roles off get seq j 231 off = add off 1 232 end 233 end 234 for i ulong get counts 5 235 put roles off 5 236 off = add off 1 237 end 238 put c 8 off 239 put owner 0 off 240 put owner 1 get c 9 241 put owner 2 4096 242 if ne mcc_cover c roles counts owner 0 243 ret 15 244 end 245 put c 3 129 246 if eq mcc_cover c roles counts owner 0 247 ret 16 248 end 249 put c 3 128 250 put roles sub off 1 8 251 if eq mcc_cover c roles counts owner 0 252 ret 17 253 end 254 ret 0 255 end 256 fn main to int 257 r = test_cover 258 if ne r 0 259 ret int r 260 end 261 r = test_windows 262 if ne r 0 263 ret int r 264 end 265 ret int test_intent 266 end