This release is a pre-release and may not be stable for production use.
xqffi -- PyO3 FFI bindings for the XQuad Rust runtime
The Python extension that exposes the Rust xqvm interpreter and xqasm assembler. Ships as abi3 manylinux wheels (x86_64 + aarch64, CPython >= 3.13) plus a universal sdist for other platforms, all built by maturin.
xqffi is a pure FFI shim -- it only re-exposes the Rust types and entry points. User-facing conveniences (Program / Session / RunResult, keyword calldata, trace inspection) live in the xquad umbrella package.
Install
pip install xqffi
Surface
xqffi.vm -- low-level one-shot
What the conformance harness drives. Small wrapper over xqvm::Vm:
from xqffi.vm import Vm
from xqffi.asm import assemble_source
vm = Vm()
vm.set_calldata([40, 2])
vm.set_output_slots(1)
vm.run(assemble_source(src))
assert vm.outputs() == [42]
XqmxModel and XqmxSample are thin getter/setter wrappers around the Rust types for direct model/sample manipulation.
xqffi.asm -- assembly
parse_xqasm(str) -> wire dict; assemble_source(str) -> raw bytes; disassemble(bytes) -> human-readable listing; instruction_count(bytes) -> instruction count.
xqffi.verifier -- static verification
verify(bytes) and verify_source(str) run the pre-execution verifier: every jump lands on a TARGET, every register is read after it is written, and stack depth balances. Both return None on success and raise ValueError on a rejected program. See Verifier.
Interactive / multi-run API
Use xquad.program for the REPL / notebook / script workflow:
from xquad.program import Program
program = Program.from_source(src)
session = program.session(output_slots=1)
session.set_calldata([40, 2])
result = session.run()
assert dict(result.outputs) == {0: 42}
Program.load(bytes) takes wire-format bytecode; Session.run() returns a RunResult with dict-keyed outputs (unset slots present as None), residual stack, and step count.
Also see
xqvm_py-- pure-Python reference VM (conformance oracle).xqcp-- constraint programming DSL that compiles to.xqasm.xqsa-- solver adapters: CPU/GPU annealers, D-Wave QPU, Quip network.xquad-- umbrella meta-package with the interactive API.- Running Programs -- full tour.
License
AGPL-3.0-or-later.
Release files for xqffi 0.4.0rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xqffi-0.4.0rc1.tar.gz | 199.6 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xqffi-0.4.0rc1-cp313-abi3-manylinux_2_34_x86_64.whl | CPython 3.13 | abi3 | Linux glibc 2.34+ x86-64 | Details |
| xqffi-0.4.0rc1-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.13 | abi3 | Linux glibc 2.17+ ARM64 | Details |
Total release size: 1.1 MB
Release files / xqffi-0.4.0rc1.tar.gz
| Download URL | xqffi-0.4.0rc1.tar.gz |
|---|---|
| Size | 199.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b0c2ca42c759e7f9c55269cf73a5889c6242ab1cba241cdeb5d4a6bb05d41f8
|
|
BLAKE2b-256 checksum How to use checksums |
086a9c62f8c0ccd39f410eeaab565af3be771dda5f2574e8ce9e1342ca431ad3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / xqffi-0.4.0rc1-cp313-abi3-manylinux_2_34_x86_64.whl
| Download URL | xqffi-0.4.0rc1-cp313-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 450.5 kB |
| Tags | CPython 3.13 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8147efeb1481ab94bc72a6bc97f7264ee7e9e67936d94a95460be1724ea130c8
|
|
BLAKE2b-256 checksum How to use checksums |
41aa0be79e78f6d0d62cf22c1161435a836447bf4bc2b6158788948e413f615a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / xqffi-0.4.0rc1-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | xqffi-0.4.0rc1-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 436.3 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
5dd4cb4f7b5d201cf6e7a54e3960ebeb7cf32de03241b3551070dcb65de7c437
|
|
BLAKE2b-256 checksum How to use checksums |
9bbaf65971ee4d016cca3928c0752329055f1289e219e0ed4d371768b9e87e2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|