Documentation / @finchart/core / index / XMappingProbe
Interface: XMappingProbe
Defined in: packages/core/src/scale/x-mapping.ts:119
A place to count which road was taken, when a fast path and a slow path fork.
When an optimization is "pick one of two" rather than "make it faster", you can't measure the cost but you can count which path was chosen — unlike timing, that's deterministic and doesn't jitter. Without this, an optimization like that could be deleted and the tests would stay quiet: the answer is the same so correctness tests don't catch it, and the call count is the same so invariant guards don't catch it either.
The cost in production is one undefined check per call — not per step.
Methods
onFallback()?
optionalonFallback():void
Defined in: packages/core/src/scale/x-mapping.ts:131
The scan pass's cursor hit a backward step wider than the window and had to search from scratch.
A backward step within the window (values mixed within a decimation bucket) is walked; a far forward jump (a decimation stride) is caught up silently by galloping — that's still scanning, so it isn't reported. Since the cursor is owned by the pass, one or two of these at the start of a pass are normal. If it scales with the number of points in the pass, the scan has stopped working.
Returns
void
onFullRebuild()?
optionalonFullRebuild():void
Defined in: packages/core/src/scale/x-mapping.ts:140
The rebuild fell back to a full walk — how many times the tail fast path (when the same source arrays grew in place, keeping their identity from the last rebuild) missed. The normal value for a new candle is 0; setData, prepend, and a configuration change are correctly counted as full every time.
Returns
void