Category: simplify · Severity: medium
Location: gpjax/kernels/additive/oak.py:60 · gpjax/kernels/additive/sobol.py:123
Problem
_newton_girard (oak.py:60) and _newton_girard_matrices (sobol.py:123) are the same algorithm — identical power-sum, sign, mask, and fori_loop structure — differing only by trailing broadcast dims of size 1. sobol's own docstring says it is 'the matrix-level analogue of _newton_girard in oak.py'.
Recommendation
Merge into one broadcast-generic implementation and call it from both sites.
Filed from the 2026-07-02 GPJax codebase audit (medium tier). Companion spec for the high-severity items: plans/2026-07-02-audit-high-severity-remediation-design.md.
Category: simplify · Severity: medium
Location:
gpjax/kernels/additive/oak.py:60 · gpjax/kernels/additive/sobol.py:123Problem
_newton_girard(oak.py:60) and_newton_girard_matrices(sobol.py:123) are the same algorithm — identical power-sum, sign, mask, andfori_loopstructure — differing only by trailing broadcast dims of size 1. sobol's own docstring says it is 'the matrix-level analogue of_newton_girardin oak.py'.Recommendation
Merge into one broadcast-generic implementation and call it from both sites.
Filed from the 2026-07-02 GPJax codebase audit (medium tier). Companion spec for the high-severity items:
plans/2026-07-02-audit-high-severity-remediation-design.md.