How chadhasakka/floating-point-stability-tools works
Project Type and Purpose
• This is an open-source floating-point stability analysis tool built as an Intel Pin plugin (“MyPinTool”).
• Purpose: instrument existing C programs (e.g., fp-arithmetic.c, fp-error-propagation.c) at runtime, collect floating-point metrics, and report stability or error propagation.
Key Components (to show
a. Input Programs
• fp-arithmetic.c
• fp-error-propagation.c
b. Build System
• makefile & makefile.rules
• VS Project file (MyPinTool-clang.vcxproj)
c. Instrumentation Framework
• Intel Pin (external binary)
• MyPinTool.cpp (plugin source) → MyPinTool.o (obj-intel64)
d. Runtime Engine
• Pin Loader
• Tool Callbacks (Instruction-Level Hooks)
e. Output/Analysis
• Logs / Reports (custom format)
Architectural Patterns and Principles
• Plugin Architecture: MyPinTool registers callbacks with Pin’s API (Instrumentation Driver pattern).
• Modular Separation:
• Build files separated from source
• Test programs (C files) isolated from the instrumentation code
• Event-Driven Design: instrumentation occurs on each instruction or memory reference callback.
Technologies, Frameworks, and Libraries
• Intel Pin SDK (external dependency)
• C++ (MyPinTool.cpp)
• GNU make / MSVC project for cross-platform builds
• Standard C (fp-arithmetic.c, fp-error-propagation.c)
Essential Details to Capture
• Pin ↔ Plugin interface showing registration of callbacks.
• Two test programs separately to show extensibility.
• Object directory (obj-intel64) to note the build target.