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

Support ref.extern n in spec tests #6858

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Support ref.extern n in spec tests #6858

merged 3 commits into from
Aug 21, 2024

Conversation

tlively
Copy link
Member

@tlively tlively commented Aug 21, 2024

Spec tests pass the value ref.extern n, where n is some integer,
into exported functions that expect to receive externrefs and receive
such values back out as return values. The payload serves to distinguish
externrefs so the test can assert that the correct one was returned.

Parse these values in wast scripts and represent them as externalized
i31refs carrying the payload. We will need a different representation
eventually, since some tests explicitly expect these externrefs to not
be i31refs, but this suffices to get several new tests passing.

To get the memory64 version of table_grow.wast passing, additionally fix
the interpreter to handle growing 64-bit tables correctly.

Delete the local versions of the upstream tests that can now be run
successfully.

@tlively tlively requested a review from kripken August 21, 2024 02:26
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

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

lgtm % comment

return fail;
}
if (uint64_t(tableSize) + uint64_t(delta) > uint64_t(table->max)) {
if (tableSize + delta > table->max) {
Copy link
Member

@kripken kripken Aug 21, 2024

Choose a reason for hiding this comment

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

These two can use std::ckd_add

Base automatically changed from triage-spec-test-issues to main August 21, 2024 16:07
Spec tests pass the value `ref.extern n`, where `n` is some integer,
into exported functions that expect to receive externrefs and receive
such values back out as return values. The payload serves to distinguish
externrefs so the test can assert that the correct one was returned.

Parse these values in wast scripts and represent them as externalized
i31refs carrying the payload. We will need a different representation
eventually, since some tests explicitly expect these externrefs to not
be i31refs, but this suffices to get several new tests passing.

To get the memory64 version of table_grow.wast passing, additionally fix
the interpreter to handle growing 64-bit tables correctly.

Delete the local versions of the upstream tests that can now be run
successfully.
@tlively tlively merged commit 7889abf into main Aug 21, 2024
13 checks passed
@tlively tlively deleted the wast-ref-extern branch August 21, 2024 17:39
@gkdn gkdn mentioned this pull request Aug 31, 2024
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.

2 participants