Treat `PtrArray` as CPU storage #629
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 272 lines diff across 3 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.336
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #629"
general
weight: 0.35
kshyatt
Temporaries from TensorOperations'
ManualAllocatorarePtrArrays, which are not inCPUStorage = Union{Array, Memory}. Their recoupling workspace in fusion-tree transformations with real coefficients and complex data (e.g. SU(2),ComplexF64) therefore misses theBLAS.gemm!method of_recouple!, andmul!on the reshaped view of the reinterpreted buffer falls back toLinearAlgebra._generic_matmatmul!.This adds
PtrArraytoCPUStorage. Its only use onmainis that_recouple!method, whose body only reinterprets the buffer and passes pointers to BLAS. PtrArrays.jl becomes a direct dependency, with the compat bound of TensorOperations, which already depends on it. The grouped subblock kernel of #597 dispatches on the sameCPUStorage, so once rebased it also applies toPtrArray-backed tensors. Measured on #597's head withPtrArrayadded there (an SU(2) PEPS CTMRG corner contraction, D = 7, χ = 49):ManualAllocator0.085 s → 0.043 s with the_recouple!method alone, 0.010 s with both, against 0.012 s for aBufferAllocator.Found in QuantumKitHub/PEPSKit.jl#482, where using a
ManualAllocatorgave a significant slowdown due to theBLAS.gemm!miss in the recouplings.<details>
<summary>Reproducer</summary>
main:This PR:
Julia 1.12.7, TensorOperations 5.8.4, 1 Julia thread, 8 BLAS threads; the first call includes compilation.
</details>
🤖 Generated with Claude Code