Precompute removes atomic.fence in shared-memory modules
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 53/100
調査の方向性
Start by tracing how --precompute handles atomic.fence and how EffectAnalyzer marks shared-memory reads and writes; the issue does not name implementation files or tests. Reproduce with the provided C example and wasm-opt --precompute --enable-threads, then compare the output with --vacuum alone. Done when precompute preserves the fence in the shared-memory case.
索引モデルが issue の本文から書いたものです。
説明
wasm-opt version 133 (version_133-96-ga631c1445), from emsdk.
--precompute (and so -O1 and above) replaces atomic.fence with nothing, even with --enable-threads and a shared memory. --vacuum alone keeps it. EffectAnalyzer marks the fence as reading/writing shared memory, so Precompute seems to skip that check.
Repro:
int x, y;
__attribute__((export_name("st"))) void st(int v) {
x = v; __atomic_thread_fence(__ATOMIC_SEQ_CST); y = 1;
}
clang --target=wasm32 -O2 -matomics -mbulk-memory -c f.c -o f.o
wasm-ld --no-entry --shared-memory --import-memory --max-memory=1048576 f.o -o f.wasm
wasm-opt --precompute --enable-threads f.wasm -o g.wasm
llvm-objdump -d f.wasm | grep -c atomic.fence # 1
llvm-objdump -d g.wasm | grep -c atomic.fence # 0
Same result with -O1, -O2, -O3, -Os and with --detect-features; -O0 keeps it.
Impact: in our emulator a guest FENCE is compiled to atomic.fence; after wasm-opt the engine had none, and a producer/consumer ring between threads read stale bytes (intermittent aborts on ARM64 Chrome). Using an atomic.rmw.or seq_cst on a dummy cell instead survives -O3.
- 主要言語
- WebAssembly
- スター
- 8.7k
- フォーク
- 905
- 平均マージ
- 2日 55分
- マージ済み PR(30日)
- 83
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WebAssembly/binaryen のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
WebAssembly/binaryen#9135 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 76/100
WebAssembly/binaryen#9018 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
RemoveUnusedModuleElements drops an active elem segment whose items are global.get, so call_indirect traps対応中かも @tlively が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
WebAssembly/binaryen#9366 ·
メンテナーはふだん 1 日以内に返信
-
Binary reader rebuilds tag types from Signature, dropping rec group and supertype (follow-up to #7219)対応中かも @tlively が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
WebAssembly/binaryen#9365 ·
メンテナーはふだん 1 日以内に返信
-
Add a pass to relax nullabilities of definitions対応中かも @stevenfontanella が 4 日前に担当しました。 オープンenhancement
WebAssembly/binaryen#9352 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
WebAssembly/binaryen の issue をすべて見る
似ている issue
-
Runner API: GET /api/jobs/<id> returns branch: null; the branch only appears under input.branchオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
radiancelux/prgenie#204 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
WalletConnect/walletconnect-monorepo#7392 · コメント 1 件 ·
-
area: app type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rohit746/pdf-view.nvim#109 ·
メンテナーはふだん 1 日以内に返信