Bug 1856 - int64x64_t double conversions
int64x64_t double conversions
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
ns-3-dev
PC All
: P5 normal
Assigned To: Peter Barnes
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-14 15:49 EST by Peter Barnes
Modified: 2014-03-02 04:18 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Barnes 2014-02-14 15:49:45 EST
Conversions between int64x64_t and double/long double have problems:

- no proper test cases
- incorrect results on some platforms/some configurations

These are producing failed or crashed tests on some platforms:

fedora-20 32 bit, gcc 4.8.2, optimized

ubuntu 10.04, gcc 4.4.3
Comment 1 Tom Henderson 2014-02-15 15:01:24 EST
The test failing on Fedora Core 20, 32 bit, optimized build is global-routing, due to an off-by-one difference in integer to double conversions.

The test that is crashing on gcc-4.4.3 is int64x64.

Just noting the additional information so that duplicate bugs are not reported.
Comment 2 Peter Barnes 2014-03-02 04:01:20 EST
This turns out to expose several issues:

- grossly insufficient test coverage

- int64x64 implements Q64.64 fixed precision arithmetic, but fractions were mishandled or not even implemented

- output of int64x64 was subtly wrong, because the patch for bug 1786 was tested against the buggy int64x64 implementation

Pending patch:

- implements complete test coverage

- handles fractions correctly

- fixes int64x64 output (again)
Comment 3 Peter Barnes 2014-03-02 04:07:37 EST
Patch r10637 67601c471c22
http://code.nsnam.org/ns-3-dev/rev/67601c471c22

This leaves four tests failing because of deltas of 1 ns in Times, ultimately affecting pcap output.
Comment 4 Peter Barnes 2014-03-02 04:09:14 EST
Patch r10638 aa85c4fcd5d7
http://code.nsnam.org/ns-3-dev/rev/aa85c4fcd5d7

Update test reference pcap for:
TestSuite devices-mesh-dot11s-regression
TestSuite devices-mesh-flame-regression
TestSuite routing-aodv-regression
TestSuite routing-olsr-regression