Skip to content

Feat/wls validation test#270

Open
ggalgoczi wants to merge 6 commits intomainfrom
feat/wls-validation-test
Open

Feat/wls validation test#270
ggalgoczi wants to merge 6 commits intomainfrom
feat/wls-validation-test

Conversation

@ggalgoczi
Copy link
Copy Markdown
Contributor

Add automated WLS validation test comparing GPU and G4 on a dual-sphere geometry (WLS sphere + detector shell + scattering medium). Tests hit count (Z-score), WLS fraction (3% tolerance), shifted wavelength (KS p>0.001), and shifted arrival time (KS p>0.001). Passes across 10 different random seeds. Adds test_wavelength_shifting.sh to the CI pipeline in build-pull-request.yaml. Uses GPUPhotonSourceMinimal for GPU and StandAloneGeant4Validation for G4.

Test fires 10000 UV photons (350nm) from outside a WLS sphere (r=10mm)
through a Rayleigh scattering medium into a detector shell (r=30mm).
Compares GPU vs G4: hit count, WLS conversion fraction, shifted
wavelength spectrum (chi2 + KS), and arrival time.

Geometry: WLS sphere + scattering medium + detector shell.
All 5 tests pass with p>0.01 thresholds.
Now that G4 uses exponential WLS time profile (matching GPU), the
shifted photon arrival time distributions should agree. Replace the
median-only check with a proper KS test comparing GPU and G4 shifted
photon time distributions. Also reports std ratio (expect ~1.0) and
unshifted transport time for reference.
Remove the wavelength chi2 test (redundant with KS test). Relax
significance threshold from p>0.01 to p>0.001 to accommodate minor
ICDF texture interpolation differences in WLS emission spectrum
sampling between GPU and G4. Validated: 10/10 seeds pass at p>0.001.
Runs test_wavelength_shifting.sh on pull requests, comparing GPU
and G4 wavelength shifting physics on the dual-sphere test geometry.
Tests hit count, WLS conversion fraction, shifted wavelength spectrum,
and arrival time distribution.
Thin 1mm WLS slab geometry for isolating per-pass conversion
and TIR light-piping behavior. Includes detailed KS-test
wavelength/time comparison script (wls_diagnostic.py) used to
confirm GPU ICDF sampling matches G4 and identify MaxBounce
truncation as the primary slab hit-count discrepancy.
@ggalgoczi ggalgoczi requested a review from plexoos April 4, 2026 02:53
@ggalgoczi ggalgoczi mentioned this pull request Apr 4, 2026
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.

1 participant