Repository navigation
ginger v0.5.0 — Scale-Aware Convergence & Solve Facade Release
Makes Options.tolerance a relative residual test (fixing non-convergence on large-coefficient polynomials), fuses the Horner P/P′ evaluation, drops leja_order from O(n³) to O(n²), removes the slower thread-pool dispatch from AUTOMATIC, and adds a solve facade with pluggable execution policies. 86 tests pass.
Features
- Solve facade + execution policies: Added
src/ginger/solve.py(SolveMode+solve_*facades,PARALLEL_THRESHOLD/should_parallelize) andsrc/ginger/_policy.py(sequential_run/jacobi_mt_runexecution policies, Strategy). (#e126a57)
Performance
- Scale-aware convergence, fused Horner, O(n²) Leja order:
residual_scale()normalizes the polynomial soOptions.toleranceis a relative test — the old absolute test was unreachable for large-coefficient polynomials (degree 16 burned all 2000 iterations while its roots were accurate to 4.7e-14).horner_eval_pp()evaluates P and P′ in one pass; float cores_delta_step/_suppress_old_step/_horner_quadraticreplaceVector2/Matrix2churn in the Bairstow hot loop;leja_orderis O(n²) (was O(n³), bit-identical output);AUTOMATICno longer dispatches to the GIL-bound thread pool (measured 2–9× slower); round-robin neighbours are precomputed. (#f532f89)
Bug Fixes
- Unused
suppressimport: Removed. (#0f2cb9c)
Testing & Code Quality
- Order-independence tests: Added 4 tests verifying bit-identical Jacobi next state under any processing order, root-set invariance under permuted guesses, machine-epsilon suppression-order drift, and Gauss-Seidel iteration-count order-dependence. (#a6205ae)
- Facade tests: Added
test_solve.py. (#e126a57) - Scaling benchmark: Added
bench/test_scaling.pyguarding niter / converged. (#f532f89)
Code Cleanup
- Refactor: Split the Bairstow steps into even/autocorr variants (dropping the autocorr flag) and deduped the job functions. (#20d545d, #e126a57)
- Removed AI slop: Stripped boilerplate from docstrings and comments; formatted test files and a signature with black. (#dc6e27c, #95fd9df, #503d51c)
- Config: Moved flake8 config into a dedicated
.flake8(fixing the stale PyScaffold project URLs) and stripped the emptyentry_pointssection fromsetup.cfg. (#a9970e1, #fd051a2)
Documentation
- Order-independence analysis: Added the corrected
order-matter.mdreport. (#fc38e01) - AGENTS.md: Added agent guidelines. (#f5b3ca2)
Build & CI
- Updated GitHub Actions: checkout→v4, setup-python→v5, codecov-action→v4; removed the stale
.bakworkflow. (#c43302f, #c9d3b43)
Full commit log (14 commits since 0.4):
f532f89perf: scale-aware convergence, fused Horner, O(n^2) leja_order95fd9dfstyle: apply black formatting to test files20d545drefactor: split bairstow steps to even/autocorr variants, drop autocorr flage126a57refactor: extract execution policies, solve facade, dedup jobsa9970e1chore: move flake8 config to dedicated .flake8 filefc38e01docs: add corrected order-independence analysisa6205aetest: add order-independence unit testsdc6e27ccleanup: remove AI slop from docstrings and commentsf5b3ca2docs: add AGENTS.md agent guidelinesfd051a2cleanup: strip empty entry_points section from setup.cfgc9d3b43ci: remove stale .bak workflow filec43302fci: update GitHub Actions versions503d51cstyle: format function signature in aberth.py0f2cb9cfix: remove unused suppress import