Repository navigation
xquad 0.6 hardens the bytecode checker that decides whether a program may run: its analyses are bounded, so no program can make it hang or do more work than its size allows, and it now checks stack heights, registers and jumps exactly. It also fixes two VM issues raised in a security review, and pip install xquad becomes the one way to install the Python toolchain. The migration guide from 0.5 covers every breaking change.
Breaking changes
- One Python distribution.
xquadnow carriesxqffi,xqcp,xqsaand thexquadCLI in one wheel; those three have no 0.6 release. Replacepip install xqsa(orxqcp,xqffi) withpip install xquad, andxqsa[cuda]withxquad[cuda]. Imports are unchanged. In an environment upgraded in place, runpip uninstall -y xqffi xqcp xqsa, thenpip install --force-reinstall xquad;import xquadrefuses to run next to the 0.5 distributions until you do. - Verifier renamed to checker.
xqvm::verifier::verify→xqvm::checker::check,Verifier→Checker,VerifierError→CheckerError,xqffi.verifier.verify→xqffi.checker.check,xquad.verifier→xquad.checker. The migration guide has a script for the fully qualified forms. - Removed CLI aliases.
xquad asm,dism,runandverify→xquad vm asm,vm dis,vm run,vm check. - Bounded data-flow analyses.
xqvm::dataflow::solve(analysis, cfg)→solve(analysis, cfg, max_visits), returningResult<_, SolveError>. - New error variants.
CheckerErrorgainsAnalysisBudgetExceededandJumpAcrossLoopBoundary;xqvm::ErrorgainsNonBinaryModel. An exhaustive match needs an arm for each. - Constraint opcodes need a binary model.
ONEHOTR,ONEHOTC,EXCLUDE,IMPLIES,EQUALITY,ATLEAST,ATLEASTWandREDUCEraiseNonBinaryModelon a spin or integer model. Allocate withBQMX, or write coefficients withSETLINE,ADDLINE,SETQUADorADDQUAD. Programs compiled byxqcpare unaffected.
Highlights
- The checker runs under a work budget and returns an error instead of stalling.
- Stack heights are checked in one pass over the control-flow graph, including peaks inside a block.
ENERGYreads the sample in place instead of copying it.- Python can interrupt a running VM with Ctrl-C.
- The Linux wheels are built against glibc 2.17; installing needs glibc 2.27, the NumPy floor (0.5 needed 2.34 on x86_64).
Behaviour changes
The default checker accepts some programs 0.5 rejected and rejects some it accepted:
- Accepted now: a program whose only fault is dead code, such as a
DROPon a dead path or a read afterHALT. - Rejected now: a read whose only earlier write sits after a terminator (
ReadUnsetRegister), a stack that overflows inside one block and comes back down (StackOverflowRisk), and aJUMPorJUMPIinto, out of or between loop bodies (JumpAcrossLoopBoundary). - A program rejected by both versions can report a different error or message.
Run xquad vm check over stored programs to find the ones affected.
Deprecations
The names 0.4 deprecated, apart from the CLI aliases, still work and warn in 0.6, and are removed in v0.7.0. The book's Deprecated APIs table lists each replacement.
Packages
| Registry | Packages |
|---|---|
| crates.io | xqvm · xqasm |
| PyPI | xquad |
pip install xquad==0.6.0Documentation: developers.quip.network/docs/xquad
Full changelog (32 changes)
Added
- checker: Reject jumps across loop bodies [BREAKING]
- xquad: Remove the deprecated top-level CLI commands [BREAKING]
Changed
- checker: Append JumpAcrossLoopBoundary to CheckerError
- xqvm: Rename the bytecode verifier to a checker [BREAKING]
Documentation
- solving: Move the deprecated names' removal to v0.7.0
- book: Link the 0.6 migration guide from Stability
- book: Add the migration guide from 0.5 to 0.6
- checker: Document the jump-span rule and JumpAcrossLoopBoundary
- xqvm: List NonBinaryModel among the faults the checker cannot see
- checker: Quote the every-path ReadUnsetRegister message
- Install xquad as the only distribution
- Name xqvm plainly and scope its fault-mapping claim
- xqvm: Cite the spec instead of the removed reference VM
- List every checker phase, rename Verification to Checking
- Finish the checker rename and drop the removed CLI row
- Call the bytecode check a checker
Fixed
- xqsa: Say the deprecated names are removed in v0.7.0
- xqvm: Reject constraint opcodes on non-binary models [BREAKING]
- xqvm: Read the ENERGY sample in place
- checker: Accept a dead loop closer and fail closed on missing facts
- checker: Check exact stack heights in one CFG traversal [BREAKING]
- xqvm: Construct reverse CFG edges without fan-in scans
- checker: Make register analysis monotone and bounded [BREAKING]
- checker: Reject transient intra-block stack overflow
- checker: Stop block analysis at the first terminator
- checker: Bound both minimum stack-depth walks
- checker: Separate reachability from register lattice top
- Refuse to import next to the 0.5 distributions, cover review gaps
- xqffi: Let Python interrupt a running VM
Performance
- checker: Propagate sparse register coordinate changes
Build
- Make the root pyproject the xquad project [BREAKING]
Ci
- release: Build, smoke and publish one distribution [BREAKING]
Full diff: v0.5.2...v0.6.0