score-v2: freeze script fixes (seed fallback), notes on the frozen set and the service concurrency finding

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Marc Mintel
2026-12-06 01:32:54 +01:00
co-authored by Claude Sonnet 5.5
parent 83e33da46f
commit f08460ae5a
2 changed files with 19 additions and 0 deletions
@@ -0,0 +1,17 @@
# Scorecard v2, stage 1 (06.12.2026)
Code: `score_v2_ziehung.py` (strata, PPS draw order, weights), `score_v2_frieren.py` (plan + freeze), `score_v2_wert.py` (headline, street sub-scores, paired stratified bootstrap),
`score_v2.py` (one call per version). Specs: `test_score_v2_*.py` (`python3 -m pytest -q entscheiden/motor/richter_lock`, 33 tests). Mutation testing is not set up for Python here.
Frozen set (not in git, real requests): `/Volumes/Alpha SSD/pokerfreak-daten/richter-lock/spots-v2/` (spots.jsonl, anfragen.jsonl, KOPF.json, SHA256SUMS, FARM-AUFTRAG.txt).
Draw: universe = 29,849 real requests; turn/river heads-up; strata street x pot type; 440 spots allocated by pot sum (largest remainder), PPS without replacement
(Efraimidis-Spirakis, sha256 keys, seed 20261206); unbuildable candidates are replaced from the reserve in draw order. All-in layer = all buildable Tor-1 all-ins (own or against).
Weight per spot = stratum money share / spots in stratum. Blocks `alt` (95 old spots, verbatim) and `rueck` (all-in damage > 10 bb) have weight 0.
Spot construction = `richter-lock-spots` with n_turn = n_river = 0 on the candidate file (same code path as spots.sh); the judge binary reproduces the 47 real old spots exactly (fields and ranges, diff 0).
## Finding: the motor service cannot answer requests concurrently today (for the session "mehrweg")
- `entscheiden/motor/src/main.rs:380` reads stdin strictly line by line (`for z in stdin().lock().lines()`), answers and prints before the next line.
- `entscheiden/motor/src/dienst.rs:77`: `Motor.merk` is a `RefCell`, so `Motor` is not `Sync` and cannot be shared by threads.
- `entscheiden/motor/src/temperatur.rs:62`: global `static WIRKUNGEN: Mutex<Vec<..>>` collects effects per answer (mixes concurrent answers).
- Per-request state in `thread_local!`: `dienst.rs:10-16` (notes), `uhr.rs:36-42` (deadline, gap): fine per thread, but must be set and cleared per request.
Until this is changed, answer runs are one service after another (`--teile 1`); no fallback to many processes.
@@ -200,6 +200,8 @@ def frieren(arbeit, gebaut, aus):
for k, vi in enumerate(q.get("villains", [])):
vi.pop("kennung", None)
vi["vw"] = frische_kennung(i, k)
if not isinstance(q.get("seed"), int) or q["seed"] <= 1: # wie frist.py: fehlender Seed aus der Zeile
q["seed"] = int(hashlib.sha256(f"richterlock:{i}".encode()).hexdigest()[:8], 16)
q.update(frist_mod.frist_felder(verteilung, q["street"], q["seed"]))
spots.append(s)
anfragen.append(q)