add dedicated `min` and `max` methods for `BitInteger` #63287
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.33) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 158 lines diff across 1 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.303
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #63287"
general
weight: 0.35
PatrickHaecker
fixes #63286
The new methods are type-stable. For
maxthe return type follows the usual promotion rules. The same applies tominif both arguments areBitSignedorBitUnsigned. For mixed arguments the return type ofminis the type of the signed argument.Comment 1: For the
minof twoBitUnsignedarguments, one could alternatively shrink the return type to the smaller of the argument types instead of widen it.Comment 2: I wonder if it would make sense to define the new methods for
Integer/Signed/Unsignedtypes instead ofBitInteger/BitSigned/BitUnsigned, and the same for the comparison operators. The reason is that the same promotion problem appears for other integer types, for example those defined in BitIntegers.jl and EmulatedBitIntegers.jl (CC @PatrickHaecker). Fixing this for all integer types in Base would solve the problem in a cleaner way and would also avoid method ambiguities that otherwise might arise if one integer is from some package X and the other one from some package Y. (If @fingolfin's current work on arbitrary size bit integers makes it into Base, then this will probably become moot.)