Skip to content

combine interpreter checkpoint#85

Merged
edubart merged 7 commits intomainfrom
combine-interpreter-checkpoint
Apr 10, 2026
Merged

combine interpreter checkpoint#85
edubart merged 7 commits intomainfrom
combine-interpreter-checkpoint

Conversation

@mpernambuco
Copy link
Copy Markdown
Contributor

No description provided.

@mpernambuco mpernambuco changed the title Refs/heads/combine interpreter checkpoint combine interpreter checkpoint Feb 25, 2026
@mpernambuco mpernambuco force-pushed the combine-interpreter-checkpoint branch from 33d63f0 to f66937e Compare February 26, 2026 14:46
mpolitzer
mpolitzer previously approved these changes Mar 25, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Waiting Merge in Machine Unit Mar 25, 2026
@mpolitzer mpolitzer requested a review from Copilot March 25, 2026 18:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Solidity uarch interpreter/step implementation to align with a newer machine-emulator layout that introduces a shadow TLB region and checkpointing support, plus related constant and ECALL interface updates.

Changes:

  • Add TLB/checkpoint-related constants and extend uarch ECALL handling (halt/putchar/mark-dirty-page/write-TLB).
  • Introduce write4Words to efficiently write a full 32-byte leaf (used for TLB entry updates).
  • Update mock/test memory layout and CMIO RX buffer constant names to match the new address map.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/UArchInterpret.t.sol Updates tests for new halt flag API and mock memory layout sizing.
templates/EmulatorConstants.sol.template Adds TLB sizing + checkpoint address constants to template.
templates/AccessLogs.sol.template Reorders prod/test sections and adds write4Words; updates mock memory layout to include shadow TLB.
src/UArchStep.sol Adds new ECALL functions and uses new halt/cycle semantics.
src/SendCmioResponse.sol Renames constants to updated address-map identifiers.
src/EmulatorConstants.sol Regenerates constants and adds TLB/checkpoint constants.
src/EmulatorCompat.sol Adds checkpoint hash helpers, changes halt flag API, and implements TLB ECALL write path.
src/AdvanceStatus.sol New helper to interpret advance/yield status from HTIF tohost.
src/AccessLogs.sol Adds write4Words and minor parameter naming cleanup in offset helpers.
shasum-download Updates download checksums to match new emulator artifacts.
helper_scripts/generate_UArchStep.sh Adjusts generator filtering/replacements for updated upstream C++ annotations/signatures.
helper_scripts/generate_SendCmioResponse.sh Updates generator replacement for new RX buffer constants and hash-tree word size naming.
helper_scripts/generate_EmulatorConstants.lua Extends constants generation for new address map / yield reasons / TLB config.
Makefile Bumps referenced machine-emulator version for test data/log downloads.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/EmulatorCompat.sol
Comment thread templates/AccessLogs.sol.template
Comment thread src/EmulatorCompat.sol
Comment thread src/EmulatorCompat.sol
@mpernambuco mpernambuco force-pushed the combine-interpreter-checkpoint branch from 6faa5ab to c9b255c Compare March 31, 2026 16:18
mpolitzer
mpolitzer previously approved these changes Apr 2, 2026
@edubart edubart added the enhancement New feature or request label Apr 9, 2026
@edubart edubart added this to the v0.14.0 milestone Apr 9, 2026
@edubart edubart moved this from Waiting Merge to Waiting Review in Machine Unit Apr 9, 2026
@edubart edubart requested a review from Copilot April 9, 2026 13:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/AdvanceStatus.sol
Comment thread src/AdvanceStatus.sol
Comment thread src/EmulatorConstants.sol Outdated
Comment thread src/EmulatorConstants.sol Outdated
Comment thread src/AccessLogs.sol Outdated
Comment thread test/UArchInterpret.t.sol Outdated
Comment thread src/AdvanceStatus.sol

uint64 tohost =
EmulatorCompat.readWord(a, EmulatorConstants.HTIF_TOHOST_ADDRESS);
uint16 reason = uint16(tohost >> 32);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hardcoded 32 should ideally use a constant to make it more clear.

Comment thread Makefile Outdated
@github-project-automation github-project-automation Bot moved this from Waiting Review to In Progress in Machine Unit Apr 9, 2026
This was referenced Apr 9, 2026
@edubart
Copy link
Copy Markdown
Collaborator

edubart commented Apr 9, 2026

@GCdePaula Can you take a look? You left some comments related with the changes at #81 and #83, and seems like they were all addressed already, is that correct? Any remaining concerns?

@stephenctw You originally wrote the checkpoint code, does everything look ok? Have in mind we need to change the checkpoint address from 0x7ffff000 to 0xfe0 in emulator v0.20.0 (emulator calls it CM_AR_SHADOW_REVERT_ROOT_HASH_START) and this will impact Dave.

@diegonehab Is the TLB changes related to the new ECALLs correct?

@mpernambuco Can you address my comments and update to the new emulator tag?

@edubart edubart requested a review from diegonehab April 9, 2026 16:39
Comment thread src/AdvanceStatus.sol

error InvalidReason(uint16 reason);

function advanceStatus(AccessLogs.Context memory a)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I don't like how this advanceStatus was introduced in the repository without being used or tests, however I assume Dave is testing it somehow, so we don't need to delay this PR.

Comment thread src/EmulatorCompat.sol
using Buffer for Buffer.Context;
using Memory for uint64;

function getCheckpointHash(AccessLogs.Context memory a)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I don't like how both getCheckpointHash/setCheckpointHash were introduced in the repository without being used or tests, however I assume Dave is testing it somehow, so we don't need to delay this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be renamed to RevertRootHash to match the emulator.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephenctw can we rename this to match the emulator naming convention? I think revert root hash is much more informative than checkpoint hash.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is being renamed by #88 which we will be merged after merging this PR first.

@diegonehab
Copy link
Copy Markdown
Contributor

@GCdePaula Can you take a look? You left some comments related with the changes at #81 and #83, and seems like they were all addressed already, is that correct? Any remaining concerns?

@stephenctw You originally wrote the checkpoint code, does everything look ok? Have in mind we need to change the checkpoint address from 0x7ffff000 to 0xfe0 in emulator v0.20.0 (emulator calls it CM_AR_SHADOW_REVERT_ROOT_HASH_START) and this will impact Dave.

@diegonehab Is the TLB changes related to the new ECALLs correct?

@mpernambuco Can you address my comments and update to the new emulator tag?

Indeed. There is a mismatch.

Comment thread Makefile Outdated
edubart
edubart previously approved these changes Apr 9, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Waiting Merge in Machine Unit Apr 9, 2026
@GCdePaula
Copy link
Copy Markdown
Contributor

@GCdePaula Can you take a look? You left some comments related with the changes at #81 and #83, and seems like they were all addressed already, is that correct? Any remaining concerns?

No concerns related to #81 and #83!

@edubart edubart merged commit fee663e into main Apr 10, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting Merge to Done in Machine Unit Apr 10, 2026
@edubart edubart deleted the combine-interpreter-checkpoint branch April 13, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants