ChildTyper constraints drop sharedness, blocking validator migration
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- wasm
- Ambito
- compilers, testing-qa
Direzione di ricerca
Start with ChildTyper::visitI31Get and visitCallRef, then read VarSharedness, VarAbsHeapType, and the IRBuilder constraint path. Run python3 check.py and inspect the named shared-i31, make-shared-objects, unsubtyping, gufa-refs, signature-pruning, type-generalizing, and dae2* tests, plus parser tests. Done means sharedness is preserved without introducing parser or validator regressions.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem:
Two attempted migrations in #6613 were reverted because ChildTyper
constraints lose the sharedness dimension. Type::isSubType
distinguishes shared from unshared heap types, but two of
ChildTyper'svisitors emit constraints that do not carry that distinction, so a validator usingPrincipalType::matches` rejects
inputs the pre-migration code accepted.
Case 1: visitI31Get. ChildTyper::visitI31Get emits
Type(HeapType::i31, Nullable), fixed to unshared. The validator's
pre-existing check uses shouldBeSubTypeIgnoringShared, which
accepts (ref null (shared i31)) as a subtype. Migrating rejects
shared i31 modules. Failing tests: basic/shared-i31.wast,
passes/make-shared-objects.wast, passes/unsubtyping.wast.
Case 2: visitCallRef. ChildTyper::visitCallRef computes
ht = curr->target->type.getHeapType().getSignature() and notes
the target as Type(*ht, Nullable). For a shared function reference
(ref null (shared $sig)), getSignature() returns the unshared
$sig, so the note rejects the shared target. Failing tests: 25
lit tests including passes/gufa-refs.wast,
passes/signature-pruning.wast, passes/type-generalizing.wast, and
passes/dae2*.wast.
Impact:
These two methods cannot be migrated to ChildTyper until the
constraints carry sharedness. A third case may exist: any
ChildTyper visitor that uses Type(HeapType::X, ...) with a
concrete heap type is potentially affected, and only sharedness
testing exposes it.
Proposed fix (Path A): Introduce a sharedness-polymorphic
constraint. The machinery already exists — VarSharedness, and the
VarAbsHeapType variant used by ChildTyper::visitRefEq — but the
affected visitors use concrete Type rather than VarRef with a
sharedness variable. Change ChildTyper::visitI31Get to emit a
VarRef whose heap type is var-shared i31, and change
ChildTyper::visitCallRef to preserve the target's sharedness when
computing the signature heap type.
Path A affects the IRBuilder, not just the validator. The IR
builder consumes the same constraints when parsing; a constraint
that is more permissive on sharedness may change parse-time
behavior. Any change should be verified against
python3 check.py and against the parser tests specifically.
Alternatives considered:
Path B: Add a mode to PrincipalType::matches that ignores
sharedness, mirroring shouldBeSubTypeIgnoringShared. Rejected
because it would make the validator accept malformed modules the
spec rejects, and because the parser has the same constraint
semantics and would diverge.
Path C: Leave the two methods unmigrated. This is the current
state after #6613's partial PR. Acceptable as a stopgap; not a
long-term answer, since the same incompatibility will recur for
every new shared-type visitor.
Follow-up: After Path A lands, re-attempt the visitI31Get and
visitCallRef migrations in #6613.
Refs #6613.
- Lingua principale
- WebAssembly
- Stelle
- 8.6k
- Fork
- 885
- Merge medio
- 2g 1h
- PR unite (30g)
- 70
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WebAssembly/binaryen
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 76/100
WebAssembly/binaryen#9018 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
WebAssembly/binaryen#9123 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
WebAssembly/binaryen#9086 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
WebAssembly/binaryen#9038 · 5 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
WebAssembly/binaryen#9006 · 2 commenti ·
Tutte le issue di WebAssembly/binaryen
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
objectionary/jeo-maven-plugin#1774 ·
-
compiler/runtime
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
leanprover/lean4#15255 ·
-
bot-triaged module: correctness (silent) module: fx release triage triage review
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
Grammar Gap: activated › effect clause › {self} deals damage equal to its power to target creature Apertaarea:mechanics ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
fil-donadoni/tolaria#4317 ·