Skip to content

Delete the dead _gram computation method (RFF computes features twice) #679

Description

@thomaspinder

Category: dead · Severity: medium
Location: gpjax/kernels/computations/base.py:44 — _gram``

Problem

AbstractKernelComputation._gram has zero callers (grep _gram( matches only definitions): gram (base.py:67) inlines cross_covariance(x, x) instead. This makes BasisFunctionComputation._gram (basis_functions.py:32-34) a dead override — and because gram goes through cross_covariance, RFF computes the feature matrix twice on every Gram call.

Recommendation

Delete _gram (both the base and the RFF override), or make gram delegate to _gram so RFF's single-pass override is actually used.

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions