evm: Load a whole CALLDATALOAD word directly from the input #1776
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 173 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.309
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1776"
general
weight: 0.35
chfast
CALLDATALOAD copied every word through a zeroed 32-byte buffer, which GCC and Clang compile to a memcpy call, also when the whole word is in the input. That is nearly every CALLDATALOAD: 98.5% of them in a profile of 1000 recent mainnet blocks. Now the index is checked on its 64-bit words instead of with a 256-bit comparison, and a word that is entirely in the input is loaded in place. The index past the input and the word that the input ends inside stay inline, as the unlikely cases.
Instructions per CALLDATALOAD in the Baseline interpreter built for the default x86-64-v2, dispatch included, measured with callgrind on a loop of each case:
The Baseline loop's code is 41 bytes smaller with GCC and 16 bytes larger with Clang. The library's code is smaller with both, by 64 and 32 bytes.
The new test loads the words at the end of the input. The input is followed by a non-zero byte, so a load that reads past its end gives a wrong result. The test also loads at the largest 64-bit index, where the index plus 32 overflows 64 bits, and at three indexes whose low word is inside the input while one of the high words is not zero.