Skip to content

ILE: derive the psi and phi_orb priors from their sampling ranges (evidence change: -ln 2) - #306

Merged
oshaughnessy-junior merged 1 commit into
rift_O4dfrom
claude/psi-prior-from-limits-o4d
Sep 14, 2026
Merged

oshaughnessy-junior merged 1 commit into
rift_O4dfrom
claude/psi-prior-from-limits-o4d

Conversation

@oshaughnessy-junior

@oshaughnessy-junior oshaughnessy-junior commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Evidence change: every ILE lnZ drops by ln 2

The conventional ILE drivers sample psi on (0, 2 pi) so that --internal-rotate-phase can use (phi+psi, phi-psi) coordinates. The psi prior was the fixed constant uniform_samp_psi = 1/pi, written for [0, pi) and defined independently of that range, so it integrated to 2. Under --internal-rotate-phase the range is (0, 4 pi) and the fixed phi_orb prior doubled too: mass 8. Measured with --zero-likelihood on 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.net or 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-psi switches --internal-rotate-phase off with a message, since the box is on physical psi. --psi-marginalization keeps 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-likelihood subprocess 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-existing np.trapz failures on numpy 2, LISA ledger and limit gates 80/80, roster census PASS.

Companion backport to rift_O4c: oshaughn#190.

🤖 Generated with Claude Code

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>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent automated review completed at the recorded exact commit. Detailed findings were withheld from public output by the private-context egress policy and require private human declassification.

@oshaughnessy-junior
oshaughnessy-junior merged commit 76a8a31 into rift_O4d Sep 14, 2026
33 checks passed
@oshaughnessy-junior
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>
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