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
aien-train / evidence / ECOSYSTEM6 / ref32-review / mul-red.om
| 1 | note Missing multiply behavior, baseline must fail runtime assertions. |
| 2 | fn mul32 a ulong b ulong to ulong |
| 3 | ret 0 |
| 4 | end |
| 5 | note SPDX-License-Identifier: AGPL-3.0-only |
| 6 | global failed ulong 1 |
| 7 | global tested ulong 1 |
| 8 | global line uchar 48 |
| 9 | fn report ok bool to void |
| 10 | id = add get tested 0 1 |
| 11 | put tested 0 id |
| 12 | put line 0 48 |
| 13 | put line 1 uchar add 48 rem div id 100 10 |
| 14 | put line 2 uchar add 48 rem div id 10 10 |
| 15 | put line 3 uchar add 48 rem id 10 |
| 16 | put line 4 32 |
| 17 | put line 5 48 |
| 18 | if not ok |
| 19 | put line 5 49 |
| 20 | put failed 0 add get failed 0 1 |
| 21 | end |
| 22 | put line 6 10 |
| 23 | w = write 1 line 0 7 |
| 24 | if ne w 7 |
| 25 | exit 74 |
| 26 | end |
| 27 | end |
| 28 | note Binary32 multiply RNE. Expected bits independently checked with IEEE host oracle. |
| 29 | note All NaNs canonicalized to positive quiet NaN; gradual underflow; signed zero. |
| 30 | fn main to int |
| 31 | report eq mul32 1065353216 1073741824 1073741824 |
| 32 | report eq mul32 3212836864 1073741824 3221225472 |
| 33 | report eq mul32 0 3212836864 2147483648 |
| 34 | report eq mul32 2147483648 3212836864 0 |
| 35 | report eq mul32 2139095040 0 2143289344 |
| 36 | report eq mul32 2139095040 3212836864 4286578688 |
| 37 | report eq mul32 2143289345 1065353216 2143289344 |
| 38 | report eq mul32 1 1065353216 1 |
| 39 | report eq mul32 8388608 1056964608 4194304 |
| 40 | report eq mul32 8388607 1073741824 16777214 |
| 41 | report eq mul32 2139095039 1073741824 2139095040 |
| 42 | report eq mul32 1069547520 1069547520 1074790400 |
| 43 | report eq mul32 1065353217 1065353217 1065353218 |
| 44 | report eq mul32 1 1056964608 0 |
| 45 | report eq mul32 3 1056964608 2 |
| 46 | if ne get failed 0 0 |
| 47 | ret 1 |
| 48 | end |
| 49 | ret 0 |
| 50 | end |