Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

il2al: host function rules become two independent conditionals and ignore the new store `s'`

オープン
#2,279 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
ocaml, wasm
領域
compilers

調査の方向性

The two host-function rules are in spectec/specification/wasm-3.0/4.3-execution.instructions.spectec around lines 184-198. The translation that emits Either only for condition-free rules is in spectec/src/il2al/translate.ml near line 1155, so start there and compare with how memory.grow is handled. Done means the RES and BOT cases become mutually exclusive alternatives, and the store s' from the RES case is applied, as checked by the --prose output.

索引モデルが issue の本文から書いたものです。

説明

I came across this while looking at how il2al uses Either for nondeterminism.

The rules Step/call_ref-hostfunc-res and -div (added in #2210) can both apply:

https://github.com/WebAssembly/spec/blob/8d6a3afa965a28e145110445101338bed947991b/specification/wasm-3.0/4.3-execution.instructions.spectec#L184-L198

--prose gives:

13. If an element of $hostcall((_HOSTFUNC hf), s, val^n) is some RES, then:
  a. Let (RES s' result) be an element of $hostcall((_HOSTFUNC hf), s, val^n).
  b. Execute the sequence $lift_result(result).
14. If BOT is contained in $hostcall((_HOSTFUNC hf), s, val^n), then:
  ...
  1. Steps 13 and 14 are not alternatives, so when both apply the algorithm does both.
  2. s' is never used, so the store is not updated.

I would expect something like this, as for memory.grow (not sure how AL should update the whole store):

13. Either:
  a. Let (RES s' result) be an element of $hostcall((_HOSTFUNC hf), s, val^n).
  b. Update the store s to s'.
  c. Execute the sequence $lift_result(result).
14. Or:
  ...

It seems il2al produces Either only for rules without conditions (translate.ml#L1155).

Note: This might be low priority since neither the document nor the reference interpreter uses this algorithm.

主要言語
WebAssembly
スター
3.5k
フォーク
540
平均マージ
1日 6時間
マージ済み PR(30日)
20

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

WebAssembly/spec のほかの issue

WebAssembly/spec の issue をすべて見る

似ている issue

Compilers の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。