Reproducible native CPU parallelism
Write the quarter circle algorithm in Aner using Philox sampling, then compare ordered hits through the generic local executor.
// The experiment belongs to this Aner program; parallel only schedules its task.
import aner.parallel
import aner.random
fn quarter_circle_hit(parameters: List, index: Int64, task_seed: Int64) -> Int64 {
let x = random.uniform(seed: 42, draw: 2 * index)
let y = random.uniform(seed: 42, draw: 2 * index + 1)
if x * x + y * y <= 1.0 { return 1 }
return 0
}
// Fixed global draw identities preserve the same points across worker counts.
let serial = parallel.repeat(iterations: 100_000, task: quarter_circle_hit,
parameters: List(), execution: parallel.local(workers: 1))
let concurrent = parallel.repeat(iterations: 100_000, task: quarter_circle_hit,
parameters: List(), execution: parallel.local())
print(serial.mean() == concurrent.mean())
print(serial.rows() == concurrent.rows())
print(4.0 * concurrent.mean())
print(concurrent.summary())
Make it your experiment.
Use Aner 0.0.3 or newer. Save this program as examples/parallel/monte_carlo_local.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check examples/parallel/monte_carlo_local.aner
aner run examples/parallel/monte_carlo_local.anerThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
Use Aner 0.0.4 or newer with aner.parallel, aner.random and VS Code extension 0.1.46. The local program needs no remote configuration. Automatic worker thread concurrency honors the discovered CPU budget; the OS controls CPU placement. Native Dense training uses its separate replica execution contract.
Bundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.
Dataset sources & attribution