0xMiden / 0xMiden/miden-vm

Clarify behavior for empty begin/while/repeat blocks in MASM (tests still ignored)

未关闭
#3,094 5 条评论 0 个 reaction 已指派 1 人 已被 @addnad 认领 在 GitHub 查看
主要语言
Rust
星标
772
派生
352
平均合并
1 天 12 小时
30 天内合并 PR
93

描述

## Summary
There are still ignored tests for empty `begin end`, `while.true end`, and `repeat.N end` blocks, which suggests the intended behavior is unclear or not enforced. This leaves ambiguity for compiler/codegen output and users.

## Background
Historically, empty blocks were discussed and partially addressed:
- https://github.com/0xMiden/miden-vm/issues/585
- https://github.com/0xMiden/miden-vm/pull/609
- https://github.com/0xMiden/miden-vm/pull/1360

Despite that, empty `begin/while/repeat` appear to still be unresolved (tests remain ignored).

## Why this matters
- Code generators often emit empty blocks during optimization or transformation passes.
- Without a defined behavior, identical programs can be rejected or behave inconsistently across versions.
- It is unclear whether this should be allowed as a no-op or rejected with a structured diagnostic.

## Proposed resolution
Please confirm which behavior is desired:

Option A: Reject
- Emit a structured diagnostic for empty blocks.
- Enable the ignored tests and assert the diagnostics.

Option B: Allow
- Treat empty blocks as a no-op (e.g., a canonicalized `nop`).
- Enable tests to assert the resulting output/IR.
- Document the behavior in the assembly docs.

I’m happy to take this on once the intended behavior is confirmed.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。