gala-driver
Work with Gala's compilation driver — salsa DB orchestration, incremental queries, pipeline wiring
Skill by gala-pl
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/gala-pl-gala-driver
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/gala-driver
Tools it pre-approves 9
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Bash(cargobuild*)testReadWriteEditGlobGrep
What's inside
- Skill name
gala-driver- Description
- Work with Gala's compilation driver — salsa DB orchestration, incremental queries, pipeline wiring
- License
- Apache-2.0
- Allowed tools
- Bash(cargo, build, *), Bash(cargo, test, *), Read, Write, Edit, Glob, Grep
- Instructions
- 126 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves some shell commands
Files (1)
- SKILL.md
SKILL.md (first lines)
## Task
$ARGUMENTS
## Context
Gala's driver (`crates/gala-driver`) **orchestrates compilation** by wiring the **salsa query database**. It defines the `Db` trait, constructs the query graph, and provides high-level compilation entry points used by `gala-cli` and `gala-lsp`.
> **Note on file layout:** The crate currently lives in `crates/gala-driver/src/lib.rs` + `crates/gala-driver/src/db.rs`. As it matures it may be split into `compile.rs`, `emit.rs`, `incremental.rs` (see `docs/ARCHITECTURE.md`). When in doubt, search for the relevant code in `lib.rs` or `db.rs`.
Key files:
- `crates/gala-driver/src/db.rs` — Salsa database definition, all queries
- `crates/gala-driver/src/lib.rs` — High-level compilation API
## Common Tasks
### Add new salsa query
1. Edit `db.rs` — add `#[salsa::tracked]` function
2. Implement in appropriate crate (hir, types, uncompute, gir, etc.)
3. Wire into pipeline if needed
4. Test incremental: edit source, verify only affected queries rerun
### Modify compilation pipeline
1. Edit `db.rs` — queries define pass order (lex → parse → hir → types → linearity → uncompute → gir → ...)
2. Each pass is a salsa query or query group
3. Ensure diagnostics aggregated correctly
### Add emission target
1. Edit `lib.rs` — add `EmitTarget` variant
2. Implement emission function (e.g., `emit_gir`, `emit_qir`)
3. Register in CLI `--emit` flag
4. Test: `gala build --emit new-target examples/hello.gala`
### Optimize incremental performance
1. Profile salsa: `RUST_LOG=salsa=debug`
2. Minimize query inputs (use fine-grained queries)
3. Use `salsa::durability` for rarely-changing inputs
4. Benchmark: cold vs incremental build time
## Testing
```bash
cargo test -p gala-driver # Unit tests
cargo test --workspace driver # All driver tests
cargo run --bin gala -- build examples/hello.gala # Full compile
cargo run --bin gala -- check examples/hello.gala # Check only
# Incremental test: run twice, second should be faster
```
## Conventions
- **Single Db trait** — all crates implement/query through it
- **Queries are pure** — no side effects, deterministic
- **Diagnostics aggregated** — `diagnostics(file)` query collects all
- **Backend-agnostic above GIR** — driver never imports backend crates
- **Shared with LSP** — same Db, same queries
- No `unwrap()` on user paths
## Key Queries (from COMPILER_PIPELINE.md)
```rust
// In crates/gala-driver/src/db.rs
#[salsa::input]
pub struct SourceFile { ... }
#[salsa::tracked]
pub fn tokens(db, file: SourceFile) -> Vec<(Token, Span)>;
#[salsa::tracked]
pub fn ast(db, file: SourceFile) -> Arc<Vec<Item>>;
#[salsa::tracked]
pub fn hir_file(db, file: SourceFile) -> Arc<HirFile>;
#[salsa::tracked]
pub fn hir_file_resolved(db, file: SourceFile) -> Arc<HirFile>;
#[salsa::tracked]
pub fn hir_functions(db, file: SourceFile) -> Arc<HashMap<DefId, HirFnDef>>;
#[salsa::tracked]
pub fn module_graph(db, file: SourceFile) -> Arc<ModuleGraph>;
#[salsa::tracked]
pub fn type_of_query(db, def_id: DefIdInput) -> Result<Arc<Ty>, Arc<Diagnostics>>;
#[salsa::tracked]
pub fn effect_of_query(db, def_id: DefIdInput) -> Result<Arc<TyEffect>, Arc<Diagnostics>>;
#[salsa::tracked]
pub fn linearity_check_query(db, def_id: DefIdInput) -> Result<Arc<Diagnostics>, Arc<Diagnostics>>;
#[salsa::tracked]
pub fn uncompute_query(db, def_id: DefIdInput) -> Result<Arc<UncomputePlan>, Arc<Diagnostics>>;
#[salsa::tracked]
pub fn gir_query(db, def_id: DefIdInput) -> Result<Arc<Gir>, Arc<Diagnostics>>;
#[salsa::tracked]
pub fn gir_diff_query(db, def_id: DefIdInput) -> Result<Arc<Gir>, Arc<Diagnostics>>;
#[salsa::tracked]
pub fn gir_opt_query(db, def_id: DefIdInput) -> Result<Arc<Gir>, Arc<Diagnostics>>;
#[salsa::tracked]
pub fn diagnostics(db, file: SourceFile) -> Arc<Vec<Diagnostic>>;
```
## Debugging
```bash
# Full compilation with timing
RUST_LOG=gala_driver=info cargo run --bin gala -- build examples/hello.gala
# Salsa query trace
RUST_LOG=salsa=debug cargo run --bin gala -- build examples/hello.gala
# Incremental: run twice
cargo run --bin gala -- build examples/hello.galaFrom gala-pl/gala, Apache-2.0.
More from gala-pl/gala
- 0.584score
gala-diff
gala-pl
Work with Gala's native differentiation — parameter-shift for quantum params, reverse-mode autodiff for classical, chain-rule composition
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-hardware-backends
gala-pl
Run Gala programs on quantum hardware — backend selection, capability checking, QIR emission, vendor SDKs
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-language-basics
gala-pl
Learn Gala language fundamentals — syntax, types, effects, linear qubits, basic quantum operations
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-noise-modeling
gala-pl
Model and simulate noise in Gala — typed noise models, QuEST noise channels, error mitigation
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-performance
gala-pl
Optimize Gala program performance — gate count, circuit depth, gradient cost, compilation time
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-python-interop
gala-pl
Call Gala from Python — PyO3 bridge, Jupyter kernel, PyTorch integration, NumPy arrays
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-quantum-algorithms
gala-pl
Implement quantum algorithms in Gala — QFT, Grover, phase estimation, adders, oracles
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-vqa-programming
gala-pl
Build variational quantum algorithms in Gala — encoders, ansätze, optimizers, native grad
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-ast
gala-pl
Work with Gala's AST — add node types, implement visitors, maintain CST/AST separation
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-codegen-classical
gala-pl
Work with Gala's classical codegen — Cranelift (debug) and LLVM (release) for orchestration layer
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
debug-compiler
gala-pl
Debug a compiler error or unexpected behavior in Gala source code
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-cookbook
gala-pl
Gala recipes — common patterns, idioms, algorithms, VQA templates, error handling
SkillAFreshness: A★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 23, 2026 (5 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/gala-pl/gala
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from gala-pl
- 0.584score
gala-diff
gala-pl
Work with Gala's native differentiation — parameter-shift for quantum params, reverse-mode autodiff for classical, chain-rule composition
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-language-basics
gala-pl
Learn Gala language fundamentals — syntax, types, effects, linear qubits, basic quantum operations
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-noise-modeling
gala-pl
Model and simulate noise in Gala — typed noise models, QuEST noise channels, error mitigation
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-performance
gala-pl
Optimize Gala program performance — gate count, circuit depth, gradient cost, compilation time
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-python-interop
gala-pl
Call Gala from Python — PyO3 bridge, Jupyter kernel, PyTorch integration, NumPy arrays
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-hardware-backends
gala-pl
Run Gala programs on quantum hardware — backend selection, capability checking, QIR emission, vendor SDKs
SkillAFreshness: A★ 1Claude Code +9
Cite this page
gala-driver skill. Agent Mart. https://agentmart.dev/skills/gala-pl-gala-driver (last updated 2026-10-24)