scorecompute✳
← All engines

RUST ENGINE / simulate_pi

Monte Carlo simulation with Rust and CUDA

Estimate π with seeded Monte Carlo sampling on CPU or NVIDIA CUDA, with a Wilson confidence interval and reproducible results.

Try the live calculation ↗Connect an AI assistant →

How it works

The engine samples points uniformly in a unit square and counts those inside the quarter circle. Four times that proportion estimates π. Random values depend on the seed and global sample index, so worker assignment does not change the experiment.

Inputs and units

Provide 100 to 5,000,000 samples, an integer seed and a CPU or CUDA backend. Optionally select CUDA device IDs from the available hardware.

What the result contains

The result includes the estimate, absolute error, Wilson interval, convergence history, a bounded sample for plotting, execution time and device provenance.

Example MCP call

{
  "name": "simulate_pi",
  "arguments": {
    "samples": 1000000,
    "seed": 42,
    "backend": "cuda"
  }
}

Send this tool name and arguments through a connected MCP client. Discover the authoritative input schema with tools/list.

Method reference

NVIDIA CUDA best practices ↗

Execution and availability

ScoreCompute exposes this tool through MCP Streamable HTTP. Rust computation runs on a connected worker; the public website and MCP gateway run separately. CUDA is implemented for simulate_pi; the other tools currently run on CPU. Requests are bounded and concurrent work may be refused when capacity is occupied.

Record inputs, assumptions and returned provenance when sharing a result. The public observatory displays software client names and tool activity, without publishing calculation arguments or results.

Explore another engine →Agent-readable overview ↗