Skip to content

Complete/fix the CUDA mesh signed-distance host launcher (sdt) #5

Description

@balbasty

Confirmed by the fable review; substantial and GPU-unverifiable, so tracked rather than fixed in the correctness pass.

fastfields-cuda-impl/distance_mesh.h: distance_mesh::dt correctly throws "not implemented" today, but the sdt launcher above it (intended to be the complete one) is internally inconsistent and would not work if wired up:

  • the kernel call (~line 591-613) omits the _treetrace/treesize args of sdt_kernel (21-param signature invoked with 19 args) and passes host pointer tree_host instead of the copied tree_device;
  • lines ~528/532/533/543 re-declare faces_device/faces_host/verts_host/tree_host, shadowing the outer cleanup variables (leaks; outer frees see nullptr);
  • line ~527 initializes offset_t stride_mat[2] with 3 values;
  • sdt_kernel (~line 282) uses runtime nbatch as a template argument (index2offset);
  • GET_BLOCKS(nbatch) (~line 592) sizes the grid from the batch rank, not the element count.

None is caught because the templates are never instantiated (the honest throw keeps the build green). Needs a careful pass plus real-hardware validation against the naive mesh SDT. Until then the throw stub is correct behaviour.

Workstream: claude-jitfields-to-fastfields

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions