Release v0.3.2: algorithm-verification fixes - #15
Merged
Merged
Conversation
…polish
Two additive correctness-relevant changes surfaced during a paper-fidelity
cross-check of DFProjection.step! against the canonical literature
(Solodov-Svaiter 1999, La Cruz 2006, Ibrahim 2024 STTDFPM, Yin 2021,
Sabi'u 2023, Halpern 1967).
SpectralThreeTerm now clamps the spectral coefficient ϑ_I to
[alpha_min, alpha_max] (defaults [1e-10, 1e30]). The clamp underwrites
the strict-descent bound F(w_k)' d_k ≤ -α_min ‖F(w_k)‖² and the trust-
region bound on ‖d_k‖. In the degenerate case y_{k-1} = 0 the rule now
falls back to alpha_min rather than zero, restoring strict descent.
SolodovSvaiterProjection gains a γ::Float64 = 1.0 keyword argument for
the standard relaxation factor γ ∈ (0, 2). The projection target becomes
w − γ·λ·F(z), and the Dykstra tolerance scales by γ² so the inner solver
stops at constant fractional accuracy of the projection step across γ
values. Default γ = 1 preserves v0.3.1 behavior byte-for-byte;
over-relaxation (γ > 1) matches the published convergence theory's
γ(2−γ) descent coefficient.
Documentation:
- extending.md § 2 gains a "Convergence contract" subsection stating the
descent + boundedness requirements for custom search directions, with
SpectralThreeTerm's clamp/v_k as the worked example.
- extending.md § 3 gains an "Implicit contract for SolodovSvaiterProjection"
subsection documenting the λ_k > 0 requirement.
- SolodovSvaiterProjection docstring notes that the 1999 exact-projection
scheme is realized here as the standard inexact-projection refinement
(Dykstra terminated at ε_k).
- extending.md § 0 renamed to "Preliminaries: contract surface"
(un-numbered); § 1 – § 7 now correspond 1-to-1 to the seven extension
slots.
Tests: 242 → 262 passing (10 new for each source change; default-
equivalence regressions confirm v0.3.1 byte-for-byte behavior outside
the formerly-degenerate code paths).
Findings tracked in notes/task_1_algorithm_verification.md
(P1.1, P1.2, P2.1, P2.2, P3.1; P3.3 dropped after discussion).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15 +/- ##
==========================================
+ Coverage 90.74% 90.81% +0.06%
==========================================
Files 12 12
Lines 670 675 +5
==========================================
+ Hits 608 613 +5
Misses 62 62 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Release v0.3.2 — algorithm-verification fixes
Summary
Two additive correctness-relevant fixes surfaced during a paper-fidelity
cross-check of
DFProjection.step!against the canonical literature(Solodov–Svaiter 1999, La Cruz 2006, Ibrahim 2023 STTDFPM/ISTTDFPM,
Yin 2021, Sabi'u 2023, Halpern 1967; aggregated in
notes/task_1_algorithm_verification.md):SpectralThreeTermgainsalpha_min/alpha_maxkeywordarguments — the spectral coefficient
ϑ_k^Iis now clamped to[alpha_min, alpha_max], restoring the strict-descent boundF(w_k)' d_k ≤ -\alpha_{\min}\|F(w_k)\|^2that's central to theconvergence theory. The previous implementation fell back to
0inthe degenerate
y_{k-1} = 0case, which violated the bound silently.SolodovSvaiterProjectiongains aγkeyword argument (γ ∈ (0, 2), default1.0) — the well-known relaxation factor for thehyperplane-projection family. Default
γ = 1preserves v0.3.1behavior byte-for-byte. The Dykstra tolerance
ε_kis scaled byγ²so the inner solver works to a constant fractional accuracy ofthe projection step across all
γvalues.Companion documentation polish (extension contracts, docstring
lineage,
extending.mdsection renumber).No source-API removals. Default behavior unchanged except the
degenerate-y fallback in
SpectralThreeTerm(which previously gave zerodescent and now gives strict descent). PATCH-classified release;
262/262tests pass.What's new
Source
SpectralThreeTermclamping (src/search_directions.jl):alpha_min::Float64 = 1e-10andalpha_max::Float64 = 1e30.direction!computesϑ_I = clamp(yy_sq > 0 ? sy/yy_sq : alpha_min, alpha_min, alpha_max).-F(w_k)' d_k ≥ α_min ‖F(w_k)‖²and the trust-region bound‖d_k‖ ≤ (α_max + 2/ᾱ_1)‖F(w_k)‖.SolodovSvaiterProjection.γ(src/iterate_updates.jl):Base.@kwdefwithγ::Float64 = 1.0.w − γ·λ·F(z); Dykstra tolerance scaled toε_k = (ζ²/2) γ² λ² ‖F(z)‖².γ(2 − γ), the recommended over-relaxation range (1.6–1.8), and the caveat thatγ ≤ 1cancels inRealSpace(the halfspace projection pulls the target back to the boundary).Tests
test/runtests.jl: 20 new tests.Search direction (SpectralThreeTerm): constructor defaults + overrides foralpha_min/alpha_max, lower-bound clamp activation, upper-bound clamp activation, degeneratey = 0fallback toalpha_min, default-knob bit-equivalence regression.v0.2 iterate update (Section A):γconstructor default + overrides,γ = 1byte-equivalence regression against the existingSolodovSvaiterProjection()default,γ = 1.8over-relaxation converges on the simplef(u) = uproblem,γ = 0.5RealSpacecancellation regression (provesγ = 0.5produces the same iterate sequence asγ = 1.0),γ = 1.6withBoxSetsmoke test.Documentation
docs/src/extending.md:### Convergence contractsubsection at the top, stating the sufficient-descent + bounded-growth conditions for custom directions and showing howSpectralThreeTerm's[α_min, α_max]clamp +v_kdenominator satisfy them.### Implicit contract for SolodovSvaiterProjectionsubsection documenting theλ_k > 0requirement and how all three built-in line searches enforce it via the Armijo separation.Preliminaries: contract surface(un-numbered). The remaining § 1 – § 7 now correspond 1-to-1 to the seven extension slots; § 8 (Convergence caveats) stays numbered as an appendix.src/iterate_updates.jlSolodovSvaiterProjectiondocstring: paragraph added noting the 1999 scheme assumes exact projection, and DFMethods realizes it via the inexact-projection refinement standard in the broader Solodov–Svaiter inexact-projection lineage.CHANGELOG.md[Unreleased]:### Addedand### Changedentries for both source changes.DFMethods.jl/CLAUDE.md: new naming-convention rule under § Coding style (single-character Greek/math letters → Unicode; multi-character or compound → ASCII spelled-out; decorated symbols with single Greek head → Unicode head + ASCII suffix).Test plan
Pkg.test()— 262/262 passing.julia --project=docs docs/make.jl— Documenter renders cleanly with theextending.mdupdates.Notes for AutoMerge
semver.
release.shcorrectly classifies this and does not require--breaking/--notes-file.Project.toml. Existing compat bounds(
CommonSolve = "0.2",LineSearch = "0.1",SciMLBase = "2.53",julia = "1.10") unchanged.keyword arguments with conservative defaults).
SpectralThreeTerm.direction!returnedϑ_I = 0in the degeneratey_{k-1} = 0case, which gives zero descent (F(w_k)' d_k = 0).This release returns
ϑ_I = alpha_min, restoring strict descent.Users hitting the degenerate path will see a tiny iterate change.
Other code paths are byte-identical.