Skip to content

Lamé flow regulariser is not self-adjoint at reflecting boundaries (critical) #26

Description

@balbasty

Part of #25. Critical / tricky — needs review before merge.

The linear-elastic (shears/div) flow operator was not self-adjoint under reflecting boundaries (DCT2/DST*): the cross-channel block was computed as D_c D_d with the field's natural boundary reads instead of D_c^T D_d, so ⟨Lx,y⟩ ≠ ⟨x,Ly⟩ except under DFT — breaking the SPD assumption of CG/relaxation solvers (and torch's self-adjoint backward).

Fix (fastfields-kernels/regularisers/flow/{2d,3d}.h, matvec_all + matvec_lame): read the transposed axis through the adjoint boundary via a new bound::transpose() (DCT1↔DST1, DCT2↔DST2; DFT/Zero/Replicate unchanged), and correct a corner sign. Interior stencil unchanged.

Verified by new operator-symmetry tests in fastfields-cpu-lib (2D + 3D, all penalty combos, DCT2/DFT/mixed) and torch gradcheck.

Upstream (jitfields shares the buggy kernel): balbasty/jitfields#5. fastfields intentionally diverges to the correct operator.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions