You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use the reference's single-precision density constants #344
The reference writes several density normalizing constants as default-kind (single-precision) Fortran literals promoted to double, for example log(dble(2.506628274)) in the Gaussian branch (amica15.f90:1331-1333), which the generalized Gaussian family also takes when rho reaches exactly 2. The default maxrho=2 clamp makes that common, so it is not confined to non-default settings. pamica's torch, NumPy and MLX backends use the double value of the same decimal literal (_LOG_SQRT_2PI = math.log(2.506628274), and likewise _LOG_NORM_COSH_SUB/_LOG_NORM_COSH_SUP), so their log normalizers differ from the reference's by the float32 rounding of the literal. Found by epic #324 Phase 8 (#334, PR #342) while building a merged-state native oracle. It was confirmed exactly for rho == 2: 3.0e-8 in the log term and 2.8e-9 in the log-likelihood. The pdftype 2, 4 and 1 families should differ by 3.7e-10, 2.0e-8 and -2.1e-8 respectively (computed from the literals, not yet measured against the binary). The comments that claim bit-for-bit agreement for these constants overstate it.
Fix
Adopt the reference's values exactly, i.e. the float32 rounding of each literal promoted to float64 (float(np.float32(2.506628274)) and so on), in all three backends through one shared definition. Pin each constant against the literal's float32 rounding in an always-on test. Add a gated native oracle at rho == 2 (no maxrho=1.99 workaround) that shows the 3.0e-8 term gone. Record the (tiny) change to default trajectories in the changelog, and remove the corresponding differences-guide row once it is fixed.
Activity
Record the single-precision density constants
Phase 8: store components as rows and fix sharing (#342)
Check the pre-#344 constant substitution
Phase 13: use the reference's single-precision constants (#349)
Merge the epic (Phase 13) into Phase 12
Start the pre-344 control from the new init
Phase 12: normalize the drawn initial mixing matrix (#350)
Make the Unreleased changelog one coherent account
Phase 16: audit the documentation against the epic (#353)