You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Round-9 review fixes: nested adds from negative/sub fallthroughs, unconverted tensor insert, zero coeff
Round 9 (adversarial probe of the round-8 delta) confirmed three
value-preserving structural defects:
- Nested adds: add + (-t) for a non-cancelling t, and add - expr in
both the core and tensor sub get_default, pushed the WHOLE lhs add
as a single child. (C-A)-B built tensor_add{-B, tensor_add{C,-A}},
and buried children then defeated merge cancellation:
(A+B)+((C-A)-B) kept an unreachable interior -A ('A+C-A'). The
negative dispatch and both get_defaults now copy the add and
signed-insert the other operand, finishing through the usual
collapse. A tensor print expectation that had pinned the nested
shape's output ordering was updated to the flat form.
- The tensor n-ary template dispatch still inserted its combined term
via plain merge_or_insert: (5A-2A)+(-3A) held an exact {2A,-(2A)}
pair instead of collapsing to zero. Now add_insert_signed, matching
the scalar/t2s merge_and_finish.
- merge_add stored a cancelled coefficient as a literal zero holder:
(2+x)+(y-2) printed '0+x+y' and compared unequal to x+y. Cancelled
coefficients are now dropped.
Also converted every remaining dispatcher-side merge_or_insert in
simplifier_sub.h/simplifier_add.h to the shared insert_signed helper
(exact-negation combining + zero filter) so no insertion path can
leave a {t,-t} pair or a zero child.
Regression tests in CoreBugFixTest (RoundNineReview suite).
Refs #340.
Signed-off-by: petlenz <peterlenz89.pl@gmail.com>
0 commit comments