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/neuralese/proposal.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 / neuralese / proposal.om` 155 lines ยท 2799 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 2 note NL4 consumes NL3 lpvalid and NL1 nddec; neither is execution authority. 3 note Caller must run lpvalid against receiver-owned context before this decoder. 4 note No host words, executable payload, capability, allocation from input or effects. 5 note Concatenate after an om2 debug entry, NL1 hadamard.om and NL3 validator.om. 6 fn nlencode f view f64 4 wire edit uchar 32 to int 7 stage = new uint 8 0 8 for i ulong 4 9 if not and ge get f i 0.0f64 le get f i 1.0f64 10 ret 50 11 end 12 end 13 for i ulong 8 14 v = 0.0f64 15 for j ulong 4 16 v = add v mul get f j ndelem i j 17 end 18 put stage i bitcast uint f32 v 19 end 20 for i ulong 8 21 u = get stage i 22 off = mul i 4 23 for j ulong 4 24 sh = mul sub ulong 3 j 8 25 c = uchar and shr u sh 255 26 put wire add off j c 27 end 28 end 29 ret 0 30 end 31 fn nlbe32 a view uchar * off ulong to uint 32 v = uint 0 33 for i ulong 4 34 v = or shl v 8 uint get a add off i 35 end 36 ret v 37 end 38 fn nlbit v f64 to int 39 note Closed synthetic codebook tolerance; ambiguous and nonfinite scores refuse. 40 if and ge v -0.`0625f64` le v 0.`0625f64` 41 ret 0 42 end 43 if and ge v 0.`9375f64` le v 1.`0625f64` 44 ret 1 45 end 46 ret -1 47 end 48 fn nlproposal a view uchar * p edit uint 16 to int 49 note This function proposes only; it does not validate context, reserve or execute. 50 b = new uint 4 0 51 if lt len a 1024 52 ret 40 53 end 54 if ne get a 5 1 55 ret 41 56 end 57 dtype = get a 10 58 width = uint 4 59 if eq dtype 2 60 width = 1 61 else 62 if ne dtype 1 63 ret 41 64 end 65 end 66 if ne len a add ulong 1024 ulong mul width 8 67 ret 40 68 end 69 if or ne get a 11 1 ne nlbe32 a 24 8 70 ret 42 71 end 72 if or ne nlbe32 a 16 mul width 8 ne nlbe32 a 20 8 73 ret 42 74 end 75 if ne get a 101 0 76 ret 43 77 end 78 if lt nlbe32 a 104 1 79 ret 44 80 end 81 factor = 1.0f64 82 zero = int 0 83 if eq dtype 2 84 scale = nlbe32 a 56 85 zero = bitcast int nlbe32 a 60 86 if or eq scale 0 ge scale 0x7f800000 87 ret 45 88 end 89 if or lt zero -128 gt zero 127 90 ret 45 91 end 92 factor = f64 bitcast f32 scale 93 end 94 for i ulong 8 95 if eq dtype 1 96 u = nlbe32 a add 1024 mul i 4 97 note Exponent255 includes every NaN and infinity, without floating comparison. 98 if eq and shr u 23 255 255 99 ret 45 100 end 101 put NM i f64 bitcast f32 u 102 else 103 q = int get a add 1024 i 104 if ge q 128 105 q = sub q 256 106 end 107 put NM i mul f64 sub q zero factor 108 end 109 end 110 r = nddec 8 111 if ne r 0 112 ret 46 113 end 114 for i ulong 4 115 v = nlbit get NF i 116 if lt v 0 117 ret 47 118 end 119 put b i uint v 120 end 121 op = add get b 0 mul get b 1 2 122 if eq op 0 123 ret 48 124 end 125 arg = add get b 2 mul get b 3 2 126 note All checks precede output writes: refusal preserves the caller's proposal. 127 for i ulong 16 128 put p i 0 129 end 130 put p 0 op 131 put p 1 arg 132 if eq op 1 133 put p 2 1 134 end 135 if eq op 2 136 put p 2 2 137 end 138 put p 3 1 139 put p 4 1 140 put p 5 1 141 put p 6 4 142 put p 7 1 143 put p 8 0 144 put p 9 1 145 ret 0 146 end 147 fn nlmatch p view uint 16 e view uint 16 to bool 148 note Independent receiver expectation, never sourced from the numerical message. 149 for i ulong 16 150 if ne get p i get e i 151 ret false 152 end 153 end 154 ret true 155 end