v0.4.0 — Portfolio Risk and Exact Stress
v0.4.0 makes verified portfolio risk and exact user-supplied stress the project's first-class production story while preserving the v0.3.7 cross-platform packaging baseline and the broader analytic, Monte Carlo, QMC, PDE, Heston, SSVI, and numerical evidence.
New portfolio surfaces
bs_portfolio_riskreturns position price, value, and Greeks plus quantity-weighted portfolio value, delta, gamma, vega, theta, and rho totals in one native batch.bs_portfolio_scenariosexact-reprices spot, volatility, rate, dividend, and elapsed-time shocks, with compact aggregate-only output by default.
Artifact-bound proof
- Independent QuantLib comparison: worst price error
3.91e-14, worst Greek error3.40e-12, position scenario P&L error2.06e-13, and portfolio scenario P&L error2.66e-13. - Determinism: exact zero-shock identity and 32/32 concurrent replays bitwise identical.
- Recorded Apple M3 Pro evaluator:
20.18xrisk-batch speedup /20.25Mpositions per second;27.92xaggregate-scenario speedup /32.13Mcells per second. - Verification covers 60 mixed position cases, 72 scenario cells, native and installed-wheel tests, ASan/UBSan, package/data policy, and exact artifact hashes.
Release payload
- 20 provider-built CPython 3.8–3.12 wheels across manylinux x86_64, macOS universal2, Windows x86, and Windows x86_64. Installed-wheel contracts passed wherever the runner could execute the slice; cibuildwheel's documented limitation prevented executing the CPython 3.8 arm64 slice of the repaired universal2 wheel, while its x86_64 slice passed.
- One verified source distribution, a machine-readable release manifest with SHA-256 digests, the committed artifact manifest, and the validation payload.
- PyPI/TestPyPI publication is not claimed by this GitHub release.
Honest boundary
This release is deterministic Black–Scholes European portfolio valuation and user-supplied stress infrastructure. It is not trading alpha, a forecast, probabilistic market-risk validation, volatility-surface dynamics, a hedge/return result, or live P&L.
Start with the README, the runnable portfolio_risk.py example, the product and evidence hub, and the full release notes.