Skip to content

Conversation

@da-roth
Copy link

@da-roth da-roth commented Jan 10, 2026

This PR integrates the Forge JIT backend for XAD, adding optional native code generation support. Forge is an optional dependency - everything builds and runs without it.

Changes

Build options added:

  • QLRISKS_ENABLE_FORGE: Enable Forge JIT backend
  • QLRISKS_ENABLE_FORGE_TESTS: Include Forge tests in test suite
  • QLRISKS_ENABLE_JIT_TESTS: Enable XAD JIT tests (interpreter backend, no Forge)
  • QLRISKS_BUILD_BENCHMARK / QLRISKS_BUILD_BENCHMARK_STANDALONE: Benchmark executables

Files added:

  • test-suite/jit_xad.cpp: JIT infrastructure tests (interpreter backend)
  • test-suite/forgebackend_xad.cpp: Forge backend tests
  • test-suite/swaption_jit_pipeline_xad.cpp: JIT pipeline tests for LMM Monte Carlo
  • test-suite/swaption_benchmark.cpp: Boost.Test benchmarks
  • test-suite/benchmark_main.cpp: Standalone benchmark executable
  • test-suite/PlatformInfo.hpp: Platform detection utilities
  • .github/workflows/ql-benchmarks.yaml: Benchmark workflow

Files modified:

  • CMakeLists.txt: Forge integration options
  • test-suite/CMakeLists.txt: Conditional test/benchmark targets
  • .github/workflows/ci.yaml: Added forge-linux and forge-windows jobs

Benchmarks

The benchmark workflow (ql-benchmarks.yaml) runs swaption pricing benchmarks comparing FD, XAD tape, JIT scalar, and JIT-AVX methods on Linux and Windows.

Also included some initial work towards #33 - the workflow has type overhead jobs that compare double vs xad::AReal pricing performance (no derivatives) on the same hardware, providing a baseline for measuring XAD type overhead.

Example benchmark run (Linux) Link

@CLAassistant
Copy link

CLAassistant commented Jan 10, 2026

CLA assistant check
All committers have signed the CLA.

@da-roth da-roth mentioned this pull request Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants