KineticForces - BUG - nutype="zero" crashes with BoundsError when the resonant integrand is non-finite and no pole was subtracted
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Read src/KineticForces/EnergyIntegration.jl, especially _resonant_integrand and the npole == 0 integration branch. Trace how non-finite values are handled when no poles were found, and clarify the intended physical value for that case before changing the fallback. Then add a regression case using a DIII-D-like equilibrium with nutype = "zero"; verify the run completes while the existing solovev_kinetic_nuzero case still passes.
索引モデルが issue の本文から書いたものです。
説明
Symptom
A DIII-D-like kinetic-calculated run with [KineticForces] nutype = "zero" (collisionless) at nominal rotation dies during kinetic matrix formation:
ERROR: TaskFailedException
nested task error: BoundsError: attempt to access 0-element Vector{ComplexF64} at index [1]
[3] ... src/KineticForces/EnergyIntegration.jl:227 [inlined]
[4] ... src/KineticForces/EnergyIntegration.jl:268
[5] QuadGK evalrule ...
Reproduced on both a plain run and a variant; the same deck with nutype = "harmonic" runs fine, and nutype = "zero" plus toroidal_rotation_factor = 0.2 also runs fine — so it needs the collisionless operator at nominal rotation.
Mechanism
_resonant_integrand (EnergyIntegration.jl:~215-234) has a non-finite-value fallback that substitutes the nearest pole's analytic regular part:
if !isfinite(val)
k = 1
for j in 2:npole
abs(x - real(x_poles[j])) < abs(x - real(x_poles[k])) && (k = j)
end
val = _real_pole_regular_part(real(x_poles[k]), ...) # x_poles[1] on an empty vector
The fallback assumes at least one pole was found. But the caller builds the same closure for the npole == 0 branch (:~268) and integrates it:
integrand = x -> _resonant_integrand(x, p, residues, x_poles, npole, leff, wb, n, wd)
if npole == 0
val, _ = quadgk(integrand, 0.0, X_ENERGY_MAX; ...)
With nutype = "zero" there is no collisional broadening, so Ω can round to exactly 0 at a quadrature node even when no pole was registered in [0, X_ENERGY_MAX] — val becomes non-finite, the fallback runs with npole = 0, and x_poles[1] throws.
Suggested fix
Guard the fallback on npole > 0, and decide what the physical value is when the integrand is non-finite with no subtracted pole (returning 0 for that node, or excluding it, is a modelling choice worth stating in the annotation rather than implying). A regression case exercising nutype = "zero" on a DIII-D-like equilibrium would cover this — the existing solovev_kinetic_nuzero case passes, so Solovev alone does not reach the branch.
Not introduced by the issue #376 kinetic stack: EnergyIntegration.jl has no commits on that branch relative to develop.
- 主要言語
- Julia
- スター
- 11
- フォーク
- 7
- 平均マージ
- 4日 1時間
- マージ済み PR(30日)
- 68
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenFUSIONToolkit/GPEC のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
OpenFUSIONToolkit/GPEC#644 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
OpenFUSIONToolkit/GPEC#643 ·
メンテナーはふだん 3 日以内に返信
-
PerturbedEquilibrium - FEATURE - Complete the resistive perturbed-equilibrium workflow from Galerkin and matched results対応中かも @matt-pharr が 1 日前に担当しました。 オープンfeature
OpenFUSIONToolkit/GPEC#635 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
test
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
OpenFUSIONToolkit/GPEC#633 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
-
Tearing - FEATURE - Add a general modified Rutherford equation for island evolution対応中かも @StuartBenjamin が 1 日前に担当しました。 オープンfeature
OpenFUSIONToolkit/GPEC#630 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
OpenFUSIONToolkit/GPEC の issue をすべて見る
似ている issue
-
`ShallowWaterModel` allocates ~9 KiB per grid point per RK3 stage on the CPU対応中かも @ali-ramadhan が今日担当しました。 オープンperformance 🏍️
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
CliMA/Oceananigans.jl#6421 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
JuliaQUBO/QUBOLib.jl#105 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
NCAR/musica#1118 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`AMSGrad` state starts at `epsilon` instead of zero, so zero gradients move parameters and small gradients are damped対応中かも @parth-patel010 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
FluxML/Optimisers.jl#247 · コメント 1 件 ·
-
README should say that row and column order must match対応中かも @SAUMYARSH が 1 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 84/100