0xMiden / 0xMiden/miden-vm

Follow-up issues for PR #2962

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

描述

# Post-merge follow-up epics for PR #2962

This issue tracks broader follow-up epics after the All-LogUp auxiliary trace work in PR #2962.

Exact Al-Kindi review-thread cleanup is tracked in #3097. PR #3098 already handled a first batch of straightforward nits, including stale `M_2+5` test naming, varying the op-group test away from all-`Noop`, several doc/comment trims, helper-style encoder cleanup, and regenerated constraint artifacts. Do not duplicate those exact review-thread items here; use #3097 as the source of truth for remaining inline comments.

## Rewrite LogUp lookup design docs

The design docs still mix old and new names for the same concepts. Some text describes running products, virtual tables, or old challenge names such as `alpha_i`, while the code now uses LogUp messages with interaction-specific bus prefixes.

Update the lookup and chiplet docs around one message model:

```text
bus_prefix[bus] + sum beta^i * payload[i]
```

Also explain the difference between:

- a logical bus,
- an interaction namespace,
- a physical lookup column.

This epic overlaps with #3097 only where Al-Kindi left exact inline comments, especially the docs/naming entries around challenge notation. Handle those exact comments through #3097; keep this issue focused on the broader docs rewrite across `docs/src/design/lookups/` and chiplet docs.

Related context: #1518, #1185, #1779, #2847, #3012.

## Settle lookup naming conventions

Some names no longer cleanly describe their role because physical columns now pack several logical buses by hand. PR #3098 removed the stale `M_2+5` shorthand from decoder tests, so this item is no longer about that specific cleanup.

The remaining question is the naming convention for:

- logical buses,
- interaction namespaces,
- physical packed lookup columns,
- module names such as `hash_kernel` and `wiring`, especially before/after any future auto-packing.

Exact review comments on this topic remain tracked in #3097, especially the column-naming and `M0..M7` discussion items. This epic should produce a naming decision and then focused follow-up PRs if renames are warranted.

## Check the END-to-control-row rule

The block-hash bus currently handles END-to-RESPAN defensively by including `respan_next` in `is_first_child`. A stronger decoder rule may be possible:

```text
when_transition().when(end).assert_zero(in_span_next)
```

Check whether this rule is valid. If it is, use it to simplify the block-hash END message flag and cover legal next-row cases: END-to-END, END-to-REPEAT, END-to-RESPAN, and END-to-HALT.

This corresponds to an exact review thread tracked in #3097. Use #3097 for the inline-comment lifecycle; use this issue only for the broader design decision if it needs discussion before implementation.

## Share chiplet and lookup flag helpers

Several lookup emitters still build related flags inline. Add small helpers where repeated flag code hides intent, while keeping each flag degree easy to audit.

PR #3098 handled some local cleanup, including the MU/MV controller-row prose, but it did not settle the broader helper extraction question. Exact helper-method review comments remain in #3097; this epic should cover any coherent helper extraction that remains after those are re-triaged.

## Revisit lookup degree notes and cached encodings

The lookup builder carries `Deg` notes and some cached-encoding paths. Some of this may be redundant if Plonky3 folds constants well enough.

Check which `Deg` notes are still useful, which cached encodings still matter, and whether `MainLookupBuilder` and `ChipletLookupBuilder` should remain separate extension traits.

Exact API/design review comments should stay linked through #3097. This epic should capture the final degree-contract decision and any benchmark or compile-time data used to remove a fast path.

## Trim op-flag accessors

`op_flag_getters!` creates accessors for many opcodes. Some are used by lookup emitters; others may only exist for symmetry with the opcode table.

Remove unused accessors, or keep them with a clear reason. Any remaining `#[expect(dead_code)]` should be intentional.

Exact review-thread bookkeeping belongs in #3097. This item remains here because it is a broader cleanup pass over opcode flag API shape.

## Benchmark prover accumulation and padding-row skips

`accumulate` now batch-inverts each chunk and then runs one sequential prefix sum over row totals. More prefix work may be movable into the chunk pass. Also, padding rows may be skippable once trace padding is removed or reduced.

Measure:

- chunk-local prefix totals with a small fixup pass,
- a row-skip path between trace generation and `build_lookup_fractions`.

This is done when the fast path matches `accumulate_slow`, representative traces are benchmarked, and skipped padding rows do not change final accumulator or boundary values.

The exact prefix-sum review note is tracked in #3097; the broader padding-row work relates to #2847 — see also #2953.

## Expand lookup test coverage

PR #3098 handled the narrow decoder-test cleanup around stale column notation and all-`Noop` batches. The remaining test work is broader coverage, not that exact nit.

Add targeted lookup tests for:

- block hash JOIN, SPLIT, LOOP, CALL, SYSCALL, and END across common MAST shapes,
- op-group add/remove behavior for each batch size,
- PUSH and non-PUSH op-group removals where stack rules allow useful variation,
- chiplet hasher selector decoding with invalid selector values.

Keep the lookup oracle cheap enough for CI. Exact review-comment test asks should still be resolved through #3097.

## Use canonical SPAN opcode names

Some chiplet request code may still use local names for SPAN. Use `opcodes::SPAN` where the value is the SPAN opcode, and keep any local constant only if it has a distinct meaning.

This exact follow-up came from a PR #2962 review comment and should be tracked through #3097. It remains listed here only as a broader consistency cleanup if the local re-triage confirms work is still needed.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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