Currently the Wasm GC tests (structs.js and i31.js for example) are written with binary strings with comments indicating the Wasm text format module that they correspond to. A recent review comment (https://github.com/WebKit/WebKit/pull/2202#discussion_r916963742) suggested improving the situation with a script to ensure the binary format matches the text, to ensure maintainability. Another possible solution is to embed a text format encoder/decoder that supports the Wasm GC proposal. One way to do this is to compile the Wasm specification reference interpreter to JS, and embed that in the tests. I'll attach a patch that illustrates this approach for the current tests.
Pull request: https://github.com/WebKit/WebKit/pull/2643
Committed 252823@main (52534d6449a4): <https://commits.webkit.org/252823@main> Reviewed commits have been landed. Closing PR #2643 and removing active labels.
<rdar://problem/97608052>