Repository navigation
Recover missing polynomial factors in 32-bit elimination - #591
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Compute rational polynomial GCDs via factorization and exact division on 32-bit builds. Use the same GCD for determinant simplification and factor specialization without changing the factor units. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Codex <noreply@openai.com> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-sol Agent-Job: 590-codex Agent-Session: local session 01a20360-b318-75d2-8e8f-b2ee468f42f6 (no session URL)
This branch has not been deployed
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.
This PR should be ignored until reviewed by @ChrisRackauckas.
On 32-bit Julia, FLINT returned only the monomial part of a rational polynomial GCD. The missing factors inflated the forced SIRS projection and caused 32-bit Core CI to reach its two-hour limit. The 32-bit elimination path now finds common factors through factorization and exact division in both matrix simplification and factor specialization.
Part of #590
Verification
On i686 Julia 1.13.4 with Nemo 0.56.2 and FLINT_jll 301.600.1+0, I ran
GROUP=Core julia --startup-file=no --check-bounds=yes -e 'using SafeTestsets; include("test/det_minor_expansion.jl")'in the resolved test environment. The same test file ran against master first, then against the patch. The two polynomials have coprime cofactors by construction.Master:
Patch, with
include("test/diffreduction.jl")appended to the same command:I ran the existing forced SIRS case on i686 with standard simplification and full saturation in a standalone diagnostic. The original Core run logged dimensions
[3794, 3]. The patched diagnostic logged[830, 3]and passed the exact comparison against the expected generators.I ran
GROUP=QA julia --startup-file=no --project=. -e 'using Pkg; Pkg.test()'on x86-64 Julia 1.13.3:I ran
GROUP=Core julia --startup-file=no --project=. -e 'using Pkg; Pkg.test()'on x86-64 Julia 1.13.3:Runic 1.13.0 in check mode over tracked Julia files,
typos src/elimination.jl src/util.jl test/bodies/det_minor_expansion.jl, andgit diff --checkexited zero.Remaining verification
I ran the full 32-bit Core group with the CI flags on i686 Julia 1.13.4:
GROUP=Core julia --startup-file=no --project=. -e 'import Pkg; Pkg.test(; julia_args=["--check-bounds=yes", "--compiled-modules=yes", "--depwarn=yes"], allow_reresolve=true, coverage=true, force_latest_compatible_version=false)'The patched run passed the forced SIRS case and reached SLIQR, where ParamPunPam 0.5.12 continued sampling after warning about its field size. I stopped the run after more than 1.1 million points. I also ran the unchanged SLIQR test case on master in isolation and saw the same warning and more than 140,000 points. Both runs reported:
I reproduced the limit in an environment containing Nemo 0.56.2 and ParamPunPam 0.5.12 with the following test. I ran it with
julia --startup-file=no --project=. reproduce.jlon each architecture. The i686 run printed the warning and passed 2.3 million points before I stopped it. The x86-64 run exited zero.The draft's 32-bit Core job confirmed the local diagnosis. The forced SIRS combinations all reached
[830, 3]. SLIQR then reported the same warning and exhausted memory in ParamPunPam'sinterpolate_exponents!while growing its coefficient array:The remaining 32-bit Core cases depend on clearing this blocker. I did not run the prerelease, downgrade, documentation, or full ModelingToolkit extension jobs locally. ParamPunPam and RationalFunctionFields owner · Larger-prime support proposal
The preceding master run also recorded a native crash through
__gmpz_mul_si→fmpq_mpoly_add→monomial_compress. A local i686 diagnostic on the base code independently crashed in_fmpz_clear_mpzwhen Julia ran a Nemo finalizer during FLINT reallocation. The allocator fault is in the native dependency path. The GCD workaround does not change that allocation path. Preceding master x86 crash · FLINT · Nemo.jlAn isolated experiment restricted interpolation to variables present in the input functions. It passed all six SLIQR combinations. I stopped the full experimental run after one hour while it was still factoring a later model inside Nemo. The experiment remains in the investigation only.
The main review tradeoff is the cost of fully factoring the shorter polynomial on 32-bit inputs with large cofactors. The draft's Tests workflow has finished, and the separate performance benchmark is still running.
Links
Risk assessment
🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.2-sol
Conversation: local session 01a20360-b318-75d2-8e8f-b2ee468f42f6 (no session URL)