It was already discussed that there is no consisent and reasonably
computable order on kernels.  Example by Kurt Pagani from February
2 2017 shows that this may lead to user-visible troubles.  Recently
Qian reported that this leads to bugs during integration.

Core of the problem is that due to failure of order our kernel
machinery may consider two kernels as unequal, even though
they should be equal.  Attached patch modifies KERNEL so
that it does not depend on order for kernel equality.
It still uses order to find positions in kernel cache.
With the patch all test pass but testsuite takes almost
two times longer than current version.  More visible
slowdown is on formal derivatives:

f := operator 'f
D(f(x), x, 655)

currently takes 8.22 sec on my machine.  After kernel patch
it was much longer (I did not wait long enough to know how
much longer).

The patch fixes problem reported by Kurt and hopefully
should fix some integration problems (of course there
are several problem with integration and most are
not coused by wrong handling of kernels).

ATM I am testing this patch, I particular I am looking
for possible troubles.  This patch passed testsuite, but
earlier version failed, at least one of failures in
earlier version looks like unwarrented assumption in
algebra, so it is possible that this version also
causes trouble in some obscure cases.  Of course,
I would like to avoid slowdown, but ATM is is not
clear how much can be done in kernel code.
Probably most of work on avoiding slowdown should
be outside kernel...

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/20210824124858.GA27713%40math.uni.wroc.pl.
--- ../ax-build16/src/algebra/KERNEL.spad	2021-08-23 15:22:18.957240437 +0000
+++ KERNEL.spad	2021-08-23 19:52:53.864545838 +0000
@@ -80,11 +80,17 @@
         #(argument k1) ~= #(argument k2) => false
         f(k1, k2)
 
+    kerEqual0(k1 : %, k2 : %) : Boolean ==
+        triage(k1, k2) = 0
+
     kernelEnterInCache(k : %) : % ==
         if (f0 := property(operator k, SPECIALEQUAL)) case None then
             f1 := (f0::None) pretend ((%, %) -> Boolean)
             (res := linearSearch(k, y +-> kerEqual(k, y, f1))) case % =>
                 return res::%
+        else
+            (res := linearSearch(k, y +-> kerEqual0(k, y))) case % =>
+                return res::%
         enterInCache(k, triage)
 
     k1 = k2 ==

Reply via email to