Repository navigation
Preserve thin-layer canopy transmission increments in Float32 - #244
Merged
sunitisanghavi merged 7 commits intoNov 7, 2026
Merged
sunitisanghavi merged 7 commits into
sunitisanghavi merged 7 commits into
Conversation
sunitisanghavi
merged commit Nov 7, 2026
de00372
into
fix/canopy-projection-quadrature
30 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thin canopy elemental layers can lose their diagonal transmission increments in Float32. Repeated doubling then amplifies that rounding into spurious absorption or gain; making the seed thinner can make the result worse. This change retains
Δ = T-Iand the solar attenuation increment fromexpm1throughout canopy doubling, reconstructing transmission only at the end. No phase matrices, fluxes or absorption are rescaled.The canopy wrapper now exposes typed elemental-thickness controls (
CanopyNumericalParameters, including TOML/YAML parsing) and uses a 1e-5 threshold with no precision floor by default. The increment solve uses canopy-local pivoted LU on CPU and the existing fused geometric-series solve on supported GPU sizes, with new fused source/operator updates and the existing large-matrix fallback. Additional non-solar source slots are explicitly rejected: distributed fluorescence needs its own source construction, not the solar attenuation recurrence.This PR is stacked on #243, with base
fix/canopy-projection-quadrature; its diff contains only the precision work. It requires the now-registered CanopyOptics v0.2.2, including the Float32 specular azimuth/grazing fixes. Retarget to main after #243 merges.Validation on Julia 1.12.6:
Pkg.testagainst released CanopyOptics v0.2.2: 25,756 passed, 16 conditional skips; CUDA masked, four Julia threads, one BLAS thread.git diff --checkpassed.Warmed kernel measurements and raw CSVs are in
docs/dev_notes/canopy_increment_doubling.md. Final fused Float32 updates improve the initial increment implementation (8 streams, IQUV, 64 spectral points: 5.54 → 2.58 ms), but Float64 IQUV regresses (8.92 → 10.68 ms). This is a numerical-accuracy fix, not a universal speedup; timings exclude phase construction, seeding, transfers and compilation. Metal and arbitrary dual-number differentiation remain unvalidated, and the change adds no canopy analytic Jacobians.