Skip to content

evaluate returns NaN in parallel for interior points the 50-neighbour walk cannot find (18 at np2, 120 at np4) — pre-existing #558

Description

@lmoresi

Surfaced by the #556 adversarial review, confirmed pre-existing (identical counts at the merge base and at the PR head, so #556 neither causes nor fixes it).

On a 3-D simplex box deformed x → x**4, 3000 interior query points: uw.function.evaluate returns 18 NaN at np=2 and 120 NaN at np=4, for points points_in_domain classifies as interior. Serial is clean.

Two contributing mechanisms, both worth their own look:

  1. The RBF fallback rung cannot rescue them. vars = mesh.vars.values() (function/_function.pyx:1273) is a generator over a WeakValueDictionary, exhausted by the dofcount loop at :1280, so the fallback's for var in vars: at :1402 iterates nothing. (Point locator: reject foreign points cheaply, locate once, and containment-check the cell hint (items 1-3 of #551, fixes the #432 class) #556 fixes this line for the serial case it newly exposed; the parallel hole is wider than that one line.)
  2. The 50-neighbour cap loses genuinely interior points. Measured separately during the same review: 6 of 3000 interior points on a graded 3-D mesh are not found at the evaluation tolerance, because the walk gives up at k = min(n_cells, 50). Those are exactly the points that then need the fallback.

Why it matters: a NaN from evaluate propagates silently into whatever consumes it — a projection, a swarm update, a diagnostic — and the parallel-only nature means it appears when a model is scaled up, not during development.

Related: #551 (the locator umbrella; this is a sibling of its items 1 and 5), #556 (fixes the serial exposure of mechanism 1).

Underworld development team with AI support from Claude Code

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