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/aien-train/blob/main/tests/distributed7/mutate.om # aien-train AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-train / tests / distributed7 / mutate.om` 158 lines ยท 2456 bytes Raw Blame History 1 note Exact-source native mutation builder for distributed7 qualification only. 2 note stdin: one ASCII mode0..4 followed by source. Refuse unmatched/stale source. 3 text m0 "if not d7_match rank\nret 7\nend\n" 4 text r0 "if not d7_tidok\nret 7\nend\n" 5 text m1 "if eq get d7_state 6 get d7_state 1\n" 6 text r1 "if le get d7_state 6 get d7_state 1\n" 7 text m2 "if ne seq get d7_state 2\nret 4\nend\n" 8 text r2 "if eq seq 0\nret 4\nend\n" 9 text m3 "if ne get ED p get d7_meta p\n" 10 text r3 "if ne get ED p get ED p\n" 11 text m4 "if ge now get d7_state 4\n" 12 text r4 "if gt now get d7_state 4\n" 13 global cmd uchar 1 14 global src uchar 65537 15 global out uchar 65536 16 global from uchar 80 17 global into uchar 80 18 global sizes ulong 3 19 20 fn select n uchar to bool 21 put sizes 2 1 22 if eq n 48 23 put sizes 0 len m0 24 put sizes 1 len r0 25 for i ulong len m0 26 put from i get m0 i 27 end 28 for i ulong len r0 29 put into i get r0 i 30 end 31 ret true 32 end 33 if eq n 49 34 put sizes 0 len m1 35 put sizes 1 len r1 36 for i ulong len m1 37 put from i get m1 i 38 end 39 for i ulong len r1 40 put into i get r1 i 41 end 42 ret true 43 end 44 if eq n 50 45 put sizes 0 len m2 46 put sizes 1 len r2 47 put sizes 2 4 48 for i ulong len m2 49 put from i get m2 i 50 end 51 for i ulong len r2 52 put into i get r2 i 53 end 54 ret true 55 end 56 if eq n 51 57 put sizes 0 len m3 58 put sizes 1 len r3 59 for i ulong len m3 60 put from i get m3 i 61 end 62 for i ulong len r3 63 put into i get r3 i 64 end 65 ret true 66 end 67 if eq n 52 68 put sizes 0 len m4 69 put sizes 1 len r4 70 for i ulong len m4 71 put from i get m4 i 72 end 73 for i ulong len r4 74 put into i get r4 i 75 end 76 ret true 77 end 78 ret false 79 end 80 81 fn match at ulong total ulong to bool 82 n = get sizes 0 83 if gt n sub total at 84 ret false 85 end 86 for i ulong n 87 if ne get src add at i get from i 88 ret false 89 end 90 end 91 ret true 92 end 93 94 fn patch total ulong to ulong 95 p = ulong 0 96 q = ulong 0 97 hits = ulong 0 98 while lt p total 99 if match p total 100 hits = add hits 1 101 for i ulong get sizes 1 102 put out q get into i 103 q = add q 1 104 end 105 p = add p get sizes 0 106 else 107 put out q get src p 108 q = add q 1 109 p = add p 1 110 end 111 end 112 if ne hits get sizes 2 113 ret 0 114 end 115 ret q 116 end 117 118 fn output n ulong to int 119 p = ulong 0 120 while lt p n 121 w = write 1 out p sub n p 122 if le w 0 123 ret 74 124 end 125 p = add p ulong w 126 end 127 ret 0 128 end 129 130 fn main to int 131 n = read 0 cmd 0 1 132 if ne n 1 133 ret 65 134 end 135 if not select get cmd 0 136 ret 65 137 end 138 total = ulong 0 139 more = true 140 while more 141 n = read 0 src total sub 65537 total 142 if lt n 0 143 ret 74 144 end 145 if eq n 0 146 more = false 147 end 148 total = add total ulong n 149 if gt total 65536 150 ret 65 151 end 152 end 153 nout = patch total 154 if eq nout 0 155 ret 65 156 end 157 ret output nout 158 end