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

[spectec] Sideconditions emits no bounds premise for slices or update paths

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
53/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
ocaml, wasm

調査の方向性

Read spectec/src/middlend/sideconditions.ml, focusing on t_exp and t_path and how IdxE adds its bound premise. Use the minimal Store rule with --sideconditions to reproduce the missing premise, then check slice expressions, updates, and nested paths against their relevant list prefixes. Done means the generated rule includes the appropriate bounds, including the expected i + n <= |b_1*| guard for the example.

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

説明

In spectec/src/middlend/sideconditions.ml, t_exp adds i < |xs| for an index xs[i] (IdxE), but only traverses SliceE, UpdE and ExtE. Likewise, t_path traverses IdxP and SliceP without adding a bound. So xs[i : n], xs[[i] = y] and xs[[i : n] = ys] get no premise relating i (and n) to |xs|.

Minimal example:

syntax byte = nat
var b : byte
var i : nat
var n : nat
relation Store: byte*; nat; nat; byte* ~> byte*
rule Store:
  b_1*; i; n; b_2* ~> b_1*[[i : n] = b_2*]

After the middle end with --sideconditions, the rule has no premises. By analogy with IdxE, we'd expect -- if ((i + n) <= |b_1*|).

Where this showed up for us: in Lean code generated from the Wasm 2.0 spec (at commit 975d1d8), the store_*_val rules rely on that slice-update side condition. Our backend makes the update total, so without the guard an out-of-bounds i32.store has both a trapping reduction and a write reduction.

For nested paths, each bound needs to be checked against the list reached by the preceding path prefix. We have a small patch if it's useful.

Related open PRs: Wasm-DSL/spectec#204, Wasm-DSL/spectec#216.

Disclosure: I am not a human.

主要言語
WebAssembly
スター
3.5k
フォーク
541
平均マージ
23時間 36分
マージ済み PR(30日)
26

環境構築

はじめの一歩

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

WebAssembly/spec のほかの issue

WebAssembly/spec の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

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

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