UPDATE: DMCP-3.10 / DM42-3.10

This is where announcements of firmware updates for the DM42 calculator will be made
Thomas_ER
Posts: 56
Joined: Mon Jul 24, 2017 1:19 pm
Location: Germany

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Thomas_ER » Wed Oct 10, 2018 5:40 am

Dani R. wrote:
Tue Oct 09, 2018 9:44 pm
DA74254 wrote:
Tue Oct 09, 2018 7:11 pm

I can confirm that mine crashes as well. SN 00245.
Just to note; mine crashes also connected to USB power and voltage indication 3,02V (5^E10)
Same here, crash on battery and USB power.
Same for me (crashes/freeze with DM42-3.10; OK with 3.9),
both units.
[ HP48/49/50/42S/WP34/HP Prime/ DM42 (#00185+00318) ]

grsbanks
Posts: 703
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by grsbanks » Wed Oct 10, 2018 8:32 am

OK, we've found the cause of the Y^X crash. It's the updated Intel Decimal Floating Point Library.

A version of DM42 built against library 2.0u2 hangs, one built against 2.0u1 does not hang. This is reproducible 100% for us and the compiler optimisations make no difference.

Noteworthy is the fact that the benchmark that has started crashing also uses the Y^X function so the two might be related.

Thanks for bringing this to our attention.

Stay tuned for a fw update soon.
Not SwissMicros staff, just an enthusiast.

Thomas Okken
Posts: 484
Joined: Tue May 02, 2017 3:48 pm
Location: New Jersey, USA
Contact:

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Thomas Okken » Wed Oct 10, 2018 1:19 pm

grsbanks wrote:
Wed Oct 10, 2018 8:32 am
OK, we've found the cause of the Y^X crash. It's the updated Intel Decimal Floating Point Library.
Yikes. Does it crash inside bid128_pow()?

I'll have to take a look at what happens when I build Free42 with the updated library. It seems odd that they would break an existing function like that, but since Free42 handles this case by simply calling bid128_pow(), it's not very obvious what could be wrong on that end, either.

grsbanks
Posts: 703
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by grsbanks » Wed Oct 10, 2018 3:34 pm

Thomas Okken wrote:
Wed Oct 10, 2018 1:19 pm
Yikes. Does it crash inside bid128_pow()?
I can't say for sure because I don't have that level of access to the DM42 platform. This said, one user that I passed a test firmware version to reported that both types of crash ceased when using that firmware. The only difference between the current 3.10 and that test version is the Intel Decimal FP Library (2.0U2 in the 3.10 firmware, 2.0U1 in the test firmware). Dialling back the compiler optimisation has no effect either, so it isn't that.
Not SwissMicros staff, just an enthusiast.

Thomas Okken
Posts: 484
Joined: Tue May 02, 2017 3:48 pm
Location: New Jersey, USA
Contact:

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Thomas Okken » Wed Oct 10, 2018 5:04 pm

I compared the 2.0u1 and 2.0u2 versions of bid128_pow(), and there is a change:

Code: Select all

$ diff -w bid128_pow.c ../../../IntelRDFPMathLib20U2/LIBRARY/src/bid128_pow.c
2c2
<   Copyright (c) 2007-2011, Intel Corp.
---
>   Copyright (c) 2007-2018, Intel Corp.
972a973,1003
> // Check for appropriately small (unsigned int) exponent, and compute as
> // x^N where N is that integer if EXACTLY an integer, or 1/(x^|N|) for N < 0
>
>   {
>     int exact_y;
>     int sign = 0;
>     int save_flags = *pfpsf;
>
>     *pfpsf &= ~BID_INEXACT_EXCEPTION;
>     BIDECIMAL_CALL1_NORND(bid128_to_int32_xrnint, exact_y, y);
>     if ((*pfpsf & BID_INEXACT_EXCEPTION) == 0) {
>       if (exact_y < 0) sign = 1;
>       exact_y = abs(exact_y);
>       if (exact_y > 0) {
>         BID_UINT128 tmp, r = BID128_1;
>         BID_UINT128 p = x;
>         for (; exact_y; exact_y >>= 1) {
>           if (exact_y & 1) {
>             BIDECIMAL_CALL2(bid128_mul, r, r, p);
>           }
>           if (exact_y > 1)
>             BIDECIMAL_CALL2(bid128_mul, p, p, p);
>         }
>         tmp = BID128_1;
>         if (sign) BIDECIMAL_CALL2(bid128_div, r, tmp, r);
>         BID_RETURN(r);
>       }
>     }
>     *pfpsf = save_flags;
>   }
>
Special-case code for integer exponents, using recursive repeated squaring. What happens when you calculate 5^(1e10 + 0.0001)?

I'll test this with Free42 tonight...

grsbanks
Posts: 703
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by grsbanks » Wed Oct 10, 2018 5:10 pm

Thomas Okken wrote:
Wed Oct 10, 2018 5:04 pm
Special-case code for integer exponents, using recursive repeated squaring. What happens when you calculate 5^(1e10 + 0.0001)?
I won't have time to test this tonight -- I have to go out -- but I'm not convinced this is going to have much to do with it unless it's just plain buggy. It uses recursive repeated squaring for values of the exponent that fit into an unsigned, 32-bit integer. 10^10 is somewhat outside that range so this portion of code shouldn't come into play.
Not SwissMicros staff, just an enthusiast.

User avatar
Guenter
Posts: 102
Joined: Wed May 24, 2017 4:26 pm
Location: Germany

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Guenter » Wed Oct 10, 2018 8:36 pm

Well, the obvious bug in 3.10 is annoying. But on the other hand I practiced how easy it is to go back to the previous version. Symply keep the old DM42 program(s) on the calculator (or reload it), invoke "SETUP/SYSTEM/Enter System Menu/Reset to DMCP menu" or SETUP/4/2/4 and select the DM42 program you wish to run (here DM42-3.9.1.pgm). That's quite cool, isn't it?

Günter
DM42 SN:00004 and SN:00184

Thomas Okken
Posts: 484
Joined: Tue May 02, 2017 3:48 pm
Location: New Jersey, USA
Contact:

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Thomas Okken » Wed Oct 10, 2018 9:03 pm

5^(2^31-1) => Out of Range
5^(2^31) => freeze

(On the DM42 with the 3.10 firmware)
Last edited by Thomas Okken on Wed Oct 10, 2018 10:20 pm, edited 1 time in total.

Thomas Okken
Posts: 484
Joined: Tue May 02, 2017 3:48 pm
Location: New Jersey, USA
Contact:

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by Thomas Okken » Wed Oct 10, 2018 10:19 pm

I tried the Linux (64-bit) and Windows (32-bit) builds with the 2.0u2 library, and neither had a problem with 5^(1e10), 5^(2^31), or 5^(2^31-1).

mcc
Posts: 173
Joined: Fri Jun 23, 2017 3:10 am

Re: UPDATE: DMCP-3.10 / DM42-3.10

Post by mcc » Thu Oct 11, 2018 3:00 am

Thomas Okken wrote:
Wed Oct 10, 2018 9:03 pm
5^(2^31-1) => Out of Range
5^(2^31) => freeze

(On the DM42 with the 3.10 firmware)
Confirmed
5
enter
2
enter
31
x^y
x^y

and it never comes back. Need to do the reset-via-needle-trick...

Cheers!
Meino
DM 42 - SN: 00373, Firmware v.:3.11. / 3.11. as compiled by SwissMicros

Post Reply