dorcsd2by1/uncsd2by1: avoid OOB access with zero rows #1291
All Vouch review confidence checks passed
Residual risk 0.12 = Change Risk (0.31) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.31 · 112 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
Shallow Review Depth
shallow_review_depth
0.289
Diff Size
diff_size
0.283
Real PR Conversation Timeline
1 comments
"Review active on #1291"
general
weight: 0.35
martin-frbg
When P=0 and M=Q (U2 is M-by-M, X21 is M-by-M and orthogonal), or P=M and M=Q (U1 is M-by-M, X11 is M-by-M and orthogonal), or Q=0, the minimal dimension R = MIN(P, M-P, Q, M-Q) is zero, so C and S are empty. In these degenerate cases the preceding code entered the R == P or R == M-P branch and called the bidiagonalization subroutines (SORBDB2/SORBDB3) which then accessed elements X21(I,I+1) or X11(I,I+1) out of bounds in the second DO loop (I = P+1, Q or I = M-P+1, Q).
Fix: handle R = 0 directly in the four driver routines before the case-dependent bidiagonalization path. The three trivial CSD cases are:
Q = 0: set U1 = I, U2 = I, return.
P = 0, M = Q: copy X21 to U2, set V1T = I, return.
P = M, M = Q: copy X11 to U1, set V1T = I, return.
All other R=0 configurations are non-standard and still fall through to the existing path (which may fail).
Fixes #549