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 / native / shader-pilot / core.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Offline specimen only. Reuses CUL1 and gbvec; never submits or executes GPU code. |
| 3 | note Candidate buffers are separate from canonical kt/gbcode. Single-threaded scratch. |
| 4 | global sptask uchar 232 |
| 5 | global spcode uchar 512 |
| 6 | fn spprofile id ulong n ulong to bool |
| 7 | if and ne id 2 ne id 3 |
| 8 | ret false |
| 9 | end |
| 10 | if ne kvalid n 0 |
| 11 | ret false |
| 12 | end |
| 13 | note Fail closed if the upstream catalog changes to an unsupported profile. |
| 14 | if or ne kw 2 1 ne kw 3 1 |
| 15 | ret false |
| 16 | end |
| 17 | if or or ne kw 8 1 ne kw 9 1 ne kw 10 1 |
| 18 | ret false |
| 19 | end |
| 20 | want = ulong 8 |
| 21 | if eq id 3 |
| 22 | want = 17 |
| 23 | end |
| 24 | if ne kw 5 want |
| 25 | ret false |
| 26 | end |
| 27 | ret true |
| 28 | end |
| 29 | fn spload id ulong to ulong |
| 30 | note Reject unknown IDs before touching the previous specimen. |
| 31 | if and ne id 2 ne id 3 |
| 32 | ret 0 |
| 33 | end |
| 34 | n = kload id |
| 35 | if not spprofile id n |
| 36 | ret 0 |
| 37 | end |
| 38 | gbvec |
| 39 | ret n |
| 40 | end |
| 41 | fn spmatch id ulong tn ulong cn ulong to int |
| 42 | note Exact content comparison, not an authenticated artifact/cache admission service. |
| 43 | n = spload id |
| 44 | if eq n 0 |
| 45 | ret 77 |
| 46 | end |
| 47 | if or ne tn n ne cn 512 |
| 48 | ret 65 |
| 49 | end |
| 50 | for i ulong n |
| 51 | if ne get sptask i get kt i |
| 52 | ret 1 |
| 53 | end |
| 54 | end |
| 55 | for i ulong 512 |
| 56 | if ne get spcode i get gbcode i |
| 57 | ret 1 |
| 58 | end |
| 59 | end |
| 60 | ret 0 |
| 61 | end |