Skip to content

Add std::native::sha256_compress - #1977

Merged
sbillig merged 2 commits into
argotorg:masterfrom
sbillig:feat/native-sha256-compress
Nov 10, 2026
Merged

sbillig merged 2 commits into
argotorg:masterfrom
sbillig:feat/native-sha256-compress

Conversation

@sbillig

@sbillig sbillig commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Updates Sonatina to 2547f707 (fe-lang/sonatina#506 through #528, mostly native code generation; no snapshot changes), with the Cranelift fork pin at fe-lang/wasmtime b7772dbce.

Adds std::native::sha256_compress(state, block): one SHA-256 compression, state after the 64 rounds over sixteen message words. It lowers to Sonatina's native sha256_compress, which uses the x86-64 SHA extensions on a host that has them and scalar rounds elsewhere. The EVM has no such instruction, so it is native-only.

fevm's SHA-256 precompile uses it.

@sbillig
sbillig force-pushed the feat/native-sha256-compress branch from ca56a92 to 835b889 Compare November 10, 2026 19:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T20:10:32.587238Z 7b4c44e New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Takes fe-lang/sonatina#506 through argotorg#528: cold functions, native
`sha256_compress`, jump threading on dominating conditions, `select`
and if-conversion, unrolling of loops with constant trip counts, and
native codegen work (padding and inactive payloads left unwritten,
aggregates built in place, local object copies coalesced, carry chains
through carry-in ops, i256 limb folds, division, overflow fusion, SP1
functions kept at four-byte alignment). The Cranelift fork pin moves to
fe-lang/wasmtime b7772dbce. No snapshot changes.
sha256_compress(state, block) is one SHA-256 compression: the eight state
words after the 64 rounds of sixteen message words, read big-endian. It
lowers to Sonatina's native sha256_compress, which uses the x86-64 SHA
extensions on a host that has them. The EVM has no such instruction, so it is
a native-only builtin.
@sbillig
sbillig force-pushed the feat/native-sha256-compress branch from 835b889 to 7b4c44e Compare November 10, 2026 20:06
sbillig added a commit to fe-lang/fevm that referenced this pull request Nov 10, 2026
The SHA-256 precompile compresses each block with
`std::native::sha256_compress`, which argotorg/fe#1977 adds along with
Sonatina 2547f707. Pin that commit, its Cargo.lock and its Sonatina
revision.
@sbillig
sbillig merged commit 4608e5f into argotorg:master Nov 10, 2026
4 of 5 checks passed
sbillig added a commit to fe-lang/fevm that referenced this pull request Nov 10, 2026
The SHA-256 precompile compresses each block with
`std::native::sha256_compress`, which argotorg/fe#1977 added along with
Sonatina 2547f707. Pin Fe master 4608e5fdf, its Cargo.lock and its
Sonatina revision.
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.

1 participant