Validation Framework
AADC’s user validation framework provides runtime validation and debugging capabilities for user-defined business logic checks across three execution phases: normal program execution, recording, and kernel execution.
Overview
Key Features:
- Phase-aware validation: Assertions work seamlessly across normal execution, recording, and kernel execution
- Hierarchical context: Track business context (portfolio, timestep, trade) for meaningful error messages
- Smart registration: Only stochastic checks are recorded; static checks optimized away
- Vectorized evaluation: Efficient AVX-based validation during kernel execution
- Customizable handling: Define your own assertion behavior via
AADC_USER_ASSERT
Core Usage:
#include <aadc/errors.h>
// Basic assertion with streaming message composition
AADC_ASSERT(x > 0.0, "x must be positive, got: " << x);
// Hierarchical context for organized error reporting
{
AADC_CONTEXT("Portfolio " << portfolio_id);
AADC_ASSERT(price > 0.0, "Price must be positive: " << price);
}Error Output Example:
[Portfolio 12345][TimeStep 42]file.cpp:89 Price must be positive: [-1.1, 2.0, 3.0, -4.0]
This is a preview of the Validation Framework documentation.
The full documentation includes API reference, implementation details, performance considerations, and advanced usage patterns.
Contact us to request a demo version and get access to the complete documentation.