Skip to content

Integrate unresolved ARTS2D resonances into detector bins - #143

Merged
joglekara merged 2 commits into
mainfrom
codex/issue-134-unresolved-resonance
Aug 30, 2026
Merged

Integrate unresolved ARTS2D resonances into detector bins#143
joglekara merged 2 commits into
mainfrom
codex/issue-134-unresolved-resonance

Conversation

@joglekara

@joglekara joglekara commented Aug 30, 2026

Copy link
Copy Markdown
Member

Builds on #142 (merged). Fixes #134.

What changed

  • Exposes reusable ARTS2D numerator and dielectric terms on arbitrary wavelength nodes while caching the EDF sinogram.
  • Finds every sign-changing zero of Re(epsilon) on a fine fixed scan, differentiates roots implicitly, and tan-maps disjoint coarse-panel neighborhoods through the local complex-linearized resonance.
  • Integrates the full collisionless spectrum directly into calibrated detector-bin edges using exact Gaussian-CDF bin probabilities. No collision model or dielectric epsilon floor is introduced.
  • Separates root_scan_panels (4096) from integration_panels (256), raises static root capacity to 16, and returns fatal fixed-shape diagnostics instead of partial results.
  • Applies rectangular iawfilter attenuation to the continuous source spectrum with exact integration breakpoints; iawoff remains a detector-space visualization mask.
  • Replaces index-space spectral/angular blur and peak restoration with physical-coordinate, unit-area bin responses. Nonuniform angular axes use the exact dense operator; uniform fine spectral grids use the identical memory-linear Toeplitz/FFT operator.
  • Preserves calibrated detector edges through data reduction, including ragged final groups, and avoids a second spectral blur/binning pass downstream.

Direct quadrature versus local correction

On the corrected 22-degree Maxwellian benchmark, the unresolved root is at 474.199678891 nm with 3.49399e-4 nm HWHM. The adaptive detector-area reference is 0.6525638697.

Method Detector L1 error Gradient L2 error Warm value Warm value+gradient
Full root-aware quadrature 0.0393-0.0399% 0.0569-0.1035% 3.721 ms 3.805 ms
First-order local correction 0.0138-0.3162% 15.5-210.5% 3.722 ms 2.622 ms

The local method gives no forward speedup and its faster backward pass is numerically wrong, so it is recorded as a rejected benchmark rather than exposed to fitting.

Root-scan and convergence evidence

The representative 449-670 nm spectrum has eight roots, including a pair only 0.096012 nm apart. Across 39 scan phases, 2048 panels missed that pair in six phases; 4096 and 8192 found all eight every time. Warm one-geometry scan timing was 23.5/32.2/55.8 ms, so 4096 is the smallest tested phase-stable default.

For the physical narrow-line regression, 64-to-128 and 64-to-256 integration refinement changed detector values by at most 4.94e-5 and gradients by at most 2.64e-4. Fine-grid phase variation was 2.10e-6 for values and 2.06e-5 for gradients, well below the 1% target.

Validation

  • 186 passed, 5 skipped on both Linux CPU and project GPU for rebased head 6917ec4d: https://github.com/ergodicio/tsadar/actions/runs/33335580949
  • Full-range adversarial-phase regression requires all eight roots and finite nonzero reverse-mode drift gradients.
  • Close multiple roots, close notch breakpoints, nonuniform detector bins, exact area/centroid preservation, constant spectra, JIT/vmap, aperture topology, and no-double-IRF paths are covered.
  • The ARTS1D golden snapshot was refreshed because it encoded the removed index-space shift and peak restoration; independent physical-coordinate IRF tests provide the correctness reference.

@joglekara

Copy link
Copy Markdown
Member Author

Manual validation on current head 3cc7296 is green: both Linux CPU and project GPU jobs completed the full suite (186 passed, 5 skipped). Run: https://github.com/ergodicio/tsadar/actions/runs/33329223046

This was dispatched manually because the workflow only auto-triggers for PRs based on main, while #143 is intentionally stacked on #142. The first dispatch exposed a test-only GPU allocation problem from using reverse-mode Jacobians for one scalar input and hundreds of outputs; the regression now uses forward mode for the full detector Jacobian and independently checks a scalar reverse-mode loss gradient.

@joglekara
joglekara force-pushed the codex/issue-134-unresolved-resonance branch from 3cc7296 to 6917ec4 Compare August 30, 2026 21:07
@joglekara
joglekara changed the base branch from codex/issue-135-arts2d-susceptibility to main August 30, 2026 21:07
@joglekara
joglekara merged commit c5360f7 into main Aug 30, 2026
2 checks passed
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.

ARTS2D: bin-integrate unresolved EPW resonances and make the IRF area-preserving

1 participant