Optimize SliceUtf8 continuation-byte counting for AArch64 / Graviton #206
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 319 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.345
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #206"
general
weight: 0.35
raunaqmorarka
Summary
Optimizes
SliceUtf8continuation-byte counting (countCodePoints,offsetOfCodePoint) for AArch64 / AWS Graviton CPUs:Long.bitCount/Integer.bitCount(which require GPR↔NEONfmov/cnt/addv/umovtransfers on Graviton2/3/4) with pure-GPR byte accumulation (up to 31 words / 248 bytes per multiply-shift reduction incountCodePoints, and single-word multiply-shift incountContinuationBytes).offset + Math.min(end8 - offset, 31 * 8)andend - offset >= 4).TestSliceUtf8.testCodePointCountRangefor non-zero offsets, exact 4/8-byte remainders, and >248-byte multi-chunk inputs.Benchmarks (EC2 Graviton4
c8g.2xlarge, Corretto 25.0.5.1 LTS, 2 forks × 5 iterations)Comparing
upstream/master(4b24603) vs. this PR (ae81744) onSliceUtf8Benchmark(avgt, ns/op — lower is better):| Benchmark | ASCII | Length / Offset | Baseline | Patched | Speedup |
|---|---:|---:|---:|---:|---:|
|
benchmarkCountCodePoints| true | 10 | 5.38 | 5.38 | 1.00× ||
benchmarkCountCodePoints| true | 100 | 38.60 | 9.38 | 4.12× ||
benchmarkCountCodePoints| true | 1000 | 402.09 | 84.02 | 4.79× ||
benchmarkCountCodePoints| true | 10000 | 4021.01 | 817.24 | 4.92× ||
benchmarkCountCodePoints| false | 10 | 16.09 | 7.33 | 2.20× ||
benchmarkCountCodePoints| false | 100 | 157.62 | 35.53 | 4.44× ||
benchmarkCountCodePoints| false | 1000 | 1582.65 | 326.78 | 4.84× ||
benchmarkCountCodePoints| false | 10000 | 15839.63 | 3191.85 | 4.96× ||
benchmarkCountCodePointsRange| true | 1000 (off 1/7/31) | 402.10 | 84.00 | 4.79× ||
benchmarkCountCodePointsRange| false | 1000 (off 1/7/31) | 1582.66 | 322.92 | 4.90× ||
benchmarkOffsetByCodePoints| true | 10 | 9.85 | 9.63 | 1.02× ||
benchmarkOffsetByCodePoints| true | 100 | 35.39 | 19.40 | 1.82× ||
benchmarkOffsetByCodePoints| true | 1000 | 376.32 | 106.90 | 3.52× ||
benchmarkOffsetByCodePoints| true | 10000 | 4007.26 | 1074.66 | 3.73× ||
benchmarkOffsetByCodePoints| false | 10 | 18.94 | 18.80 | 1.01× ||
benchmarkOffsetByCodePoints| false | 100 | 151.52 | 56.97 | 2.66× ||
benchmarkOffsetByCodePoints| false | 1000 | 1576.57 | 442.65 | 3.56× ||
benchmarkOffsetByCodePoints| false | 10000 | 15872.17 | 4181.58 | 3.80× |Test Plan
javac --release 25 --add-modules jdk.incubator.vectorand ran JUnit 5TestSliceUtf8: 51/51 tests passed.