Engineering notes
Short, technical write-ups on the internals — one or two a week.
The birthday paradox: 23 people, one surprisingly likely collision
Calculate birthday collision probabilities in an editable Java notebook and compare any matching pair with a match to your own birthday.
Javajax4jprobabilitynotebooksFind a square root by averaging two wrong guesses
Turn a rectangle into a square, then use the same update to calculate a whole array of square roots in an editable Java notebook.
Javajax4jnumerical methodsnotebooksMNIST in Java: train a digit recognizer, then inspect its mistakes
Train a small neural network on real handwritten digits with jax4j autodiff. Edit Java cells, watch the loss and inspect wrong predictions.
Javajax4jMNISTmachine learningnotebooksLooking for NumPy in Java? Meet jax4j.
Arrays, broadcasting and GPU computing in an editable Java notebook.
Javajax4jNumPynumerical computingnotebooksBA-CVA Worked Example: From Exposures to Capital
A $1.5m CDS reduces a constructed BA-CVA charge by $328,490. Follow the exposure inputs, counterparty weights and aggregation to see why.
BA-CVACVAcapitalcounterparty-riskjavaISDA SIMM: Why Portfolio Margin Isn’t the Sum of Trade Margins
Two trades cost $1.612m in standalone demo margin but $0.522m together. Follow the sensitivities to see where the reduction comes from.
isda-simmmarginportfolio-riskjavaYour VaR Passed Kupiec. Why Did Christoffersen Reject It?
Twenty breaches, two very different calendars. A worked example of why counting VaR exceptions can miss the trouble sitting right beside them.
VaRbacktestingKupiecChristoffersenriskjavaHow to Run Java GPU Workloads in Docker
An old GTX 1060, a fresh Docker install, and ten million Monte Carlo paths: from GPU passthrough to Java option pricing with Greeks.
dockergpucudacontainersnablatensorThe XAD showcase, on NablaTensor: Heston, SABR, XVA and LIBOR
Benchmark Heston, SABR calibration, XVA CVA, and LIBOR swaption kernels across XAD, NablaTensor, and MatLogica AADC.
benchmarksxadmatlogicahestonsabrxvalibormonte-carloautodiffgreeksXAD in C++ and MatLogica AADC on the Monte Carlo Ladder
Benchmark XAD, MatLogica AADC, and NablaTensor on matching Monte Carlo option pricing and Greek workloads.
benchmarksxadmatlogicac++monte-carloautodiffgreeksFour JDKs, One Tape: Zulu 24 Through 27
Benchmark the same Asian option tape on Azul Zulu JDK 24 through 27 and compare JVM bytecode and SIMD replay performance.
benchmarksjvmjitsimdvector-apimonte-carloautodiffForget, then remember: checkpointing the adjoint sweep on a GPU
Learn how GPU checkpointing reduces memory use and improves Monte Carlo Greek performance, with measured Vulkan results.
gpuvulkanopenclcudaautodiffgreekscheckpointingmonte-carlobenchmarksFive Non-Java Quant Libraries, One NablaTensor Baseline
Benchmark five non-Java quantitative finance libraries against NablaTensor for Monte Carlo option pricing and Greeks.
benchmarksquantlibtensorflowpytorchpythonrustmonte-carloautodiffgreeksfinmath-lib, Strata, JQuantLib vs. NablaTensor
Benchmark finmath-lib, Strata, and JQuantLib against NablaTensor for Monte Carlo pricing, adjoint Greeks, and Asian option support.
benchmarksfinmathstrataquantlibmonte-carloautodiffjvmgreeksCache the dice, not the price: common random numbers as a memo table
See how common random numbers and NablaTensor DRAW_CACHE reuse Monte Carlo paths across markets, with measured cpu-jit and SIMD results.
monte-carlovariance-reductioncachingjvmgreeksbenchmarksriskA JIT inside a JIT: how cpu-jit compiles adjoint Greeks into bytecode
Learn how NablaTensor cpu-jit compiles an adjoint tape into JVM bytecode, and inspect the generated instructions and benchmark costs.
autodiffjvmbytecodejitgreeksbenchmarkscompilersFour ways to talk to a GPU: CUDA, ROCm, Vulkan and OpenCL on one pricing kernel
An updated historical GPU comparison: CUDA, ROCm, Vulkan and the retired OpenCL replay backend, with current Quant and jax4j setup.
gpubenchmarkscudavulkanopenclrocmautodiffsimdSA-CVA in Practice: Sensitivities, Capital, and a Java Example
Follow a practical SA-CVA Java example: build the sensitivity vector, calculate capital, and compare an adjoint sweep with 28 revaluations.
cvaxvaregulationbenchmarks13 billion Black-Scholes paths a second — with every Greek — on a laptop iGPU
See a measured GPU Monte Carlo Black-Scholes benchmark on an integrated Radeon 780M, with option price and five Greeks from one sweep.
autodiffgpubenchmarksgreeksblack-scholesBump-and-revalue is quietly costing you 10x
See why five central-difference Greeks need 11 valuations. Compare adjoint AD timings, understand the benchmark estimate, and validate Greeks interactively.
autodiffbenchmarksgreeks