Goldy is a Rust GPU library that realizes the Fondaco Machine on modern hardware. Programs describe parcels (data) and schemes (computation with ownership-derived ordering); Goldy manages the physical medium, schedules dispatches, and mediates all foreign interaction through exchanges.
Maturity: Goldy 0.2 is the Fondaco Machine public API. SemVer applies within 0.2.x; expect breaking changes at 0.3. Python bindings remain alpha; Rust is the primary surface.
Traditional GPU APIs expose descriptors, barriers, render passes, and swapchain plumbing. The Fondaco model is different.
Goldy makes that model practical on 2020+ GPUs:
| Fondaco concept | Goldy realization |
|---|---|
| Scheme | Scheme — retained dependency graph, resubmitted each frame |
| Parcel | Parcel / Buffer / Texture — stable handles |
| Dispatch | Compute, render, copy, and present nodes inside a scheme |
| Exchange | SurfaceExchange, MemoryExchange |
| Settlement | Transaction → Claim → consume() / discard() |
- Scheme-first API — record once, submit every frame; barriers and transient aliasing derived automatically
- Typed bindless shaders — Slang with
[goldy_compute],[goldy_vertex],[goldy_fragment]andgoldy_expaccess patterns (Scattered,Broadcast,Interpolated, …) - Compute-to-surface — compute shaders write swapchain drawables directly; no raster pass required
- Native backends — Vulkan 1.4+ (Windows, Linux), DX12 (Windows), Metal Tier 2+ (macOS); no MoltenVK
- Multi-language bindings — Rust (primary), Python, .NET, C++
- 21 Rust examples — triangle, compute particles, Game of Life, plasma, multi-window, and more
Not yet shipped (see runtime mapping for status): yielding scripts, $yield petitions, scheme fusion/splitting, defragmentation, WASI host integration.
use goldy::{
Buffer, BufferKind, ComputePipeline, Context, DeviceDescriptor, Instance,
NodeAccess, RequestAdapterOptions, RetainedPool, Scheme, ShaderModule,
SurfaceConfig, SurfaceExchange, Transaction,
};
let instance = Instance::new()?;
let device = instance
.request_adapter(&RequestAdapterOptions::default())?
.request_device(&DeviceDescriptor::default())?;
let ctx = device.create_context()?;
let pool = RetainedPool::new(&device)?;
let surface = SurfaceExchange::new(&ctx, &window, SurfaceConfig::default())?;
let shader = ShaderModule::from_slang(&device, COMPUTE_SHADER)?;
let pipeline = ComputePipeline::new(&device, &shader)?;
let uniforms = pool.alloc_buffer_with_data(&device, &uniforms_data, BufferKind::Broadcast)?;
let mut scheme = Scheme::new(&ctx);
let present = surface.bind_destination(&mut scheme)?;
scheme
.node("render", &pipeline)
.with_parcel(&uniforms, NodeAccess::Read)
.with_present(&present.0)
.dispatch(wg_x, wg_y, 1);
// Each frame:
let mut submission = scheme.submit()?;
present.1.claim(&mut submission)?.consume()?;Windowed examples require the examples feature:
cargo run --features examples --example compute_to_surface --release
cargo run --features examples --example triangle --releaseProgram (schemes + parcels)
│
▼
Scheme / GraphIR ←── wave & partition analysis, retention
│
▼
RetainedPool / TransientPool / VramAllocator
│
▼
Vulkan │ DX12 │ Metal ←── Slang → SPIR-V / DXIL / MSL
│
▼
Exchanges (present, readback)
Goldy abstracts where bytes live (Layer A: medium) but exposes what access costs (Layer B: coalescing, occupancy, residency). See the design thesis.
[dependencies]
goldy = "0.2"Slang is embedded at build time and extracted at runtime — application developers do not install Slang separately. Set GOLDY_SLANG_PATH only to override. Maintainer bump procedure: slang/manifest.json + slang/download.sh.
Release packaging and shader debugging notes live in the GitHub repo.
| Platform | Backend | Window surfaces |
|---|---|---|
| Windows | DX12 (default), Vulkan | Yes |
| Linux | Vulkan | Wayland (X11 not supported) |
| macOS | Metal | Yes |
Override backend: GOLDY_BACKEND=vulkan|dx12|metal.
Minimum hardware: Vulkan 1.4+, DX12 with Enhanced Barriers, Metal Argument Buffers Tier 2+. See Target Hardware.
- 📖 Documentation — tutorials, programming model, backends, bindings
- 📖 Fondaco Machine spec — normative abstract machine
- 📖 Goldy runtime mapping — what Goldy implements today vs designs in progress
- 📖 API reference — Rust docs
cargo fmt --all -- --check
cargo clippy -- -D warnings
GOLDY_VALIDATION=all cargo testRun all examples: ./run_all_examples.sh (requires --features examples).
MIT — see LICENSE.
Mohamed Koubaa
