test+fix(codegen): broaden to generated .twasm corpus; authoritative parse errors#168
Merged
Merged
Conversation
…tative parse errors Broaden: generated_twasm_source_round_trips builds 256 random valid .twasm SOURCE modules (random regions/scalar fields/arrays/align + named-param fns) and asserts each parses, emits valid wasm, and round-trips the verifier — exercising arbitrary schemas, not just the six hand-written examples. Reinforce: tw build no longer silently falls back to hardcoded-schema string-matching on a parse failure (which masked real errors behind a confusing double message). A parse error is now authoritative: clean diagnostic + non-zero exit. The Rust parser covers the example/paint-type schemas and general .twasm, so the fallback is removed. 33/33 codegen tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-on to #167 ("broaden & reinforce at this level").
Broaden —
generated_twasm_source_round_trips: 256 random valid.twasmsource modules (random regions / scalar fields / arrays /align+ named-param fns), each parses, emits valid wasm, and round-trips the verifier. Arbitrary schemas, not just the six examples.Reinforce —
tw buildno longer silently falls back to hardcoded string-matching on parse failure; a parse error is authoritative (clean diagnostic + non-zero exit). The Rust parser covers example/paint-type + general.twasm, so the fallback is removed.33/33 codegen tests pass. Still v0; next is real
region.get/setbody lowering.🤖 Generated with Claude Code