Land the lecture evaluation system (benchmark plugin 0.3.0: rubric v2, skill wired)#5
Land the lecture evaluation system (benchmark plugin 0.3.0: rubric v2, skill wired)#5mmcky wants to merge 13 commits into
Conversation
… cases The quantitative evaluation system for lecture code rewrites developed and validated on QuantEcon/lecture-python.myst#717 and #654: - references/EVALUATION_FRAMEWORK.md — the standard in prose: 7 weighted dimensions, numeric scoring anchors, structural checklists, verdict bands, worked HIGH/LOW examples - scripts/scoring/ — the standard as code: rubric.py (deterministic evidence -> score), score.py (engine/CLI), EVIDENCE_TEMPLATE.json (the judgement contract: measured numbers + cited yes/no answers) - scripts/calibration/ — the shared aiyagari Bellman benchmark pinning the "25x as-used = score 5" efficiency anchor - references/examples/{ge_arrow,markov_asset}/ — two complete worked evaluations (measurement scripts, results, evidence, reports): ge_arrow 2.85/5 mixed/wash; markov_asset 2.25/5 net regression (build-breaking bug) Content as delivered 2026-07-21; placed at plugin-convention paths. Path/link integration follows in a separate commit.
Integration on top of the landed package (content authored by @xuanguang-li; this commit is path/plumbing only plus docs): - score.py takes a lecture directory path (works from any cwd) instead of a name resolved against the old package root - ge_arrow scripts use local imports (import model_old), matching the markov_asset idiom, so every script runs directly from its directory - run_all.py (both examples): scoring call updated to the new layout, lecture dir derived not hardcoded, and a provenance stamp written to results/env.json (python/platform/numpy/jax/quantecon versions) -- the seed of the QuantEcon/meta#335 shared result schema - All relative links in EVALUATION_FRAMEWORK.md and the two reports rewritten for the new layout (verified: no dangling references) - scripts/README.md rewritten: engine layout, the three-step scoring contract, the evaluate-a-new-lecture recipe - SKILL.md updated: system landed, operational procedure now points at the real engine/templates, worked cases become regression anchors - benchmark plugin 0.1.0 -> 0.2.0 (marketplace kept in sync) Verified: both example scorecards regenerate byte-identically from the new layout; scripts/validate.py green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR lands the benchmark plugin’s lecture-acceleration evaluation framework, including a prose rubric plus a deterministic scoring engine and two worked evaluation baselines (ge_arrow, markov_asset) that can be regenerated from evidence files.
Changes:
- Adds a deterministic scoring engine (
scripts/scoring/) that computes dimension scores + weighted totals from per-lectureevidence.json. - Adds a shared efficiency calibration benchmark (
scripts/calibration/bellman_bench.*) and updates plugin/marketplace versions to0.2.0. - Adds the evaluation framework document plus two fully-worked evaluation example directories (scripts, results, evidence, reports) used as regression anchors.
Reviewed changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates plugin status messaging for benchmark. |
| benchmark/skills/review-acceleration/SKILL.md | Replaces placeholder procedure with the new 3-step evidence→score workflow and calibration anchors. |
| benchmark/scripts/scoring/score.py | Adds the scoring CLI that reads <lecture>/evidence.json and writes <lecture>/results/scorecard.json. |
| benchmark/scripts/scoring/rubric.py | Implements the rubric as code (weights, thresholds, checklists, verdict bands). |
| benchmark/scripts/scoring/EVIDENCE_TEMPLATE.json | Introduces the evidence schema template for new evaluations. |
| benchmark/scripts/README.md | Documents the scripts layout and end-to-end evaluation workflow. |
| benchmark/scripts/calibration/bellman_bench.py | Adds the shared high-end efficiency calibration benchmark. |
| benchmark/scripts/calibration/bellman_bench.json | Commits the benchmark output pinning the “score 5” efficiency anchor. |
| benchmark/references/examples/markov_asset/scripts/static_metrics.py | Adds markov_asset static metrics extraction used in scoring evidence. |
| benchmark/references/examples/markov_asset/scripts/smoke_test.py | Adds a runnable smoke test for old/new markov_asset implementations. |
| benchmark/references/examples/markov_asset/scripts/run_all.py | Adds markov_asset pipeline orchestration + provenance stamp + shared scoring invocation. |
| benchmark/references/examples/markov_asset/scripts/model_old.py | Adds extracted baseline NumPy implementation under evaluation. |
| benchmark/references/examples/markov_asset/scripts/model_new.py | Adds extracted candidate JAX implementation under evaluation (verbatim). |
| benchmark/references/examples/markov_asset/scripts/check_equivalence.py | Adds markov_asset equivalence checking (float32 vs x64) and patched-call-option comparison. |
| benchmark/references/examples/markov_asset/scripts/benchmark.py | Adds markov_asset warm scaling benchmark. |
| benchmark/references/examples/markov_asset/scripts/as_used_total.py | Adds markov_asset as-used (cold-inclusive) end-to-end timing script. |
| benchmark/references/examples/markov_asset/results/static_metrics.json | Adds captured metrics output used by the evidence/scorecard. |
| benchmark/references/examples/markov_asset/results/scorecard.json | Adds computed scorecard output for markov_asset baseline. |
| benchmark/references/examples/markov_asset/results/scaling.json | Adds captured scaling results for markov_asset baseline. |
| benchmark/references/examples/markov_asset/results/equivalence_x64_True.json | Adds captured x64 equivalence results for markov_asset baseline. |
| benchmark/references/examples/markov_asset/results/equivalence_x64_False.json | Adds captured float32-as-shipped equivalence results for markov_asset baseline. |
| benchmark/references/examples/markov_asset/markov_asset_REPORT.md | Adds the worked markov_asset evaluation report. |
| benchmark/references/examples/markov_asset/evidence.json | Adds the worked markov_asset evidence file consumed by the scorer. |
| benchmark/references/examples/ge_arrow/scripts/sweep_bench.py | Adds ge_arrow sweep benchmark used by the evaluation pipeline. |
| benchmark/references/examples/ge_arrow/scripts/static_metrics.py | Adds ge_arrow static metrics extraction used in scoring evidence. |
| benchmark/references/examples/ge_arrow/scripts/run_all.py | Adds ge_arrow pipeline orchestration + provenance stamp + shared scoring invocation. |
| benchmark/references/examples/ge_arrow/scripts/model_old.py | Adds extracted baseline NumPy implementation under evaluation. |
| benchmark/references/examples/ge_arrow/scripts/model_new.py | Adds extracted candidate JAX implementation under evaluation (verbatim). |
| benchmark/references/examples/ge_arrow/scripts/cold_start.py | Adds cold-start latency measurement for ge_arrow evaluation. |
| benchmark/references/examples/ge_arrow/scripts/check_equivalence.py | Adds ge_arrow equivalence checking across all lecture examples. |
| benchmark/references/examples/ge_arrow/scripts/benchmark.py | Adds ge_arrow benchmark (as-used, warm, scaling) used in scoring evidence. |
| benchmark/references/examples/ge_arrow/scripts/as_used_total.py | Adds ge_arrow as-used (cold-inclusive) end-to-end timing script. |
| benchmark/references/examples/ge_arrow/results/sweep.json | Adds captured sweep benchmark results for ge_arrow baseline. |
| benchmark/references/examples/ge_arrow/results/static_metrics.json | Adds captured metrics output used by the evidence/scorecard. |
| benchmark/references/examples/ge_arrow/results/scorecard.json | Adds computed scorecard output for ge_arrow baseline. |
| benchmark/references/examples/ge_arrow/results/equivalence.json | Adds captured equivalence results for ge_arrow baseline. |
| benchmark/references/examples/ge_arrow/results/benchmark.json | Adds captured benchmark results for ge_arrow baseline. |
| benchmark/references/examples/ge_arrow/ge_arrow_REPORT.md | Adds the worked ge_arrow evaluation report. |
| benchmark/references/examples/ge_arrow/evidence.json | Adds the worked ge_arrow evidence file consumed by the scorer. |
| benchmark/references/EVALUATION_FRAMEWORK.md | Adds the evaluation framework specification, anchors, and workflow. |
| benchmark/.claude-plugin/plugin.json | Bumps benchmark plugin version to 0.2.0. |
| .gitignore | Adds standard Python/macOS ignore patterns. |
| .claude-plugin/marketplace.json | Updates marketplace version to 0.2.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…/template Addresses Copilot review on #5: - rubric.py computes the verdict band from the rounded total, so the band always agrees with the number displayed (raw FP sums can land at 2.4999999999999996 for combinations that are exactly 2.50 in exact arithmetic; 797/78125 score combinations were affected) - rubric.py docstring points at ../../references/EVALUATION_FRAMEWORK.md - EVIDENCE_TEMPLATE.json _how cites the actual CLI form (scripts/scoring/score.py <lecture-dir> from the plugin root) Both committed scorecards regenerate unchanged (neither sits at a band edge). The x64-divergence guard in score_correctness is deliberately left as authored — rubric semantics stay with the standard's author. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
From the detailed logic review of the evaluation scripts: - run_all.py (both examples) now captures the JSON lines printed by the fresh-process scripts (as_used_total, cold_start) into results/as_used.json / results/cold_start.json, with the derived as_used_speedup - the headline metric previously lived only on the console, though the docstrings already claimed aggregation - ge_arrow static_metrics: remove the duplicated "@" pattern that double-counted concept token hits (informational metric only; regenerated results: old.concept_token_hits 110 -> 105) - markov_asset static_metrics: rename statements_for_one_asset -> statements_for_one_result, matching EVIDENCE_TEMPLATE.json and the ge_arrow template vocabulary (values unchanged; results regenerated) Both scorecards regenerate byte-identically - no scored value changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benchmark/references/examples/README.md explains both canonical cases in detail - the economics, the two implementations, where every evidence number comes from, and why each verdict is what it is - and records the 2026-07-21 line-by-line verification (scorecard byte reproduction, evidence-results cross-checks, rubric edge audit, fairness audit) plus the known caveats (M1 hand-curated readability inputs, m3 x64 stamping, n6 sweep asymmetry). These examples are the regression baseline for the skill; their accuracy is now auditable rather than asserted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Detailed logic review completed — all 17 scripts line-by-line, plus scripted cross-checks of every evidence value against its results-file source. Full write-up now lives in the PR as Verdict: logic sound, methodology fair, every traceable number consistent. Fairness properties verified: Fixed in
For @xuanguang-li's consideration (rubric/design territory — deliberately not changed here):
Also still open from the earlier Copilot round: the 🤖 Generated with Claude Code |
From the adversarially-verified final review (31-agent pass over the full PR): Robustness (both run_all.py files — all four confirmed by execution): - guard against JSON-scalar stdout lines (json.loads succeeds on `42`/ `null`; .get then raised AttributeError and aborted the pipeline) - track per-step returncodes; failed step titles now go into the provenance stamp so a partial run cannot claim full provenance for stale results - symmetric total_s guard in the as_used_speedup derivation (bare numpy-side index could KeyError) - warn on duplicate mode keys instead of silently overwriting Simplification (integrator-authored code only): - the byte-identical 18-line write_env block duplicated in both run_all.py files becomes shared scripts/scoring/env_stamp.py, invoked like score.py (-26 LOC net; the shared meta#335 schema now has one definition) Consistency: - gitignore the per-run generated results (as_used.json, cold_start.json, env.json) and annotate their doc citations as generated-not-committed (committing them faithfully is impossible here: the local env is jax 0.10.1 vs the reports' 0.4.35) - examples/README: fix 'logic 5' -> 4 (scorecard and its own arithmetic say 4; with 5 the listed scores sum to 3.00, not 2.85) - REPORT link labels updated to match their (already-correct) targets; markov REPORT's stale statements_for_one_asset key renamed - evidence.json _how strings and score.py's scorecard _note now cite scripts/scoring/... (scorecards regenerated; only the _note changed) - SKILL.md no longer restates the weight vector and verdict bands -- it points at EVALUATION_FRAMEWORK.md sections 1-2 and rubric.py, so recalibration cannot drift the copies - scripts/README: commands documented as running from the plugin root Both scorecards regenerate byte-identically under the updated engine; validate.py green; env_stamp smoke-tested including steps_failed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Final review completed (31-agent adversarially-verified pass: integration correctness traced path-by-path, measured duplication analysis, doc-overlap mapping, installed-plugin packaging, fresh-eyes diff review, and an execution agent that ran every documented command). Fixes landed in Two additional items for @xuanguang-li (found by the fresh-eyes pass; your files, your call):
Deferred simplification bundle (measured, verified outcome-preserving, but touching your scripts' structure — proposed for whenever a third example lands or the next re-measurement, whichever comes first):
Deliberately not proposed: sharing the median-timer/results-path/allclose helpers — measured as a net negative (couples the templates the adaptation model wants independent). 🤖 Generated with Claude Code |
* Docs: plugin guide, skill usage, repo setup — with triage mode validated
- benchmark/README.md: the plugin's user guide — review mode (session
walkthrough, report format), triage mode ("should this lecture be
converted?"), manual pipeline quickstart, plugin map
- SKILL.md: triage-mode section (the prospective subset: baseline
as-used total, pattern match against the calibrated poles, crossover
check, readability-cost forecast, and the weight-algebra decision
rule)
- docs/using-skills.md: consumer guide — setup paths, invocation forms,
report-first expectations, troubleshooting
- docs/developing-skills.md: contributor guide — layout, conventions,
dev loop, versioning, squash-merge/stacking and external-author
attribution patterns
- README.md: documentation index
Triage mode is empirically validated before being documented: blind
triage using only baseline-side data (fresh runs: ge_arrow 0.028s,
markov_asset 0.087s; committed calibration: aiyagari pattern 54.3s)
reproduces all three known verdicts (don't convert / don't convert /
convert), and correctly cannot predict conversion-quality defects
(markov_asset's build bug) — that scope limit is documented with it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Docs: fix command count and map-table link text
Addresses Copilot review on #6: the manual-install snippet is three
commands, not two; the benchmark map row's link text now matches its
target (scripts/README.md) with the engine path named in the
description instead.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Docs: scale the evidence discipline by output tier, not blanket
The evidence-file + engine pattern applies to skills that aggregate
judgements into scored verdicts; findings-list skills need only cited
claims. developing-skills.md gets the three-tier discipline; CATALOG
gains the principle.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Design review: corrections of record + merged three-way synthesis
Two independent design critiques of the evaluation system (a fresh
unframed session; a 36-agent adversarial workflow with steelman
defense) were merged in reviews/. Three of our own claims were
falsified by execution and are corrected here:
- markov_asset's lecture DOES build in notebook order: a stale global
err masks the stray err.throw(), silently disabling the checkify
stability validation (worse than a crash, but not a build failure).
Erratum prepended to the REPORT; wording corrected in examples
README, SKILL.md, plugin README; correction posted on
lecture-python.myst#654
- "mirrors the lecture exactly": both reference replays deviate from
the lectures' construction patterns; certification corrected
- "medians over repeats": false for the as-used totals (single pass
per side); fairness-audit wording corrected; triage validation
noted as in-sample
reviews/ holds the independent report and the merged synthesis:
which critiques survived the steelman defense (convention-only safety
couplings; readability instrument inverting its own exemplars; the
review/triage mode contradiction; band-label semantics; noise vs
resolution) and which were defended (ratio form, weighted total,
min() shape, per-consequence billing), plus the ranked v2 plan.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Update references after withdrawal of the #654 comments
The evaluation findings briefly posted to lecture-python.myst#654 were
withdrawn; the PR will receive one authoritative evaluation after the
rubric-v2 revision and a full skill run, rather than a
comment-and-correction trail. Erratum and merged review updated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…mp, K-repeat Implements items 1-4 of #7 (the changes that survived the three-way design review), validated against both committed evidence files: - score_all derives the logic&design bug-cap from the correctness evidence (builds / x64-divergence) instead of trusting a hand-set boolean, and gates the verdict: correctness 1 caps at net regression, correctness 2 at mixed/wash. The review's honest-evidence 4.2 hole (float32 catastrophe, no logic bug -> "merge") now gates to net regression. - no-conversion verdict: baseline as-used under the 1 s materiality floor (a labeled policy choice) + slower as-used candidate -> the scorecard says don't convert instead of scoring the polish. Reconciles review with triage. - sensitivity stamp in score.py: every scored input perturbed one at a time (bools flipped, counts +/-1, floats +/-10%); scorecard stamped robust/fragile with deciding flips listed. - K-repeat as-used: run_all.py repeats each as-used side 3x in fresh processes; the headline speedup is a median, per-run speedups feed a contested-band annotation in the engine. Re-validation: ge_arrow re-scores 2.85 (unchanged), verdict now no-conversion (candidate band mixed/wash), stamped fragile with exactly the review's demonstrated flips. markov_asset re-scores 2.25 (unchanged), no-conversion + gated net regression, stamped robust across all 29 perturbations - the gate absorbs the one-concept band flip the review demonstrated. Both band movements are deliberate v2 changes, noted in the reports. Benchmark plugin bumped to 0.3.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Operationalizes /benchmark:review-acceleration for installed-plugin runs (#4 item 3): evaluations are built under <workspace>/benchmark-eval/<lecture>/ with the plugin read-only at CLAUDE_PLUGIN_ROOT (run_all.py already resolves the shared engine from that env var); preconditions stated up front; extraction/replay diff check added to scaffold; the v2 verdict outputs (gates, no-conversion, sensitivity stamp) carried through the procedure, triage decision rule, and calibration anchors. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tplace Adds a Testing locally section to the contributor guide: --plugin-dir for skill iteration, a local-path marketplace for full install simulation before merging (test from a consuming project; the checkout's branch is what gets served; the marketplace name collides with production), and the remove/add/install sequence to return to the GitHub source afterwards. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…reproduced The skills#8 dry run, targeting the motivating PR the system was first developed on (lecture-python.myst#717) rather than the reserved #654 acceptance case. Fresh partial clone at base 8cfba4c / head 8c2d0d7, wired workspace procedure (benchmark-eval/<lecture>/ with CLAUDE_PLUGIN_ROOT), jax 0.10.1 vs the reference 0.4.35: reproduces 2.85 / no-conversion / fragile with the same three deciding flips; every measured quantity moved only within its band. Full cross-comparison in reviews/validation-run-ge_arrow-2026-07-22.md. Fixes surfaced by the run: - ge_arrow check_equivalence.py now writes equivalence_x64.json under JAX_ENABLE_X64 instead of clobbering the as-shipped results (the markov_asset template already did this per-regime) - model_old.py fidelity note discloses the cosmetic whitespace normalisation found by diffing against a fresh extraction - both evidence files now record source_pr + base/head SHAs (provenance was previously PR-number-and-branch only) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Walks the review-acceleration procedure end-to-end by hand - checkout at the recorded SHAs, workspace scaffold, K-repeat measurement, the two precision regimes and why each exists, evidence, scoring, band-based cross-comparison - with every command and number taken from the recorded validation run so readers can check their results against a committed reference. Linked from the README docs table and the benchmark guide. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… truth Adds the repo-level instructions file for AI agents and contributors, following the QuantEcon.manual convention: AGENTS.md is canonical and CLAUDE.md imports it. Its governing principle is @jstac's — skills point to existing documentation in the manual wherever possible instead of repeating what the manual says — worked out concretely for this repo: rule text stays upstream in style-guide, numbers live once, every topic has an owning doc, and cross-boundary references are links rather than copies. The rest of the file is a doc map plus the conventions that aren't written down anywhere else (commit subjects, scratch notes, writing for the GitHub renderer). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lands @xuanguang-li's complete evaluation system for lecture code rewrites — the deliverable #4 was waiting on, developed and validated on QuantEcon/lecture-python.myst#717 and QuantEcon/lecture-python.myst#654. Two commits, deliberately split: commit 1 is the package as delivered, authored by @xuanguang-li; commit 2 is path/plumbing integration plus docs.
What lands
references/EVALUATION_FRAMEWORK.mdscripts/scoring/rubric.py(evidence → score, deterministically — never hand-typed),score.py(CLI),EVIDENCE_TEMPLATE.json(the judgement contract: measured numbers + cited true/false answers)scripts/calibration/references/examples/ge_arrow/references/examples/markov_asset/The two worked cases double as the regression baseline: the skill must reproduce their verdicts. Verified in this PR — both scorecards regenerate byte-identically from the new layout via
python scripts/scoring/score.py references/examples/<lecture>.Integration (commit 2)
score.pytakes a lecture directory path (runs from any cwd); ge_arrow scripts converted to local imports matching the markov_asset idiomrun_all.pywrites a provenance stamp (results/env.json: python/platform/library versions) — the seed of the PROJECT: QuantEcon benchmarking programme (code performance & execution) meta#335 shared result + environment-descriptor schemascripts/README.mdrewritten around the three-step contract (measure → record evidence → score); SKILL.md procedure now points at the real engine and templates, with the worked cases as calibration anchors0.1.0 → 0.2.0, marketplace kept in sync;validate.pygreenDesign note
Per-lecture measurement scripts are adapted templates, not a fixed harness — adapting them to each lecture's examples and call sequence is exactly the step the skill automates, while scoring stays deterministic. This supersedes the "generalised CLI" idea in #4 item 2.
🤖 Generated with Claude Code
Update 2026-07-22 — docs merged in, rubric v2, skill wired (plugin 0.3.0)
This PR now also carries three follow-ups so the whole system can be tested from this branch before landing on
main:2aea122): user/developer docs, the benchmark user guide, validated triage mode, the design-review record (reviews/), and the markov_asset corrections of record.719e825) — the four engine quick-wins from PLAN: evaluation rubric v2 — enforce couplings, verdict vocabulary, instrument fixes (from the three-way design review) #7 that survived the three-way design review, each validated against the committed evidence files: safety couplings enforced inscore_all(derived logic&design bug-cap; correctness 1/2 gates the verdict band — the review's honest-evidence 4.2 hole now gates to net regression), the no-conversion verdict (reconciles review mode with triage), a one-flip sensitivity stamp (robust/fragile with deciding flips), and K-repeat as-used (median of 3 fresh-process runs with contested-band annotation).a36a744): evaluations run in the user's workspace (benchmark-eval/<lecture>/) with the plugin read-only atCLAUDE_PLUGIN_ROOT; preconditions and the extraction/replay diff check added to the procedure.Re-validation: both totals are unchanged (ge_arrow 2.85, markov_asset 2.25); both verdicts now lead with no-conversion, markov_asset's additionally gated at net regression. ge_arrow stamps fragile (the review's demonstrated flips, listed in the scorecard); markov_asset stamps robust — the v2 gate absorbs the one-concept band flip the review demonstrated. Band movements are documented as deliberate v2 changes in both reports. Plugin
0.2.0 → 0.3.0, marketplace in sync,validate.pygreen.