Repository navigation
Commit 450fe91
committed
ogar-blockly: everything is a call — (function : value), shape-carved
Operator-ruled rework of the function body from a flat opcode
stream to the V3 indexed reading: every 12-byte lane is 6x(u8:u8)
rails indexed against a label codebook, and the unit is a Call --
function index : value byte(s).
There is no opcode/function distinction any more. ADD is function
0x40, a user block is another index in the same <256 codebook, and
invoking either is the same bytes. PaletteOp is renamed FnIndex;
the Inventory SoA is the label codebook those indices resolve
against, which is why labels stay out of payloads (slot purity)
while one byte still names anything in scope.
Three earlier defects/claims retire in place:
- The "nesting gap" is withdrawn. It was an artifact of treating
the body as self-delimiting bytecode. Nesting is by reference --
a function index names another function's node -- exactly as SB3
nests via block ids. No END marker, no jump offset, no need.
- The operand gap (codex P1 on #235) closes. The value byte is the
immediate (WAIT:10, REPEAT:4); computed arguments use a stack
discipline ((NUMBER:5)(NUMBER:3)(ADD:_)); wide literals spend the
value byte as a constant-pool index (pool is a named follow-up).
- Arity is a classid property, not an encoding trick. LaneShape
(mirroring CascadeShape G6D2/G4D3/G3D4) carves the same 360 bytes
as 180 pairs / 120 triples / 90 quads. A function needing more
immediates picks a wider carving, never a wider field.
Narrowing is loud: BodyError::ValueBeyondShape refuses a call the
shape would truncate instead of dropping a byte. Length recovery is
call-level, per shape -- the byte-level rposition regression is
caught by test in every shape. Both guards were verified by
breaking them: the truncation guard fails the suite with "two
immediates must not fit Pairs", the len regression with "Quads:
trailing bare call lost".
The retired edge-block design (12 in-family + 4 out-of-family) is
stripped from this crate's docs; slot 1 is documented reserved-
zeroed with the retirement named, so the deprecated shape cannot be
re-learned from here. Relations ride the payload rails as indexed
calls.
Also recorded in the ledger: the operator's literal-over-grammar
ruling (grammar lines like A = B + C are a projection over the pair
stream, never the storage format) and the baby-steps roadmap --
ABI-shaped Blockly/Scratch first, later a PowerAutomate-shaped
low-code editor, both Mario-editor ergonomics over
ClassView : WideFieldMask projections.
Ledger: docs/DISCOVERY-MAP.md D-BLOCKS-PALETTE (correction 2).
Gates: 16 tests pass (2 falsifier break-runs verified), fmt clean,
clippy -D warnings clean, workspace check + tests clean.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DN5odWu4eisdevH9bPWyz1 parent 49deab6 commit 450fe91
3 files changed
Lines changed: 956 additions & 496 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
33 | 50 | | |
34 | 51 | | |
35 | | - | |
| 52 | + | |
36 | 53 | | |
37 | 54 | | |
38 | 55 | | |
39 | | - | |
| 56 | + | |
40 | 57 | | |
41 | 58 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
47 | 68 | | |
48 | 69 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
57 | 81 | | |
58 | 82 | | |
0 commit comments