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
omega-mv / evidence / SEED-0 / r6-structs / wolfram.txt
| 1 | # R6 struct numbers, checked in Wolfram (stateless kernel, 2026-10-22) |
| 2 | |
| 3 | pack is little-endian: byte i of the word is character i, as the lexer does |
| 4 | (`w = or w shl ulong b sh`, sh += 8). |
| 5 | |
| 6 | pack("fn") = 28262 matches omc.om kw (fn is 28262) |
| 7 | pack("end") = 6581861 matches omc.om kw |
| 8 | pack("new") = 7824750 matches |
| 9 | pack("get") = 7628135 matches |
| 10 | pack("put") = 7632240 matches |
| 11 | pack("struct") = 127970521019507 the new keyword, code 85 |
| 12 | |
| 13 | t6 recurrence. sum starts at a. For i = 0, 1, 2, 3: v[i] becomes a+i, then sum += v[i]. |
| 14 | sum_final = a + Sum[a + i, {i, 0, 3}] = 6 + 5*a |
| 15 | a = 3 -> 21. The gate expects exit 21. |
| 16 | |
| 17 | Stack bytes for `cells` cells of 8, rounded up to 16, the same form om4 uses for arrays: |
| 18 | align(n) = BitShiftLeft[BitShiftRight[BitShiftLeft[n, 3] + 15, 4], 4] |
| 19 | n = 1..8 -> 16, 16, 32, 32, 48, 48, 64, 64. Each is a multiple of 16 and within 15 of 8*n. |
| 20 | |
| 21 | Scale so a typed store of width 2^tlog lands on byte cell*8: |
| 22 | scaled_index = cell * 2^(3 - tlog) |
| 23 | uint (tlog 2) cell 3 -> index 6, byte offset 24 |
| 24 | long (tlog 3) cell 3 -> index 3, byte offset 24 |
| 25 | uchar (tlog 0) cell 5 -> index 40, byte offset 40 |
| 26 | |
| 27 | Overlap if the scale is forgotten (index = cell, store uses the type's own width): |
| 28 | t7 struct M a uint, b uchar. put b 9 writes byte 1 of a. a was 1, becomes 1 + 9*256 = 2305. |
| 29 | Correct layout: b is at byte 8. get a stays 1. Gate expects 1. |
| 30 | t8 struct N a uchar, b uint, c uchar, d uchar, e uchar. put e 9 writes byte 4, which is b's |
| 31 | low byte. b was 1, becomes 9. Correct: e is at byte 32. get b stays 1. Gate expects 1. |
| 32 | t9 struct H v uint 2, t uchar. put t 9 writes byte 2 of v[0]. v[0] was 1, becomes |
| 33 | 1 + 9*65536 = 589825. Correct: t is at byte 16. get v 0 stays 1. Gate expects 1. |
| 34 | |
| 35 | Twin exits used by the gate, same formulas as the C-path twins, without free: |
| 36 | t1 20+22 = 42 |
| 37 | t2 3+3 = 6 |
| 38 | t3 5*(4-1) = 15 |
| 39 | t4 10+7 = 17 |
| 40 | t5 4+2*3 = 10 |
| 41 | t6 21 |