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/tools/pi-drive-27b/specdraft.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 / tools / pi-drive-27b / specdraft.om` 175 lines ยท 3546 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 2 note tools/pi-drive-27b/specdraft.om -- pure Omega (OM-1) L2-resident CPU prompt-lookup 3 note speculative drafter for GB10 CPU+GPU co-execution (Cortex-X925, <128 KiB static state). 4 note Library unit (no fn main); concatenate ahead of a driver unit and compile with seed/out/omc. 5 6 const SDCAP ulong 8192 7 const SDMASK ulong 8191 8 const SDMAXK ulong 8 9 const SDMAXN ulong 4 10 11 note Static state: 64 KiB token ring + 176 B buffers/counters = 65712 B (<128 KiB L2 resident). 12 global sdctx ulong 8192 13 global sdlen ulong 1 14 global sddraftbuf ulong 8 15 global sdtgtbuf ulong 9 16 global sdtotal_draft ulong 1 17 global sdtotal_acc ulong 1 18 global sdsteps ulong 1 19 global sdlast_ng ulong 1 20 21 note Reset ring state, draft/target buffers, and acceptance counters. 22 fn sdreset to void 23 put sdlen 0 0 24 put sdtotal_draft 0 0 25 put sdtotal_acc 0 0 26 put sdsteps 0 0 27 put sdlast_ng 0 0 28 i = ulong 0 29 while lt i SDMAXK bound 8 30 put sddraftbuf i 0 31 i = add i 1 32 end 33 j = ulong 0 34 while lt j 9 bound 9 35 put sdtgtbuf j 0 36 j = add j 1 37 end 38 k = ulong 0 39 while lt k SDCAP bound 8192 40 put sdctx k 0 41 k = add k 1 42 end 43 end 44 45 note Append one token to the bounded 8192-token ring and advance monotonic sdlen. 46 fn sdpush tok ulong to void 47 n = get sdlen 0 48 idx = and n SDMASK 49 put sdctx idx tok 50 put sdlen 0 add n 1 51 end 52 53 note Read token at logical position pos from the ring. 54 fn sdget pos ulong to ulong 55 idx = and pos SDMASK 56 ret get sdctx idx 57 end 58 59 note Earliest live logical position retained in the 8192-token ring. 60 fn sdstart to ulong 61 n = get sdlen 0 62 if gt n SDCAP 63 ret sub n SDCAP 64 end 65 ret 0 66 end 67 68 note Compare ng-gram at logical pos against suffix at logical suf. 69 fn sdmatch pos ulong suf ulong ng ulong to bool 70 i = ulong 0 71 while lt i ng bound 4 72 a = sdget add pos i 73 b = sdget add suf i 74 if ne a b 75 ret false 76 end 77 i = add i 1 78 end 79 ret true 80 end 81 82 note Search backwards in live ring [sdstart..sdlen) for prior match of current ng-gram suffix. 83 note Returns continuation start pos + ng (>0 and