Determinism
Repeating a run
Cuprel is designed for deterministic replay: the same data and the same settings are meant to give the same results when a run is repeated.
What replay means
A replay feeds the same bars to the same script with the same settings. The marks, alerts and simulated trades that come out are meant to be the same, and the engine keeps a digest of each so that runs can be compared without reading them.
What is designed out
- Random numbers. They come from a seeded generator whose output depends only on the seed and a position, never on the clock. The default seed does not depend on the text of the script.
- Time. A script reads the time of the bar, not the time of the machine.
- Price steps. Rounding to the price grid uses a table of decimal steps that is written out in full. Computing powers at run time can differ between hosts.
- Math functions. The engine carries its own implementation of the exponential, logarithm, power and trigonometric functions instead of calling the host's math library, which is meant to remove one source of differences between runtimes.
Public statement about the math kernel
Not published yet. A statement about identical results across runtimes will appear here only after the path that production uses has passed a multi-engine check and the evidence record allows it. Evidence is being gathered.
What can be said now: the kernel does not promise correctly rounded results.
How it is checked
Replay tests, stored digests of results, and runs on several JavaScript engines are part of the engine's internal checks. Their results are internal. They are not published as claims, and nothing on this page is a measurement.
See also Resources for the limits that keep a run bounded, and Status for the label of each area.