How factslab/quivers works
Quivers is a typed functional probabilistic programming language with a PyTorch runtime. The principal path is authoring QVR (or generating it from a formula), checking and compiling it to QIEC, then executing and fitting a model or transpiling it to another probabilistic language. The graph also shows the documented diagnostics, structural/categorical API, and language tooling branches. Product relationships are based primarily on the README workflow; sampled source excerpts are partial, so uncertain internal call links are omitted.
Main entry points: module.py Checked QIEC · program.py Program wrapper · grammar.js QVR source · program_runtime.py QIEC execution
Components 19
QVR language
- Formula interface
src/quivers/formulas/compile.py - QVR source
grammars/qvr/grammar.js - Parser and compiler
src/quivers/dsl - Checked QIEC
src/quivers/qiec/module.py
Execution and inference
- Program wrapper
src/quivers/program.py - QIEC execution
src/quivers/qiec/program_runtime.py - Effect handlers
src/quivers/effects/interpreter.py - Inference methods
src/quivers/inference
Analysis and targets
- Diagnostics
src/quivers/diagnostics - Static analysis
src/quivers/analysis - Transpilation pipeline
src/quivers/transpile/_pipeline.py - Target renderers
src/quivers/transpile/renderers
Developer tooling
- CLI and REPL
src/quivers/cli - Language server
src/quivers/lsp/server.py - Editor grammar
editors/vscode-qvr/src/extension.ts
Modeling APIs
- Categorical and structural API
src/quivers/categorical
Other components
- Model author
- PyTorch
- External target runtimes
Connections 24
- Model author → QVR source: authors
- Model author → Formula interface: specifies formula
- Formula interface → QVR source: generates QVR
- QVR source → Parser and compiler: parses and checks
- Parser and compiler → Checked QIEC: compiles to
- Model author → CLI and REPL: invokes
- CLI and REPL → Parser and compiler: checks source
- CLI and REPL → Program wrapper: runs program
- Checked QIEC → Program wrapper: loads checked module
- Program wrapper → QIEC execution: invokes entry
- QIEC execution → Effect handlers: dispatches effects
- QIEC execution → PyTorch: executes with
- Program wrapper → Inference methods: fits model
- Inference methods → PyTorch: uses autodiff
- Inference methods → Diagnostics: produces diagnostics
- Checked QIEC → Static analysis: summarizes program
- Model author → Transpilation pipeline: requests target output
- Transpilation pipeline → Target renderers: dispatches rendering
- Target renderers → External target runtimes: emits target code
- Model author → Editor grammar: edits source
- Editor grammar → Language server: requests language services
- Language server → QVR source: analyzes documents
- Checked QIEC → Language server: provides tooling context
- Categorical and structural API → PyTorch: models with