Commit ba3c7d9
## What
Lands the front-end → IR **parser seam** that #127/#130 named as the
gate to *"for every valid `.twasm` source"*. The IR-level corpus (#147)
and codegen (#146) already worked; what was missing was parsing real
`.twasm` source into the IR. This adds a hand-written Rust `.twasm`
parser (`crates/typed-wasm-codegen/src/parser.rs`) covering the **L1–L5
subset paint-type's bridge exercises** (region schemas + typed
load/store) — a stopgap until the **AffineScript** front-end (ADR-0004)
lands. (ReScript is banned estate-wide and is not a candidate; ADR-0004
to be ratified with AffineScript as the host.)
- `tw build` now does **source → parse → IR → verifier-accepted wasm**
(previously string-matched example-01 only).
- `lib.rs` gains `paint_type_{tile,layer}` IR builders + `self_verify`.
- paint-type schemas are **vendored** under
`tests/fixtures/paint-type/paint-type-{tile,layer}.twasm` (mirroring
`JoshuaJewell/paint-type:src/bridges/`) so
`corpus::parsed_paint_type_schemas_round_trip` runs **self-contained in
CI** — no sibling checkout required.
## Verification
- `cargo test --workspace --locked` green (codegen + verify, 100+ tests
incl. the new round-trip).
- Round-trip asserts emitted wasm validates + passes **L7/L10 ownership
+ L2 access-site** verification.
- `tw build` + `tw-verify` on both fixtures → **VERIFIED**.
- Clean build, no warnings.
## Scope / non-goals
**Unblocks the paint-type slice of #127/#130** (parse + verify for the
bridge surface). The full goal stays open on those issues: the
**AffineScript** front-end, examples 04/05/06, L11–L13, source-level
ECHIDNA corpus. Do **not** close #127/#130 on this PR.
> Note: `main`'s `e2e` workflow is currently red for unrelated reasons
(estate Actions billing-wall / startup_failure pattern); this change is
independently green locally.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent f9f52c5 commit ba3c7d9
12 files changed
Lines changed: 1740 additions & 213 deletions
File tree
- .github/workflows
- crates/typed-wasm-codegen
- src
- bin
- tests
- fixtures/paint-type
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
71 | 69 | | |
72 | | - | |
| 70 | + | |
73 | 71 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 72 | + | |
78 | 73 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
83 | 77 | | |
84 | 78 | | |
85 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
143 | 169 | | |
144 | 170 | | |
145 | 171 | | |
| |||
0 commit comments