Commit f75154b
fix(qudarap): guard null scint dereference on GPU reemission path (#294)
PR #291 correctly made missing scintillation ICDF non-fatal for valid
non-scintillating geometries. This PR addresses a separate case: a
problematic material configuration where `REEMISSIONPROB > 0` is
present, but no emission spectrum is defined.
In the current implementation, the boundary texture still carries a
nonzero reemission probability from `qudarap/qbnd.h:195`, even when no
`QScint`/ICDF is created because `FASTCOMPONENT` and `SLOWCOMPONENT` are
missing. During propagation, a photon can then enter the reemission
branch in `qudarap/qsim.h:804` and attempt to sample a reemission
wavelength via `scint->wavelength()` in `qudarap/qsim.h:812`, which
becomes a null dereference on the GPU.
This PR guards that path by treating reemission-without-`QScint` as bulk
absorption instead of attempting to reemit. It also guards the
scintillation genstep path against a null `scint` pointer.
A reproducer geometry is included in
`tests/geom/opticks_raindrop_reemit_no_scint.gdml`.
In short:
- No scintillation properties at all: valid non-scintillating geometry,
handled by PR #291
- `REEMISSIONPROB > 0` but no emission spectrum: inconsistent
configuration, now guarded to avoid GPU null dereference
---------
Co-authored-by: ggalgoczi <ggalgoczi@users.noreply.github.com>
Co-authored-by: Dmitri Smirnov <dmixsmi@gmail.com>1 parent 2f21fff commit f75154b
3 files changed
Lines changed: 204 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
806 | 812 | | |
807 | 813 | | |
808 | 814 | | |
| |||
2546 | 2552 | | |
2547 | 2553 | | |
2548 | 2554 | | |
2549 | | - | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
2550 | 2558 | | |
2551 | 2559 | | |
2552 | 2560 | | |
| |||
0 commit comments