Fix equal-magnitude MIN_ABS/MAX_ABS selection in VRANGE instructions #855
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 410 lines diff across 5 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.360
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #855"
general
weight: 0.35
stlintel
Problem
The shared
f32_rangeandf64_rangehelpers implement theMIN_ABSandMAX_ABSoperations used byVRANGEPD,VRANGEPS,VRANGESD, andVRANGESS.For absolute-value comparisons, the helpers clear both operand signs and use
a strict less-than comparison. When the operands have equal magnitudes but
opposite signs, equality therefore falls through to a source-order-dependent
choice:
MIN_ABSselects SRC2 andMAX_ABSselects SRC1.Consequently, one source order returns the positive operand for
MIN_ABSandthe negative operand for
MAX_ABS. This also affects-0.0/+0.0ties.Fix
Extend the existing opposite-sign selection path to cover equal-magnitude
absolute comparisons. The helpers compare magnitudes by clearing the IEEE-754
sign bit from each operand before testing for equality.
This follows the existing Bochs SoftFloat convention used by the float32,
float64, and float16 MINMAX helpers, as well as by the surrounding RANGE
code.
When the magnitudes are equal and the signs differ, the existing selection
logic then chooses the negative operand for MIN_ABS and the positive operand
for MAX_ABS, independent of source order. NaN handling and DAZ normalization
remain unchanged and occur before this selection.
Architectural reference
The Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 2,
sections “VRANGEPD—Range Restriction Calculation for Packed Pairs of Float64
Values,” “VRANGEPS—Range Restriction Calculation for Packed Pairs of Float32
Values,” “VRANGESD—Range Restriction Calculation From a Pair of Scalar
Float64 Values,” and “VRANGESS—Range Restriction Calculation From a Pair of
Scalar Float32 Values,” define the range operations in Tables 5-22 and 5-23.
For equal-magnitude operands with opposite signs, those tables require
MIN_ABSto select the negative operand andMAX_ABSto select the positiveoperand.
Validation
A standalone 64-bit CPL3 guest exercised the four instructions on the Bochs
tigerlakeCPU model with AVX-512 state enabled (XCR0=0xe7). The tie testsused both source orders for
-1.0/+1.0and-0.0/+0.0, with sign controlset to preserve the selected operand’s sign.
| Instruction | Operations and tie inputs | Before | After |
|---|---|---:|---:|
|
VRANGEPD|MIN_ABS/MAX_ABS,±1.0and±0.0, both orders | FAIL | PASS ||
VRANGEPS|MIN_ABS/MAX_ABS,±1.0and±0.0, both orders | FAIL | PASS ||
VRANGESD|MIN_ABS/MAX_ABS,±1.0and±0.0, both orders | FAIL | PASS ||
VRANGESS|MIN_ABS/MAX_ABS,±1.0and±0.0, both orders | FAIL | PASS |Additional controls passed after the change:
MIN_ABSandMAX_ABSinputs;0x02source-1 sign control;checks for both float32 and float64.
The patched tree was rebuilt successfully with
make -j2.