Skip to content

DRAFT (record only): algebraic phi start oracle — better starts, identical answer - #273

Draft
oshaughnessy-junior wants to merge 1 commit into
rift_O4dfrom
rift_O4d_joint_phi_start_oracle
Draft

oshaughnessy-junior wants to merge 1 commit into
rift_O4dfrom
rift_O4d_joint_phi_start_oracle

Conversation

@oshaughnessy-junior

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

Copy link
Copy Markdown
Owner

DRAFT — record only. Do not review, fix, or merge.

The wiring was tested and does not pay. Kept as a record of a closed line of work, so
nobody spends the same effort twice. See "Integration result" below.

Integration result (why this is parked)

Wired into #270 and measured. At fixed time and distance #270's exponent
x*A(phi,u) - 0.5*x^2*B(phi,u) - 4log x is a 2-D trig polynomial, so
phi_start_candidates(x*C_A_t - 0.5*x^2*C_B) applies directly; both use the same
w = 1 for k=0, 2 for k>0 convention, so no adapter is needed. Tested on tables from
make_synth -> angle_coefficient_tables, m_max=2 and m_max=4 HM, not random Gaussians.

case 270 lattice: starts / worst miss +273: starts / worst miss delta lnI enum cost
m_max=2 rho~18 8 / 0.686 rad 64 / 0.025 +0.000e+00 0.6 s
m_max=2 rho~90 8 / 0.686 64 / 0.026 +9.1e-13 0.6 s
m_max=2 rho~359 8 / 0.686 64 / 0.026 +0.000e+00 0.7 s
m_max=4 rho~18 13 / 0.184 1618 / 0.015 +5.7e-14 135 s
m_max=4 rho~90 13 / 0.090 1601 / 0.005 +0.000e+00 127 s
m_max=4 rho~359 13 / 0.090 1604 / 0.005 +0.000e+00 135 s

The candidates cover the true phi-maxima 18-27x better and it changes nothing: same
retained mode count, same ok flag, lnI identical to float noise in all six rows.
Newton refinement does the work -- a start 0.69 rad from a peak lands in the same basin
as one 0.025 rad away. #270's coarse lattice is sufficient, and the algebraic set costs
~1000x more at m_max=4 for a bit-identical answer.

Two things the test also settled:

  • certified=False on every physics table at both KP=5 and KP=9. The mode-order decline
    reproduces on real coefficient tables, not only on seeded Gaussians. That closes the
    open caveat below.
  • Prototype U,V/Q-guided multi-peak JAX marginalization #270's real-table regressions cannot run outside the author's host: they skip on
    /tmp/hm51_Ctables_incl0.6.npz and /tmp/rift-paper-av-ladder/..., which are
    node-local. Raised separately.

Limitation, stated so nobody over-reads the result: select_refined_modes retained 1 mode
at m_max=4 and 4 at m_max=2 against 10-32 true phi-maxima. If that filter is the binding
constraint, the test is partly blind to start quality. "Start quality is irrelevant" is
supported for #270 as configured, not in general.

Two harness errors were made and corrected before the table above. The first window,
copied from #270's HM packet, put every start on a distance boundary because make_synth
at default kappa_boost has A^2 - 16B < 0 everywhere -- no interior distance peak.
Both seedings then retained zero modes. Fixed by setting kappa_boost to 20/100/400 and
deriving the window from the actual root distribution.


Why

#267 built an exact outside bound on the algebraically enumerated stationary set. That bound is unsound at production mode order: enumerate_torus_maxima declines from KP=5 up with "fewer than two algebraically complete projections", and an incomplete candidate set makes a supremum bound an under-estimate — the one direction the certificate existed to prevent. #267 is closed.

The set itself is the best thing available for proposing optimizer starts, and a proposal carries no completeness requirement: a missed start costs accuracy that a downstream consistency check can still catch, not soundness. On its decline path the enumerator already returns the union of its definitely-on-torus roots, so the set is non-empty precisely where it cannot certify.

What this adds

phi_start_candidates(C) -> PhiStartSet | None, and nothing else.

  • No kernel wiring, no bound_nodes parameter, no bound_exact_phi, no phi_local_lnI_planned. Those were the certification path and they are not rescued.
  • certified is carried for the caller's ledger and gates nothing in this module.
  • The docstring records the envelope-theorem argument for why these φ are the right ones to propose from: every local max of h(φ) = max_u g is a 2-D stationary point of g, and where the maximizing u switches branches h has an upward kink — a minimum, which cannot carry a supremum.

Measured

seed 7, KS=2; sup_h over the candidates versus over a 32768-point uniform φ grid, at amplitudes 1108 and 283672. Negative means the candidates win.

KP certified n_cand gap (nat) enumerator
3 yes 14 −3.0e−05 / −7.6e−03 0.06–0.15 s
5 no 48 −4.8e−04 / −1.2e−01 0.32–0.33 s
7 no 47/49 −1.5e−03 / −3.8e−01
9 no 59/66 −1.5e−03 / −3.9e−01 8.7–9.6 s

The candidates beat the dense grid at every mode order, certified or not, because they sit on the peak while a uniform grid straddles it; the gap widens with amplitude because the peak sharpens, which is the regime this line of work targets.

Cost does not track amplitude. Both the candidate count and the enumerator wall time are flat across the 256× range and track mode order instead. Contrast the Lipschitz bound grid this descends from, which needed pi * M10 / tol points and grew as rho^2. The KP=9 cost of ~9 s is real and is the thing to watch.

Intended consumer

#270 proposes its four-dimensional starts from a U,V/Q-ranked angular lattice. This is an alternative or supplementary proposal source with a cost that is independent of SNR. Nothing here imports or depends on #270, and #270 does not import this — the wiring, if wanted, is a follow-up and someone should measure whether the algebraic candidates actually improve #270's tier agreement before it lands.

Validation

  • 40 passed in 401s in the focused CPU JAX file (test_joint_anglemarg_peaklocal.py), including the three new tests.
  • EXPECTED_TESTS 461 → 464 in .travis/test-jax.sh, re-measured by collection.

What is not claimed

  • No production dispatch changes. This is an importable diagnostic function.
  • The KP≥5 sets are not complete and are not labelled as such. Building any bound on them would repeat DRAFT: exact phi outside bound — certifies only at m_max=1, not production #267's error.
  • Fixtures are seeded synthetic tables, not angle_coefficient_tables output. The mode-order-dependent decline is reproducible but has not been confirmed on real coefficient tables.

🤖 Generated with Claude Code

…not a certificate

#267 built an exact outside bound on the algebraically enumerated stationary set.  The
bound is unsound at production mode order: `enumerate_torus_maxima` declines from KP=5 up
with "fewer than two algebraically complete projections", and an incomplete candidate set
makes a supremum bound an UNDER-estimate.  #267 is closed.

The set itself is still the best thing available for PROPOSING optimizer starts, and a
proposal needs no completeness proof -- a missed start costs accuracy a downstream
consistency check can catch, not soundness.  On its decline path the enumerator returns
the union of its on-torus roots, so it is non-empty exactly where it cannot certify.

`phi_start_candidates` is that, and nothing else: no kernel wiring, no `bound_nodes`, no
`phi_local_lnI_planned`.  `certified` is carried for the caller's ledger and gates
nothing.

Measured, seed 7 / KS=2, sup_h over the candidates vs over a 32768-point uniform grid
(negative = candidates win), at amplitudes 1108 and 283672:

    KP  certified  n_cand  gap (nat)              enumerator
     3       yes       14  -3.0e-05 / -7.6e-03    0.06 - 0.15 s
     5       no        48  -4.8e-04 / -1.2e-01    0.32 - 0.33 s
     7       no     47/49  -1.5e-03 / -3.8e-01
     9       no     59/66  -1.5e-03 / -3.9e-01    8.7 - 9.6 s

The candidates beat the dense grid at every mode order because they sit ON the peak while
a uniform grid straddles it, and the gap widens with amplitude.  Count and cost are flat
across the 256x amplitude range and track mode order instead; the KP=9 cost of ~9 s is
real and is the thing to watch.

40 passed in the focused CPU JAX file; EXPECTED_TESTS 461 -> 464.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@oshaughnessy-junior
oshaughnessy-junior deployed to private-review-dispatch-rift September 7, 2026 07:24 — with GitHub Actions Active
@oshaughnessy-junior
oshaughnessy-junior marked this pull request as draft September 7, 2026 08:02
@oshaughnessy-junior oshaughnessy-junior changed the title Rescue the algebraic phi set from #267 as a start oracle, not a certificate DRAFT (record only): algebraic phi start oracle — better starts, identical answer Sep 7, 2026
@oshaughnessy-junior
oshaughnessy-junior deployed to private-review-dispatch-rift September 7, 2026 08:02 — with GitHub Actions Active
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