Repository navigation
test: execute the u256 intrinsics against vectors on the OpenVM runner - #2
Merged
maximmenshikov merged 4 commits intoOct 13, 2026
Merged
Conversation
guest.cs only links the zkvm_u256_* shims. u256.cs runs each of the eleven against precomputed results, out of place and with the result over the first operand, and CI asserts zero mismatches over 296 checks on the pinned runner.
Also restores the line continuations in the workflow step.
# Conflicts: # .github/workflows/build-release.yml
5 of 16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
The eleven
zkvm_u256_*shims insrc/openvm_intrinsics/openvm_intrinsics.Sare only linked in CI (tests/integration/guest.cs) and never run. A wrong funct7 or register order would link fine and then compute the wrong thing. Nethermind's OpenVM guest is about to callzkvm_u256_mulfor EVM MUL (NethermindEth/nethermind branchperf/openvm-bigint-arith), so this PR makes CI execute the shims.tests/integration/u256.cs(new) is a bflat guest that runs every shim against 148 rows of precomputed results: 11 operand pairs for each non-shift op, and 10 shift counts on two values for each shift (counts include 0, 63, 64, 255, 256, 300 and 2^256-1). Each row runs three ways: into a separate buffer, with the result over the first operand, and with the result over the second. The in-place forms are how a caller works on a stack slot, and they only hold if the instruction reads both operands before it writes. The public output is the mismatch count and the check count.build-release.yml:link-guestalso linksu256.csand uploads it withguest.run-u256-vectorsjob runs it on the pinnednethermindeth/openvm-runner:v2.1.0-rv64digest and fails unless the guest reports 0 mismatches over 444 checks.No library or package change, so no version bump.
The vectors pin the extension's semantics on the rv64 line, from
extensions/bigint/circuitat OpenVM 56d5e4db:Testing
Built locally with the bflat image Nethermind pins (
bflat-riscv64-11:2ee8a26) againstlibopenvm.afromNethermind.OpenVM.Runtime1.0.0-preview.1, then run on the pinned runner:That is 0 mismatches over 444 checks. As a negative control, I flipped one expected limb of a mul row: the guest reported 2 mismatches (out of place and in place).
The fork has no Actions run for the new job, so CI on this PR is the first run of
run-u256-vectorsitself.Remarks
🤖 AI agent (Claude Code / Opus 5.5) on behalf of @LukaszRozmej