Skip to content

@wp.func_native passes tile parameters by value instead of by reference #1362

Closed

Description

@daedalus5

Description:

When using @wp.func_native with tile parameters, the generated C++ code passes tiles by value rather than by reference. This means native snippets cannot modify shared tiles in-place — any writes to a tile parameter inside a native snippet operate on a copy and are silently discarded.

@wp.func already passes tiles by reference (using C++ template parameters and non-const references), but @wp.func_native's codegen_snippet() does not apply the same treatment. This inconsistency prevents users from writing native tile operations that mutate shared state, such as fused tile primitives that update a shared velocity vector.

Expected behavior: Tile parameters in @wp.func_native should use the same pass-by-reference semantics as @wp.func, allowing native snippets to read and write tile data directly.

Affected code: warp/_src/codegen.py — codegen_snippet() method.

Activity

  1. added this to the 1.13.0 milestone on Apr 13, 2026
  2. self-assigned this
    on Apr 13, 2026
  3. added theissue type on Apr 13, 2026
  4. shi-eric commented on Apr 17, 2026

    @shi-eric
    Contributor

    Addressed by f58c0b0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions