[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-83175":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":14,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":14,"starSnapshotCount":14,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},83175,"xquad","QuipNetwork\u002Fxquad","QuipNetwork","A rust implementation of the Quip Network's quantum virtual machine.",null,"Rust",5611,17,5,0,34.77,"GNU Affero General Public License v3.0",false,"main",true,[],"2026-06-12 02:04:32","\u003C!--\nCopyright (C) 2026 Postquant Labs Incorporated\nSPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n# XQuad\n\n> **Early public release.** The instruction set, binary format, and public API\n> may still change before v1.0. Production use is not recommended yet.\n\nXQuad is a hardware-agnostic toolchain for expressing and running quadratic\noptimization problems (QUBO \u002F Ising \u002F discrete) across quantum annealers and\nclassical solvers. It ships as three Rust crates plus five Python distributions\nbuilt around a single virtual-machine specification.\n\nThink of it as **LLVM for quadratic models** — a common intermediate\nrepresentation that lets you write a problem once and retarget it to any\nsupported backend.\n\n- **Spec-first.** Every behaviour is nailed down in [`spec\u002Fxqvm\u002FSPEC.md`](spec\u002Fxqvm\u002FSPEC.md)\n  and cross-implementation parity is mechanically enforced: every committed\n  conformance vector runs on both the Rust production VM (`xqvm`) and the\n  Python reference VM (`xqvm_py`) in CI; disagreement fails the build.\n- **Embeddable.** The Rust core supports `no_std + alloc`, so the same VM\n  runs inside WASM runtimes, Substrate pallets, and native binaries.\n- **Interactive.** The Python umbrella (`xquad`) is REPL and Jupyter-friendly:\n  load a program once, run it with different calldata, inspect outputs by\n  slot. Low-level FFI lives in `xqffi`; user-facing `Program` \u002F `Session` \u002F\n  `RunResult` live in `xquad.program`.\n\n## Install\n\n### Rust (from crates.io)\n\n```sh\ncargo install xqcli           # gives you the `xquad` binary\n```\n\n### Python (from PyPI)\n\n```sh\npip install xquad             # umbrella — full pipeline\n# or pick individual pieces:\npip install xqffi xqcp xqsa   # FFI bindings + DSL + solvers\n```\n\n## Package map\n\nThree Rust crates on **crates.io**:\n\n| Crate | Binary | Description |\n|---|---|---|\n| [`xqvm`](xqvm\u002F) | – | X-Quadratic Virtual Machine interpreter, bytecode codec, opcode table (`no_std + alloc`) |\n| [`xqasm`](xqasm\u002F) | – | `.xqasm` text-format assembler |\n| [`xqcli`](xqcli\u002F) | `xquad` | Unified CLI — `xquad run` \u002F `asm` \u002F `dsm` |\n\nFive Python distributions on **PyPI**:\n\n| Package | Description |\n|---|---|\n| [`xqffi`](xqffi\u002F) | PyO3 FFI bindings for `xqvm` + `xqasm` (`xqffi.vm`, `xqffi.asm`) |\n| [`xqvm_py`](xqvm_py\u002F) | Pure-Python reference VM (conformance oracle) |\n| [`xqcp`](xqcp\u002F) | Constraint-programming DSL that compiles to `.xqasm` |\n| [`xqsa`](xqsa\u002F) | Solver adapters (dwave-samplers; pluggable solver interface) |\n| [`xquad`](xquad\u002F) | Umbrella meta-package with interactive `Program` \u002F `Session` \u002F `RunResult` API |\n\nThe one Rust package without a crates.io artefact is the `xqffi` pyo3\ncrate itself — it ships as the `xqffi` PyPI wheel rather than a reusable\nRust library.\n\n## Quick start\n\n### A minimal program (CLI)\n\n```asm\n; add.xqasm — push two integers and add them\nPUSH 10\nPUSH 32\nADD\nHALT\n```\n\n```sh\nxquad asm add.xqasm -o add.xqb && xquad run add.xqb\n```\n\n### End-to-end (Python, via the umbrella)\n\nThe recommended user-facing surface is `xquad.program.Program` +\n`Session` + `RunResult`. Load once, run many times with different\ncalldata, inspect outputs by slot:\n\n```python\nfrom xquad.program import Program\n\nprogram = Program.from_source(\"\"\"\nPUSH 0\nINPUT r0\nPUSH 1\nINPUT r1\nLOAD r0\nLOAD r1\nADD\nSTOW r2\nPUSH 0\nOUTPUT r2\nHALT\n\"\"\")\n\nsession = program.session(output_slots=1)\nsession.set_calldata([40, 2])\nresult = session.run()\nassert dict(result.outputs) == {0: 42}\n```\n\n`Program.load(bytes)` takes wire-format bytecode; `Session.run()`\nreturns a `RunResult` with dict-keyed outputs (unset slots present as\n`None`), residual stack, and step count. See\n[`docs\u002Fpython-api-walkthrough.md`](docs\u002Fpython-api-walkthrough.md) for\nthe full tour.\n\n#### Low-level \u002F conformance surface\n\nFor conformance harnesses and one-shot execution, the raw\n`xqffi.vm.Vm` is still available directly:\n\n```python\nfrom xqffi.asm import assemble_source\nfrom xqffi.vm import Vm\n\nbytecode = assemble_source(src)\nv = Vm()\nv.set_calldata([40, 2])\nv.set_output_slots(1)\nv.run(bytecode)\nassert v.outputs() == [42]\n```\n\nThe `xquad.vm.VM` class offers a middle tier — a unified wrapper with\nbackend dispatch (`VMBackend.RUST` \u002F `VMBackend.PYTHON`) that accepts\n`.xqasm` source and normalises types across the two interpreters.\n\n### End-to-end worked example\n\n[`examples\u002Ftsp\u002F`](examples\u002Ftsp\u002F) shows a full Travelling Salesman Problem\ndriven from the `xqcp` DSL through the VM and `xqsa` solver, runnable on\neither the Python reference VM or the Rust VM:\n\n```sh\nuv run --no-sync python examples\u002Ftsp\u002Frunner.py --seed 42\nuv run --no-sync python examples\u002Fmaxcut\u002Frunner.py --seed 42 --interpreter rust\n\n# Run every example on both interpreters, diff against golden.json:\nmake example-smoke\n```\n\n## Architecture\n\nXQuad is a stack-based interpreter with a 256-slot register file. Registers\nhold typed values — integers, integer vectors, QUBO\u002FIsing models\n(`XqmxModel`), and candidate solutions (`XqmxSample`). A dedicated loop stack\ndrives `RANGE`\u002F`ITER` iteration.\n\nThe opcode table is declared once in `xqvm\u002Fsrc\u002Fbytecode\u002Ftypes\u002Ftable.rs` via\nthe `opcodes!` x-macro; `conformance\u002Fopcodes.yaml` is the machine-readable\nmirror that all three representations (YAML, Rust macro, `xqvm_py.opcodes`)\nare checked against at build time and in CI\n(`scripts\u002Fcheck-opcode-parity.py`).\n\nThe binary format is a bare instruction stream — no header, no constant\npool — just an opcode byte followed by its operands in big-endian byte\norder.\n\nSee [`docs\u002Fbytecode-semantics.md`](docs\u002Fbytecode-semantics.md) for\ninstruction-by-instruction semantics and\n[`spec\u002Fxqvm\u002FSPEC.md`](spec\u002Fxqvm\u002FSPEC.md) for the normative spec.\n\n## Development\n\n### Prerequisites\n\n```sh\ncurl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fsh.rustup.rs | sh   # stable Rust\nmake deps                                                          # dev tools\n```\n\n### Local setup\n\n```sh\nmake xquad\n```\n\nThis syncs the Python workspace (`xqvm_py`, `xqcp`, `xqsa`, `xqffi`,\n`xquad`) into `.venv\u002F`, builds the `xqffi` pyo3 extension via maturin,\nwrites a workspace `.pth` so scripts anywhere in the repo can\n`import xqcp` \u002F `xqsa` \u002F `xqvm_py` \u002F `xqffi` \u002F `xquad` naturally, and\ninstalls the `xquad` CLI binary under `~\u002F.cargo\u002Fbin\u002F`.\n\nOpen a REPL with everything ready:\n\n```sh\nmake repl\n```\n\n### CI-equivalent locally\n\n```sh\nmake all          # fmt + lint + test (what CI runs)\nmake conformance  # cross-impl parity suite (Rust + Python)\n```\n\n### Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for the development workflow, commit\nconventions, and DCO sign-off requirements. Agent guidelines for AI coding\nassistants are in [AGENTS.md](AGENTS.md); cutting a release is documented in\n[RELEASING.md](RELEASING.md).\n\n## License\n\nLicensed under the [GNU Affero General Public License v3.0 or later](LICENSE).\n","XQuad 是一个用 Rust 实现的量子虚拟机，用于表达和运行二次优化问题（如QUBO\u002FIsing\u002F离散模型），支持在量子退火器和经典求解器上执行。其核心功能包括硬件无关性、规范先行设计以及嵌入式和交互式特性。项目通过定义明确的行为规范确保跨实现的一致性，并且Rust核心支持`no_std + alloc`，使得该虚拟机可以在WASM运行时、Substrate托盘和原生二进制文件中运行；Python版本则友好地支持REPL和Jupyter环境。适用于需要在不同后端灵活部署二次优化算法的研究或开发场景。",2,"2026-06-11 04:10:22","top_language"]