Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle chaining sketch #5853

Draft
wants to merge 230 commits into
base: main
Choose a base branch
from
Draft

Oracle chaining sketch #5853

wants to merge 230 commits into from

Conversation

kripken
Copy link
Member

@kripken kripken commented Aug 2, 2023

Once open I'll add a comment with a link to the relevant part.

@kripken
Copy link
Member Author

kripken commented Aug 2, 2023

@tlively The key part of the code is here:

https://github.com/WebAssembly/binaryen/pull/5853/files#diff-4d9d6d08d863caa22d1fa86a99f2b7d37d1013d36c98e177aca6edd6eaff54e1R2070-R2074

    // Start with an empty base oracle, infer TNH once in the middle, and a
    // second time.
    auto base = std::make_shared<Oracle>(wasm, options);
    auto mid = std::make_shared<TNHOracle>(wasm, options, base);
    tnhOracle = std::make_unique<TNHOracle>(wasm, options, mid);

The TNH oracle gets a "previous oracle" that it uses as a base to improve upon. Adding
more oracles in the chain is just a matter of adding one line. We could interleave TNH
and other oracles in this way, in particular.

Atm though some simple experiments don't show a big benefit to this. One issue is
that we look at RefCast types in the TNH oracle, and those are just updated in the
GUFA pass itself, after the oracles are all done. So one needs to run all of GUFA more
than once, and just running it that way seems good enough for now.

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.

None yet

1 participant