Basel Capital Engine Calculation Drift Diagnostic Matrix
Identify computational drift and precision loss in quantitative risk and regulatory capital pipelines.
Use this template when debugging floating-point variance, Monte Carlo divergence, or unexpected Risk-Weighted Asset (RWA) calculation discrepancies across regulatory stress test pipelines.
Role: Senior Quantitative Software Auditor specializing in regulatory capital modeling engines and high-performance risk simulation pipelines.
Context
- Risk Engine Architecture: {{model_runtime_environment}}
- Counterparty Exposure Records: {{counterparty_exposure_dataset}}
- Observed Output Variance: {{observed_rwa_variance}}
- Quantitative Pricing Library: {{pricing_kernel_version}}
- Pseudo-Random Seed Configuration: {{monte_carlo_seed_config}}
- Regulatory Basel Standard: {{regulatory_framework_standard}}
Task
Generate an advanced diagnostic matrix evaluating numerical drift, floating-point rounding degradation, and model implementation flaws causing {{observed_rwa_variance}} across capital calculation pipelines, providing targeted numerical remediations.
Method
- Audit {{counterparty_exposure_dataset}} for non-normal distributions, NaN/Inf injection, or extreme tail values.
- Profile {{pricing_kernel_version}} SIMD vectorization routines for IEEE 754 precision loss across heterogeneous CPU/GPU nodes.
- Trace the deterministic pseudo-random number generator under {{monte_carlo_seed_config}} to identify thread-scheduling race conditions.
- Recompute expected Value-at-Risk (VaR) and Expected Shortfall bounds against {{regulatory_framework_standard}} formulas.
- Compare intermediate netting and collateral aggregation routines in {{model_runtime_environment}} against analytical benchmarks.
- Classify calculation drift points by capital adequacy impact and computational cost.
- Develop deterministic unit-testing test fixtures with strict epsilon tolerances for regression testing.
Constraints
- The diagnostic MUST differentiate strictly between mathematical model drift and software implementation bugs.
- Remediation approaches MUST NOT compromise the engine throughput required by {{model_runtime_environment}}.
- Numerical stability fixes MUST comply with precision requirements defined in {{regulatory_framework_standard}}.
- Analysis MUST explicitly verify thread safety and seed isolation across multi-threaded execution runs.
Output format
- Numerical Integrity Assessment (evaluation of floating-point drift and simulation divergence).
- Drift Root Cause Matrix (Markdown table with columns: Calculation Module, Mathematical Function, Root Cause Mechanism, Precision Loss (bps), Determinism Status, Remediation Code Pattern).
- Precision Verification Test Suite (specification of epsilon bounds and deterministic seed validation tests).
Self-review
- Confirm all precision tolerances match {{regulatory_framework_standard}} compliance thresholds.
- Verify that compiler optimization flags (e.g., fast-math) are accounted for in {{model_runtime_environment}}.
- Check that seed isolation checks explicitly address concurrency issues from {{monte_carlo_seed_config}}.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.