Skip to content

Verify GenerativeModelInput.x_init is unused and remove it if so #309

Description

@coderabbitai

Context

While reviewing the Protpardelle wrapper's featurize() method (see PR #300, review comment #300 (comment)), we noticed that GenerativeModelInput.x_init is populated by every model wrapper's featurize() method (src/sampleworks/models/boltz/wrapper.py, src/sampleworks/models/protenix/wrapper.py, src/sampleworks/models/rf3/wrapper.py, src/sampleworks/models/protpardelle/wrapper.py), but a codebase-wide search (rg '\.x_init\b') found no downstream reads of this attribute anywhere outside of the constructors themselves.

Sampling appears to actually initialize state via initialize_from_prior() (e.g. sampleworks.core.samplers.pure_guidance.PureGuidance.sample), not via the x_init field on GenerativeModelInput.

Several existing TODO comments already flag this suspicion, e.g.:

  • src/sampleworks/models/rf3/wrapper.py line 484: "TODO: figure out if this is necessary or if we should just remove x_init completely."
  • src/sampleworks/models/boltz/wrapper.py line 735: "not sure exactly what the best way to handle x_init is, should define it a bit better"
  • src/sampleworks/models/protpardelle/wrapper.py line 441: "I don't think we really need it. Our sampler will call the initialize_from_prior() method..."

Requested work

  1. Confirm that GenerativeModelInput.x_init is truly unused by any sampler/scaler downstream consumer (beyond being set at construction time).
  2. If confirmed unused:
    • Remove the x_init field from GenerativeModelInput in src/sampleworks/models/protocol.py.
    • Remove the corresponding x_init=... computation/plumbing from each wrapper's featurize():
      • src/sampleworks/models/boltz/wrapper.py
      • src/sampleworks/models/protenix/wrapper.py
      • src/sampleworks/models/rf3/wrapper.py
      • src/sampleworks/models/protpardelle/wrapper.py
    • Update any related docstrings/comments referencing x_init.
    • Update tests that construct GenerativeModelInput with x_init=....

Acceptance criteria

  • GenerativeModelInput no longer carries an x_init field (or the field is kept only if a genuine downstream use is discovered, in which case this issue should instead document that use).
  • All model wrappers' featurize() methods are updated accordingly, and related dead code (e.g. reference-coordinate computation solely for x_init) is removed.
  • Existing tests pass with the updated protocol.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions