xqvm_py
Status -- transitional.
xqvm_pyis the executable conformance oracle for the XQuad toolchain: every vector underconformance/must produce identical observable state on both this Python reference and the Rustxqvmproduction runtime. The arrangement is explicitly transitional. Once the Rust runtime is fully battle-tested,xqvm_pymay be dropped entirely (with conformance vectors graduating to "Rust must produce exactly these outputs" reference data) or demoted to a prototyping sandbox for trying out new opcodes / VM features in Python before they earn a spec slot. Do not build infrastructure that hard-depends onxqvm_py's existence.
Python reference implementation of the X-Quadratic Virtual Machine.
See spec/xqvm/SPEC.md for the authoritative
technical specification.
Scope
- Pure-Python executor, state model, opcodes, xqmx (sparse quadratic matrix), vector, and tracer.
- No assembler or disassembler: the Rust
xqasmcrate is the only implementation, exposed to Python viaxqffi.asm(pyo3). Tests and the CLI shim callxqvm_py.program_from_xqasmto turn.xqasmtext into an executableProgram.
Layout
xqvm_py/ <-- this directory IS the package (flat layout)
__init__.py re-exports the public surface (Executor, Program, ...)
__main__.py entry point for `python -m xqvm_py`
executor.py fetch-decode-execute loop
state.py stack, registers, loop control, jump table
opcodes.py Opcode enum + operand metadata
program.py Program dataclass + program_from_xqasm()
xqmx.py sparse quadratic matrix (model + sample modes)
vector.py typed vec<int> / vec<xqmx>
errors.py typed runtime errors
tracer.py step-by-step execution tracer
cli/ python -m xqvm_py run ...
tests/ pytest suite (wheel-excluded)
Quick start
From the xquad workspace root:
uv sync # installs xqvm_py editable + xqffi via maturin
uv run pytest xqvm_py/tests # run the full test suite
echo "PUSH 5
PUSH 3
ADD
HALT" > /tmp/prog.xqasm
uv run python -m xqvm_py run /tmp/prog.xqasm # CLI shim
Programmatic use:
from xqvm_py import Executor, program_from_xqasm
prog = program_from_xqasm("PUSH 10\nPUSH 5\nADD\nSTOW r0\nHALT\n")
executor = Executor()
executor.execute(prog)
print(executor.state.get_register(0)) # 15
Conformance
Behavioural parity with the Rust xqvm crate is enforced by the
xquad-conformance Rust test harness at
conformance/. New VM semantics require a new
vector. Divergence between implementations fails CI with no "drift
tracking" middle ground.
Metadata
Release files for xqvm-py 0.4.1
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 | |
|---|---|---|---|---|
| xqvm_py-0.4.1.tar.gz | 94.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xqvm_py-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 153.1 kB
Release files / xqvm_py-0.4.1.tar.gz
| Download URL | xqvm_py-0.4.1.tar.gz |
|---|---|
| Size | 94.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
238bb9131586d5a2fb87e3955ebddbcc01a01f7a492b8b4455d484a75fa28c13
|
|
BLAKE2b-256 checksum How to use checksums |
5563a8b8a19aa2747c9027fd7d4b5c9c997bfcc77ba13ca24f96ec1524e47c16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / xqvm_py-0.4.1-py3-none-any.whl
| Download URL | xqvm_py-0.4.1-py3-none-any.whl |
|---|---|
| Size | 58.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f82320518621cc70da2b0da5dcf938a849d78cd77005a03471f01f84a7ce897
|
|
BLAKE2b-256 checksum How to use checksums |
eabefe6b2c78e688c47f44e04e164ca4a998fae0d71460b808ab41009339fac6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for xqvm-py 0.4.1
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.