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/om/gpu/dsv41/decoder/core.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 / om / gpu / dsv41 / decoder / core.om` 118 lines ยท 2771 bytes Raw Blame History 1 note SPDX-License-Identifier: AGPL-3.0-only 2 note Plan the resident checkpoint in tensor-index order. Offloaded expert 3 note weights and Engram row planes stay on disk; Engram projections stay resident. 4 global dcOffset ulong 96085 5 global dcSource ulong 96085 6 global dcLength ulong 96085 7 global dcShard uint 96085 8 global dcFD long 48 9 global dcTotals ulong 3 10 text dcExpert ".ffn.experts." 11 text dcRows ".engram.embed." 12 text dcEmbedding "embed.weight" 13 text dcPin "`aeffef21b0840b05d82f525da3f72546b8ffbb5ee876b926518b486f0198cb9f`" 14 15 fn dcMatch row view uchar 160 pos ulong needle view uchar * to bool 16 if gt add pos len needle 160 17 ret false 18 end 19 for i ulong len needle 20 if ne get row add pos i get needle i 21 ret false 22 end 23 end 24 ret true 25 end 26 27 fn dcResident row view uchar 160 shard ulong to bool 28 if eq shard 2 29 ret dcMatch row 56 dcEmbedding 30 end 31 if eq shard 43 32 ret true 33 end 34 if or lt shard 3 and gt shard 42 lt shard 47 35 ret false 36 end 37 pos = ulong 63 38 while and ge get row pos 48 le get row pos 57 39 pos = add pos 1 40 end 41 ret not or dcMatch row pos dcExpert dcMatch row pos dcRows 42 end 43 44 fn dcPlan fd int to bool 45 if ne fseek fd 0 2 `15373600` 46 ret false 47 end 48 ctx = new uchar 104 0 49 digest = new uchar 32 0 50 row = new uchar 160 0 51 sha256_init ctx 52 for i ulong 3 53 put dcTotals i 0 54 end 55 for i ulong 96085 56 if not diRead fd row mul i 160 160 57 ret false 58 end 59 sha256_update ctx row 60 shard = ulong get row 0 61 put dcLength i 0 62 if dcResident row shard 63 pos = and add get dcTotals 0 255 `18446744073709551360` 64 size = diGet row 16 8 65 put dcOffset i pos 66 put dcLength i size 67 put dcSource i diGet row 8 8 68 put dcShard i uint shard 69 put dcTotals 0 add pos size 70 put dcTotals 1 add get dcTotals 1 size 71 put dcTotals 2 add get dcTotals 2 1 72 end 73 end 74 sha256_final ctx digest 75 for i ulong 32 76 v = uint get digest i 77 if ne sh_hexd shr v 4 get dcPin mul i 2 78 ret false 79 end 80 if ne sh_hexd and v 15 get dcPin add mul i 2 1 81 ret false 82 end 83 end 84 ret true 85 end 86 87 fn dcTransfer fd int arena long src ulong dest ulong size ulong to bool 88 buf = new uchar 262144 0 89 pos = ulong 0 90 while lt pos size 91 n = sub size pos 92 if gt n len buf 93 n = len buf 94 end 95 if not diRead fd buf add src pos n 96 ret false 97 end 98 if ne mapwrite arena add dest pos buf 0 n long n 99 ret false 100 end 101 pos = add pos n 102 end 103 ret true 104 end 105 106 fn dcPopulate arena long to bool 107 for i ulong 96085 108 size = get dcLength i 109 if ne size 0 110 shard = ulong get dcShard i 111 fd = int get dcFD sub shard 1 112 if not dcTransfer fd arena get dcSource i get dcOffset i size 113 ret false 114 end 115 end 116 end 117 ret true 118 end