Skip to content

ginger v0.5.0 — Scale-Aware Convergence & Solve Facade Release

Latest

Choose a tag to compare

@luk036 luk036 released this 09 Oct 05:27
· 1 commit to main since this release

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) and src/ginger/_policy.py (sequential_run / jacobi_mt_run execution policies, Strategy). (#e126a57)

Performance

  • Scale-aware convergence, fused Horner, O(n²) Leja order: residual_scale() normalizes the polynomial so Options.tolerance is 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_quadratic replace Vector2/Matrix2 churn in the Bairstow hot loop; leja_order is O(n²) (was O(n³), bit-identical output); AUTOMATIC no longer dispatches to the GIL-bound thread pool (measured 2–9× slower); round-robin neighbours are precomputed. (#f532f89)

Bug Fixes

  • Unused suppress import: 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.py guarding 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 empty entry_points section from setup.cfg. (#a9970e1, #fd051a2)

Documentation

  • Order-independence analysis: Added the corrected order-matter.md report. (#fc38e01)
  • AGENTS.md: Added agent guidelines. (#f5b3ca2)

Build & CI

  • Updated GitHub Actions: checkout→v4, setup-python→v5, codecov-action→v4; removed the stale .bak workflow. (#c43302f, #c9d3b43)

Full commit log (14 commits since 0.4):

  1. f532f89 perf: scale-aware convergence, fused Horner, O(n^2) leja_order
  2. 95fd9df style: apply black formatting to test files
  3. 20d545d refactor: split bairstow steps to even/autocorr variants, drop autocorr flag
  4. e126a57 refactor: extract execution policies, solve facade, dedup jobs
  5. a9970e1 chore: move flake8 config to dedicated .flake8 file
  6. fc38e01 docs: add corrected order-independence analysis
  7. a6205ae test: add order-independence unit tests
  8. dc6e27c cleanup: remove AI slop from docstrings and comments
  9. f5b3ca2 docs: add AGENTS.md agent guidelines
  10. fd051a2 cleanup: strip empty entry_points section from setup.cfg
  11. c9d3b43 ci: remove stale .bak workflow file
  12. c43302f ci: update GitHub Actions versions
  13. 503d51c style: format function signature in aberth.py
  14. 0f2cb9c fix: remove unused suppress import