Skip to content

Mooncake scalar_pullback overwrites tangent instead of accumulating #543

Closed

Description

@lkdvos

scalar_pullback does first(blocks(dt))[2][1] = Δval (plain assignment) instead of accumulating, unlike every other rule in this extension (increment!!/in-place +=). If the tensor fed to scalar(t) is also used elsewhere in the same reverse pass, one pullback's contribution silently clobbers the other's — wrong gradient, no error.

ext/TensorKitMooncakeExt/tensoroperations.jl:196-204. Fix: first(blocks(dt))[2][1] += Δval.

Activity

  1. linked a pull request that will close this issueRelease v0.17.2 #550on Sep 20, 2026
  2. added a commit that references this issue on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions