Conversation
petlenz
force-pushed
the
fix-353-t2s-contraction-sequences
branch
from
July 25, 2026 12:35
2b561b2 to
c0f0110
Compare
petlenz
force-pushed
the
fix-353-t2s-contraction-sequences
branch
from
July 25, 2026 13:38
c0f0110 to
84530ed
Compare
petlenz
force-pushed
the
fix-353-t2s-contraction-sequences
branch
from
July 25, 2026 14:16
84530ed to
2a4b143
Compare
petlenz
force-pushed
the
fix-353-t2s-contraction-sequences
branch
from
July 25, 2026 22:33
2a4b143 to
c0cd24e
Compare
petlenz
force-pushed
the
fix-353-t2s-contraction-sequences
branch
from
July 26, 2026 12:14
c0cd24e to
3d0c609
Compare
petlenz
force-pushed
the
fix-353-t2s-contraction-sequences
branch
2 times, most recently
from
July 26, 2026 17:18
c8fb55c to
1a17e02
Compare
petlenz
force-pushed
the
fix-353-t2s-contraction-sequences
branch
from
July 26, 2026 17:42
1a17e02 to
3a5ad33
Compare
petlenz
force-pushed
the
fix-353-t2s-contraction-sequences
branch
2 times, most recently
from
July 26, 2026 18:40
05cdfad to
c4a3309
Compare
The tensor_inner_product_to_scalar evaluator always computed the plain
tmech::dcontract(l, r): dot_product(A,{1,2},B,{2,1}) (= A_ij B_ji)
silently evaluated as A : B, and rank-1 full contractions threw
'requires rank 2' even though the node is a legal dot product (which
also broke evaluating derivatives of dot() on rank-1 arguments).
tensor_data_dcontract_wrapper now receives both sequences: matching
rank-2 sequences contract plain ({2,1}/{2,1} sums the same pairs),
mismatched ones contract against the transpose, and rank-1 uses
tmech::dot. Rank>2 general contraction stays a clear
not-implemented error (tracked by the #383 evaluation-ceilings epic)
instead of a silently wrong value.
The identity half of this node (hash/== ignoring the sequences) landed
in #399.
Signed-off-by: petlenz <peterlenz89.pl@gmail.com>
The dispatch derives Dim/Rank from the LHS; a mixed-rank node (constructible through the weak || precondition in dot_product, #360) reached a wrong-type static_cast and, with the new rank-1 branch, returned silent garbage where it previously threw. The wrapper now throws evaluation_error on operand rank/dim mismatch and on sequence sizes not covering the rank. Signed-off-by: petlenz <peterlenz89.pl@gmail.com>
petlenz
force-pushed
the
fix-353-t2s-contraction-sequences
branch
from
July 26, 2026 19:03
c4a3309 to
3eb5bf3
Compare
petlenz
added this pull request to stack #425
September 15, 2026 20:15
Member
Author
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
Fixes #353. Stacked on #406. Completes the node whose identity half landed in #399 (#343).
dot_product(A,{1,2},B,{2,1})evaluated as plain A : B (542.5 vs correct 479.5 in the issue repro)dot_product(u,{1},v,{1})threwrequires rank 2tmech::dot— also unblocks evaluatingdiff(dot(u), s)for rank-1 argsTests
Numeric lock-in comparing both rank-2 orientations against hand-computed sums plus the rank-1 dot. Full suite: 2446/2446 pass. gcc-14 clean.