From f08460ae5adc970f12b579cd8e5b2d3fe27554cf Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sun, 6 Dec 2026 01:32:54 +0100 Subject: [PATCH] score-v2: freeze script fixes (seed fallback), notes on the frozen set and the service concurrency finding Co-Authored-By: Claude Sonnet 5.5 --- entscheiden/motor/richter_lock/SCORE-V2.md | 17 +++++++++++++++++ .../motor/richter_lock/score_v2_frieren.py | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 entscheiden/motor/richter_lock/SCORE-V2.md diff --git a/entscheiden/motor/richter_lock/SCORE-V2.md b/entscheiden/motor/richter_lock/SCORE-V2.md new file mode 100644 index 00000000..74148cef --- /dev/null +++ b/entscheiden/motor/richter_lock/SCORE-V2.md @@ -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>` 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. diff --git a/entscheiden/motor/richter_lock/score_v2_frieren.py b/entscheiden/motor/richter_lock/score_v2_frieren.py index 04292fd7..4434b0ca 100644 --- a/entscheiden/motor/richter_lock/score_v2_frieren.py +++ b/entscheiden/motor/richter_lock/score_v2_frieren.py @@ -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)