WebAssembly / WebAssembly/binaryen

wasm-reduce: don't require test file and working file

Open
#2,651 9 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:

  • -t provides the test file, which is what the predicate script is supposed to test
  • -w provides the working file, which is where the final reduced result (and current-smallest during reduction) is placed

Users must provide both or wasm-reduce will not run.

I think there would be better user ergonomics if the predicate script was either

  • passed the file to test as an argument, or
  • the predicate script was always invoked with a temp dir as the current dir and that temp dir has the file to test inside it so that if the predicate script uses the test file via a relative path it always works (this is what creduce does)

Given one of those choices, then the user would only need to supply the input file and the predicate script. They would not also need to supply the test file and working file.

Additionally, both of those approaches would allow for multiple executions of the predicate script in parallel, opening up opportunities for speeding up the reduction process.

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

Start by reading the wasm-reduce command behavior around the -t and -w options, then compare the proposed predicate-script invocation approaches with the current workflow. Define the intended input and output arguments and verify that reduction can run with only the input file and predicate script, including parallel predicate executions.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
cli, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.