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: Add more 64-bit tests #12839

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

Inphi
Copy link
Contributor

@Inphi Inphi commented Nov 6, 2024

Add differential tests for 64-bit functionality. This modifies the TestEVM... and FuzzState... tests in two ways:

  • Fixing existing 32-bit tests to be also compatible with cannon64.
  • Creating 64-bit specific implementations based on existing 32-bit tests

The latter approach is used for tests that have noticeable different behavior (usually due to full-word register ops and sign-extension). So most of the changes here is a refactor the existing test setups so they can be used by the cannon32 and cannon64 tests.
The tests suffixed with 32 run only on cannon32 builds. While tests suffixed with 64 run only on cannon64. The rest run on both 32/64-bit VMs.

The complete list of tests updated can be found using go test -tags=cannon64 -list=. ./mipsevm/tests/... | grep -E '(TestEVM|FuzzState)' | sort:

FuzzStateConsistencyMulOp
FuzzStateConsistencyMultOp
FuzzStateConsistencyMultuOp
FuzzStateHintRead
FuzzStateHintWrite
FuzzStatePreimageRead
FuzzStatePreimageWrite
FuzzStateSyscallBrk
FuzzStateSyscallCloneMT
FuzzStateSyscallExitGroup
FuzzStateSyscallFcntl
FuzzStateSyscallMmap
TestEVM_ClaimProgram
TestEVM_EmptyThreadStacks
TestEVM_EntryProgram
TestEVM_Fault
TestEVM_HelloProgram
TestEVM_MMap
TestEVM_MT64_LL
TestEVM_MT64_LLD
TestEVM_MT64_SC
TestEVM_MT64_SCD
TestEVM_MT_LL
TestEVM_MT_SC
TestEVM_MT_StoreOpsClearMemReservation32
TestEVM_MT_StoreOpsClearMemReservation64
TestEVM_MT_SysRead_Preimage32
TestEVM_MT_SysRead_Preimage64
TestEVM_NoopSyscall32
TestEVM_NoopSyscall64
TestEVM_NormalTraversalStep_HandleWaitingThread
TestEVM_NormalTraversal_Full
TestEVM_OpenMIPS
TestEVM_PopExitedThread
TestEVM_SchedQuantumThreshold
TestEVM_SingleStep_Bitwise32
TestEVM_SingleStep_Bitwise64
TestEVM_SingleStep_Branch32
TestEVM_SingleStep_Branch64
TestEVM_SingleStep_Jump
TestEVM_SingleStep_LoadStore32
TestEVM_SingleStep_LoadStore64
TestEVM_SingleStep_MfhiMflo
TestEVM_SingleStep_MovzMovn
TestEVM_SingleStep_MthiMtlo
TestEVM_SingleStep_MulDiv
TestEVM_SingleStep_MulDiv64
TestEVM_SingleStep_Operators
TestEVM_SingleStep_Operators64
TestEVM_SingleStep_Shift64
TestEVM_SysClockGettimeMonotonic
TestEVM_SysClockGettimeNonMonotonic
TestEVM_SysClockGettimeRealtime
TestEVM_SysClone_FlagHandling
TestEVM_SysClone_Successful
TestEVM_SysExit
TestEVM_SysFutex_UnsupportedOp
TestEVM_SysFutex_WaitPrivate
TestEVM_SysFutex_WakePrivate
TestEVM_SysGetPID
TestEVM_SysGetTID
TestEVM_SysNanosleep
TestEVM_SysOpen
TestEVM_SysWriteHint
TestEVM_SysYield
TestEVM_UnsupportedSyscall32
TestEVM_UnsupportedSyscall64
TestEVM_WakeupTraversalStep
TestEVM_WakeupTraversal_Full
TestEVM_WakeupTraversal_WithExitedThreads

Meta

Fixes #12598

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 66.77%. Comparing base (8565b8f) to head (c48a360).
Report is 8 commits behind head on develop.

Files with missing lines Patch % Lines
cannon/mipsevm/exec/mips_instructions.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12839      +/-   ##
===========================================
+ Coverage    66.65%   66.77%   +0.12%     
===========================================
  Files           56       56              
  Lines         4666     4665       -1     
===========================================
+ Hits          3110     3115       +5     
+ Misses        1384     1378       -6     
  Partials       172      172              
Flag Coverage Δ
cannon-go-tests-32 61.81% <33.33%> (-0.08%) ⬇️
cannon-go-tests-64 56.38% <83.33%> (+2.22%) ⬆️

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

Files with missing lines Coverage Δ
cannon/mipsevm/testutil/arch.go 65.51% <100.00%> (+5.51%) ⬆️
cannon/mipsevm/testutil/vmtests.go 91.00% <ø> (-0.43%) ⬇️
cannon/mipsevm/exec/mips_instructions.go 97.44% <50.00%> (ø)

... and 2 files with indirect coverage changes

@Inphi Inphi requested a review from mbaxter November 6, 2024 20:36
@Inphi Inphi marked this pull request as ready for review November 6, 2024 20:36
@Inphi Inphi requested a review from a team as a code owner November 6, 2024 20:36
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.

Cannon64: Migrate 32-bit tests to be forward-compatible
1 participant