test(v4.0.0): execute M+, D-, D0= and D= on the golden model
All four run exactly as written in DECOMPOSITION.md 5.6/5.7 and need no change now that D+ and DNEGATE are call-free. Checked against C at 32- and 64-bit cells, optimised and ASan+UBSan: every edge-vector combination (M+ over all triples, D- and D= over all 50625 quadruples, D0= over all pairs) plus 20000 pseudo-random cases weighted to equal low or high cells and low sums that wrap to 0. Mutations of D0= and M+ are caught. Headroom (data cells under args / return entries under return address): M+ 6/4, D- 5/4, D0= 7/7, D= 5/3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
092036c97a
commit
6a371b850e
@@ -390,7 +390,7 @@ A double is two 32-bit cells on a mesh node.
|
||||
|
||||
| Word | Fate | v4 definition |
|
||||
| --- | --- | --- |
|
||||
| `M+` | CAP | `S>D D+` |
|
||||
| `M+` | CAP | `S>D D+` — executed on the golden model (2026-10-02). |
|
||||
| `M-` | CAP | `NEGATE M+` |
|
||||
| `M*` | CAP | `2DUP xor push ABS SWAP ABS UM* pop 0< IF DNEGATE THEN` |
|
||||
| `M/MOD` | CAP | `SM/REM` |
|
||||
@@ -406,11 +406,11 @@ A double is two 32-bit cells on a mesh node.
|
||||
| `S>D` | CAP | `dup 0<` — executed on the golden model (2026-10-02). |
|
||||
| `D+` | CAP | `push over push push drop pop over over xor -if L1 drop + -if C1 jump C0 L1: drop over -if L2 drop + jump C1 L2: drop + C0: pop pop + ; C1: pop pop + 1 + ;` — call-free. The carry out of the low cells is found by sign tests: if their top bits differ, there is a carry exactly when the sum's top bit is clear; if they match, exactly when both are set. Executed on the golden model (2026-10-02); leaves its caller 6 data cells under its arguments and 5 return entries. Replaces `push SWAP push over + 2DUP U> ROT drop NEGATE pop pop + +`, which was exact but left 1 return entry. |
|
||||
| `DNEGATE` | CAP | `inv over if L1 drop push inv 1 + pop ; L1: drop 1 + ;` — call-free: `~d + 1`, carrying into the high cell exactly when the low cell is 0. Executed on the golden model (2026-10-02). Replaces `inv SWAP inv SWAP 1 0 D+`, which left a caller no return-stack room, so `DABS` could not run at all. |
|
||||
| `D-` | CAP | `DNEGATE D+` |
|
||||
| `D-` | CAP | `DNEGATE D+` — executed on the golden model (2026-10-02). |
|
||||
| `DABS` | CAP | `dup 0< IF DNEGATE THEN` — executed on the golden model (2026-10-02). |
|
||||
| `D0=` | CAP | `OR 0=` |
|
||||
| `D0=` | CAP | `OR 0=` — executed on the golden model (2026-10-02). |
|
||||
| `D0<` | CAP | `NIP 0<` |
|
||||
| `D=` | CAP | `D- D0=` |
|
||||
| `D=` | CAP | `D- D0=` — executed on the golden model (2026-10-02). |
|
||||
| `D<` | CAP | `ROT 2DUP = IF 2DROP U< ELSE SWAP < NIP NIP THEN` |
|
||||
| `DMAX` | CAP | `2OVER 2OVER D< IF 2SWAP THEN 2DROP` |
|
||||
| `DMIN` | CAP | `2OVER 2OVER D< 0= IF 2SWAP THEN 2DROP` |
|
||||
|
||||
Reference in New Issue
Block a user