Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ae75db4
Upgrade Fugue to version 0.3.0 with major enhancements and breaking c…
alexnodeland Aug 19, 2025
980ad9f
Enhance README and examples for Fugue library
alexnodeland Aug 19, 2025
f182b81
Update CHANGELOG and remove deprecated AdaptiveScales
alexnodeland Aug 19, 2025
07465af
format code
alexnodeland Aug 19, 2025
73cb815
Enhance type-safety in distributions
alexnodeland Aug 20, 2025
ecb6bf6
Refactor distributions for enhanced type safety and validation
alexnodeland Aug 20, 2025
2f60731
Remove unused epsilon variable from VariationalParam sampling methods…
alexnodeland Aug 22, 2025
ce931ac
Improve memory management and add memory benchmarks
alexnodeland Aug 22, 2025
16304eb
Add MCMC benchmarks and update DiminishingAdaptation structure
alexnodeland Aug 22, 2025
37d7e89
Enhance type safety and proposal strategies in MCMC implementation
alexnodeland Aug 22, 2025
e7bb7e8
Refactor MCMC benchmarks and improve code formatting
alexnodeland Aug 22, 2025
b8df4c3
Add rustfmt configuration for consistent code formatting
alexnodeland Aug 22, 2025
a8baecf
Run cargo clippy
alexnodeland Aug 22, 2025
5f15bca
Update Cargo.toml to organize dependencies and add new ones for CLI, …
alexnodeland Aug 22, 2025
131fa51
Add documentation style guide and module README template
alexnodeland Aug 23, 2025
78d9ef5
Enhance error handling system with structured error codes and context
alexnodeland Aug 23, 2025
869e0fc
Add Makefile for build automation and improve testing
alexnodeland Aug 23, 2025
a6d0695
Merge pull request #1 from alexnodeland/refactor/productionize
alexnodeland Aug 23, 2025
9f0209c
Add issue templates (#3)
alexnodeland Aug 23, 2025
cb439a6
Add comprehensive documentation and slim down main README following s…
Copilot Aug 28, 2025
8afdc53
Update README.md
alexnodeland Aug 28, 2025
d911f0f
Update API documentation links and remove outdated notes (#5)
alexnodeland Sep 1, 2025
9ea7e02
Fix/pass ci (#6)
alexnodeland Sep 1, 2025
3897a59
Docs/finalize meta docs (#7)
alexnodeland Sep 1, 2025
930ce40
Update development environment and dependencies (#8)
alexnodeland Sep 1, 2025
a916efe
Chore/update package name (#9)
alexnodeland Sep 1, 2025
3fa3494
Fix/project includes (#10)
alexnodeland Sep 1, 2025
b954a91
Enhance README.md with improved formatting and new sections (#11)
alexnodeland Sep 1, 2025
e84b1ba
Update examples/production_deployment.rs
alexnodeland Sep 1, 2025
636eb26
Update examples/trace_manipulation.rs
alexnodeland Sep 1, 2025
562d2c7
Refactor PooledPriorHandler usage across examples and documentation (…
alexnodeland Sep 1, 2025
d5c5581
Refactor code for improved readability and efficiency (#14)
alexnodeland Sep 1, 2025
1b5df81
Update CI workflow to enforce plugin installation with --force flag
alexnodeland Sep 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mcr.microsoft.com/devcontainers/rust:1-bullseye

# Install OS dependencies here
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
pkg-config libssl-dev cmake clang curl wget && \
apt-get clean && rm -rf /var/lib/apt/lists/*
52 changes: 52 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "rust-mdbook-dev",
"build": { "dockerfile": "Dockerfile" },
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"username": "vscode",
"installZsh": false,
"upgradePackages": true
},
"ghcr.io/devcontainers/features/git:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"serayuzgur.crates",
"tamasfe.even-better-toml",
"tamago324.marksman",
"DavidAnson.vscode-markdownlint",
"yzhang.markdown-all-in-one",
"ms-azuretools.vscode-docker",
"github.vscode-github-actions"
],
"settings": {
"editor.formatOnSave": true,
"rust-analyzer.cargo.features": "all",
"rust-analyzer.cargo.buildScripts.enable": true,
"rust-analyzer.checkOnSave.command": "clippy",
"rust-analyzer.checkOnSave.allTargets": true,
"files.trimTrailingWhitespace": true,
"markdownlint.config": { "MD013": false }
}
}
},
"containerEnv": {
"CARGO_TERM_COLOR": "always"
},
// Cache mounts removed due to Docker compatibility issues
// Use named volumes instead for better compatibility
"mounts": [
"source=cargo-registry,target=/usr/local/cargo/registry,type=volume",
"source=cargo-git,target=/usr/local/cargo/git,type=volume",
"source=cargo-target,target=/workspaces/${localWorkspaceFolderBasename}/target,type=volume"
],
"forwardPorts": [3000],
"portsAttributes": {
"3000": { "label": "mdBook", "onAutoForward": "notify" }
},
"postCreateCommand": "bash .devcontainer/postCreate.sh",
"postStartCommand": "git config --global --add safe.directory /workspaces/${localWorkspaceFolderBasename}",
"remoteUser": "vscode"
}
38 changes: 38 additions & 0 deletions .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -euo pipefail

echo "Starting post-create setup..."

# Rust components
echo "Installing Rust components..."
rustup component add rustfmt clippy

echo "Installing taplo..."
if ! command -v taplo >/dev/null 2>&1; then
ARCH=$(uname -m)
case $ARCH in
x86_64)
TAPLO_ARCH="linux-x86_64"
;;
aarch64|arm64)
TAPLO_ARCH="linux-aarch64"
;;
*)
echo "Unsupported architecture: $ARCH. Skipping taplo installation."
TAPLO_ARCH=""
;;
esac

if [ -n "$TAPLO_ARCH" ]; then
curl -sSfL "https://github.com/tamasfe/taplo/releases/latest/download/taplo-full-${TAPLO_ARCH}.gz" \
| gunzip > /usr/local/bin/taplo && chmod +x /usr/local/bin/taplo || true
fi
fi

# Install dev tools from Cargo.toml dev-dependencies
echo "Installing development tools from Cargo.toml..."
if command -v make >/dev/null 2>&1; then
make install-dev-tools || true
fi

echo "Post-create setup completed!"
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.md]
max_line_length = off
trim_trailing_whitespace = false
83 changes: 83 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0] - 2025-09-XX

### Added

- Initial release of Fugue, a monadic probabilistic programming library for Rust.
- **Core probabilistic programming framework**:
- `Model<A>` abstraction for composable probabilistic programs.
- Monadic operations: `bind`, `map`, `and_then`, `pure` for program composition.
- `sample`, `observe`, `factor`, `guard` primitives for probabilistic modeling.
- **Type-safe distribution system** with natural return types:
- `Bernoulli` distribution returning `bool` (eliminates `== 1.0` comparisons).
- `Poisson` and `Binomial` distributions returning `u64` (natural counting).
- `Categorical` distribution returning `usize` (safe array indexing).
- Continuous distributions (`Normal`, `Beta`, `Gamma`, etc.) returning `f64`.
- 10 built-in distributions with parameter validation and numerical stability.
- **Ergonomic macros** for probabilistic programming:
- `prob!` macro for Haskell-style do-notation.
- `plate!` macro for vectorized operations over collections.
- `addr!` and `scoped_addr!` macros for hierarchical addressing.
- **Multiple inference algorithms**:
- MCMC: Adaptive Metropolis-Hastings with convergence diagnostics.
- SMC: Sequential Monte Carlo with multiple resampling methods.
- VI: Mean-field variational inference with ELBO optimization.
- ABC: Approximate Bayesian Computation with distance functions.
- **Effect handler system**:
- `Handler` trait for pluggable model interpreters.
- 5 built-in handlers: `PriorHandler`, `ReplayHandler`, `ScoreGivenTrace`, `SafeReplayHandler`, `SafeScoreGivenTrace`.
- Type-safe execution preserving distribution return types.
- **Trace system** for execution history:
- Complete recording of random choices and log-weights.
- Type-safe value access with `get_f64()`, `get_bool()`, `get_u64()`, `get_usize()`.
- Three-component log-weight decomposition (prior, likelihood, factors).
- **Memory optimization**:
- Copy-on-write traces (`CowTrace`) for efficient MCMC proposals.
- Object pooling (`TracePool`) for zero-allocation inference.
- Efficient trace construction (`TraceBuilder`).
- **Production features**:
- Comprehensive error handling with `FugueError` and error codes.
- Numerically stable algorithms with overflow protection.
- Convergence diagnostics: R-hat, effective sample size, Geweke tests.
- Statistical validation against analytical solutions.
- **Documentation and examples**:
- Comprehensive user guide with 20+ tutorial and how-to pages.
- Complete API documentation with rustdoc.
- 14 examples covering foundation concepts, statistical modeling, and advanced patterns.
- 158+ doctests ensuring example correctness.
- **Testing infrastructure**:
- 82+ unit tests across all modules.
- 9+ integration tests for end-to-end workflows.
- Property-based testing with `proptest`.
- Continuous integration with format, lint, and test enforcement.

### Changed

- N/A (initial release)

### Deprecated

- N/A (initial release)

### Removed

- N/A (initial release)

### Fixed

- N/A (initial release)

### Security

- N/A (initial release)

[Unreleased]: https://github.com/alexandernodeland/fugue/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/alexandernodeland/fugue/releases/tag/v0.1.0
11 changes: 11 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Docs reviewers
/docs/ @alexnodeland
/examples/ @alexnodeland
# Crate API reviewers
/src/ @alexnodeland
/tests/ @alexnodeland
/benches/ @alexnodeland
# CI and meta
/.github/ @alexnodeland
/.devcontainer/ @alexnodeland
/.vscode/ @alexnodeland
Loading