UndercuttingActivitySignal validation and latency

Incremental, causal technical analysis documentation

Measured locally on 2026-10-05, macOS 26.5.1 arm64, CPython 3.14.5, NumPy 2.5.1, RTTA 0.2.4. The C++23/nanobind Release extension was built successfully as a cp312-abi3-macosx_26_0_arm64 wheel with -O3 and interprocedural optimization. The wheel contains the native extension and Python exports, not the private C++ implementation header.

Correctness

The full repository suite passed: 2,339 passed, 2 skipped. Both skips are optional TA-Lib checks because its Python package is not installed. The new instrument and execution example contribute 97 tests. Coverage includes hand-counted improvements/deteriorations; clustered, simultaneous, opposite-side, 1 ms/10 ms and equal-timestamp matching; shared causal classification; irregular spread integration; interval/quarter boundary crossing; late availability; invalid/stale books, gaps, recovery, duplicate IDs and quiet session opens; automatic and external quarterly calibration; raw-QID sample variance; risk-sign inversion; entry, hysteresis and exact k+3 expiry; integer outputs; tick/aggregate and update/advance/batch/replay equivalence; prefix causality; and later-touch paper execution with no future price in pending order state.

Build and test commands for an ordinary local development environment:

python -m pip install --no-build-isolation --no-deps -e .
python -m pytest -q -rs
python tools/build_html_docs.py

For this validation, the wheel was installed into /private/tmp/rtta-ua-build and tested with that path first, bypassing an older installed editable-import redirector. The existing global installation was not modified. The actual build command was:

python -m pip install --no-build-isolation --no-deps --upgrade --target /private/tmp/rtta-ua-build .

Mixed-tape native replay

python benchmarks/benchmark_update_latency.py --samples 200000 --repeat 5 --warmup 1 --indicator UndercuttingActivitySignal,FlowPressureCapacitySignal,SpreadFeatures
Indicator Arity Python loop ns/sample update ns/sample update net ns/sample advance ns/sample advance net ns/sample update/advance C++ replay update ns/sample C++ replay advance ns/sample replay update/advance
UndercuttingActivitySignal 4 18.2 171 153 175 157 0.98x 16.5 16.2 1.02x
FlowPressureCapacitySignal 5 20.8 139 118 109 87.8 1.28x 39.1 39.0 1.00x
SpreadFeatures 3 14.8 87.7 72.9 55.7 40.9 1.57x 9.33 9.45 0.99x

The common registry uses synthetic quotes and trades one millisecond apart. It exercises the ordinary ingestion/matching hot path with sparse completed intervals and no preloaded calibration. Native replay includes batch validation and the C++ loop; Python-facing columns include call overhead. Values are the best of five runs after one warmup, not throughput or tail-latency guarantees.

Frequent calibrated decisions

python benchmarks/benchmark_undercutting_activity.py --samples 50000 --repeat 5 --warmup 1

Python 3.14.5; NumPy 2.5.1; RTTA 0.2.4; macOS-26.5.1-arm64-arm-64bit-Mach-O Samples=50000; repeat=5; warmup=1; best wall time per event, including constructor.

Matching Window ms update ns/event advance ns/event C++ replay update ns/event C++ replay advance ns/event
side_first 10 201.8 202.6 34.9 34.5
global_first 10 199.2 196.2 34.6 34.5
side_first 1 198.6 191.9 34.0 34.4

This supplemental workload completes a five-minute interval every four events, using a validated preceding-quarter snapshot, min_revisions=1 and a five-minute staleness limit. It asserts risk readiness and 12,500 completed decisions before timing. These nondefault quality gates make the synthetic sequence exercise risk, continuation, hysteresis and expiry; they are not proposed market settings. The one-millisecond row also checks the configurable matching path.

No chronological market-data evaluation or profitability claim is made. The Massive example's feed/condition assumptions, execution costs and unresolved supplement matching details are documented in the algorithm page.