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/CUDApp/blob/main/om/pipeline/select.om # CUDApp CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit. 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 `CUDApp / om / pipeline / select.om` 213 lines · 3880 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note #57 pure deterministic policy over trusted #35/#53/#54/#17 records. 3 note This predicate does not authenticate receipts or authorize graph activation. 4 note Exact field contract and trust boundary: docs/pipeline/CONTRACT.md. 5 note Candidate capacity 16. Every row has 64 cells. All times integer ns. 6 fn pl_nonzero a view ulong 1024 b ulong to bool 7 v = ulong 0 8 for j ulong 4 9 v = or v get a add b j 10 end 11 ret ne v 0 12 end 13 fn pl_equal a view ulong 1024 b ulong q view ulong 64 p ulong to bool 14 for j ulong 4 15 if ne get a add b j get q add p j 16 ret false 17 end 18 end 19 ret pl_nonzero a b 20 end 21 fn pl_cost a view ulong 1024 b ulong to bool 22 if ne get a add b 2 63 23 ret false 24 end 25 total = ulong 0 26 for j ulong 6 27 v = get a add add b 4 j 28 if gt v sub ulong `18446744073709551615` total 29 ret false 30 end 31 total = add total v 32 end 33 if eq get a add b 3 0 34 ret false 35 end 36 ret le total get a add b 3 37 end 38 fn pl_row a view ulong 1024 b ulong q view ulong 64 to bool 39 fam = get a b 40 if or lt fam 1 gt fam 3 41 ret false 42 end 43 note Required independent semantic/byte/physical/full-workload/quality gates. 44 if ne get a add b 1 31 45 ret false 46 end 47 if not pl_cost a b 48 ret false 49 end 50 for j ulong 4 51 if ne get a add add b 17 j get q add 3 j 52 ret false 53 end 54 end 55 for j ulong 4 56 if gt get a add add b 11 j get q add 7 j 57 ret false 58 end 59 end 60 if or eq get a add b 12 0 or eq get a add b 14 0 eq get a add b 16 0 61 ret false 62 end 63 features = get a add b 15 64 if ne and features get q 11 features 65 ret false 66 end 67 note Target feature bits are supplied by exact admitted profile, never SM inference. 68 if not pl_equal a add b 33 q 14 69 ret false 70 end 71 if not pl_equal a add b 37 q 18 72 ret false 73 end 74 if not pl_equal a add b 41 q 22 75 ret false 76 end 77 if not pl_equal a add b 45 q 26 78 ret false 79 end 80 if not pl_equal a add b 49 q 30 81 ret false 82 end 83 if not pl_equal a add b 53 q 34 84 ret false 85 end 86 if not pl_nonzero a add b 21 87 ret false 88 end 89 if not pl_nonzero a add b 25 90 ret false 91 end 92 if not pl_nonzero a add b 29 93 ret false 94 end 95 if not pl_nonzero a add b 57 96 ret false 97 end 98 for j ulong 3 99 if ne get a add add b 61 j 0 100 ret false 101 end 102 end 103 ret true 104 end 105 fn pl_same a view ulong 1024 x ulong y ulong to bool 106 for k ulong 4 107 if ne get a add x k get a add y k 108 ret false 109 end 110 end 111 ret true 112 end 113 fn pl_unique a view ulong 1024 count ulong to bool 114 for i ulong count 115 for j ulong i 116 if pl_same a add mul i 64 21 add mul j 64 21 117 ret false 118 end 119 end 120 end 121 ret true 122 end 123 fn pl_before a view ulong 1024 x ulong y ulong to bool 124 for j ulong 4 125 v = get a add add x 21 j 126 w = get a add add y 21 j 127 if lt v w 128 ret true 129 end 130 if gt v w 131 ret false 132 end 133 end 134 ret false 135 end 136 fn pl_select q view ulong 64 a view ulong 1024 o edit ulong 16 to int 137 note Clear all output on every refusal; result is advisory, never a launch handle. 138 for j ulong 16 139 put o j 0 140 end 141 if ne get q 0 1 142 ret 65 143 end 144 count = get q 1 145 if or eq count 0 gt count 16 146 ret 65 147 end 148 if not pl_unique a count 149 ret 65 150 end 151 inc = get q 2 152 if ge inc count 153 ret 65 154 end 155 note Session recovery generation begins at zero; exact zero epochs are valid. 156 if eq get q 4 0 157 ret 65 158 end 159 for j ulong 26 160 if ne get q add 38 j 0 161 ret 65 162 end 163 end 164 base = mul inc 64 165 if not pl_row a base q 166 ret 69 167 end 168 if not pl_equal a add base 21 q 30 169 ret 69 170 end 171 if gt get a add base 3 get q 13 172 ret 69 173 end 174 best = inc 175 cost = get a add base 3 176 for i ulong count 177 b = mul i 64 178 if pl_row a b q 179 v = get a add b 3 180 if le v get q 13 181 if le v get a add base 3 182 benefit = sub get a add base 3 v 183 if ge benefit get q 12 184 if lt v cost 185 best = i 186 cost = v 187 else 188 if and eq v cost ne best inc 189 if pl_before a b mul best 64 190 best = i 191 end 192 end 193 end 194 end 195 end 196 end 197 end 198 end 199 note Incumbent is retained even if an alternative fails any admission obligation. 200 put o 0 1 201 put o 1 best 202 put o 2 get a mul best 64 203 put o 3 cost 204 for j ulong 4 205 put o add 4 j get a add add mul best 64 21 j 206 put o add 8 j get a add add mul best 64 29 j 207 end 208 put o 12 get q 3 209 put o 13 get q 4 210 put o 14 get q 5 211 put o 15 get q 6 212 ret 0 213 end