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

Simplify linear-memory host function tests #1241

Open
graydon opened this issue Nov 21, 2023 · 0 comments
Open

Simplify linear-memory host function tests #1241

graydon opened this issue Nov 21, 2023 · 0 comments
Assignees
Labels
cleanup non-observable improvements to the implementation

Comments

@graydon
Copy link
Contributor

graydon commented Nov 21, 2023

PR #1233 tests the linear memory host functions from synthetic wasm guest functions. There are a couple issues with these tests that would be nice to address:

  1. They can probably all just reuse a single definition of the test linear memory pattern -- computed once during wasm synthesis and stored into the wasm as a data section -- rather than imperatively rewriting the contents of linear memory when they run. This is partly a speed issue, partly an issue around "it'd be nice to exercise the data section code paths of wasmi", and partly a simplification issue: if you calculate the LM during synthesis it's a little easier to dump out for inspection.
  2. They probably don't need to be macro-generated? This I'm less certain about -- and it might still benefit from something macro-like such as the crossroads crate for factoring -- but I think the variation-between-tests ought not to be much larger than a couple lines each, and I think writing all those short tests in aggregate might not be much more code than this macro code, and would certainly be easier to understand, run individual tests of, etc.

This is a low-priority code-cleanup bug, not anything especially urgent.

@graydon graydon added bug Something isn't working cleanup non-observable improvements to the implementation and removed bug Something isn't working labels Nov 21, 2023
@jayz22 jayz22 self-assigned this Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup non-observable improvements to the implementation
Projects
None yet
Development

No branches or pull requests

3 participants
@graydon @jayz22 and others