Remove static dimension type parameter #42
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 298 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.341
Real PR Conversation Timeline
1 comments
"Review active on #42"
general
weight: 0.35
projekter
Currently, the "dimension" of the Sobol sequence is implemented as a static type parameter. However, the whole code never makes any use that the value is known at compile time. Instead, all it does is iterating over
1:ndims(which will typically be not so small that loop unrolling would be favorable in any way, and the loop bodies are too long for this anyway) and creating vectors of lengthndims, which turns the static parameter into a runtime variable.I would say that the whole point why for example
Arrayuses a static dimension parameter instead of dynamic ones is:For multiple
SobolSeqof different dimension, instead, the compiler has to regenerate the code for every single method with the only difference between them being an integer constant in the function body, which is very inefficient. On top on this, any package that uses this one and needs to generate aSobolSeqwith only runtime-known length (actually, I'm here because ofMultistartOptimization.jl), unavoidably now has type instabilities and uninferrability (or it follows the same approach and "staticizes" the dynamical value, leading to dynamical dispatch and compiler overhead by method generation).Given that there is no technical reason or benefit for the static type parameter, I propose to change it to a field of the struct instead, which solves all the mentioned problems.
SobolSeqis now unparametrized andScaledSobolSeqonly contains the type of the boundaries as a type parameter.This is a breaking change if people explicitly wrote
SobolSeq{N}before, therefore this would be a major version increment.Note that I increased the Julia version to 1.8 since I declared the
ndimsfieldconst; however, this is the only reason for the compatibility reduction and can of course also be removed if you'd rather like to keep compatibility.Closes #18 as obsolete (see also my comment there).