Skip to content

Narrow zeroth-moment guard to the pow(0,0) corner case in parcel debug diagnostics - #500

Draft
pdziekan with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-parcel-test-job
Draft

Narrow zeroth-moment guard to the pow(0,0) corner case in parcel debug diagnostics#500
pdziekan with Copilot wants to merge 3 commits into
masterfrom
copilot/fix-parcel-test-job

Conversation

Copilot AI commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

parcel_test (Debug, none) was failing in unit_test_debug/test_spectrum.py::test_spectrum_diff[dradii_dr_dry] after a recent change in SD moment counting. The regression came from broad xp == 0 handling in the moment counter, which altered behavior beyond the intended pow(0,0) NaN-avoidance fix.

  • Root-cause correction

    • In src/impl/diagnose_SD_attributes/particles_impl_moms.ipp, the fast path is now limited to the exact ambiguous case (xp == 0 && x == 0), instead of all xp == 0.
  • Behavioral impact

    • Preserves the intended protection against pow(0,0) instability.
    • Restores previous numerical path for all nonzero x, avoiding unintended drift in debug spectrum outputs.
  • Code change (minimal and localized)

const real_t n = thrust::get<0>(tpl);
const real_t x = thrust::get<1>(tpl);

if (xp == 0 && x == 0)
  return n;

Copilot AI and others added 2 commits August 24, 2026 13:41
Co-authored-by: pdziekan <10848601+pdziekan@users.noreply.github.com>
Co-authored-by: pdziekan <10848601+pdziekan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job parcel_test (Debug, none) Narrow zeroth-moment guard to the pow(0,0) corner case in parcel debug diagnostics Aug 24, 2026
Copilot AI requested a review from pdziekan August 24, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants