20 June 2026
Week 3-5: First Implementation & API Pivot
The first working prototype of the protocol-based potential function API is up in PR #1876, including a comparison notebook (sbi_old_vs_new_api.ipynb) demonstrating the new API for NLE side by side with the current one.
While building the prototype I made two observations that suggest a simpler path to the original goal of stateless potential functions:
- Stateless via copy instead of protocol redesign. Making
set_x() return a new instance rather than mutating the existing one is enough to achieve statelesness for most workflows. The main open question is how this interacts with batched sampling, where the observation is swapped repeatedly.
- Remove
x_o from the setup step entirely. Across all trainers (NLE, NPE, NRE), x_o is already always set to None when build_posterior is called internally. This means the only meaningful place to provide it is at sample() time, which is already how most user-facing code reads. Enforcing this would reduce surface area rather than add to it.
Next step: implement and test the simplified approach in a separate branch to see whether it passes existing tests without adding new abstractions.
24 May 2026
Week 1&2: Bonding Period
During the bonding period, I focused on reducing uncertainty before implementation starts.
I finished a UML diagram comparing the current class hierarchy against a proposed protocol-based redesign for the potential function API. For now, the diagrams and design notes are only shared internally with mentors while the design direction is still under discussion.
I also prepared several design choices for the API redesign and identified a minimal subset of the existing tests relevant to potential functions. This makes development iterations significantly faster since I do not have to run unrelated tests continuously.
Besides the API work, I explored tooling for more efficient development workflows and token usage, including Claude Code 101, Claude Code in Action, Serena, and RTK.
Next step: moving from design preparation into the first implementation phase.
10 May 2026
Preparing for GSoC 2026
"Set up a blog" it says in the GSoC Guides, so here we go:
Welcome to the start of my GSoC 2026 journey with sbi. I'll use this blog to document progress, implementation details, lessons learned, and technical insights throughout the summer.
The proposal phase is complete, and now the focus shifts toward execution. My accepted proposal can be found here: GSoC 2026 Proposal.
During the bonding period, my main focus will be understanding the potential functions inside the sbi.inference.potentials module and how the rest of the inference pipeline depends on them. Its API is exposed in sbi/inference/potentials/__init__.py:
__all__ = ["likelihood_estimator_based_potential",
"mixed_likelihood_estimator_based_potential",
"posterior_estimator_based_potential",
"ratio_estimator_based_potential",
"vector_field_estimator_based_potential"]
My first step toward understanding them is writing docstring examples, see PR #1820.