MoonPolicyEval is a small MoonBit library for offline reinforcement-learning style evaluation.
It focuses on the parts that are easy to reuse across projects:
episode return
discounted return
episode length
coverage-aware success rate
policy comparison with aligned trajectories
policy ranking across multiple datasets
Markdown report generation
simple CSV trajectory parsing
The project is intentionally decoupled from any training framework. It accepts raw trajectory data and produces reusable reports.
Why this shape
The OSC2026 guide emphasizes:
MoonBit as the primary implementation language
public repository and traceable commits
clear README, runnable example, CI, tests, and mooncakes.io publication
open-source license and source provenance
MoonPolicyEval is designed around those expectations. The code is small enough to review, but the data model can grow with new metrics later.
Data model
An Episode contains:
episode_id
task_id
policy_name
rewards
success
The library derives:
EpisodeScore
PolicySummary
PolicyComparison
CLI
The demo binary is intentionally lightweight and does not depend on a training stack.
moon run cmd/main demo
moon run cmd/main csv-demo
moon run cmd/main rank-demo
moon run cmd/main summary '<evaluation-json>'
moon run cmd/main compare '<comparison-json>'
moon run cmd/main csv-summary '<csv-text>'
moon run cmd/main report '<evaluation-json>'
MoonPolicyEval
MoonPolicyEval is a small MoonBit library for offline reinforcement-learning style evaluation. It focuses on the parts that are easy to reuse across projects:
The project is intentionally decoupled from any training framework. It accepts raw trajectory data and produces reusable reports.
Why this shape
The OSC2026 guide emphasizes:
MoonPolicyEval is designed around those expectations. The code is small enough to review, but the data model can grow with new metrics later.
Data model
An
Episodecontains:episode_idtask_idpolicy_namerewardssuccessThe library derives:
EpisodeScorePolicySummaryPolicyComparisonCLI
The demo binary is intentionally lightweight and does not depend on a training stack.
Evaluation request
Comparison request
Library entry points
episode_returndiscounted_returnepisode_lengthsummarizecompareparse_evaluation_requestparse_comparison_requestTests
Run:
The tests cover:
Repository layout
moonpolicyeval.mbt: core libraryanalysis.mbt: policy ranking helperscsv.mbt: CSV parser and sample payloadreport.mbt: Markdown report renderingcmd/main/main.mbt: demo CLImoonpolicyeval_test.mbt: public testsmoonpolicyeval_wbtest.mbt: white-box testsdocs/SOURCE.md: provenance noteLicense
Apache-2.0