Skip to content

Conversation

@Al-Kindi-0
Copy link
Contributor

Describe your changes

Checklist before requesting a review

  • Repo forked and branch created from next according to naming convention.
  • Commit messages and codestyle follow conventions.
  • Commits are signed.
  • Relevant issues are linked in the PR description.
  • Tests added for new functionality.
  • Documentation/comments updated according to changes.
  • Updated `CHANGELOG.md'

Al-Kindi-0 and others added 30 commits December 14, 2025 13:56
# Conflicts:
#	miden-vm/tests/integration/operations/crypto_ops.rs
#	processor/src/operations/crypto_ops.rs
#	processor/src/operations/ext2_ops.rs
#	processor/src/operations/field_ops.rs
#	processor/src/operations/fri_ops.rs
#	processor/src/operations/horner_ops.rs
#	processor/src/operations/u32_ops.rs
#	processor/src/parallel/core_trace_fragment/tests.rs
#	prover/src/lib.rs
Reduce diff against `next` by aligning API patterns. Some changes are
temporary simplifications that should be addressed in follow-up PRs.

## Changes Made

### Matching `next` branch patterns
- Remove `Copy` from `StackInputs`/`StackOutputs` (add `.clone()` calls)
- Rename field `precompile_requests` → `pc_requests` in ExecutionProof
- Remove `Default` derive from `HashFunction`
- Reorder `HashFunction` variants: Poseidon2=0x04, Keccak=0x05
- Use `.inverse()` instead of `.try_inverse().unwrap()` where appropriate
- Delete unused `air/src/utils.rs` and `processor/src/transpose.rs`

### Temporary simplifications
- Replace `.expect("...")` with `.unwrap()` on `QuadFelt::from_basis_coefficients_slice`
- Various formatting fixes (indentation, parentheses removal)

## Follow-up Issues to Create

### 1. Rename `pc_requests` back to `precompile_requests`
The abbreviated name reduces readability. The full name should be
restored after the migration is complete.
**Files**: `air/src/proof.rs`

### 2. Migrate to `QuadFelt::new(a, b)` API
The `next` branch uses `QuadFelt::new(a, b)` instead of
`QuadFelt::from_basis_coefficients_slice(&[a, b]).unwrap()`.
This is cleaner and avoids the unwrap entirely.
**Files**: ~33 occurrences across processor/, miden-vm/, crates/

### 3. Audit inverse method semantics
One test changed from `delta.inverse()` to `delta.try_inverse().unwrap_or(ZERO)`
which silently returns ZERO on zero input. Verify this matches production
behavior or restore panic semantics to match `next` which uses `.inv()`.
**Files**: `processor/src/chiplets/memory/tests.rs`

### 4. Restore helpful `.expect()` messages where appropriate
Replacing `.expect("context")` with `.unwrap()` loses error context.
Review and restore messages for non-obvious failure points.

### 5. Verify Keccak discriminant change is intentional
`HashFunction::Keccak` changed from 0x04 to 0x05. This is a serialization
breaking change for any existing proofs using Keccak. Confirm this is
acceptable or document the migration path.
**Files**: `air/src/proof.rs`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@huitseeker huitseeker force-pushed the al-migrate-p3-ver2 branch 13 times, most recently from 02468c7 to 116efcf Compare December 31, 2025 00:59
Base automatically changed from al-migrate-p3-ver2 to next January 2, 2026 19:42
@bobbinth
Copy link
Contributor

bobbinth commented Jan 4, 2026

@Al-Kindi-0 - is this PR still relevant? If so, let's merge the latest next into it.

@Al-Kindi-0
Copy link
Contributor Author

@Al-Kindi-0 - is this PR still relevant? If so, let's merge the latest next into it.

Yes, this is still relevant but I am thinking after the 0.4.2 release of Plonky3 and provided we manage to upstream support for periodic columns.

@adr1anh
Copy link
Contributor

adr1anh commented Jan 12, 2026

This should target #2498, which had to be rebuilt after the P3 migration PR got merged. It might require extracting the core changes from here and rebuilding the branch. We could also close this PR and push the changes directly to #2498.

@Al-Kindi-0
Copy link
Contributor Author

@adr1anh , as you see fit, though I think just extracting the core logic and building it on top of #2498 might be the easiest solution

@adr1anh
Copy link
Contributor

adr1anh commented Jan 12, 2026

I can take care of this and then close this PR

@Al-Kindi-0
Copy link
Contributor Author

I can take care of this and then close this PR

That would be great, thanks!

@Al-Kindi-0
Copy link
Contributor Author

Closing this one as we can open a new PR once support for periodic columns is integrated in upstream P3.

@Al-Kindi-0 Al-Kindi-0 closed this Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants