feat(format): lbfgs-kernel-v1 6-gate PARTIAL discharge#1400
Open
noahgift wants to merge 1 commit into
Open
Conversation
Binds FALSIFY-LB-001..006 from lbfgs-kernel-v1 at PARTIAL_ALGORITHM_LEVEL
via 6 verdict functions plus a reference dot-product helper.
- LB-001: g^T * direction < 0 strictly (descent direction)
- LB-002: y^T * s > 0 for every accepted (s, y) pair
- LB-003: history length ≤ m (eviction works)
- LB-004: f(x_{k+1}) < f(x_k) (objective strictly decreases)
- LB-005: SIMD vs scalar within 8 ULP
- LB-006: empty history → direction == -g (steepest descent)
## Five Whys
1. Why does lbfgs-kernel-v1 list 6 falsification IDs without
algorithm-level discharge? PMAT lints flagged FALSIFY-LB-001..006
as unbound at PARTIAL_ALGORITHM_LEVEL.
2. Why does that block ship? Coverage % cannot move while peripheral
second-order optimization invariants are unbound.
3. Why bit-exact (`to_bits()`) for LB-006 (empty history → -g)?
The contract specifies "direction = -g" — pure negation, not a
computation. Float-tolerant compare would let "almost -g" slip
past, masking the regression class "initial scaling applied a
factor of 1.0001 instead of 1.0."
4. Why 8 ULP budget for LB-005 (vs e.g. 4)? L-BFGS two-loop
recursion accumulates over `m=5..20` (s, y) pair dot products.
Each dot product over a 1000-dim parameter vector adds ~1000
floats; the round-off accumulates to ~7 ULPs in the worst case.
8 ULP gives 1 ULP of slack while still catching real divergence.
5. Why fail-on-zero-grad for LB-001 (vs vacuous Pass)? A
zero-gradient input means we're at the optimum — the gate
doesn't apply, but returning Fail forces the call site to gate
on `||g|| > eps` first. Vacuous Pass would let "we forgot to
check the convergence condition" pollute coverage with
dead-code paths.
Adds 24 unit tests including a 4-bucket history-bound sweep and a
strict-vs-equal objective-decrease check. Realistic-healthy walks
the canonical L-BFGS step on a quadratic; pre-fix walks 6
simultaneous regressions across the entire kernel surface.
No runtime % shift; algorithm-level coverage advances by 6 gates.
7ddf16a to
6f5d8b1
Compare
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.
Summary
lbfgs-kernel-v1atPARTIAL_ALGORITHM_LEVELvia 6 verdict functions + reference dot-product.Gates bound
g^T * direction < 0(descent) for non-zero gradienty^T * s > 0for every accepted (s, y) pair≤ mf(x_{k+1}) < f(x_k)strictlydirection == -g(bit-exact steepest)Five Whys
See commit message — captures bit-exact for LB-006, 8 ULP rationale for LB-005, and fail-on-zero-grad for LB-001.
Test plan
cargo test -p aprender-core --lib lb_001_006— 24 passed🤖 Generated with Claude Code