Skip to content

Disallow "L" subtyping - #111

Merged
tlively merged 1 commit into
mainfrom
no-L-subtyping
Aug 25, 2026
Merged

Disallow "L" subtyping#111
tlively merged 1 commit into
mainfrom
no-L-subtyping

Conversation

@tlively

@tlively tlively commented Aug 17, 2026

Copy link
Copy Markdown
Member

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.

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.
@tlively
tlively requested a review from rossberg August 17, 2026 23:13
@tlively

tlively commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

cc @fitzgen

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@tlively

tlively commented Aug 24, 2026

Copy link
Copy Markdown
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.

@tlively
tlively merged commit 7b64bc8 into main Aug 25, 2026
1 check failed
@tlively
tlively deleted the no-L-subtyping branch August 25, 2026 20:24
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disallow described types subtyping non-described types?

2 participants