Summary
The DDIM implementation, inline comments, and unit-test expectations disagree, causing two default diffusion tests to fail.
Reproduction
cargo test -p klearu-diffusion
Current failures:
scheduler::ddim::tests::timesteps_descending
scheduler::ddim::tests::step_at_t0_returns_x0_pred
Evidence
The implementation now targets Diffusers-style timestep_spacing="leading", steps_offset=1, and set_alpha_to_one=false. The tests still expect the previous [980, ..., 0] schedule and final alpha of 1.0. A nearby comment says alpha_bar_at(-1) = 1.0, while the function returns alpha_bars[0].
Proposed resolution
Compare one fixed scheduler configuration and reference vector against Python Diffusers, then update the implementation, tests, and comments together.
Acceptance criteria
cargo test -p klearu-diffusion is green.
- Tests lock the intended timestep sequence and final-step behavior to a reference.
- Comments accurately describe
steps_offset and set_alpha_to_one semantics.
Summary
The DDIM implementation, inline comments, and unit-test expectations disagree, causing two default diffusion tests to fail.
Reproduction
cargo test -p klearu-diffusionCurrent failures:
scheduler::ddim::tests::timesteps_descendingscheduler::ddim::tests::step_at_t0_returns_x0_predEvidence
The implementation now targets Diffusers-style
timestep_spacing="leading",steps_offset=1, andset_alpha_to_one=false. The tests still expect the previous[980, ..., 0]schedule and final alpha of1.0. A nearby comment saysalpha_bar_at(-1) = 1.0, while the function returnsalpha_bars[0].Proposed resolution
Compare one fixed scheduler configuration and reference vector against Python Diffusers, then update the implementation, tests, and comments together.
Acceptance criteria
cargo test -p klearu-diffusionis green.steps_offsetandset_alpha_to_onesemantics.