ILE: derive the psi and phi_orb priors from their sampling ranges (evidence change: -ln 2) - #306
Merged
Conversation
The conventional ILE drivers sample psi on (0, 2 pi), so that --internal-rotate-phase can use (phi+psi, phi-psi) coordinates, but passed the fixed constant mcsampler.uniform_samp_psi = 1/pi, written for [0, pi), as the psi prior. A prior defined independently of the range it is integrated over has no reason to be normalized: this one had mass 2, and mass 4 under --internal-rotate-phase (range (0, 4 pi)), where phi_orb's fixed 1/(2 pi) prior doubled as well. Every reported lnZ carried +ln 2 (+ln 8 rotated). Measured with --zero-likelihood on the base driver: 0.684 +/- 0.013 and 2.090 +/- 0.013. Found by the 2026-09-08 marginalization audit (paper repo, MATRIX X4) through the --psi-marginalization review, whose normalized marginal came out ln 2 below the sampled path. Fix: capture psi_prior_range and phi_orb_prior_range once the sampling ranges are final (after the rotate-phase widening, before any --limit-* box), and build both priors with ret_uniform_samp_vector_alt over those ranges, in the batchmode, LISA and legacy drivers. The likelihood is periodic in both angles and each range covers whole periods, so lnZ is now that of a prior normalized on one period. Under --limit-psi the density stays 1/(full range), the convention the sky and inclination boxes use. --limit-psi now switches --internal-rotate-phase off with a message: the box is on physical psi and the rotated coordinates cannot honour it. --psi-marginalization keeps its ln(mass) guard, now read from the driver's own prior object; at mass 1 it adds 0. EVIDENCE CHANGE. Every ILE lnZ drops by ln 2 (ln 8 with --internal-rotate-phase). Posteriors are unchanged. Old all.net or composite tables cannot be mixed with new ones without adding the offset, and old CIP fits reused with new ILE rows inherit it. The JAX driver already used a normalized psi prior on [0, pi]; the two drivers now agree. Tests: test_angle_prior_normalization.py (constructor, driver wiring, and a --zero-likelihood subprocess whose lnZ must be ln(total prior mass): 0, 0 rotated, and the box fraction under --limit-psi); the psi-marginalization tests re-pinned to mass 1. Registered in .travis/test-integrate.sh. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
oshaughnessy-junior
deployed
to
private-review-dispatch-rift
September 9, 2026 10:12 — with
GitHub Actions
Active
oshaughnessy-junior
deployed
to
private-review-dispatch-rift
September 14, 2026 21:53 — with
GitHub Actions
Active
oshaughnessy-junior
added a commit
that referenced
this pull request
Sep 14, 2026
Base moved again: the AV selfish-host fallback (#342), the psi/phi_orb prior derivation (#306), and the two chips this work spawned -- backend-agnostic L0 toy integrands (#340) and the demo scripts that were writing PNGs to the repo root (#343). Auto-merged with no conflicts. Verified rather than assumed: both sides survive in all five overlapping files, git diff and git diff -w agree line for line so there is no reindentation damage, every file parses, and the count-pinned core-unit floors still hold (500 collected / 488 passed, plugin-free 497/485, which is what they are set to). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Evidence change: every ILE lnZ drops by ln 2
The conventional ILE drivers sample psi on (0, 2 pi) so that
--internal-rotate-phasecan use (phi+psi, phi-psi) coordinates. The psi prior was the fixed constantuniform_samp_psi = 1/pi, written for [0, pi) and defined independently of that range, so it integrated to 2. Under--internal-rotate-phasethe range is (0, 4 pi) and the fixed phi_orb prior doubled too: mass 8. Measured with--zero-likelihoodon the base driver, lnZ = 0.684 +/- 0.013 (ln 2 = 0.693) and 2.090 +/- 0.013 (ln 8 = 2.079).This PR derives both angle priors from the sampling ranges the driver actually uses, in the batchmode, LISA and legacy drivers. The likelihood is periodic in both angles and every range covers whole periods, so lnZ is now that of a normalized prior. Posteriors are unchanged.
Breaking for table reuse. Old
all.netor composite tables cannot be mixed with new ILE rows: the old rows sit ln 2 high (ln 8 under rotate-phase). Reused CIP fits inherit the same constant.Cross-driver consistency. The JAX driver already used a normalized psi prior on [0, pi], so the two drivers disagreed by ln 2 (audit finding X4). They now agree.
Also:
--limit-psiswitches--internal-rotate-phaseoff with a message, since the box is on physical psi.--psi-marginalizationkeeps its ln(mass) guard, now read from the driver's own prior object, and adds 0.Tests:
test_angle_prior_normalization.py(constructor, wiring in all three drivers, and a--zero-likelihoodsubprocess whose lnZ must be ln(prior mass): 0, 0 rotated, box fraction under--limit-psi), registered in.travis/test-integrate.sh; psi-marginalization tests re-pinned to mass 1. Local: 10/10 new, psi suite green except two pre-existingnp.trapzfailures on numpy 2, LISA ledger and limit gates 80/80, roster census PASS.Companion backport to
rift_O4c: oshaughn#190.🤖 Generated with Claude Code