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

Closed

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

Activity

  1. lmoresi commented on Aug 14, 2026

    @lmoresi
    MemberAuthor

    Update: this is fixed by PR #556, not separate-and-pre-existing as filed.

    The dead RBF fallback rung (mechanism 1 here) turned out to be the cause of the parallel NaNs too, not just the serial exposure. With vars = list(mesh.vars.values()) the counts go from 0/18/120 at np1/2/4 to 0/0/0 on the same probe. Keeping this open until #556 merges, then closing against it.

    Mechanism 2 (the 50-neighbour cap losing genuinely interior points — 6 of 3000 on a graded 3-D mesh) is real and remains: with the rung repaired those points now get an RBF value instead of a NaN, which is a much better failure mode but still a fallback rather than a location. That belongs with #551's locator work.

  2. lmoresi commented on Aug 14, 2026

    @lmoresi
    MemberAuthor

    Fixed by PR #556, merged as 3f54218. The dead RBF fallback rung (vars = mesh.vars.values() — a generator over a WeakValueDictionary, exhausted by an earlier dofcount loop) was the cause of the parallel NaNs as well as the serial exposure that surfaced it: the counts go from 0/18/120 at np1/2/4 to 0/0/0 on the same probe.

    Mechanism 2 remains, tracked under #551: the 50-neighbour cap still loses genuinely interior points (6 of 3000 on a graded 3-D mesh). With the rung repaired those points now take an RBF value instead of a NaN — a much better failure mode, but still a fallback rather than a location.

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