Port Log
35 entries • C++ → Rust / C# / WASM
Heston Normal — dual-path draft: Sidani 2014 paper + heritage C++ converge on MathIR
"
// Two ports, one MathIR — dual provenance for every future stochastic-vol family
public static class HestonNormalFromPaper { // Path A — SSRN 2445328, negative-i
public static double PriceOfCall(double F, double K, double tau, /* ... */) { /* ... */ }
// Φ(τ,u,ν₀) = exp(C(τ) + D(τ)ν₀ − iu·x₀) ← paper convention
}
public static class HestonNormalFromHeritage { // Path B — heritage, positive-i
public static double PriceOfCall(double F, double K, double tau, /* ... */) { /* ... */ }
// phi(u) = exp(cv + dv·v0 + i·u·forward), called with −u ← heritage convention
}
// Cross-check: |A − B| < 1e-10 on 25 randomised parameter sweeps.
// Sidani Table 1: reproduced at 5e-5 by BOTH paths. Heritage vectors: 1e-9.ECOICOP V1/V2 era validation — ?AsOf= and ?Version= API
Inflation symbology API now validates COICOP codes against the ECOICOP era in effect on any given date. CP023 (tobacco, V2) is valid from 2026-02-01. CP022 (tobacco, V1) is valid before that date. Explicit ?Version= always wins over ?AsOf=.
// Priority: explicit Version > AsOf-inferred > default (V2)
public static bool IsCoicopValidAsOf(string coicop, EcoicopVersion version)
=> coicop switch {
"CP023" => version is V2 or V3, // COICOP 2018 — from Feb 2026
"CP022" => version is V1, // COICOP 1999 — pre Feb 2026
_ => true // era-independent
};ReflexLibs.Symbology — 648 inflation indices live in production
Tier-0 library with zero internal dependencies ships to production. 8 tiers from TopThree(9) to SixHundredFortyEight(648). Full JSON API at /api/symbology/inflation with filtering by tier, geo, COICOP, and base year.
// Golden key format: {GEO}.HICP.{COICOP}.{BASE}
// e.g. EUR.HICP.XTOB.2015 — HICPxT Euro Area 2015 base
var idx = InflationIndex.Parse("EUR.HICP.XTOB.2015");
// idx.GoldenKey = "EUR.HICP.XTOB.2015"
// idx.EurostatCoicop = "TOT_X_TBC"
// idx.LegacySymbol = "EUR.HICPXTOB.2015"xll.ai live — Xlli document pipeline in production
xll.ai goes live on ContaboRhine1 with the full Xlli document pipeline. XllAiLandingPageBuilder → XlliHtmlRenderer. Six themes (dark/light × green/blue/rust). LettuceEncrypt auto-provisioning HTTPS for all three domains.
// Xlli pipeline: structured data → renderer → HTML
var doc = XllAiLandingPageBuilder.Build(iconResolver);
var html = XlliHtmlRenderer.RenderLandingHtml(doc, new HtmlRenderOptions
{
Version = ComponentVersions.GetVersion("xllai-web"), // "6.4.12.2"
});decimal128 Phase 1 — C# System.Decimal + Rust rust_decimal parity confirmed
Bitwise equivalence confirmed between C# System.Decimal and Rust rust_decimal. Both use a 96-bit mantissa with a decimal scale factor — same model, different language. Foundation for the decimal128 pricing workstream across Black-76, SABR, and NormDist.
use rust_decimal_macros::dec;
// Exact decimal arithmetic — no float rounding
let result = dec!(0.1) + dec!(0.2);
assert_eq!(result, dec!(0.3)); // ✓ exact
// C# cross-validation:
// decimal r = 0.1m + 0.2m;
// Debug.Assert(r == 0.3m); // ✓ same resultGPU renderer scaffolding — wgpu + DirectWrite + etagere
Phase 3 Rust GPU renderer scaffolded. xll-platform-render-gpu crate wired into workspace. DirectWrite (dwrote crate) for glyph shaping, etagere for atlas packing. Goal: pixel-level parity with WebView2/Chromium at 150% DPI — no Chromium dependency.
// Render flow: XlliDocument → GPU render passes (no Chromium)
// ExportController::render_xlli() → XlliDocument
// → render-gpu: walk sections
// → DirectWrite glyphs + wgpu rectangles
// → xll-secure-app window (air-gapped)nano-math-autodiff — Dual/Dual2 across C# and Rust, 57+23 tests
Automatic differentiation live in both C# and Rust. Dual<T> for first-order, Dual2<T> for second-order. Injectable NormDist architecture means Black-76 works with f64, Dual, or Dual2 — same code path, different numeric type. 57 C# tests + 23 Rust tests all passing.
// Black-76 vega in one pass via Dual — no finite differences
let vol = Dual::var(0.20); // differentiate w.r.t. vol
let price = black76(f, k, t, vol, df, cp, &norm);
// price.v = option price
// price.dv = vega (∂price/∂vol)Black-76 Rust family complete — 23/23 tests, bitwise parity with C#
Lognormal, Bachelier, and shifted-lognormal Black-76 fully ported to Rust. NormDist extracted as a swappable trait. All 23 test vectors bitwise-identical to the C# reference implementation. The Triumvirate is complete for the base pricing family.
// Injectable NormDist — swap erfc, lookup table, or approximation
pub trait NormDist {
fn cdf(&self, x: f64) -> f64;
fn pdf(&self, x: f64) -> f64;
}
pub fn black76<N: NormDist>(
f: f64, k: f64, t: f64, vol: f64, df: f64, cp: i32, norm: &N,
) -> f64 {
let d1 = ((f/k).ln() + 0.5*vol*vol*t) / (vol*t.sqrt());
let d2 = d1 - vol * t.sqrt();
df * cp as f64 * (f * norm.cdf(cp as f64*d1) - k * norm.cdf(cp as f64*d2))
}xll-deploy.py — automated build, snapshot, and service restart
Production deploy pipeline in Python. Walks csproj dependency tree, publishes Release build, writes timestamped snapshot to xll.ai.production, copies LettuceEncrypt accounts forward, updates Windows service binary path, and restarts the service. One command deploys everything.
# Full deploy in one command
python xll-deploy.py xllai-web --slim
# Automatically:
# 1. dotnet publish → bin/
# 2. Copy accounts/ (LettuceEncrypt certs) from last good snapshot
# 3. sc.exe config svc-xllai-web binPath= <new exe>
# 4. Restart-Service svc-xllai-web
# 5. git commit to xll.ai.productionSecure Platform — 6 crates, xll-secure-preview running
Rust secure platform workspace complete with 6 crates: xll-platform-core, render-html, render-pdf (stub), transport (SecureTransport+STDIO), xll-secure-app (HIGH SECURITY, zero Chromium), and xll-secure-preview (WebView2 utility). Preview binary running with version dashboard.
// xll-secure-app: zero Chromium, zero network stack
// xll-secure-preview: WebView2 utility for internal tooling
// Both share the same ExportController trait
pub trait ExportController {
fn render_html(&self, route: &str) -> String;
fn render_xlli(&self, route: &str) -> XlliDocument;
}WIT Component Model proven — cargo-component builds 63KB WASM
WIT-based WASM Component Model proven on Claude1. cargo-component + wit-bindgen toolchain working. Result<f64, MathError> replaces bare exports. record decimal28 for Component Model boundary. All transcendentals (sqrt, exp, ln, erf, phi) verified through typed WIT interfaces.
// WIT interface — typed, versioned, language-agnostic
interface core-math {
sqrt: func(x: f64) -> result<f64, math-error>;
exp: func(x: f64) -> result<f64, math-error>;
ln: func(x: f64) -> result<f64, math-error>;
erf: func(x: f64) -> result<f64, math-error>;
phi: func(x: f64) -> result<f64, math-error>;
}NanoTable V4 — Contracts/Prism/Build/Render/Export/SDK split complete
NanoTable library split into 6 focused assemblies. Rust port substantially complete with Export + SDK crates. 290+ tests across C# and Rust. JavaScript NanoTable.SDK.BidAskTable Rust port complete. SpreadMatrix migrated to V4. Clean architecture, zero circular dependencies.
// V4 split: each assembly has one job
// Contracts — NanoTableModel, DocSection, NanoCodeBlock (pure data)
// Prism — colour themes, CSS token maps
// Build — NanoTableBuilder (fluent API)
// Render — HTML, Skia, PDF renderers
// Export — Export controllers, Navigator wiring
// SDK — BidAskTable, SpreadMatrix, user-facing APIEurostat HICP revision history — EurostatHistory Web2/Web3
EurostatHistory web apps (Web2/Web3) deployed providing HICP revision history with NanoTable rendering. Base-comparison tables (2015/2025 base), flash estimates, and HICP decomposition. End-user data tool for inflation market participants.
// HICP revision: compare vintages of the same index
// Base 2015 → Base 2025 rebasing handled automatically
// Flash estimate vs final release delta shown in NanoTableNavigator multi-panel WPF framework — IsolatedWebView2 + bus messaging
Navigator framework built: multi-panel WPF with WebView2 pool, isolated/web panel modes, XLLQ SinglePageBus messaging. TestDashboard with TRX pivot tables. Export Controller Pattern (pure C# rendering + thin ASP.NET adapter) established as the standard architecture.
// Export Controller Pattern — same controller, two hosts
[HttpGet("/riskevo-site/symbology/inflation")]
public ContentResult ServePage() // ASP.NET Kestrel
=> new() { Content = BuildHtmlPage(), ... };
[NonAction]
public string RenderHtml(string route, bool lightTheme = false)
=> BuildHtmlPage(lightTheme); // WPF WebView2 (no HTTP)ECOICOP V2 effective — Eurostat switches to COICOP 2018 classification
Eurostat adopts ECOICOP V2 (COICOP 2018) from February 2026. Tobacco changes from CP022 to CP023. All-items changes from CP00 to TOTAL in TSV keys. ReflexLibs symbology library updated to handle both eras with date-based validation. Historic I15 data remains V1.
// V2 effective date — single source of truth
public static readonly DateOnly EcoicopV2EffectiveDate = new(2026, 2, 1);
// Tobacco code lookup — correct for any date
public static string TobaccoCoicopAsOf(DateOnly asOf) =>
asOf < EcoicopV2EffectiveDate ? "CP022" : "CP023";BGC Euro Inflation customer app — Navigator pattern, XllDB vault stack
BGC European Inflation customer application built on Navigator pattern. XllDB vault stack for data access. BGC broker relationships (Mike Lane, Jacques Semour, Daniel Sahyoun, Deniz Safer) served through the same Kestrel + Navigator infrastructure as internal tools.
Xlli universal document format — TOML publication manifests
Xlli JSON document format designed and built. XlliDocument, XlliCard, XlliAsset, XlliMeta types. TOML publication manifests for brand-switch and version-sync. NanoTable.Markdown added. The Xlli format becomes the interchange between C# and Rust renderers.
// One document format drives every output surface
var doc = new XlliDocument {
Format = "xlli",
Sections = [ new DocSection { Type = DocSectionType.Hero, ... } ],
Cards = { ["kestrel-web"] = new XlliCard { ... } },
Css = BuildThemeCss(), // 6-theme CSS
Script = BuildThemeJs(), // dark/light + colour toggles
};solution.ai.toml + cps.ai.toml manifest system established
TOML-first manifest system established across the monorepo. solution.ai.toml declares workspace members and dependencies. cps.ai.toml declares component properties and version. Every project, library, and WASM module now has a machine-readable TOML identity.
# solution.ai.toml — workspace declaration
[solution]
name = "xll.ai.main"
version = "6.4.12"
[workspace]
members = ["src/Xll.Ai.NanoLibs", "src/Xll.Ai.Components", ...]
# cps.ai.toml — component identity
[component]
name = "nano-math-autodiff"
version = "6.4.12.1"
languages = ["csharp", "rust"]NormDist injectable architecture — ErfcNormDist, tail-stable put pricing
INormDist interface introduced in C# with ErfcNormDist implementation for tail-stable put pricing. Injectable across Black-76 lognormal, Bachelier, and shifted-lognormal. Same interface ported to Rust as NormDist trait. Foundation for Dual-based autodiff integration.
// Tail-stable put pricing via erfc — avoids cancellation for deep OTM puts
public class ErfcNormDist : INormDist {
public double Cdf(double x) => 0.5 * Erfc(-x / Math.Sqrt(2));
public double Pdf(double x) => Math.Exp(-0.5*x*x) / Math.Sqrt(2*Math.PI);
}
// Same interface in Rust: pub trait NormDist { fn cdf(&self, x: f64) -> f64; }NanoLibs.Inflation + Svensson-FrontJet calibration
NanoLibs.Inflation library established. Svensson-FrontJet yield curve calibration infrastructure. Zero-coupon inflation swap pricing, HICPxT forward curve construction, and seasonal adjustment models. Production-grade inflation analytics for the European market.
Rust WASM in production — nanotable_wasm.wasm embedded in Nano.Vault
Rust WASM target proven in production. nanotable_wasm.wasm compiled via wasm-pack and embedded in Nano.Vault fat DLL as an embedded resource. Browser-side NanoTable computation with zero server round-trip. The WASM deployment model established for all future Rust ports.
// wasm-pack build → .wasm embedded in C# DLL as resource
// C# loads it at runtime — no file path, no deployment headache
var bytes = GetType().Assembly.GetManifestResourceStream("nanotable_wasm.wasm");
var module = WasmModule.Load(bytes);
var result = module.Call("nanotable_render", jsonInput);XLLQ SinglePageBus — WebView2 bridge for multi-panel messaging
XLLQ message bus built for WebView2 multi-panel applications. State sync, model assignment, session save/load — all via postMessage. IsolatedWebView2 panels communicate without HTTP overhead. The bus becomes the backbone of the Navigator desktop framework.
// JavaScript bridge — panels communicate via XLLQ bus
window.xllq.publish(39;model.assign39;, {
panelId: 39;pricing-panel39;,
modelId: 39;EUR.HICP.XTOB.201539;,
asOf: 39;2026-01-3139;
});
window.xllq.subscribe(39;model.loaded39;, (msg) => {
renderNanoTable(msg.data);
});ImageManagerCache3 — 380+ embedded language icons, data URIs
ImageManagerCache3 built with 380+ embedded images across 18 catalogs (flags, programming languages, economic indicators, seasonal). All images served as Base64 data URIs — zero external HTTP requests. ComboLoader generates the embedded resource DLL at build time from TOML manifests.
# image_toml_to_csproj.py — generates image DLL from TOML manifest
# 380+ images × 3 sizes = ~1100 embedded resources
# Catalogs: proglang, flags, eco, seasonal, ...
[[images]]
catalog = "proglang"
key = "rust"
sizes = [64, 96, 128]
source = "images/ProgLanguage/rust.png"reflex-contracts — 5 contract layers, 23 tests, Rust IRS pricing
reflex-contracts Rust crate complete with 5 contract layers for IRS, bonds, swaptions, caps/floors, and inflation swaps. 23 tests green. The Rust contract hierarchy mirrors the C++ heritage architecture with full Rust safety guarantees — no unsafe blocks.
// 5 contract layers — mirrors C++ heritage
pub trait IrsContract: PricingContract { fn fixed_rate(&self) -> f64; }
pub trait BondContract: PricingContract { fn coupon(&self) -> f64; }
pub trait SwaptionContract: PricingContract { fn expiry(&self) -> f64; }
pub trait InflationContract: PricingContract { fn index(&self) -> &str; }
// All: Result<f64, PricingError> — no panics, no NaN propagationSABR calibration — Rust port, full vol surface, 57 test vectors
SABR volatility model ported to Rust. Full implied vol surface calibration for EUR swaption markets. Normal SABR, lognormal SABR, and shifted SABR variants. 57 test vectors cross-validated against C# and the original C++ reference implementation.
// SABR implied vol — Hagan et al. approximation
pub fn sabr_vol(f: f64, k: f64, t: f64, alpha: f64, beta: f64, rho: f64, nu: f64) -> f64 {
// Full Hagan formula — handles ATM, smile wings, and time decay
// Cross-validated against C++ reference to 1e-12 precision
}PCT/GB2026/050025 — patent filing for inflation analytics platform
PCT patent application filed covering the AI-reboot inflation analytics platform architecture. Claims cover the polyglot Triumvirate testing model, the TOML-driven mathematical IR generation, and the cross-language numerical validation framework. ISA/EPO written opinion response in progress.
Triumvirate testing proven — C#, Rust, WASM bitwise parity
The Triumvirate testing model proven in production. C# + Rust + JavaScript/WASM produce bitwise-identical results for the same test vectors. Same TOML oracle test vectors drive all three language implementations. This becomes the quality gate for all future ReflexLibs ports.
# Oracle test vectors in TOML — same file drives C#, Rust, and JS tests
[[vectors]]
description = "Black-76 lognormal ATM call"
f = 1.02
k = 1.02
t = 1.0
vol = 0.20
df = 0.98
cp = 1
expected = 0.07797... # identical across all three languagesMathIR — TOML-driven code generation across 5 languages
MathIR (Mathematical Intermediate Representation) system built. TOML specs describe mathematical functions once; code generators emit C#, Rust, C++, Python, and JavaScript implementations. Same algebraic expression, five correct implementations, no manual translation errors.
# MathIR spec — one source, five languages
[function.black76_d1]
inputs = ["f:f64", "k:f64", "t:f64", "vol:f64"]
formula = "( ln(f/k) + 0.5 * vol^2 * t ) / ( vol * sqrt(t) )"
# Emits: C#, Rust, C++, Python, JavaScript — all correctreflex-traits — Rust trait hierarchy for 16 pricing model metrics
reflex-traits crate establishes the Rust trait hierarchy for all IRS and inflation pricing models. 16 sub-metrics for cross-language portability scoring: numerical stability, precision, test coverage, WASM compatibility, edge-case handling, and 11 others. Every model gets a Rustification score.
// 16-metric Rustification score per model
pub struct AiRanking {
pub numerical_stability: f32, // 0–1
pub precision_parity: f32, // bitwise match with C++ reference
pub test_coverage: f32, // fraction of test vectors passing
pub wasm_compatible: bool, // no_std + no unsafe
pub edge_cases: f32, // ATM, ITM/OTM extremes, t→0
// ... 11 more metrics
}Eurostat HICP data pipeline — 648 symbol history, flash estimates
Full Eurostat HICP data pipeline operational. 648 symbols across 31 geographies and all COICOP categories. Flash estimate ingestion, revision tracking, and base-year rebasing (2015↔2025). Data served via NanoTable views to BGC inflation desk and internal analytics.
# Eurostat TSV ingestion — handles old and new format
# Old format: freq,unit,coicop,geo (M,I15,CP00,AT)
# New format: unit,coicop,geo (I15,CP00,AT)
# Both → canonical symbol: AT.CP00.2015NanoTable first production deployment — BGC inflation desk
NanoTable HTML renderer deployed to the BGC European Inflation desk. Bid/ask tables, curve tables, and pivot views all rendered server-side in C# with client-side theme switching. First external customer using the NanoTable stack in production.
// NanoTable — server-side HTML, client-side themes
var model = new NanoTableBuilder()
.AddRow(["EUR", "HICP", "XTOB", "2015", "1.0234"])
.WithTheme(NanoTheme.DarkGreen)
.Build();
var html = NanoTableRenderer.RenderHtml(model);Black-76 C# family complete — lognormal, Bachelier, shifted-lognormal
Black-76 family fully implemented in C#. Lognormal, normal (Bachelier), and shifted-lognormal models. Injectable INormDist interface. 57/57 oracle test vectors passing against C++ reference. Foundation for the Rust port and Triumvirate cross-validation.
// Black-76 lognormal with injectable NormDist
public static double Price(double f, double k, double t, double vol,
double df, int cp, INormDist norm)
{
double d1 = (Math.Log(f/k) + 0.5*vol*vol*t) / (vol*Math.Sqrt(t));
double d2 = d1 - vol * Math.Sqrt(t);
return df * cp * (f * norm.Cdf(cp*d1) - k * norm.Cdf(cp*d2));
}Xll.ai platform concept — Triumvirate Gen2 architecture begins
Xll.ai platform architecture designed. Three-tier deployment: Kestrel web, WebView2 desktop, Rust secure. Single codebase, same controllers serving all three tiers. The Triumvirate Gen2 design — C# + Rust + WASM co-deployed — becomes the engineering north star.
# Three tiers, one platform
# Tier 1: Kestrel → public web (xll.ai, reflexlibs.ai)
# Tier 2: WebView2 → internal desktop (Navigator)
# Tier 3: Rust secure → air-gapped, edge AI, zero ChromiumAI reboot — ReflexLibs C++ heritage enters Rustification phase
Decision made: ReflexLibs C++ heritage (15 years, 8 pricing models, 6 original authors) to be systematically ported to Rust and C# with full Triumvirate cross-validation. The AI reboot begins. Every model gets a portability score. No silent NaN, no exceptions — Result<T,E> everywhere.
// Rustification philosophy:
// No NaN propagation → Result<f64, PricingError>
// No exceptions → explicit error handling
// No unsafe → safe abstractions only
// No hidden state → pure functions, injectable dependencies
// Bitwise parity → same output as C++ referenceReflexLibs C++ heritage — 15 years, production-grade on trading floors
The starting point: ReflexLibs C++ library with 15+ years of production use on trading floors. Interest rate swaps, bonds, swaptions, caps/floors, inflation swaps. Full SABR vol surface calibration for EUR markets. HICP seasonality engine. The battle-tested foundation that everything else is built on.
// C++ heritage — production since 2010
// Black-76 family: lognormal, Bachelier, shifted-lognormal
// SABR: full vol surface calibration (Hagan et al.)
// Inflation: HICP seasonality, ZC swap pricing, ECB curve
// All: deterministic, reproducible, trading-floor grade
double black76_lognormal(double f, double k, double t,
double vol, double df, int cp, const NormDist& norm);