Skip to content

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

Open
oshaughnessy-junior wants to merge 1 commit into
oshaughn:rift_O4cfrom
oshaughnessy-junior:claude/psi-prior-from-limits-o4c
Open

oshaughnessy-junior wants to merge 1 commit into
oshaughn:rift_O4cfrom
oshaughnessy-junior:claude/psi-prior-from-limits-o4c

Conversation

@oshaughnessy-junior

Copy link
Copy Markdown

Evidence change: every ILE lnZ drops by ln 2

The 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 this driver, lnZ = 0.702 +/- 0.009 (ln 2 = 0.693) and 2.094 +/- 0.009 (ln 8 = 2.079); after the change 0.003 and 0.008 (time-marginalized run on a synthetic zero-signal frame, default sampler).

This PR derives both angle priors from the sampling ranges the driver actually uses, in the batchmode 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.

Backport of the same change on rift_O4d (oshaughnessy-junior#306), where the JAX driver already used a normalized psi prior and the two drivers now agree. Tests: test_angle_prior_normalization.py (constructor and driver wiring), 5/5 locally.

🤖 Generated with Claude Code

The 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).

Fix: capture psi_prior_range and phi_orb_prior_range once the sampling
ranges are final and build both priors with ret_uniform_samp_vector_alt
over those ranges, in the batchmode 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.

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.

Backport of the rift_O4d change; test_angle_prior_normalization.py carries
the constructor and driver-wiring checks.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@oshaughnessy-junior
oshaughnessy-junior deployed to private-review-dispatch-rift-upstream September 9, 2026 10:12 — with GitHub Actions Active
mebiri pushed a commit to mebiri/research-projects-RIT that referenced this pull request Sep 15, 2026
…nterp-cubic-and-grid-fix

Two shipped scripts that cannot do what they document (--interp cubic unreachable; util_ManualOverlapGrid --inj broken)
mebiri pushed a commit to mebiri/research-projects-RIT that referenced this pull request Sep 15, 2026
Only conflict: .travis/test-jax.sh EXPECTED_TESTS.  Neither side's number was
right for the MERGED manifest -- 61 counted this branch's file list, 30 counted
rift_O4d's, which lacks test_jax_fairdraw_export.py but adds
test_interp_choices.py from oshaughn#190.  Resolved to 64 by RUNNING collection on the
merged FILES list, not by arithmetic on the two sides.

rift_O4d added test_interp_choices.py to FILES without an entry in the
per-file count ledger above EXPECTED_TESTS; added (3), so that block remains a
complete accounting rather than a partial one that happens to sum short.

Checked that the auto-merge of bin/integrate_likelihood_extrinsic_jax kept both
sides rather than trusting it: this branch's 2-arg fairdraw_size, both
length-mismatch guards and the corrected --n-fairdraw-extrinsic-samples help
text are present, and oshaughn#190's `--interp cubic` choice is present.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mebiri pushed a commit to mebiri/research-projects-RIT that referenced this pull request Sep 15, 2026
…interp cubic)

oshaughn#180 has landed, so this PR now targets rift_O4d directly rather than stacking.

Three conflicts:

  * --interp cubic.  oshaughn#190 shipped the same fix independently, with a help string
    explaining that linear undershoots the rholm peak and biases the recovered
    arrival time.  Took THEIRS wholesale -- it is a strict superset of the bare
    `choices` widening this branch carried -- and dropped mine.
  * The gate's per-file ledger.  Both entries are needed (this branch's chooser
    file, oshaughn#190's test_interp_choices.py); kept both.
  * EXPECTED_TESTS.  Resolved to 95 by RUNNING collection on the merged FILES
    list.  64 (rift_O4d) + 31 (chooser) = 95 confirms nothing else shifted.

TWO STALE CLAIMS OF MY OWN, found by reading what landed rather than only the
conflict hunks:

  * The gate ledger entry for test_jax_tempering_chooser.py still said the
    chooser is "actually assigned to opts.adapt_weight_exponent" -- the contract
    REMOVED in cf02b9d when that write turned out to make event 1 of a batch
    read event 0's choice.  Corrected to the return-value contract.
  * The --smc-puffball branch comment said smc_puffball_sample "returns
    post_weight uniform with temper=1.0".  oshaughn#180 changed that: it now reports the
    inv_T its ladder actually reached and a matching L^(1-inv_T) weight, and its
    export weights are uniform only because analyze_one REFUSES the event unless
    the ladder finishes at inv_T=1.  Skipping the guard is still correct -- the
    signature still swallows `temper` in **_ignore, so the exponent is genuinely
    inert -- but the comment now says why, and warns against re-deriving "its
    weights are always uniform" from that branch.

Checked the driver's automerge kept both sides rather than trusting it: oshaughn#180's
2-arg fairdraw_size and both length-mismatch guards are present alongside this
branch's resolve_tempering_exponent, the resolved_beta wiring at both sampler
call sites, and a single _USABLE_EXPORT_ESS shared with fairdraw_indices.

65 tests pass across the two interacting files (31 chooser + 34 export).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mebiri pushed a commit to mebiri/research-projects-RIT that referenced this pull request Sep 15, 2026
Caught reading PR oshaughn#186's own diff after the rift_O4d merge.  I wrote "79" when
79 was current; merging oshaughn#180 (64) plus this branch's chooser took the floor to
95 and left my own note stale -- the same failure the note itself documents,
one revision later.

Also records where the count came from (27 -> 48 -> 64 via oshaughn#180 -> 95 here,
with oshaughn#190's test_interp_choices.py along the way) and re-measures the wall time
on the host it was actually run on (859 s, ldas-pcdev11, 16 cores), so the
60-minute timeout is justified against a current number rather than a stale one.

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