Skip to content

MATH-1424: Preserve converged real Schur boundaries - #332

Merged
asf-gitbox-commits merged 1 commit into
apache:masterfrom
skyon0522-ai:codex/math-1424-schur-boundaries
Oct 19, 2026
Merged

asf-gitbox-commits merged 1 commit into
apache:masterfrom
skyon0522-ai:codex/math-1424-schur-boundaries

Conversation

@skyon0522-ai

Copy link
Copy Markdown
Contributor

The finite 2-by-2 matrix in MATH-1424 has two real eigenvalues, approximately 9,900,980.4766 and 20,099,019.5234. On current master, the unscaled input instead returns a complex pair with real parts 15,000,000 and imaginary parts approximately +/-5,099,019.5234; scaling the same input by 2^-20 works.

Schur convergence already identifies real pairs and negligible split boundaries, but their subdiagonal entries can retain rounding residuals. Eigenvalue extraction then interprets a residual above its absolute threshold as a complex block. Make those existing convergence decisions explicit by clearing accepted splits and the subdiagonal after a real-pair rotation. No convergence threshold, public API or dependency changes.

The regressions cover the analytic two-root result at both scales, a genuine 2 +/- i block beside 1e13, accepted split and one-root boundaries, and normalized Schur reconstruction and orthogonality residuals. All three new methods fail against the original Schur implementation; the mixed-scale complex control runs before the split assertion fails.

Validation on Linux, Temurin JDK 17.0.20.1+1 and Maven 3.9.11:

  • The original EigenDecomposition test class reports 30 tests, 0 failures/errors and 2 existing skips.
  • The fixed EigenDecomposition/Schur/Hessenberg classes report 50 tests, 0 failures/errors and 2 existing skips.
  • Root clean verify with command-local JAVA_TOOL_OPTIONS=-Xmx6g: all 14 modules succeeded, exit 0. Retained reports contain 3,787 tests, 33 skips and zero final failures/errors. The existing retry policy recovered 41 cases after 79 failed attempts; this was not a first-pass-clean run.

The default-heap root run stopped at the existing FP64FieldDenseMatrixTest.testVeryLargeAllocation with heap exhaustion. The same allocation test also failed on pristine master at the default heap, then passed with the command-local 6 GiB setting before the fixed root run. Product code, POMs, JaCoCo and native retry settings were unchanged. I have not isolated the causes of the recovered flaky cases. The original-master comparison covered that allocation test, not a complete root build.

An isolated probe also reproduces the reported input failure in unmodified Commons Math 3.6.1. This patch and its regression tests target Math 4 master; it is not a tested Math 3 backport. Windows, macOS and new upstream GitHub CI have not been run for this patch.

AI assistance: OpenAI Codex assisted with source analysis, the implementation, regression tests and drafting.

Clear subdiagonals after accepted relative splits and real-pair rotations.
Keep the existing convergence decisions and genuine complex blocks, with
analytic, scaled and reconstruction regressions.

Generated-by: OpenAI Codex
@skyon0522-ai

Copy link
Copy Markdown
Contributor Author

Using Temurin 17.0.20.1+1 and a direct JUnit4 Request.method launcher with no retries, CMAESOptimizerTest.testDiagonalRosen also fails on the PR's CI base commit 3d15331bf8b73ecb3f209fb165ad47d41dd13ef7 (expected 0, tolerance 1e-10, actual 1.416773781598585e-10). It fails on the tested PR merge 13b75826ecff8e0ded33baf51e2105da530a0a1c as well (4.08456980926037e-10); testMaximize passes once on each revision.

The test calls RandomSource.MT_64.create() without a fixed seed, so these are independent samples, not a deterministic same-seed comparison. Source inspection shows CMA-ES symmetrizes its covariance matrix before EigenDecomposition, selecting the symmetric/tridiagonal path; this check does not validate the modified SchurTransformer path. This check does not explain the other CI failures; I have not changed the patch or rerun CI.

@asf-gitbox-commits
asf-gitbox-commits merged commit 95cda75 into apache:master Oct 19, 2026
2 of 12 checks passed
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.

2 participants