All Projects → fbenz → FpDebug

fbenz / FpDebug

Licence: GPL-2.0 license
Dynamic Program Analysis based on Valgrind to find Floating-Point Accuracy Problems

Programming Languages

shell
77523 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to FpDebug

verrou
floating-point errors checker
Stars: ✭ 39 (+105.26%)
Mutual labels:  valgrind, floating-point
ck-clsmith
Collective Knowledge extension to crowdsource bug detection in OpenCL compilers using CLSmith tool from Imperial College London
Stars: ✭ 26 (+36.84%)
Mutual labels:  pldi-artifact, pldi
verificarlo
A tool for debugging and assessing floating point precision and reproducibility.
Stars: ✭ 51 (+168.42%)
Mutual labels:  floating-point, mpfr
DoubleFloats.jl
math with more good bits
Stars: ✭ 102 (+436.84%)
Mutual labels:  floating-point
fpzip
Lossless compressor of multidimensional floating-point arrays
Stars: ✭ 58 (+205.26%)
Mutual labels:  floating-point
massif.js
Visualize Valgrind Massif memory consumption online.
Stars: ✭ 30 (+57.89%)
Mutual labels:  valgrind
DecFP.jl
Julia IEEE decimal floating-point via the Intel decimal-float library
Stars: ✭ 49 (+157.89%)
Mutual labels:  floating-point
ndzip
A High-Throughput Parallel Lossless Compressor for Scientific Data
Stars: ✭ 19 (+0%)
Mutual labels:  floating-point
memcheck-cover
An HTML generator for Valgrind's Memcheck tool
Stars: ✭ 30 (+57.89%)
Mutual labels:  valgrind
ValgrindHelperForAndroid
A easy way to use valgrind on Android device.
Stars: ✭ 53 (+178.95%)
Mutual labels:  valgrind
ghaction-cmake
cmake swiss army knife github docker action
Stars: ✭ 19 (+0%)
Mutual labels:  valgrind
Number Precision
🚀1K tiny & fast lib for doing addition, subtraction, multiplication and division operations precisely
Stars: ✭ 3,345 (+17505.26%)
Mutual labels:  floating-point
cargo-valgrind
A cargo subcommand, that runs valgrind and displays its output in a helpful manner.
Stars: ✭ 66 (+247.37%)
Mutual labels:  valgrind
ChangePrecision.jl
macro to change the default floating-point precision in Julia code
Stars: ✭ 28 (+47.37%)
Mutual labels:  floating-point
gnlTester
Tester for the get_next_line project of 42 school
Stars: ✭ 87 (+357.89%)
Mutual labels:  valgrind
valgrind
Enhanced Valgrind for Persistent Memory
Stars: ✭ 85 (+347.37%)
Mutual labels:  valgrind
fphdl
VHDL-2008 Support Library
Stars: ✭ 36 (+89.47%)
Mutual labels:  floating-point
c-project-template
A C project template with Makefile, command line options parsing, unittest using cmocka and valgrind
Stars: ✭ 97 (+410.53%)
Mutual labels:  valgrind
ruby memcheck
Use Valgrind memcheck on your native gem without going crazy
Stars: ✭ 90 (+373.68%)
Mutual labels:  valgrind
printfTester
Tester for the ft_printf project of 42 school
Stars: ✭ 94 (+394.74%)
Mutual labels:  valgrind

FpDebug

GNU General Public License

FpDebug is a heavyweight Valgrind tool for detecting floating-point accuracy problems.

The tool uses MPFR for its side-by-side computation in higher precision. Because MPFR is run with the tool on top of Valgrind, it has only access to the partial C library provided by Valgrind. Thus, a patch for MPFR is provided that adjusts it to run on top of Valgrind. As GMP is used by MFPR, a patch for GMP is also provided.

Origin

This project was started during my Bachelor’s thesis (winter 2010/11). The results have been published in:

A Dynamic Program Analysis to find Floating-Point Accuracy Problems [PDF]
Florian Benz, Andreas Hildebrandt, and Sebastian Hack
PLDI '12: Proceedings of the 2012 ACM SIGPLAN Conference on Programming Language Design and Implementation

Quick start

The docker folder contains Dockfiles for several systems that can be used to build and play around. During the build a small example program is also built and analyzed to check that everything works.

Build and run Docker image
sudo docker build -t fpdebug .
sudo docker run -it fpdebug /bin/bash

Build from source

Note
The version on master runs with Valgrind 3.7 and might not work on more recent systems than Ubuntu 12.04. However, a version for Valgrind 3.12 can be found here: #2 . But so far it has only been tested on small examples. Tests have been performed on Ubuntu 16.04 and Ubuntu 16.10.
Note
Only 64bit systems are supported.

The following installation instructions are for Ubuntu 12.04.5 LTS (64bit). The instructions should be similar for most other Linux systems.

Install build dependencies
# Git is only needed to check out the sources
sudo apt-get install git
# m4 is a dependency of GMP
sudo apt-get install m4
# libc6-dbg is required for Valgrind (otherwise it fails at runtime)
sudo apt-get install libc6-dbg
Get the sources
git clone [email protected]:fbenz/FpDebug.git
Install patched GMP 5.0.1
./install_gmp.sh
Install patched MPFR 3.0.0
./install_mpfr.sh
Install Valgrind with FpDebug
./install_valgrind.sh

Running FpDebug

Build an example
cd valgrind/fpdebug/examples
gcc test_1.c -O0 -g -o test_1.out
(or $ gcc test_1.c -O0 -g -mfpmath=387 -o test_1.out )
Run FpDebug
./valgrind/install/bin/valgrind --tool=fpdebug valgrind/fpdebug/examples/test_1.out
FpDebug output
==7041== FpDebug-0.1, Floating-point arithmetic debugger
==7041== Copyright (C) 2010-2011 by Florian Benz.
==7041== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==7041== Command: valgrind/fpdebug/examples/test_1.out
==7041==
==7041== precision=120
==7041== mean-error=yes
==7041== ignore-libraries=no
==7041== ignore-accurate=yes
==7041== sim-original=no
==7041== analyze-all=yes
==7041== bad-cancellations=yes
==7041== ignore-end=no
Test program: machine epsilon, client request
Sum: 1.0000000e+00
Running on valgrind
==7041== (float) sum PRINT ERROR OF: 0x7FF0000F4
==7041== (float) sum ORIGINAL:          1.00000000000000 * 10^0, 1/120 bit
==7041== (float) sum SHADOW VALUE:      1.00000025000000 * 10^0, 49/120 bit
==7041== (float) sum ABSOLUTE ERROR:    2.50000002921524 * 10^-7, 27/120 bit
==7041== (float) sum RELATIVE ERROR:    2.49999940421539 * 10^-7, 120/120 bit
==7041== (float) sum CANCELED BITS:     0
==7041== (float) sum Last operation: 0x4007AD: main (test_1.c:14)
==7041== (float) sum Operation count (max path): 5
==7041== DUMP GRAPH (test_1_sum.vcg): successful
==7041==
==7041== DUMP GRAPH (valgrind/fpdebug/examples/test_1.out_1_0.vcg): successful
==7041== SHADOW VALUES (valgrind/fpdebug/examples/test_1.out_shadow_values_relative_error_1): successful
==7041== SHADOW VALUES (valgrind/fpdebug/examples/test_1.out_shadow_values_canceled_1): successful
==7041== SHADOW VALUES (valgrind/fpdebug/examples/test_1.out_shadow_values_special_1): successful
==7041== MEAN ERRORS (valgrind/fpdebug/examples/test_1.out_mean_errors_addr_1): successful
==7041== MEAN ERRORS (valgrind/fpdebug/examples/test_1.out_mean_errors_canceled_1): successful
==7041== MEAN ERRORS (valgrind/fpdebug/examples/test_1.out_mean_errors_intro_1): successful

License

FpDebug is Open Source software released under the GNU General Public License, version 2.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].