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/kv.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 / kv.om` 68 lines ยท 1668 bytes Raw Blame History 1 note SPDX-License-Identifier: AGPL-3.0-only 2 note Batch-one KV layout. Each layer owns a 128-row sliding window. Layers 3 note 2, 8, 14 and 20 publish compressed latents and index keys for consumers. 4 note The checked kernels use FP32 storage for BF16-rounded reconstructions. 5 note Sequence pages have 2048 token positions. The final partial page stays 6 note addressable only through the sequence length supplied to the planner. 7 const dkPage ulong 2048 8 global dkWindow ulong 40 9 global dkLatent ulong 40 10 global dkIndex ulong 40 11 global dkState ulong 40 12 global dkPlanInfo ulong 3 13 14 fn dkPlan length ulong to bool 15 if or eq length 0 gt length `1048576` 16 ret false 17 end 18 pages = div add length sub dkPage 1 dkPage 19 reserved = mul pages dkPage 20 off = ulong 0 21 for l ulong 40 22 put dkWindow l off 23 off = add off ulong 262144 24 end 25 latent = ulong 0 26 keys = ulong 0 27 state = ulong 0 28 for l ulong 40 29 if or or eq l 2 eq l 8 or eq l 14 eq l 20 30 rows = reserved 31 if lt l 20 32 rows = div reserved 2 33 end 34 latent = off 35 off = add off mul rows ulong 2048 36 keys = off 37 off = add off mul rows ulong 512 38 state = 0 39 if lt l 20 40 state = off 41 off = add off ulong 8192 42 end 43 end 44 if ge l 37 45 latent = 0 46 keys = 0 47 state = 0 48 end 49 put dkLatent l latent 50 put dkIndex l keys 51 put dkState l state 52 end 53 put dkPlanInfo 0 length 54 put dkPlanInfo 1 pages 55 put dkPlanInfo 2 off 56 ret true 57 end 58 59 fn dkTouch mapping long to bool 60 pos = ulong 0 61 while lt pos get dkPlanInfo 2 62 if ne mapset mapping pos 8 0 0 63 ret false 64 end 65 pos = add pos 4096 66 end 67 ret true 68 end