miscompilation: signed widening arithmetic diverges from native execution
- 主要語言
- Rust
- 星號
- 115
- 分支
- 84
- 平均合併
- 1 天 8 小時
- 30 天內合併 PR
- 15
描述
The differential fuzzing suite found a silent wrong-result miscompilation (no VM abort): a `(u32, u32) -> u32` function mixing `i64.extend8/16/32_s`, `i64.extend_i32_s`, and `i64.mul_wide_s` (one negative-constant and one dynamic multiplicand) returns a different value under the Miden VM than natively.
For inputs `(3022925119, 3340151117)`: native `3550407903` vs MASM `3550391763`.
## Reproduce
On the branch from #1286:
```sh
cargo test -p midenc-integration-tests differential::tests::sext_shapes_repro -- --ignored
```
`sext_shapes_repro` pins the failing input pair and fails deterministically; `sext_shapes` runs the same case under 16 random inputs. The case source is `tests/integration/src/end_to_end/differential/cases/case_sext_shapes.rs`; both tests are `#[ignore]`d in `tests/integration/src/end_to_end/differential/tests.rs`.
## Already bounded
Passing sibling cases show each ingredient is correct in isolation:
- `sext_widths` — pure extend8/16/32_s chains
- `mulwide_dyn` — dynamic-by-dynamic `i64.mul_wide_s`
- `mulwide_fold` — `mul_wide_s` with a *positive* constant multiplicand
The remaining suspects are the negative-constant multiplicand shape (the one piece no passing sibling covers) or an interaction between the shapes.
貢獻指南
研究方向
失敗的測試位於 `tests/integration/src/end_to_end/differential/tests.rs` 中,名為 `sext_shapes_repro`。檢查案例原始碼 `case_sext_shapes.rs` 以查看混合了有號擴展和乘法的函式。執行測試以確認差異,然後追蹤編譯器對帶有負數常數的 `i64.extend8/16/32_s`、`i64.extend_i32_s` 和 `i64.mul_wide_s` 的處理過程。將生成的 Miden 組合語言程式碼與預期的原生執行結果進行比較。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- rust
- 領域
- compilers
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100