Core mechanism
Each node records an operation and its dependencies, rather than retaining source-language objects. That representation makes node counts, input/output identities and operation mix inspectable before choosing a replay backend.
The Java source records the selected production payoff with NablaTensor and inspects its actual tape nodes.
The market and selected payoff are written into Java. European calls use one fixing; path payoffs use the selected step count.
This exact source runs in TeaVM. Form changes update its Java literals and reset manual edits.
import com.nablatensor.engine.AadOpEnum;
import com.nablatensor.engine.AadTape;
import com.nablatensor.engine.Nabla;
import com.nablatensor.quant.EquityMarket;
import com.nablatensor.quant.Product;
import com.nablatensor.quant.Products;
import com.nablatensor.quant.TimeGrid;
public final class RecordingTapeRiskStudio {
private RecordingTapeRiskStudio() {}
public static void main(String[] args) {
EquityMarket market = EquityMarket.of()
.spot(100)
.strike(100)
.vol(20 / 100.0)
.rate(3 / 100.0)
.maturity(1)
.build();
Product<EquityMarket> product = Products.europeanCall();
report(product, market, 1);
}
private static void report(Product<EquityMarket> p, EquityMarket m, int steps) {
AadTape tape = Nabla.model(m, (rec, in) -> p.record(rec, in, TimeGrid.uniform(steps)))
.tape();
int active = 0;
int[] counts = new int[AadOpEnum.values()
.length];
for (int i = 0; i < tape.size(); i++) {
counts[tape.op(i)
.ordinal()]++;
if (tape.isActive(i)) active++;
}
System.out.println("TAPE|" + steps + "|" + tape.size() + "|" + tape.inputCount() + "|" + tape.outputCount()
+ "|" + active + "|" + (tape.size() - active));
for (AadOpEnum op : AadOpEnum.values()) if (counts[op.ordinal()] > 0) System.out.println("OP|"
+ steps + "|" + op + "|" + counts[op.ordinal()]);
}
}
The recorded graph is an auditable inventory of the arithmetic needed to reproduce a valuation and its adjoint.
Each node records an operation and its dependencies, rather than retaining source-language objects. That representation makes node counts, input/output identities and operation mix inspectable before choosing a replay backend.
Record with representative product dimensions, inspect tape size and operation composition, then choose checkpointing or backend options with evidence rather than assumptions. Re-record after materially changing the payoff structure.
Tape introspection diagnoses computational structure; it does not prove financial-model correctness or numerical convergence.