-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
The validator lacks GC structural subtyping, causing:
- 21 assert_invalid failures for "sub type" validation
- 8 assert_invalid failures for "unknown type" in GC instructions
- ~20 module validation failures (false positives) in
type-subtyping.wast,type-equivalence.wast,type-rec.wast
What's needed
-
Sub type validation: When a type uses
(sub $parent ...), validate that:- The parent type index exists
- The child type is structurally compatible with the parent
- Function subtypes have contravariant params and covariant results
-
Recursive type groups:
(rec ...)groups define mutually recursive types. Type indices within a rec group can reference each other. -
Type equivalence for GC: Two types are equivalent if they have the same structure (iso-recursive interpretation). The validator must use structural comparison for type-indexed operations like
call_indirect.
Impact
- ~49 directly failing assertions
- Additional cascading failures from false module validation rejections
Files
kiln-build-core/src/wast_validator.rs— needs newvalidate_subtypes()functionkiln-format/src/module.rs— may need sub/rec type information in Module structkiln-decoder/src/streaming_decoder.rs— may need to decode sub/rec type declarations
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request