diff --git a/messung/farm/innovation/aus-vergleich.py b/messung/farm/innovation/aus-vergleich.py new file mode 100644 index 00000000..ddeda581 --- /dev/null +++ b/messung/farm/innovation/aus-vergleich.py @@ -0,0 +1,18 @@ +# Gegenprobe: Antworten mehrerer Arme (farm_zeitprobe ..jsonl) je Anfrage vergleichen (Zug, Groesse, Grund), je Strasse; Marke [Vorflop-selbst zaehlen +import json, sys, collections, re +NORM = lambda g: re.sub(r"\d+ ms", "# ms", str(g)) # Rechenzeiten im Grund sind keine Abweichung +pfad, arme = sys.argv[1], sys.argv[2:] +L = {a: [json.loads(z) for z in open("%s.%s.jsonl" % (pfad, a), encoding="utf-8")] for a in arme} +k = lambda r: None if r is None else (r.get("action"), r.get("size"), NORM(r.get("reason"))) +basis = arme[0] +for a in arme[1:]: + je = collections.Counter(); ab = collections.Counter(); abzug = collections.Counter(); marke = collections.Counter(); bsp = [] + for x, y in zip(L[basis], L[a]): + st = x["street"]; je[st] += 1 + if k(x["antwort"]) != k(y["antwort"]): + ab[st] += 1 + if (x["antwort"] or {}).get("action") != (y["antwort"] or {}).get("action") or (x["antwort"] or {}).get("size") != (y["antwort"] or {}).get("size"): abzug[st] += 1 + if len(bsp) < 3: bsp.append((x["i"], st, str((x["antwort"] or {}).get("reason"))[:90], str((y["antwort"] or {}).get("reason"))[:90])) + if "[Vorflop-selbst" in str((y["antwort"] or {}).get("reason", "")): marke[st] += 1 + print("%s gegen %s: Anfragen %s | abweichend (Zug/Groesse/Grund) %s | davon Zug oder Groesse %s | Marke [Vorflop-selbst %s" % (a, basis, dict(je), dict(ab), dict(abzug), dict(marke))) + for b in bsp: print(" Beispiel", b) diff --git a/messung/farm/innovation/vs-jam.ps1 b/messung/farm/innovation/vs-jam.ps1 new file mode 100644 index 00000000..e7537a3c --- /dev/null +++ b/messung/farm/innovation/vs-jam.ps1 @@ -0,0 +1,35 @@ +# innovation 05.12.: Bau 6de8484cb und b88a78a1d, dann (1) knoten-jam, (2) bau-jam, (3) Gegenprobe ohne Schalter (500 echte Anfragen) +$ErrorActionPreference = 'Continue' +$G = 'D:\Projects\pokerfreak-daten\grundstrategie-mitzaehler'; $O = 'D:\Projects\pokerfreak-daten\innovation\vorflop_selbst' +if (Test-Path 'D:\Projects\pokerfreak\scratch\laeufer.pid') { 'SPIELT'; exit 2 } +function Bau([string]$c) { + $B = "D:\Projects\pf-vorflopselbst-$c" + if (-not (Test-Path "$B\entscheiden\motor\Cargo.toml")) { New-Item -ItemType Directory -Force $B | Out-Null; tar -xf "$B.tar" -C $B } + $toml = "$B\entscheiden\motor\Cargo.toml"; (Get-Content $toml) -replace 'postflop-solver-temp"', 'postflop-solver-temp-28bcd38f"' | Set-Content $toml -Encoding utf8 + Push-Location "$B\entscheiden\motor"; cargo build --release --locked -j 8 --bin motor 2>&1 | Select-Object -Last 1; $rc = $LASTEXITCODE; Pop-Location + if ($rc -ne 0) { "BAU $c fehlgeschlagen $rc"; exit 1 } + $z = "$B\pokerbench-innovation-vorflopselbst.exe"; Copy-Item "$B\entscheiden\motor\target\release\motor.exe" $z -Force + "EXE $z SHA256 " + (Get-FileHash $z).Hash; return $z +} +$neu = Bau '6de8484cb'; $neu = @($neu)[-1]; $alt = Bau 'b88a78a1d'; $alt = @($alt)[-1] +$umg = [ordered]@{ R0 = '1'; MOTOR_RAKE_REGEL = '1'; MOTOR_ALLIN_UEBERSETZUNG = '1'; MOTOR_FLOP_EXAKT = '1'; MOTOR_FLOP_EXAKT_MS = '2000'; MOTOR_FLOP_EXAKT_VOR_MS = '2000'; MOTOR_FLOP_EXAKT_S_JE_GB = '22'; MOTOR_FLOP_EXAKT_ZIEL = '1.0'; MOTOR_FLOP_EXAKT_GB = '4'; RAYON_NUM_THREADS = '24' } +"UMGEBUNG " + (($umg.GetEnumerator() | % { "$($_.Key)=$($_.Value)" }) -join ' ') +foreach ($k in $umg.Keys) { Set-Item "env:$k" $umg[$k] } +function Lauf([string]$name, [string]$argz) { + "=================== ${name}: $argz"; $t0 = Get-Date + & $neu ($argz -split ' ') 2>&1 | % { "$_" } + "Rueckgabe $LASTEXITCODE nach $([math]::Round(((Get-Date) - $t0).TotalMinutes, 1)) min" +} +$dl = 'delta=0.069134,1.817251,0.080857,0.210826' +Lauf 'knoten-jam' "vorflop-selbst-knoten sechs100 $G 2000-600-400 200 $G\sechs100-v2.bin $O\t6s_knoten.jsonl 1 24 0 4096 modus=suche $dl tau_ref2=0.000000 m=64 grenze=1800 jamregel=1 klassen=AKs,T6s,86s,KQo,J9s,22" +if (Test-Path "$O\sechs100-v2-suche-jam.vselbst") { 'Ziel sechs100-v2-suche-jam.vselbst existiert schon - kein Bau' } else { + Lauf 'bau-jam' "vorflop-selbst-bauen sechs100 $G 2000-600-400 200 $G\sechs100-v2.bin $O\sechs100-v2-suche-jam.vselbst faeden=24 modus=suche tau_ref2=0.000000 $dl jamregel=1 stand=6de8484cb n_max=1024" } +if (Test-Path "$O\sechs100-v2-suche-jam.vselbst") { $f = Get-Item "$O\sechs100-v2-suche-jam.vselbst"; "SIDECAR $($f.FullName) $($f.Length) $((Get-FileHash $f.FullName).Hash)" } +'=================== aus: Gegenprobe 500 Anfragen' +$A = 'D:\Projects\pokerfreak-daten\pruefstand\vorflop-selbst-aus-6de8484cb'; New-Item -ItemType Directory -Force $A | Out-Null +python -X utf8 -c "import json;a=json.load(open(r'D:\Projects\pokerfreak-daten\pruefstand\basis-rein-temperatur-cc6eaf52\probe\antworten.json',encoding='utf-8'));n=[x for x in a if x['q']['street']!='PREFLOP'];v=[x for x in a if x['q']['street']=='PREFLOP'][:500-len(n)];f=open(r'$A\ein500.jsonl','w',encoding='utf-8');[f.write(json.dumps(x['q'])+'\n') for x in v+n];print('Anfragen',len(v)+len(n),'davon Vorflop',len(v))" +$env:ZEITPROBE_STRASSEN = 'PREFLOP,FLOP,TURN,RIVER' +$x = ($umg.GetEnumerator() | % { "$($_.Key)=$($_.Value)" }) -join ',' +Set-Location 'D:\Projects\pokerfreak-daten\pruefstand\sharingan-splash-0312\werkzeuge' +python -X utf8 farm_zeitprobe.py "$A\ein500.jsonl" 'D:\Projects\pokerfreak-daten\pruefstand\basis-rein-temperatur-cc6eaf52\kern_schalter.txt' "$A\aus.json" "basis=$alt|$x" "neu_aus=$neu|$x" "neu_an=$neu|$x,MOTOR_VORFLOP_SELBST=$O\sechs100-v2-suche-jam.vselbst" +python -X utf8 D:\Projects\pokerfreak-daten\pruefstand\basis-0312\aus-vergleich.py "$A\aus.json" basis neu_aus neu_an