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
omega-mv / gpu / nvidia / om / cache / lifecycle_test.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Concatenate residency.om before this native host test. No GPU or new session. |
| 3 | fn kc_test_zero to int |
| 4 | p = new ulong 528 0 |
| 5 | r = new ulong 16 0 |
| 6 | put r 1 121 |
| 7 | put r 2 1 |
| 8 | put r 3 1 |
| 9 | put r 7 1 |
| 10 | if ne kc_init p 0 121 10 1 0 |
| 11 | ret 1 |
| 12 | end |
| 13 | if ne kc_prepare p r 1 |
| 14 | ret 2 |
| 15 | end |
| 16 | if ne kc_commit p 0 1 0 0 |
| 17 | ret 3 |
| 18 | end |
| 19 | if ne kc_pin p 0 1 0 0 |
| 20 | ret 4 |
| 21 | end |
| 22 | if ne kc_invalidate p 1 121 0 |
| 23 | ret 5 |
| 24 | end |
| 25 | if ne kc_pin p 0 1 0 -2 |
| 26 | ret 6 |
| 27 | end |
| 28 | ret 0 |
| 29 | end |
| 30 | fn main to int |
| 31 | p = new ulong 528 0 |
| 32 | r = new ulong 16 0 |
| 33 | if ne kc_test_zero 0 |
| 34 | ret 43 |
| 35 | end |
| 36 | if ne kc_init p 1 121 100 1 0 |
| 37 | ret 1 |
| 38 | end |
| 39 | put r 0 1 |
| 40 | put r 1 121 |
| 41 | put r 2 40 |
| 42 | put r 3 11 |
| 43 | put r 7 1 |
| 44 | if ne kc_prepare p r 1 |
| 45 | ret 2 |
| 46 | end |
| 47 | note Concurrent duplicate and independent registration cannot steal pending slot. |
| 48 | put r 7 2 |
| 49 | if ne kc_prepare p r -6 |
| 50 | ret 3 |
| 51 | end |
| 52 | put r 3 12 |
| 53 | if ne kc_prepare p r -5 |
| 54 | ret 4 |
| 55 | end |
| 56 | if ne kc_seal p 1 1 -6 |
| 57 | ret 5 |
| 58 | end |
| 59 | if ne kc_commit p 0 2 1 -7 |
| 60 | ret 6 |
| 61 | end |
| 62 | if ne kc_commit p 0 1 1 0 |
| 63 | ret 7 |
| 64 | end |
| 65 | put r 3 11 |
| 66 | if ne kc_find p r 1 |
| 67 | ret 8 |
| 68 | end |
| 69 | if ne kc_revision p 0 1 1 |
| 70 | ret 38 |
| 71 | end |
| 72 | if ne kc_livebytes p 1 40 |
| 73 | ret 39 |
| 74 | end |
| 75 | if ne kc_init p 1 121 100 1 -8 |
| 76 | ret 40 |
| 77 | end |
| 78 | put r 2 41 |
| 79 | if ne kc_find p r -1 |
| 80 | ret 41 |
| 81 | end |
| 82 | put r 2 40 |
| 83 | if ne kc_pin p 0 1 1 0 |
| 84 | ret 9 |
| 85 | end |
| 86 | if ne kc_acquire p 0 1 1 0 |
| 87 | ret 10 |
| 88 | end |
| 89 | if ne kc_unpin p 0 1 1 0 |
| 90 | ret 11 |
| 91 | end |
| 92 | note Record reference released, but interrupted completion keeps flight reference pinned. |
| 93 | put r 3 12 |
| 94 | if ne kc_prepare p r -5 |
| 95 | ret 12 |
| 96 | end |
| 97 | if ne kc_retire p 0 1 1 0 |
| 98 | ret 13 |
| 99 | end |
| 100 | if ne kc_retire p 0 1 1 -8 |
| 101 | ret 14 |
| 102 | end |
| 103 | if ne kc_prepare p r 1 |
| 104 | ret 15 |
| 105 | end |
| 106 | note Abort preserves immutable old entry and old revision after failed upload. |
| 107 | if ne kc_abort p 0 2 1 0 |
| 108 | ret 16 |
| 109 | end |
| 110 | put r 3 11 |
| 111 | if ne kc_find p r 1 |
| 112 | ret 17 |
| 113 | end |
| 114 | if ne get p 17 1 |
| 115 | ret 18 |
| 116 | end |
| 117 | if ne kc_seal p 1 1 0 |
| 118 | ret 19 |
| 119 | end |
| 120 | put r 3 12 |
| 121 | if ne kc_prepare p r -3 |
| 122 | ret 20 |
| 123 | end |
| 124 | put r 3 11 |
| 125 | if ne kc_prepare p r 1 |
| 126 | ret 21 |
| 127 | end |
| 128 | if ne kc_seal p 1 0 0 |
| 129 | ret 22 |
| 130 | end |
| 131 | put r 3 12 |
| 132 | put r 2 61 |
| 133 | if ne kc_prepare p r -4 |
| 134 | ret 23 |
| 135 | end |
| 136 | put r 2 40 |
| 137 | if ne kc_prepare p r -7 |
| 138 | ret 37 |
| 139 | end |
| 140 | put r 7 3 |
| 141 | if ne kc_prepare p r 1 |
| 142 | ret 24 |
| 143 | end |
| 144 | if ne kc_commit p 0 3 1 0 |
| 145 | ret 25 |
| 146 | end |
| 147 | if ne kc_pin p 0 1 1 -7 |
| 148 | ret 26 |
| 149 | end |
| 150 | if ne kc_hold p 0 2 1 1 0 |
| 151 | ret 27 |
| 152 | end |
| 153 | put r 3 13 |
| 154 | if ne kc_prepare p r -5 |
| 155 | ret 28 |
| 156 | end |
| 157 | if ne kc_hold p 0 2 1 -1 0 |
| 158 | ret 29 |
| 159 | end |
| 160 | note Session recovery destroys resident handles only, caller retains portable artifact bytes. |
| 161 | if ne kc_invalidate p 2 122 0 |
| 162 | ret 30 |
| 163 | end |
| 164 | if ne kc_pin p 0 2 1 -2 |
| 165 | ret 31 |
| 166 | end |
| 167 | if ne kc_prepare p r -2 |
| 168 | ret 32 |
| 169 | end |
| 170 | if ne kc_revision p 0 1 0 |
| 171 | ret 42 |
| 172 | end |
| 173 | put r 0 2 |
| 174 | put r 1 122 |
| 175 | put r 7 2 |
| 176 | if ne kc_prepare p r 1 |
| 177 | ret 33 |
| 178 | end |
| 179 | if ne kc_commit p 0 2 1 -2 |
| 180 | ret 34 |
| 181 | end |
| 182 | if ne kc_abort p 0 2 2 0 |
| 183 | ret 35 |
| 184 | end |
| 185 | if ne get p 5 0 |
| 186 | ret 36 |
| 187 | end |
| 188 | ret 0 |
| 189 | end |