Disallow "L" subtyping - #111
Merged
Merged
Conversation
Update the overview, interpreter, and tests to reflect the decision that the "L" subtyping pattern, in which a subtype has a descriptor but its supertype does not, should be disallowed. The spectec is not updated because it does not yet include the relevant subtyping rules. Closes #109.
Member
Author
|
cc @fitzgen |
Member
Author
|
I will land this after the corresponding V8 change is landed to avoid breaking V8's running of the latest spec tests in the meantime. The corresponding Binaryen change has already landed. |
marianoguerra
added a commit
to marianoguerra/wax-mb
that referenced
this pull request
Sep 3, 2026
…xt form Two behaviour changes from ocsigen/wax, both inside feature-gated proposals, and one harness fix that fell out of moving the pin. custom-descriptors adopted the "complete square" rule (WebAssembly/custom-descriptors#111): descriptor presence must MATCH along the declared subtype chain, where a subtype could previously add a descriptor its supertype lacked. The check in check_type_definitions becomes symmetric with the `describes` one beside it, which is what upstream did in both its validator and its typer -- only the typer exists here. compact-import-section's shared-type text form turns out to be strictly name-only, so the `(item $id "name")` extension is gone: a group whose items bind identifiers is printed per-item, each spelling the shared type out. Nothing is lost in the binary, because the encoder already picks the shared-type (0x7E) encoding on descriptor equality whatever the text form was -- Lowering::compact_group needed no change, only the printer did. The name-only branch stays for a group whose items carry no name-section id. The harness fix: collect_docs read docs/src/*.md plus skills/wax/reference.md, which the reference's doc build assembles FROM those pages -- so the top-level pages were collected twice and docs/src/correspondence/ was reachable only through the skill. Upstream split reference.md into per-topic files and the single-file lookup silently stopped matching, which would have dropped the correspondence blocks entirely. Reading docs/src recursively is what that lookup stood in for: the same 215 distinct modules, without the 172 duplicate files, and not breakable by a re-split. Corpus and goldens regenerated against the new pin. The diff is the review artifact: descriptors.wast renumbers around an inserted mismatched-finality module, its "subtype adds a descriptor" module becomes assert_invalid, compact-import-item-id's g2.wat is now a parse error upstream and g1.wat replaces it, and descriptor-types.t contributes sub-added-descriptor. Verified against the new reference binary: oracles 1 and 3 pass the whole corpus, the harness self-test passes, cram is 62/0/10, and the oracle 4 text burn-down goes 32 -> 26 -- the four compact-import files it fixes, plus two duplicate entries -- with no new drift. Oracle 2 native's 18 misses are byte-identical to the same run at 380aeb6, checked in a worktree. Co-Authored-By: Claude Opus 5 <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.
Update the overview, interpreter, and tests to reflect the decision that the "L" subtyping pattern, in which a subtype has a descriptor but its supertype does not, should be disallowed.
The spectec is not updated because it does not yet include the relevant subtyping rules.
Closes #109.