Repository navigation
test: enable the value check on the symmetric weak Hessian - #21
Merged
Merged
Conversation
Upstream's test_hessian_02_sym_weak_matrix builds a manual expectation and
then comments out the assertion against it ("NOTE: Disabling strict value
check"), leaving hessian_02_sym_weak as the one weak-operator builder whose
values nothing verifies on either side of the port.
The builder is right and the expectation is wrong: the symmetric basis element
for j1 != j2 is dx_j1 (x) dx_j2 + dx_j2 (x) dx_j1, so pairing the symmetric
Hessian against it picks up both entries, which is the x2 the builder applies
and upstream's manual assembly omits. gamma_02_sym carries the matching
weighting, so the two conventions agree.
Enable the check with the factor restored, and pin the convention itself with
a second, port-added test that routes through the full (0,2) basis, where no
symmetric-basis choice enters: expanding the strong symmetric coefficients and
pairing them with the full Gram reproduces hessian_02_weak. Both pass at
d = 1..4. Catalogued as upstream bug 5.
Closes #13
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.
Closes #13.
hessian_02_sym_weakwas the one weak-operator builder whose values nothing verified — upstream'stest_hessian_02_sym_weak_matrixassembles a manual expectation and then comments out the assertion against it (NOTE: Disabling strict value check), and the port reproduced that shape-only test as-is.What turned out to be wrong
The builder is correct; the expectation it was being compared against is not. The symmetric basis element for
j₁ ≠ j₂isdx_{j₁} ⊗ dx_{j₂} + dx_{j₂} ⊗ dx_{j₁}, so pairing the (symmetric) Hessian against it picks up both entries — that is the ×2hessian_02_sym_weakapplies to off-diagonal rows and that upstream's manual assembly omits.gamma_02_symcarries the matching per-index ×2 on its rows and columns, so the operator and the Gram agree. Comparing the builder against an expectation missing the factor fails on exactly the off-diagonal rows, so the assertion was disabled rather than the expectation fixed.What this PR does
test/test_pysrc.jl→hessian→hessian_02_sym_weak matrix, with the multiplicity factor restored. Passes atd = 1..4.(0,2)basis and pairing them with the full Gram must reproducehessian_02_weak, whose⟨H(φ_I), φ_i dx_j ⊗ dx_k⟩entries involve no basis choice at all. Without it, the first test only re-encodes the builder's own weight rule; with it, deleting the ×2 from the builder fails both tests.docs/upstream-bugs.md, marked as a test defect (shipped code right, coverage absent) with no parity fixture to guard it — unlike the other four entries.Worth upstreaming to the Python suite as a follow-up.
Full suite: 2389 passing.