Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannon: Simplify futex handling #13754

Draft
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

mbaxter
Copy link
Contributor

@mbaxter mbaxter commented Jan 14, 2025

Description

Simplify futex handling:

  • Handle futex wake / sleep operations by treating them like a sleep or yield: just preempt the current thread
  • Cut fields related to futex wake / sleep handling
  • Cut the wakeup traversal logic
  • Cut wakeup logic

Additional changes include:

  • Create new StateVersion's since the serialization of the vm state has changed
  • Cut metrics related to wakeups

Tests

  • Update tests and added a new unit test to validate StateVersion parsing
  • Manually ran the op-challenger run-trace command to validate we could successfully confirm output roots with the updated 64-bit VM

Metadata

Fixes #13443

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 91.22807% with 5 lines in your changes missing coverage. Please review.

Project coverage is 79.04%. Comparing base (49ea3d0) to head (a63b903).
Report is 11 commits behind head on develop.

Files with missing lines Patch % Lines
packages/contracts-bedrock/src/cannon/MIPS2.sol 81.25% 1 Missing and 2 partials ⚠️
cannon/cmd/load_elf.go 0.00% 1 Missing ⚠️
...acts-bedrock/src/cannon/libraries/MIPSSyscalls.sol 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #13754       +/-   ##
============================================
+ Coverage    47.07%   79.04%   +31.97%     
============================================
  Files          961      166      -795     
  Lines        80429     9188    -71241     
  Branches       753      747        -6     
============================================
- Hits         37858     7263    -30595     
+ Misses       39664     1671    -37993     
+ Partials      2907      254     -2653     
Flag Coverage Δ
cannon-go-tests-32 61.99% <92.30%> (-0.28%) ⬇️
cannon-go-tests-64 56.62% <79.48%> (-0.73%) ⬇️
contracts-bedrock-tests 91.59% <77.77%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cannon/mipsevm/exec/mips_syscalls.go 92.00% <100.00%> (-0.06%) ⬇️
cannon/mipsevm/multithreaded/mips.go 93.31% <100.00%> (-1.11%) ⬇️
cannon/mipsevm/multithreaded/state.go 55.13% <ø> (+0.88%) ⬆️
cannon/mipsevm/multithreaded/stats.go 90.90% <ø> (-1.74%) ⬇️
...non/mipsevm/multithreaded/testutil/expectations.go 100.00% <100.00%> (ø)
cannon/mipsevm/multithreaded/thread.go 65.71% <100.00%> (+4.53%) ⬆️
cannon/mipsevm/singlethreaded/mips.go 93.24% <100.00%> (ø)
cannon/mipsevm/versions/detect.go 85.71% <100.00%> (ø)
cannon/mipsevm/versions/state.go 61.15% <100.00%> (+13.36%) ⬆️
packages/contracts-bedrock/src/cannon/MIPS.sol 89.86% <100.00%> (ø)
... and 3 more

... and 796 files with indirect coverage changes

Comment on lines +68 to +70
# TODO: Publish cannon/v1.3.0 and update tag
# FROM --platform=$BUILDPLATFORM us-docker.pkg.dev/oplabs-tools-artifacts/images/cannon:v1.3.0 AS cannon-builder-v1-3-0
FROM --platform=$BUILDPLATFORM us-docker.pkg.dev/oplabs-tools-artifacts/images/cannon:3d3deab1f8e110caf355b53dde6d20c96bb08ebc AS cannon-builder-v1-3-0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: Need to address this TODO before merging

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.

Futex implementation is quite complex and still wrong at times
2 participants