Skip to content

sym_addmatvec_/sym_submatvec_ do not mutate the caller in place (C3) #3

Description

@balbasty

Tracked centrally in fastfields/fastfields-lib#17 (item C3).

The trailing-_ variants sym_addmatvec_ / sym_submatvec_ advertise in-place accumulation (out0 += H @ vec), but the implementation materialises a private contiguous copy (out = np.array(out_b, ...)), writes the binding's result into that copy, and returns it — leaving the caller's accumulator untouched.

This silently drops the update and diverges from the cupy backend (fastfields-cupy/.../_sym.py), whose _ variants truly write through the caller's buffer.

Fix: operate in place on the caller's out0 (write through its DLPack buffer), matching the _ contract and the cupy backend.

Fixed in PR referencing this issue.

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