Skip to content

builtins: add rndn normal-distribution sampler#180

Merged
danieljohnmorris merged 2 commits into
mainfrom
fix/normal-distribution
May 12, 2026
Merged

builtins: add rndn normal-distribution sampler#180
danieljohnmorris merged 2 commits into
mainfrom
fix/normal-distribution

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Doc cited every MC program forced to bootstrap because rnd is uniform-int only. Added rndn mu sigma via Box-Muller. Shared helper across tree/VM/JIT for consistency; each call consumes two fastrand f64 samples. Opcode 104. Statistical tests over N=1000 within 6.3 standard errors.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 86.72566% with 30 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/vm/compile_cranelift.rs 16.66% 10 Missing ⚠️
src/verify.rs 38.46% 8 Missing ⚠️
src/interpreter/mod.rs 85.71% 6 Missing ⚠️
src/codegen/python.rs 40.00% 3 Missing ⚠️
src/vm/mod.rs 97.82% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@danieljohnmorris danieljohnmorris force-pushed the fix/normal-distribution branch 6 times, most recently from b6869b9 to a2edd14 Compare May 12, 2026 09:25
Doc cited every Monte Carlo program forced to bootstrap because rnd is uniform-int only. Added rndn mu sigma via Box-Muller (shared across all three engines for consistency). Each call consumes two fastrand f64 samples. Opcode 104.
@danieljohnmorris danieljohnmorris force-pushed the fix/normal-distribution branch from a2edd14 to eb58ea7 Compare May 12, 2026 23:06
@danieljohnmorris danieljohnmorris merged commit f8ff279 into main May 12, 2026
4 of 5 checks passed
@danieljohnmorris danieljohnmorris deleted the fix/normal-distribution branch May 12, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant