{"data":{"kind":"file","path":"README.md","version_id":"srf7euex2sx6f9vkqq433a8d","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":3674,"modified_at":"2026-08-16T21:50:20.167000","content_hash":"16a10ebfc97dccd31dfef0187fc302daed18d1d75c4757d2ea1944177f9c0b81"},"entries":[],"content":"# MCMCBench Prime Intellect environment\n\nMCMCBench Prime is a standalone Verifiers 0.3 v1 package for reinforcement\nlearning over MCMC sampler design. One task is one immutable posterior instance.\nAt each turn, the policy returns a structured NIMBLE sampler configuration; the\nenvironment validates it, runs multiple NIMBLE chains, computes posterior\ndiscrepancy and CODA telemetry, returns the configured feedback, and permits\nanother revision.\n\n```text\nJSON sampler action -> trusted validator -> NIMBLE chains -> -Wasserstein reward\n         ^                                                          |\n         +------------------ selected feedback ---------------------+\n```\n\nThe trainable `wasserstein_reward` is the negative standardized sliced\nWasserstein-1 distance from fresh evaluator-private reference draws. The raw\nreference draws and posterior moments never appear in policy state or prompts;\nonly the configured scalar/full/binary reward projection can be returned.\nCODA diagnostics remain trace telemetry and have zero weight in reward. The\naction cannot change the model, data, monitored nodes, chain budget, reference\nevaluator, or reward function.\n\n## Runtime boundary\n\nThe Python wheel is self-contained. It includes the benchmark generator,\nvalidator, reward implementation, prompt, and versioned R verifier sources; it\ndoes not import the parent repository at runtime. R is never launched as a host\nsubprocess. The environment provisions the task's `vf.Runtime`, uploads a\ncontent-hashed R bundle to it, and invokes `Rscript` through\n`vf.Runtime.run`. The same runtime is reused for every pilot in the episode.\n\nThe task-provided image supplies the locked execution toolchain: R 4.6.1,\nNIMBLE 1.4.2, coda 0.19-4.1, and jsonlite 2.0.0. Build it from the environment\ndirectory:\n\n```bash\ndocker build \\\n  -f environments/mcmcbench_prime/Dockerfile.runtime \\\n  -t mcmcbench-nimble:0.2.0 \\\n  environments/mcmcbench_prime\n```\n\nPush that image to a registry accessible by the selected Prime runtime. Set its\npullable reference with `taskset.task.runtime_image`; the task copies it to\n`TaskData.image` and declares `NEEDS_CONTAINER = True`. The local default is\n`mcmcbench-nimble:0.2.0`.\n\n## Install and validate\n\nUse Python 3.12 or 3.13 and install the package directly:\n\n```bash\nuv pip install -e environments/mcmcbench_prime\nprime env install punnettsquare9331/mcmcbench-prime@0.4.0\nuv run validate mcmcbench-prime --only-gold --num-tasks 1\n```\n\nFor a focused transport test that does not require Docker or R:\n\n```bash\nPYTHONPATH=environments/mcmcbench_prime \\\n  python -m pytest environments/mcmcbench_prime/tests/test_runtime_execution.py\n```\n\nThe native package exports exactly one `Taskset` and one `Env`. Procedural mode\nprovides a deterministic, unbounded training stream; fixed mode provides the\nscientific evaluation suite. Task configuration controls the feedback condition\n(`full`, `scalar`, `binary`, or `none`), pilot limit, invalid-action limit,\nchain budget, seed, NIMBLE compilation, and runtime image. A terminal\n`{\"mode\":\"stop\"}` deploys the latest valid sampler configuration, or exact\nNIMBLE defaults when selected immediately.\n\nThe executable action language covers the installed NIMBLE sampler registry,\nordered/overlapping/repeated kernels, initialization, proposal covariance, and\nan environment-owned Metropolis engine. That engine supports replica tempering\nand assumption-free symbolic coordinate maps after SymPy verifies both inverse\ncompositions, the signed Jacobian, and that the determinant is globally\nnonzero. Maps requiring domain assumptions stay gated on a trusted external\nLean artifact. Arbitrary R is never executed.\n","encoding":"utf-8","truncated":false,"total_bytes":3674},"status":null}