Replace trueimpes' hard-coded pressure_scale with row equilibration - #7285
Draft
hnil wants to merge 1 commit into
Draft
Replace trueimpes' hard-coded pressure_scale with row equilibration#7285hnil wants to merge 1 commit into
hnil wants to merge 1 commit into
Conversation
hnil
marked this pull request as draft
August 7, 2026 15:35
hnil
force-pushed
the
pr/trueimpes-row-equilibration
branch
from
August 11, 2026 08:23
f0659b6 to
4459366
Compare
The 50e5 factor on the pressure row of block_transpose was a no-op in exact arithmetic: the rhs of the local solve is a unit vector, so scaling row p by s yields w = B^-T e_p / s, and the subsequent abs_max normalisation divides the factor straight back out. Its only effect was to condition the small dense solve, since the pressure row of a storage derivative is tiny relative to the others. Equilibrate all rows to unit max magnitude instead, with power-of-two factors so the scaling introduces no rounding. Same cancellation argument, no magic constant, and every row is conditioned rather than just the pressure one. Verified behaviour-neutral on SPE1CASE1 (trueimpes 383/322/445 -> 376/317/440; default cprw 443 -> 437 - pivoting noise). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hnil
force-pushed
the
pr/trueimpes-row-equilibration
branch
from
August 11, 2026 12:06
4459366 to
7b958f9
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.
The 50e5 factor on the pressure row of the local trueimpes solve is a no-op in exact arithmetic: the rhs is a unit vector, so any row scaling cancels in the abs_max normalisation. Replace it with a power-of-two equilibration of all rows, which conditions the small dense solve without a magic constant.
Shows the effect (weights unchanged, so iteration counts move only at pivoting-noise level):
SPE1CASE1 cprw 443 -> 437 and SPE9_CP unchanged at 439; the trueimpes CPR path via an explicit JSON gives 383/322/445 -> 376/317/440.
🤖 Generated with Claude Code