Skip to content

[Trivial] Exclude 1 math test on DFly.#57

Closed
dkgroot wants to merge 1 commit intoldc-developers:ldc-ltsmasterfrom
dkgroot-ldc:fix_math
Closed

[Trivial] Exclude 1 math test on DFly.#57
dkgroot wants to merge 1 commit intoldc-developers:ldc-ltsmasterfrom
dkgroot-ldc:fix_math

Conversation

@dkgroot
Copy link

@dkgroot dkgroot commented Feb 22, 2018

Not 100% what is causing this check to fail / or what this test is trying to prove):
assert(pow(-1.0L, 1/real.epsilon - 1.0L) == -1.0L);

Running (In D + ldc):

printf("%f\n", pow(-1.0L, 1/real.epsilon));
printf("%f\n", pow(-1.0L, 1/real.epsilon - 1.0L));

gives:

0.000000
nan

However (C + gcc -lm):

printf("%f\n", pow(-1.0L, 1/FLT_EPSILON));
printf("%f\n", pow(-1.0L, 1/FLT_EPSILON - 1.0L));

gives:

1.000000
-1.000000

Which is the correct answer.

Excluding the test on dragonfly for now, until i figure out the cause.

@dkgroot
Copy link
Author

dkgroot commented Feb 22, 2018

DFly SemaphoreCI

@JohanEngelen
Copy link
Member

I think it's better to spend more time figuring out what is causing the problem first.
Do you have an ideas about what could be the cause? (what's the real size of DFly? Is a stdlib call done for pow? If so, is the DFly stdlib doing something different from other platforms?)

@dkgroot
Copy link
Author

dkgroot commented Feb 24, 2018

@JohanEngelen
i am not 100% sure about all of this:

  • pow() is mapped to /usr/include/math.h (ie: libm ) (at least i hope so / how can i verify this ?).
  • druntime:/src/core/stdc/config.d -> alias real c_long_double; ()

@kinke
Copy link
Member

kinke commented Feb 24, 2018

how can i verify this ?

Launch a debugger and step into it. You'll probably want to link against the debug runtime for debug infos in Phobos: -g -link-debuglib. Be sure to have a thorough look at the exponent arg (1/real.epsilon).

@kinke
Copy link
Member

kinke commented Feb 24, 2018

Well at least in current ltsmaster, the libm function is definitely not called, it's all implemented in D: https://github.com/ldc-developers/phobos/blob/ldc-ltsmaster/std/math.d#L6884

@dkgroot
Copy link
Author

dkgroot commented Feb 24, 2018

Will have another stab at it tomorrow.
BTW: I only excluded the test, to get my CI to be able to compile all the rest (as a check).

@redstar
Copy link
Member

redstar commented Feb 28, 2018

I check this, too, because I think I introduced this failure with #56.

@dkgroot
Copy link
Author

dkgroot commented Feb 28, 2018

@redstar thanks for the update / reference !
Will check tomorrow with / without #56 to see if that resolves the issue (Meaning this PR could be dropped!

@redstar
Copy link
Member

redstar commented Feb 28, 2018

#60 fixes the problem for me.

@redstar
Copy link
Member

redstar commented Mar 1, 2018

Indeed, the unit test failure in std.math is fixed now on Travis. Please check your build with the latest update.

@dkgroot
Copy link
Author

dkgroot commented Mar 1, 2018

@redstar Thanks for the update. Closing this PR

@dkgroot dkgroot closed this Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants