AQX
Adaptive Quantitative Python Execution
AQX is a research prototype for risk-aware adaptive backend selection in quantitative Python workloads. It studies whether a system can choose among existing execution strategies—rather than asking developers to manually benchmark every implementation—while controlling the risk of a bad choice.
Research status: experimental / pre-publication. Results in this repository are evidence from a small benchmark corpus, not production performance guarantees.
Why AQX?
Quantitative Python code can run through multiple execution paths: ordinary Python, NumPy vectorization, Numba JIT, and Numba parallel execution. The fastest option depends on workload structure, input size, compilation effects, and machine characteristics.
AQX treats backend selection as a prediction + risk-control problem.
Python workload
|
v
workload features
|
v
backend-selection model
|
+--> uncertainty / regret risk
|
v
select backend or use safe fallback
Current research result
The v0.9 measured corpus contains 20 cases across four quantitative-finance workload families and five sizes, with measurements for four backends: pure Python, NumPy, Numba, and Numba-parallel.
Under the repository's primary held-out protocol, the best lightweight selector reached:
- 95.0% oracle-hit accuracy
- 3.52% mean regret
- 0% median regret
A deliberately harder leave-one-workload-family-out experiment reached 80.0% accuracy and 12.48% mean regret.
These are promising results, but the benchmark currently uses one machine and a small corpus. The project is therefore not yet presented as a production optimizer or as definitive evidence of general performance.
Installation
Python 3.10+ is supported.
After the first PyPI release, install the published distribution with:
python -m pip install aqx-adaptive-execution
To install the current source checkout instead:
python -m pip install -e .
For local research and development dependencies:
python -m pip install -e ".[research,dev]"
The distribution name (aqx) must be available on PyPI at publication time. If PyPI rejects it as unavailable or reserved, choose a distinct name such as aqx-quant in pyproject.toml; the Python import name can remain aqx.
Tests
pytest -q
Reproduce the v0.9 analysis
python experiments/run_v09_clean.py
The repository keeps measured timing data under results/ and the research interpretation under paper/.
Project structure
aqx/ # selector and execution components
benchmarks/ # benchmark definitions
experiments/ # experiment runners and analyses
results/ # measured / derived experiment artifacts
plots/ # research figures
paper/ # research notes and results
tests/ # correctness and regression tests
Research positioning
AQX does not claim to invent JIT compilation, vectorization, or automatic parallelization. Those areas have extensive prior art. The research question is narrower:
Can a risk-aware selector choose among existing Python execution backends for quantitative workloads while approaching an oracle policy with substantially less manual backend selection?
Roadmap
- v0.9 — robustness, ablation, cross-family generalization
- v1.0 — larger benchmark corpus, additional hardware, stronger external baselines, decision-overhead accounting
- future — optional C++ / GPU backends if the selection problem remains scientifically compelling
Contributing
See CONTRIBUTING.md. Benchmark improvements are especially valuable when they include reproducible measurement protocols and machine metadata.
License
MIT. See LICENSE.
60-second demo
Install the repository in editable mode, then run:
pip install -e .
aqx-demo --workload monte_carlo --size 4096
The demo warms each backend before measuring it, reports median steady-state time, and shows the empirically fastest backend for that machine and workload. It is deliberately separate from the learned research selector so users can reproduce the basic performance question without downloading trained models.
v1.0 research-release scope
v1.0 freezes the current research baseline and makes the repository easier for outside users to reproduce and challenge. The strongest current result comes from a 20-case corpus and a leave-one-size-rank-out protocol. It should be treated as a research finding, not as a production guarantee.
The next publication-grade experiment should expand the corpus, repeat measurements across hardware, compare stronger autotuning baselines, and report end-to-end selector overhead.
Contributing benchmark evidence
If you benchmark AQX on another machine, please include Python, NumPy, Numba, CPU model, OS, workload, input size, and the exact command used. This lets the project distinguish algorithmic effects from hardware-specific behavior.
Metadata
Release files for aqx-adaptive-execution 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aqx_adaptive_execution-1.0.0.tar.gz | 24.8 kB | Without provenance | Details for aqx_adaptive_execution-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aqx_adaptive_execution-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for aqx_adaptive_execution-1.0.0-py3-none-any.whl |
Total release size: 53.0 kB
Release files / aqx_adaptive_execution-1.0.0.tar.gz
| Download URL | aqx_adaptive_execution-1.0.0.tar.gz |
|---|---|
| Size | 24.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c36299c7ef8e52fec08881abbb177c989a5b2b3d8e9608c2b0726674ed7863f
|
|
BLAKE2b-256 checksum How to use checksums |
7091994a4a835ede2922f7fadfbe9547206ae06b35e83f7e8f70f8163cd3fd84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Release files / aqx_adaptive_execution-1.0.0-py3-none-any.whl
| Download URL | aqx_adaptive_execution-1.0.0-py3-none-any.whl |
|---|---|
| Size | 28.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eac9c3e87d80baa5e52dd768a6bca3d916dac8a205474e4f397e4fb9d3188307
|
|
BLAKE2b-256 checksum How to use checksums |
a63399dfc9a56b7bedb681186011789c419994c96fecf597eecec0448d0348fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Security for aqx-adaptive-execution 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.