interplane.Get Omega
Read in your language

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

branch main Branches Tags History

aien-train / native / si19 / fixture.om

103 lines · 2728 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note FIXTURE for aien-train#19: a seeded, resettable transition micro-world.
3note It stands in for Omega X1 ExperienceTransition (omega-mv#699), which is not on
4note main. It is not World, J-Space or Cortex evidence. Transitions are executed by
5note these fixed dynamics; no model, teacher or corpus generates them.
6note Typed finite observation: position p -12..12, velocity v -3..3. Action u -1,0,1.
7note Dynamics: p2 = p + v; v2 = v + gain*u + gust. gust is -1 w.p. 1/8, +1 w.p. 1/8, else 0.
8note A transition is terminal when p2 leaves -12..12, v2 leaves -3..3, or step 7 ends.
9note A terminal transition records its true successor, never the reset state. The next
10note transition starts from a fresh reset, so no transition crosses an episode boundary.
11note FS slot s occupies FS[16s..16s+15]: 0 gain, 1 env rng, 2 p, 3 v, 4 step, 5 episode,
12note 6 reset p low, 7 reset p high, 8 behaviour-policy rng, 9 transitions emitted.
13note FT receives one transition: 0 p, 1 v, 2 u, 3 p2, 4 v2, 5 done, 6 episode*16+step.
14global FS long 64
15global FT long 8
16
17fn fxrand at ulong to long
18n = get FS at
19n = rem add mul n 1664525 1013904223 4294967296
20put FS at n
21ret shr n 8
22end
23
24fn fxreset s ulong to void
25b = mul s 16
26lo = get FS add b 6
27span = add sub get FS add b 7 lo 1
28put FS add b 2 add lo rem fxrand add b 1 span
29put FS add b 3 sub rem fxrand add b 1 5 2
30put FS add b 4 0
31end
32
33fn fxinit s ulong gain long seed long wide long to void
34note wide 0: reset p in -12..-4 (training region); wide 1: reset p in -12..12.
35b = mul s 16
36for i ulong 16
37put FS add b i 0
38end
39put FS b gain
40put FS add b 1 seed
41put FS add b 6 -12
42hi = long -4
43if eq wide 1
44hi = 12
45end
46put FS add b 7 hi
47put FS add b 8 add seed 7919
48fxreset s
49end
50
51fn fxact s ulong to long
52note Uniform random behaviour policy from its own seeded stream.
53ret sub rem fxrand add mul s 16 8 3 1
54end
55
56fn fxdone p2 long v2 long step long to long
57if or gt p2 12 lt p2 -12
58ret 1
59end
60if or gt v2 3 lt v2 -3
61ret 1
62end
63if ge add step 1 8
64ret 1
65end
66ret 0
67end
68
69fn fxvel b ulong v long u long to long
70note Successor velocity: v + gain*u + gust, drawn from the environment stream.
71r = rem fxrand add b 1 8
72v2 = add v mul get FS b u
73if eq r 0
74ret sub v2 1
75end
76if eq r 7
77ret add v2 1
78end
79ret v2
80end
81
82fn fxstep s ulong u long to void
83b = mul s 16
84v = get FS add b 3
85put FT 0 get FS add b 2
86put FT 1 v
87put FT 2 u
88put FT 3 add get FT 0 v
89put FT 4 fxvel b v u
90step = get FS add b 4
91done = fxdone get FT 3 get FT 4 step
92put FT 5 done
93put FT 6 add mul get FS add b 5 16 step
94put FS add b 9 add get FS add b 9 1
95if eq done 1
96put FS add b 5 add get FS add b 5 1
97fxreset s
98else
99put FS add b 2 get FT 3
100put FS add b 3 get FT 4
101put FS add b 4 add step 1
102end
103end