prompt: regularization JAX gradient gaps — leg 2 re-derived and shipped - #169
Merged
Conversation
The leg 2 remedies were written before PyAutoArray#391 landed and had gone stale in three ways. Re-checked against source rather than assumed: - `log det H` implicit: ALREADY SHIPPED on all four kernel schemes behind `log_det_method == "slogdet"`. Nothing owed. - jitter as a kwarg: ALREADY SHIPPED. Only the scaling is missing — split out as leg 2b, its own task, since it moves a numerical default. - "keep H implicit" in general: NOT ACHIEVABLE. `curvature_reg_matrix` is a dense `F + H` feeding the dense solve, so H is still formed there. Recorded so it is not re-opened without an iterative-solver design. Leg 2a (`s^T H s` via one Cholesky solve) was the one genuinely open piece and is now shipped on `claude/automind-task-planning-gm4flt` in PyAutoArray, behind a new opt-in `Settings.regularization_term_method`. Measured 5.99e-08 -> 2.93e-16 relative error at cond(C) = 3.2e9, confirming this prompt's noise-floor measurement was the explicit inverse. Difficulty medium -> small: only leg 2b remains. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KazMzMZYPLfaZoYQ79YQ8Q
Investigation found the prompt's "cheaper interim" framing understated the problem. The fixed absolute 1e-8 jitter assumes diag(C) ~ 1, true for the three unweighted kernels but not MaternAdaptKernel, whose C_ii = w_i^2 spans the adaptive-weight range. At inner=0.1/outer=100 the jitter is 100% of the faintest pixel's variance — and those coefficients are free model parameters, so a sampler can reach that regime mid-fit, silently. Fixed by an opt-in correlation-relative jitter. Records the rejected N*eps*max(diag) rule, which fixed distortion but pushed cond(C) to 3.2e15. Both legs of this prompt are now shipped; it is ready to advance to complete/ once the PyAutoArray branch merges. The JAX leg of the gate remains owed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KazMzMZYPLfaZoYQ79YQ8Q
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.
Mind bookkeeping for PyAutoLabs/PyAutoArray#437.
Why this touches the prompt at all
The prompt's leg 2 was written before PyAutoArray#391 landed and had gone stale in three ways. Re-checked against source (
efaf3041) rather than assumed:log det Himplicit — already shipped. Present on all four kernel schemes behindlog_det_method == "slogdet". Nothing was owed.Himplicit" in general — not achievable.curvature_reg_matrixis a denseF + Hfeeding the dense solve for the reconstruction, soHis still formed there. Only the evidence terms can avoid the explicit inverse. Recorded so it isn't re-opened without an iterative-solver design first.Starting dev on the prompt as written would have burned a session rediscovering all three.
What shipped
Both remaining legs, in PyAutoArray#437:
s^T H sfrom one Cholesky solve. Measured 5.99e-08 → 2.93e-16 relative error atcond(C) = 3.2e9, confirming this prompt's own ~1e-6..4e-5 noise-floor measurement was the explicit inverse.inner=0.1/outer=100the fixed absolute jitter is 100% of the faintest pixel's variance, and those are free model parameters, so a sampler can reach that regime mid-fit.The record also keeps one rejected design (
jitter = N*eps*max(diag), which pushedcond(C)to 3.2e15) so it isn't retried.Sizing note
Difficulty: medium→small. The Feature Agent scored this prompttoo-largeand proposed a four-phase split, but that was an artefact of prompt length — the file is long because legs 1 and 3 carry their completion records inline. The actual open work was one leg in one library repo.lifecycle.py checkOK. This prompt now has no open work and is ready to advance tocomplete/once #437 merges.Generated by Claude Code