WebAssembly / WebAssembly/binaryen

PossibleContents is not a lattice

Open
#7,581 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

IIUC, we have this structure:

             Type(i32)
            /         \
Global("g1", i32) Global("g2", i32)
           |     X     |
       Literal(1) Literal(2)

There is no unique least upper bound of the two literals and there is no unique greatest lower bound of the two globals. This is a problem because union and intersect are supposed to calculate unique least upper / greatest lower bounds.

I think there is a probably a way to solve this, but I'll have to think on it.

I ran into this while trying to simplify and complete the implementation of intersect as part of the investigation suggested here: https://github.com/WebAssembly/binaryen/pull/7538/files#r2054860951

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the PossibleContents lattice model and the intersect investigation referenced in WebAssembly/binaryen#7538. Compare the intended behavior of union and intersect for the shown literals and globals; done means the model has a decided resolution for their least upper and greatest lower bounds.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.