benchmarks-mv
Measurement harnesses and evidence bundles for AIEN on the NVIDIA DGX Spark GB10. Speed is reported against the machine's physical limit and my own previous run. Attachment of AienOS.
Brought by drakestapleton
benchmarks-mv / native / neuralese / nl7-wire.om
| 1 | om2 |
| 2 | note NL7 independent learned receiver replay, frozen prereg 989fb7a2. |
| 3 | note Reads parameter snapshots and actual byte carriers; truth ID never enters receiver. |
| 4 | note Run together with nl7-score: this checker qualifies learned wire causality, not learning. |
| 5 | const CHUNK ulong 16384 |
| 6 | global Buf uchar CHUNK |
| 7 | global Io ulong 2 |
| 8 | global Row ulong 64 |
| 9 | global Meta ulong 5 |
| 10 | global Last ulong 9 |
| 11 | global Params f64 558 |
| 12 | global Pmask ulong 18 |
| 13 | global Used ulong 18 |
| 14 | global Seen ulong 4096 |
| 15 | global Wire uchar 24 |
| 16 | global Coord f64 3 |
| 17 | global Counts ulong 4 |
| 18 | text BAD "NL7WIRE INVALID\n" |
| 19 | text PASS "NL7WIRE PASS frames=" |
| 20 | text FAIL "NL7WIRE FAIL frames=" |
| 21 | text REF " refused=" |
| 22 | text LF "\n" |
| 23 | fn putout a view uchar * n ulong to void |
| 24 | p = ulong 0 |
| 25 | while lt p n |
| 26 | k = write 1 a p sub n p |
| 27 | if le k 0 |
| 28 | exit 93 |
| 29 | end |
| 30 | p = add p ulong k |
| 31 | end |
| 32 | end |
| 33 | fn invalid to void |
| 34 | putout BAD len BAD |
| 35 | exit 90 |
| 36 | end |
| 37 | fn number n ulong to void |
| 38 | b = new uchar 20 0 |
| 39 | p = ulong 20 |
| 40 | while true bound 20 |
| 41 | p = sub p 1 |
| 42 | put b p uchar add rem n 10 48 |
| 43 | n = div n 10 |
| 44 | if eq n 0 |
| 45 | break |
| 46 | end |
| 47 | end |
| 48 | putout part b p sub ulong 20 p sub ulong 20 p |
| 49 | end |
| 50 | fn next to long |
| 51 | if eq get Io 0 get Io 1 |
| 52 | k = read 0 Buf 0 CHUNK |
| 53 | if lt k 0 |
| 54 | invalid |
| 55 | end |
| 56 | if eq k 0 |
| 57 | ret -1 |
| 58 | end |
| 59 | put Io 0 0 |
| 60 | put Io 1 ulong k |
| 61 | end |
| 62 | p = get Io 0 |
| 63 | put Io 0 add p 1 |
| 64 | ret long get Buf p |
| 65 | end |
| 66 | fn value to ulong |
| 67 | v = ulong 0 |
| 68 | n = ulong 0 |
| 69 | first = long -1 |
| 70 | while true bound 21 |
| 71 | c = next |
| 72 | if or eq c 44 eq c 10 |
| 73 | if eq n 0 |
| 74 | invalid |
| 75 | end |
| 76 | if and gt n 1 eq first 48 |
| 77 | invalid |
| 78 | end |
| 79 | put Meta 0 ulong c |
| 80 | ret v |
| 81 | end |
| 82 | if or lt c 48 gt c 57 |
| 83 | invalid |
| 84 | end |
| 85 | if eq n 0 |
| 86 | first = c |
| 87 | end |
| 88 | if or gt v 1844674407370955161 and eq v 1844674407370955161 gt c 53 |
| 89 | invalid |
| 90 | end |
| 91 | v = add mul v 10 ulong sub c 48 |
| 92 | n = add n 1 |
| 93 | end |
| 94 | ret 0 |
| 95 | end |
| 96 | fn fields to void |
| 97 | if ne next 44 |
| 98 | invalid |
| 99 | end |
| 100 | for j ulong 64 |
| 101 | put Row j value |
| 102 | if eq get Meta 0 10 |
| 103 | put Meta 1 add j 1 |
| 104 | ret |
| 105 | end |
| 106 | end |
| 107 | invalid |
| 108 | end |
| 109 | fn seedindex seed ulong to ulong |
| 110 | if eq seed 101 |
| 111 | ret 0 |
| 112 | end |
| 113 | if eq seed 211 |
| 114 | ret 1 |
| 115 | end |
| 116 | if eq seed 307 |
| 117 | ret 2 |
| 118 | end |
| 119 | invalid |
| 120 | ret 0 |
| 121 | end |
| 122 | fn bank to ulong |
| 123 | si = seedindex get Row 0 |
| 124 | if or gt get Row 1 2 or lt get Row 2 2 gt get Row 2 3 |
| 125 | invalid |
| 126 | end |
| 127 | ret add mul add mul si 3 get Row 1 2 sub get Row 2 2 |
| 128 | end |
| 129 | fn finite v f64 to bool |
| 130 | ret eq sub v v 0.0f64 |
| 131 | end |
| 132 | fn parameter to void |
| 133 | if or ne get Meta 1 5 ne get Meta 2 0 |
| 134 | invalid |
| 135 | end |
| 136 | ix = bank |
| 137 | p = get Row 3 |
| 138 | if or gt p 30 ne get Used ix 0 |
| 139 | invalid |
| 140 | end |
| 141 | bit = shl ulong 1 p |
| 142 | if ne and get Pmask ix bit 0 |
| 143 | invalid |
| 144 | end |
| 145 | v = bitcast f64 get Row 4 |
| 146 | if not finite v |
| 147 | invalid |
| 148 | end |
| 149 | put Params add mul ix 31 p v |
| 150 | put Pmask ix or get Pmask ix bit |
| 151 | end |
| 152 | fn budindex budget ulong to ulong |
| 153 | if eq budget 8 |
| 154 | ret 0 |
| 155 | end |
| 156 | if eq budget 24 |
| 157 | ret 1 |
| 158 | end |
| 159 | if eq budget 96 |
| 160 | ret 2 |
| 161 | end |
| 162 | if eq budget 192 |
| 163 | ret 3 |
| 164 | end |
| 165 | invalid |
| 166 | ret 0 |
| 167 | end |
| 168 | fn width budget ulong to ulong |
| 169 | if eq budget 8 |
| 170 | ret 2 |
| 171 | end |
| 172 | if eq budget 24 |
| 173 | ret 8 |
| 174 | end |
| 175 | if eq budget 96 |
| 176 | ret 32 |
| 177 | end |
| 178 | ret 64 |
| 179 | end |
| 180 | fn prediction to void |
| 181 | if or ne get Meta 1 9 ne get Meta 2 0 |
| 182 | invalid |
| 183 | end |
| 184 | if gt get Row 2 4 |
| 185 | invalid |
| 186 | end |
| 187 | if and ne get Row 2 2 ne get Row 2 3 |
| 188 | ret |
| 189 | end |
| 190 | ix = bank |
| 191 | bi = budindex get Row 4 |
| 192 | if or gt get Row 3 15 gt get Row 5 18 |
| 193 | invalid |
| 194 | end |
| 195 | if ne get Pmask ix 2147483647 |
| 196 | invalid |
| 197 | end |
| 198 | payload = mul width get Row 4 3 |
| 199 | if or ne get Row 8 payload gt get Row 7 1 |
| 200 | invalid |
| 201 | end |
| 202 | if eq get Row 7 0 |
| 203 | if gt get Row 6 15 |
| 204 | invalid |
| 205 | end |
| 206 | else |
| 207 | if ne get Row 6 99 |
| 208 | invalid |
| 209 | end |
| 210 | end |
| 211 | slot = add mul add mul ix 4 bi 19 get Row 5 |
| 212 | bit = shl ulong 1 get Row 3 |
| 213 | if ne and get Seen slot bit 0 |
| 214 | invalid |
| 215 | end |
| 216 | put Seen slot or get Seen slot bit |
| 217 | put Used ix 1 |
| 218 | for j ulong 9 |
| 219 | put Last j get Row j |
| 220 | end |
| 221 | put Meta 2 1 |
| 222 | put Meta 3 ix |
| 223 | end |
| 224 | fn violate to void |
| 225 | put Counts 0 add get Counts 0 1 |
| 226 | end |
| 227 | fn wirebit pos ulong to ulong |
| 228 | byteval = ulong get Wire div pos 8 |
| 229 | shift = rem pos 8 |
| 230 | ret and shr byteval shift 1 |
| 231 | end |
| 232 | fn getbits axis ulong bits ulong to ulong |
| 233 | v = ulong 0 |
| 234 | start = mul axis bits |
| 235 | for b ulong bits |
| 236 | pos = add start b |
| 237 | bit = wirebit pos |
| 238 | v = or v shl bit b |
| 239 | end |
| 240 | ret v |
| 241 | end |
| 242 | fn coordinate axis ulong bits ulong to f64 |
| 243 | u = getbits axis bits |
| 244 | if le bits 8 |
| 245 | levels = sub shl ulong 1 bits 1 |
| 246 | ret sub mul div f64 u f64 levels 8.0f64 4.0f64 |
| 247 | end |
| 248 | if eq bits 32 |
| 249 | ret f64 bitcast f32 uint u |
| 250 | end |
| 251 | ret bitcast f64 u |
| 252 | end |
| 253 | fn perturb mode ulong to void |
| 254 | if eq mode 0 |
| 255 | ret |
| 256 | end |
| 257 | m = sub mode 1 |
| 258 | axis = div rem m 6 2 |
| 259 | v = div 1.0f64 12.0f64 |
| 260 | if ge m 6 |
| 261 | v = div 1.0f64 6.0f64 |
| 262 | end |
| 263 | if ge m 12 |
| 264 | v = div 1.0f64 4.0f64 |
| 265 | end |
| 266 | if eq rem m 2 1 |
| 267 | v = neg v |
| 268 | end |
| 269 | put Coord axis add get Coord axis v |
| 270 | end |
| 271 | fn unpack to bool |
| 272 | budget = get Last 4 |
| 273 | if eq budget 8 |
| 274 | if ne and get Wire 0 uchar 192 uchar 0 |
| 275 | ret false |
| 276 | end |
| 277 | end |
| 278 | for k ulong 3 |
| 279 | v = coordinate k width budget |
| 280 | if not finite v |
| 281 | ret false |
| 282 | end |
| 283 | put Coord k v |
| 284 | end |
| 285 | perturb get Last 5 |
| 286 | for k ulong 3 |
| 287 | if not finite get Coord k |
| 288 | ret false |
| 289 | end |
| 290 | end |
| 291 | ret true |
| 292 | end |
| 293 | fn receive to ulong |
| 294 | base = mul get Meta 3 31 |
| 295 | pred = ulong 0 |
| 296 | for j ulong 4 |
| 297 | v = get Params add base add 27 j |
| 298 | for k ulong 3 |
| 299 | weight = get Params add base add 15 add mul k 4 j |
| 300 | v = add v mul get Coord k weight |
| 301 | end |
| 302 | score = mul 0.5f64 add 1.0f64 div v add 1.0f64 fabs v |
| 303 | if not and ge score 0.0f64 le score 1.0f64 |
| 304 | ret 99 |
| 305 | end |
| 306 | if lt fabs sub score 0.5f64 0.1f64 |
| 307 | ret 99 |
| 308 | end |
| 309 | if ge score 0.5f64 |
| 310 | pred = or pred shl ulong 1 j |
| 311 | end |
| 312 | end |
| 313 | ret pred |
| 314 | end |
| 315 | fn checkwire to void |
| 316 | n = div get Last 4 8 |
| 317 | if ne get Meta 1 add n 10 |
| 318 | invalid |
| 319 | end |
| 320 | for j ulong 6 |
| 321 | if ne get Row j get Last j |
| 322 | invalid |
| 323 | end |
| 324 | end |
| 325 | if gt get Row 6 2 |
| 326 | invalid |
| 327 | end |
| 328 | for j ulong n |
| 329 | v = get Row add j 7 |
| 330 | if gt v 255 |
| 331 | invalid |
| 332 | end |
| 333 | put Wire j uchar v |
| 334 | end |
| 335 | put Counts 1 add get Counts 1 1 |
| 336 | if ne get Row 6 0 |
| 337 | if or ne get Last 6 99 ne get Last 7 1 |
| 338 | violate |
| 339 | end |
| 340 | put Counts 2 add get Counts 2 1 |
| 341 | ret |
| 342 | end |
| 343 | if not unpack |
| 344 | violate |
| 345 | ret |
| 346 | end |
| 347 | for k ulong 3 |
| 348 | if ne bitcast ulong get Coord k get Row add add n 7 k |
| 349 | violate |
| 350 | end |
| 351 | end |
| 352 | pred = receive |
| 353 | if ne pred get Last 6 |
| 354 | violate |
| 355 | end |
| 356 | status = ulong 0 |
| 357 | if eq pred 99 |
| 358 | status = 1 |
| 359 | put Counts 2 add get Counts 2 1 |
| 360 | end |
| 361 | if ne status get Last 7 |
| 362 | violate |
| 363 | end |
| 364 | end |
| 365 | fn diagnostic to void |
| 366 | if eq get Meta 1 5 |
| 367 | if ne get Meta 2 0 |
| 368 | invalid |
| 369 | end |
| 370 | ix = bank |
| 371 | if ne get Pmask ix 2147483647 |
| 372 | invalid |
| 373 | end |
| 374 | ret |
| 375 | end |
| 376 | if ne get Meta 2 1 |
| 377 | invalid |
| 378 | end |
| 379 | checkwire |
| 380 | put Meta 2 0 |
| 381 | end |
| 382 | fn load to void |
| 383 | while true |
| 384 | c = next |
| 385 | if eq c -1 |
| 386 | break |
| 387 | end |
| 388 | if not or eq c 78 or eq c 80 eq c 68 |
| 389 | invalid |
| 390 | end |
| 391 | fields |
| 392 | if eq c 78 |
| 393 | prediction |
| 394 | end |
| 395 | if eq c 80 |
| 396 | parameter |
| 397 | end |
| 398 | if eq c 68 |
| 399 | diagnostic |
| 400 | end |
| 401 | end |
| 402 | end |
| 403 | fn complete to void |
| 404 | if ne get Meta 2 0 |
| 405 | invalid |
| 406 | end |
| 407 | for ix ulong 18 |
| 408 | if ne get Pmask ix 2147483647 |
| 409 | invalid |
| 410 | end |
| 411 | end |
| 412 | for base ulong 72 |
| 413 | for mode ulong 19 |
| 414 | if ne get Seen add mul base 19 mode 65535 |
| 415 | invalid |
| 416 | end |
| 417 | end |
| 418 | end |
| 419 | end |
| 420 | fn main to int |
| 421 | if ne argcnt 1 |
| 422 | invalid |
| 423 | end |
| 424 | load |
| 425 | complete |
| 426 | if eq get Counts 0 0 |
| 427 | putout PASS len PASS |
| 428 | else |
| 429 | putout FAIL len FAIL |
| 430 | end |
| 431 | number get Counts 1 |
| 432 | putout REF len REF |
| 433 | number get Counts 2 |
| 434 | putout LF 1 |
| 435 | if ne get Counts 0 0 |
| 436 | ret 1 |
| 437 | end |
| 438 | ret 0 |
| 439 | end |