Skip to content

perf(factors): optimize rolling operators and bench path#376

Merged
warren618 merged 1 commit into
mainfrom
codex/integrate-pr342-factor-perf
Jul 2, 2026
Merged

perf(factors): optimize rolling operators and bench path#376
warren618 merged 1 commit into
mainfrom
codex/integrate-pr342-factor-perf

Conversation

@warren618

Copy link
Copy Markdown
Collaborator

Summary

  • Add bottleneck/NumPy fast paths for hot factor operators: ts_rank, ts_argmax, ts_argmin, and decay_linear.
  • Add factor-bench process parallelism and base-equity vectorization with regression coverage.
  • Apply maintainer polish on top of perf(factors): tiered operator optimization — bottleneck + numpy stride + parallel bench #342: initialize large bench inputs once per worker, preserve custom registry= injection by using sequential mode for injected registries, handle invalid worker env values, suppress all-NaN ts_rank runtime warnings, and remove the unused hypothesis dev dependency.

Credit

Original performance implementation from #342 by @shadowinlife. This maintainer integration keeps the contribution and tightens the parallel execution and dependency edges before merge.

Closes #339
Refs #342

Validation

  • python -m pip install --target /tmp/vibe-pr342-bn-only --no-deps "bottleneck>=1.3.7" -q
  • PYTHONPATH=/tmp/vibe-pr342-bn-only:agent pytest agent/tests/test_factor_operators.py agent/tests/test_bench_parallel.py agent/tests/test_equity_regression.py -q -> 50 passed
  • VIBE_TRADING_DISABLE_BOTTLENECK=1 PYTHONPATH=/tmp/vibe-pr342-bn-only:agent pytest agent/tests/test_factor_operators.py -q -> 38 passed
  • python -m compileall -q agent/backtest/engines/base.py agent/scripts/bench_performance.py agent/src/factors/_backend.py agent/src/factors/base.py agent/src/factors/bench_runner.py
  • git diff --check
  • PYTHONPATH=/tmp/vibe-pr342-bn-only:agent python agent/scripts/bench_performance.py

Closes #339

Original implementation from #342 by @shadowinlife.

Maintainer integration keeps the bottleneck and numpy operator fast paths, vectorized base equity calculation, and bench parallelism while initializing large bench inputs once per worker process, preserving custom registry injection by using sequential mode for injected registries, removing the unused Hypothesis dev dependency, and quieting all-NaN ts_rank warnings.
@warren618 warren618 merged commit 593dba8 into main Jul 2, 2026
1 check passed
@warren618 warren618 deleted the codex/integrate-pr342-factor-perf branch July 2, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Tiered acceleration for factor computation and backtest execution engine

2 participants