mirror of
https://github.com/wassname/moral-maps.git
synced 2026-08-22 12:10:13 +08:00
Sequential eval was the bottleneck (~12s/vignette × 131 = 27 min/pass; with bidirectional ±C × 14 methods, that projected to ~17 h). Three model calls per row (phase1 generate, scoring forward, cosmetic continuation) became one phase1 + one scoring per *batch*; continuation generate dropped (callers only use p_true + pmass_format). Parity smoke (scripts/smoke_batch_parity.py): float32 is bit-exact (max Δp_true=0.0000 over 16 prompts, 4.3× speedup at limit=4). bf16 drifts on individual rows — greedy argmax flips at near-tie tokens then phase1 diverges — but pmass agrees within 0.03 (scoring forward correct) and aggregates over 131 vignettes will average out the per-row noise. Other changes shipped in this commit: - core.py: analyse() now returns raw_pmass dict alongside raw p_true (callers needed per-(vid,cond,frame) pmass for diagnostic warnings). - guided.py guided_rollout: warn + log top-5 when pmass<0.9 (catches OOD steering / format-broken vignettes without a separate audit pass). - eval.py: pre-tokenize a sample to log expected prompt+cache budget so OOM is predictable from the SHOULD line; group items by frame so each batch shares schema_hint + prefill.