WebAssembly / WebAssembly/binaryen

[Proposal] Optimization for AoS with SIMD

Open
#3,854 0 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

Not sure where this should be best done - at the compiler level, at the binaryen level, or at the VM runtime level.

As the GC proposal adds structures and arrays, we technically have the ability to turn AoS into SoA or AoSoA (with fixed SIMD proposal).
Like (pseudocode):

class Vec3 {
    f32 x;
    f32 y;
    f32 z;
};
const vels = Vec3[100];
f32 getVelX(i32 i) { 
  return vels[i].x;
}

into:

class Vec3 {
    f32 x[4];
    f32 y[4];
    f32 z[4];
};
const vels = Vec3[(100 + 3) / 4];
f32 getVelX(i32 i) { 
  return vels[i / 4].x[i & 3];
 }

And apply SIMD auto-vectorisation afterwards.

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

No file, test, or entry point is identified. Start by determining whether the transformation belongs in the compiler, Binaryen, or VM runtime, then define representative AoS inputs and a SIMD benchmark. Done means a chosen layer, a semantics-preserving AoS-to-SoA or AoSoA transformation, and demonstrated auto-vectorization.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.