Skip to content

IBM: harden device-side patch_ib lookups against non-positive ids (silent on NVHPC GPU) #2396

Open

Description

@sbryngelson

Observation

Most unguarded patch_ib(id) reads in device kernels trace to ghost_points(:)%ib_patch_id, set in s_find_ghost_points and s_find_ghost_points_ordered from s_get_neighborhood_idx, which returns -1 when the marker's body is not in the rank's list. Sites include m_ibm.fpp (about 699, 1441-1457, 1568, 2011, 2348, 3949, 4284) and m_compute_levelset.fpp (about 41, 63). The collision code, momentum-set and face-flux sites are guarded. On an A100 (NVHPC 25.5), the IBM label with an aborting variant (clamp the id to 1 and abort after the loop on a flag) saw no non-positive id in 115 tests, so this is hardening, not a known bug; an undefined read would be silent on NVHPC GPU (cf. the conditionally-assigned private scalar fixed in #2330 and documented in the Silent-Failure Traps).

Proposal

A small guard or abort at the two setters (+20/-6 lines); parked until an id <= 0 is ever observed.

AI-assisted (Claude Code).

Activity

  1. sbryngelson commented on Nov 22, 2026

    @sbryngelson
    MemberAuthor

    Related pull requests: #2330 (conditionally assigned private scalar, merged), #2329 (wall column, merged).

    AI-assisted (Claude Code).

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions