Project

General

Profile

Design #1709

Test tut-CoCoLA2

Added by John Abbott over 1 year ago. Updated 8 days ago.

Status:
Closed
Priority:
Normal
Category:
bug
Target version:
Start date:
11 Nov 2022
Due date:
% Done:

100%

Estimated time:
1.01 h
Spent time:

Description

tut-CoCoLa2.cocoa5
prints out the result of LinKer which may vary from call to call.

Change the test so that it does not print out values which may vary from run to run!

[2022-11-11: Recd by email from Ulrich]

History

#1 Updated by John Abbott over 1 year ago

I think there are 7 places to revise...
Just search for LinKer and see which ones actually are printed.

#2 Updated by John Abbott over 1 year ago

  • Assignee set to Anna Maria Bigatti

#3 Updated by Anna Maria Bigatti over 1 year ago

  • Subject changed from Test tut-cocola2 to Test tut-CoCoLA2
  • % Done changed from 0 to 10

#4 Updated by Ulrich von der Ohe over 1 year ago

John Abbott wrote:

tut-CoCoLa2.cocoa5
prints out the result of LinKer which may vary from call to call.

Change the test so that it does not print out values which may vary from run to run!

[2022-11-11: Recd by email from Ulrich]

I'm not sure this is the same issue I alluded to in my email.

The problem I meant in my email is triggered by line 181 in tut-CoCoLA2.cocoa5:

eigenfactors(A3, z); --> two eigenfactors

This boils down to

f := x^4 - 20*x^2 + 36;
factor(f).factors;

The expected output (as given in tut-CoCoLA2.out) is:
[x^2 -2, x^2 -18]

I get the reversed order
[x^2 -18, x^2 -2]
randomly (about every second time two).

Note: I have observed this bug on OpenBSD only, never on a GNU/Linux system.

#5 Updated by Ulrich von der Ohe over 1 year ago

PS: Sorry for the late clarification -- I wasn't aware that this was posted here and only saw it by chance.

#6 Updated by Ulrich von der Ohe over 1 year ago

Ulrich von der Ohe wrote:

Note: I have observed this bug on OpenBSD only, never on a GNU/Linux system.

The problem also appears on other systems.

For example, this is literal input/output from a CoCoA-5 session (running on GNU/Linux, but now I don't think that it matters):

# use R ::= QQ[x];
# f := (x^2 - 2) * (x^2 - 1000);
# f;
x^4 -1002*x^2 +2000
# factor(f);
record[RemainingFactor := 1, factors := [x^2 -2,  x^2 -1000], multiplicities := [1,  1]]
# factor(f);
record[RemainingFactor := 1, factors := [x^2 -1000,  x^2 -2], multiplicities := [1,  1]]

#7 Updated by Anna Maria Bigatti over 1 year ago

Reminder for me: check both LinKer and eigenfactors

#8 Updated by John Abbott about 1 month ago

  • Status changed from New to In Progress
  • % Done changed from 10 to 20

Maybe we can change the relevant line(s) to something like:

E1 := eigenfactors(A1, z);
E2 := eigenfactors(A2, z);
E3 := eigenfactors(A3, z);
if not(EqSet(E2, concat(E1,E2))) then println "phi1 & phi2 are not splitting endomorphisms"; endif

What do you think?

#9 Updated by Ulrich von der Ohe 21 days ago

John Abbott wrote:

What do you think?

I think it would be preferable to have deterministic output (i.e. literally the same strings). Generally this is much easier to work with. But if that is not doable then changing the test as you suggest is at least a way to avoid the test failing due to this unexpected presentation of the result. (By the way, the test still fails with CoCoALib-0.99850 with apparently a 50% chance.)

#10 Updated by John Abbott 19 days ago

Ah, oops!
Since Anna did not object, I have just made the change hinted at in my comment 8 above. This should avoid the non-deterministic printed result -- Ulrich is right that we should avoid printed values whose printed string form may vary.

#11 Updated by John Abbott 19 days ago

  • Status changed from In Progress to Resolved
  • % Done changed from 20 to 70

#12 Updated by John Abbott 15 days ago

  • % Done changed from 70 to 80

I have just checked-in the changes. They should be in the next "internal" release. Hope to resolve #1814 before making an internal release...

#13 Updated by John Abbott 8 days ago

  • Status changed from Resolved to Closed
  • % Done changed from 80 to 100
  • Estimated time set to 1.01 h

Also available in: Atom PDF