Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
f81f3c3
feat: add optional Rust backend with auto-dispatch
polakowo Apr 13, 2026
fd9f358
chore: bump version to 1.0.0
polakowo Apr 13, 2026
8344d20
chore: modernize .gitignore and fix rust build config
polakowo Apr 13, 2026
b0f9569
refactor: polish README and rename supports_rust to array_compatible_…
polakowo Apr 13, 2026
a517ac3
feat(generic): expand Rust backend to cover full generic module
polakowo Apr 13, 2026
ddf23ff
style: apply consistent code formatting across codebase
polakowo Apr 13, 2026
8f9515d
style: expand multi-arg function calls and signatures to one-per-line
polakowo Apr 13, 2026
b42f107
feat(generic): make accessor layer backend-agnostic and fix Rust edge…
polakowo Apr 14, 2026
450aef6
perf(rust): add row-major optimized 2D kernels for C-order arrays
polakowo Apr 14, 2026
1c4c766
feat(indicators): add Rust backend for core indicators with auto-disp…
polakowo Apr 15, 2026
5db0301
style: apply consistent code formatting to tests, benchmarks, and docs
polakowo Apr 15, 2026
d6c0206
feat(signals): add Rust backend for signal functions with auto-dispatch
polakowo Apr 15, 2026
8b72efc
feat(signals): expand Rust backend to random and stop generation
polakowo Apr 16, 2026
560b9a6
feat(signals): route signal generators through backend dispatch
polakowo Apr 16, 2026
2e5fa91
feat(labels): add Rust backend for label functions with auto-dispatch
polakowo Apr 16, 2026
a82bd48
feat(returns): add Rust backend for return functions with auto-dispatch
polakowo Apr 17, 2026
796630f
perf(rust): add row-major fast paths and lazy iteration optimizations
polakowo Apr 17, 2026
60b5b0c
feat(records): add Rust backend for records functions with auto-dispatch
polakowo Apr 17, 2026
48a4ba3
fix(records): relax record dtype constraints and improve col handling
polakowo Apr 17, 2026
f63ddbd
feat(portfolio): add Rust backend for portfolio functions with auto-d…
polakowo Apr 18, 2026
aa52b3f
feat(api): thread backend parameter through public API methods
polakowo Apr 18, 2026
f72936a
refactor: rename backend to engine across the codebase
polakowo Apr 18, 2026
ce389b1
feat: add instance-level engine preference with per-call override
polakowo Apr 18, 2026
7646a5b
fix(portfolio): improve Rust simulation robustness and random dispatch
polakowo Apr 18, 2026
8608ca0
perf(portfolio): optimize Rust portfolio functions and expand benchmarks
polakowo Apr 18, 2026
b95c05d
perf(portfolio): add non-shared fast path for Rust order simulation
polakowo Apr 18, 2026
e895581
feat(portfolio): add Rust backend for signal-based simulation
polakowo Apr 19, 2026
faefa59
feat(engine): add soft dtype casting and array preparation for Rust d…
polakowo Apr 19, 2026
80b7efa
refactor(engine): align function order and expand Rust dispatch coverage
polakowo Apr 20, 2026
6c9207d
refactor: clean up tests and fix lint warnings across codebase
polakowo Apr 20, 2026
d354dd0
perf(rust): add single-column fast paths and overhaul benchmark harness
polakowo Apr 20, 2026
b26c915
refactor(test): remove obsolete benchmark matrix tests
polakowo Apr 20, 2026
402c30e
perf: optimize hot paths in Rust and Numba kernels
polakowo Apr 20, 2026
bf32535
docs: add Rust engine and benchmark documentation
polakowo Apr 21, 2026
205c518
perf(rust): accept flexible arrays in portfolio simulation without Py…
polakowo Apr 21, 2026
c561acc
perf(rust): extend FlexArray to signals and labels, remove Python-sid…
polakowo Apr 21, 2026
3be37b7
build: add Rust engine to CI, packaging, Docker, and documentation
polakowo Apr 21, 2026
1e99347
docs: refine README features list and installation descriptions
polakowo Apr 21, 2026
45609cb
chore: update copyright years to 2017-2026 across all source files
polakowo Apr 21, 2026
8ac4060
style: set 120-char line width and reformat Rust and Python sources
polakowo Apr 21, 2026
99362ee
build(ci): separate Rust test extras and broaden CI test scope
polakowo Apr 21, 2026
0b8050b
Merge pull request #845 from polakowo/rust-backend
polakowo Apr 22, 2026
9a75403
build(deps): bump rand from 0.8.5 to 0.9.3 in /rust
dependabot[bot] Apr 22, 2026
b93a0d9
fix: update Rust code and tests for rand 0.9 compatibility
polakowo Apr 22, 2026
f27425e
Merge pull request #846 from polakowo/dependabot/cargo/rust/rand-0.9.3
polakowo Apr 22, 2026
5cdbd78
fix(build): use free-text license format in Rust package metadata
polakowo Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.ipynb linguist-language=Python
*.ipynb linguist-language=Python
*.rs linguist-language=Rust
37 changes: 32 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
name: Docker

on:
release:
types: [published]
workflow_call:
inputs:
ref:
required: false
type: string
prerelease:
required: false
type: boolean
default: false
workflow_dispatch:
inputs:
ref:
description: "Git ref to build. Defaults to the workflow ref."
required: false
type: string
prerelease:
description: "Skip latest tags."
required: false
type: boolean
default: false

permissions:
contents: read
Expand All @@ -23,16 +40,26 @@ jobs:
tag_suffix: ""
latest_tag: latest

- variant: rust
vbt_extras: "rust"
tag_suffix: "-rust"
latest_tag: latest-rust

- variant: full
vbt_extras: "full"
tag_suffix: "-full"
latest_tag: latest-full

- variant: full-rust
vbt_extras: "full,rust"
tag_suffix: "-full-rust"
latest_tag: latest-full-rust

steps:
- name: Checkout release tag
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || github.ref }}
ref: ${{ inputs.ref || github.ref }}
fetch-depth: 1
fetch-tags: true
filter: blob:none
Expand All @@ -58,7 +85,7 @@ jobs:
tags: |
type=ref,event=tag,suffix=${{ matrix.tag_suffix }}
type=semver,pattern={{version}}${{ matrix.tag_suffix }}
type=raw,value=${{ matrix.latest_tag }},enable=${{ !github.event.release.prerelease }}
type=raw,value=${{ matrix.latest_tag }},enable=${{ !inputs.prerelease }}

- name: Build and push (multi-arch) - ${{ matrix.variant }}
uses: docker/build-push-action@v6
Expand All @@ -72,4 +99,4 @@ jobs:
build-args: |
VBT_EXTRAS=${{ matrix.vbt_extras }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max
183 changes: 174 additions & 9 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ on:
release:
types: [published]
workflow_dispatch:
inputs:
dry_run:
description: "Build and upload artifacts, but skip PyPI and Docker publishing."
required: false
type: boolean
default: true

permissions:
contents: read

jobs:
release-build:
vectorbt-build:
runs-on: ubuntu-latest

steps:
Expand All @@ -28,34 +34,193 @@ jobs:

- name: Build release distributions
run: |
# NOTE: put your own distribution build steps here.
python -m pip install build
python -m build

- name: Upload distributions
- name: Upload vectorbt distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
name: vectorbt-dists
path: dist/

pypi-publish:
rust-sdist:
runs-on: ubuntu-latest

steps:
- name: Checkout release tag
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || github.ref }}
fetch-depth: 1
fetch-tags: true
filter: blob:none

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Build vectorbt-rust source distribution
run: |
python -m pip install maturin
python -m maturin sdist --manifest-path rust/Cargo.toml --out dist

- name: Upload vectorbt-rust source distribution
uses: actions/upload-artifact@v4
with:
name: vectorbt-rust-sdist
path: dist/

rust-wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
python-version: "3.10"
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
python-version: "3.11"
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
python-version: "3.12"
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
python-version: "3.13"
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
python-version: "3.10"
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
python-version: "3.11"
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
python-version: "3.12"
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
python-version: "3.13"
- os: macos-latest
target: x86_64-apple-darwin
python-version: "3.10"
- os: macos-latest
target: x86_64-apple-darwin
python-version: "3.11"
- os: macos-latest
target: x86_64-apple-darwin
python-version: "3.12"
- os: macos-latest
target: x86_64-apple-darwin
python-version: "3.13"
- os: macos-latest
target: aarch64-apple-darwin
python-version: "3.10"
- os: macos-latest
target: aarch64-apple-darwin
python-version: "3.11"
- os: macos-latest
target: aarch64-apple-darwin
python-version: "3.12"
- os: macos-latest
target: aarch64-apple-darwin
python-version: "3.13"
- os: windows-latest
target: x86_64-pc-windows-msvc
python-version: "3.10"
- os: windows-latest
target: x86_64-pc-windows-msvc
python-version: "3.11"
- os: windows-latest
target: x86_64-pc-windows-msvc
python-version: "3.12"
- os: windows-latest
target: x86_64-pc-windows-msvc
python-version: "3.13"

steps:
- name: Checkout release tag
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || github.ref }}
fetch-depth: 1
fetch-tags: true
filter: blob:none

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Build vectorbt-rust wheel
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --locked --manifest-path rust/Cargo.toml --out dist --compatibility pypi -i python${{ matrix.python-version }}
sccache: "true"
manylinux: auto

- name: Upload vectorbt-rust wheel
uses: actions/upload-artifact@v4
with:
name: vectorbt-rust-wheel-${{ matrix.target }}-py${{ matrix.python-version }}
path: dist/

vectorbt-rust-publish:
if: ${{ !inputs.dry_run }}
runs-on: ubuntu-latest
needs:
- rust-sdist
- rust-wheels
permissions:
id-token: write

environment:
name: pypi

steps:
- name: Retrieve vectorbt-rust distributions
uses: actions/download-artifact@v4
with:
pattern: vectorbt-rust-*
path: dist/
merge-multiple: true

- name: Publish vectorbt-rust distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/

vectorbt-publish:
if: ${{ !inputs.dry_run }}
runs-on: ubuntu-latest
needs:
- release-build
- vectorbt-build
- vectorbt-rust-publish
permissions:
id-token: write

environment:
name: pypi

steps:
- name: Retrieve release distributions
- name: Retrieve vectorbt distributions
uses: actions/download-artifact@v4
with:
name: release-dists
name: vectorbt-dists
path: dist/

- name: Publish release distributions to PyPI
- name: Publish vectorbt distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/

docker-publish:
if: ${{ !inputs.dry_run }}
needs:
- vectorbt-publish
uses: ./.github/workflows/docker.yml
with:
ref: ${{ github.event.release.tag_name || github.ref }}
prerelease: ${{ github.event.release.prerelease || false }}
secrets: inherit
39 changes: 37 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,43 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Create virtual environment
run: uv venv --python ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --extra cov
run: uv pip install --python .venv -e ".[test]"

- name: Run tests
run: uv run pytest tests/
run: uv run --python .venv --no-sync pytest tests/

rust-engine:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Create virtual environment
run: uv venv --python ${{ matrix.python-version }}

- name: Install dependencies
run: uv pip install --python .venv -e ".[test-rust]"

- name: Build local Rust engine
run: uv run --python .venv --no-sync python -m maturin develop --manifest-path rust/Cargo.toml --release

- name: Run Rust engine tests
run: uv run --python .venv --no-sync pytest tests/
Loading
Loading