diff --git a/messung/farm/innovation/vs-br.ps1 b/messung/farm/innovation/vs-br.ps1 new file mode 100644 index 00000000..a84363c4 --- /dev/null +++ b/messung/farm/innovation/vs-br.ps1 @@ -0,0 +1,52 @@ +# innovation 05.12.: BR-Regel mit 6a293e400 (nativ): a) vergleich3 (Frist 3 h), b) bauen br=1 (nur bei a) Rueckgabe 0 und Zeile modus=suche), c) Archiv +$ErrorActionPreference = 'Continue' +if (Test-Path 'D:\Projects\pokerfreak\scratch\laeufer.pid') { 'SPIELT'; exit 2 } +$bauOrt = 'D:\Projects\pf-vorflopselbst-6a293e400' +if (-not (Test-Path "$bauOrt\entscheiden\motor\Cargo.toml")) { New-Item -ItemType Directory -Force $bauOrt | Out-Null; tar -xf "$bauOrt.tar" -C $bauOrt } +"-- .cargo/config.toml: " + (Test-Path "$bauOrt\.cargo\config.toml") +$tomlPfad = "$bauOrt\entscheiden\motor\Cargo.toml"; (Get-Content $tomlPfad) -replace 'postflop-solver-temp"', 'postflop-solver-temp-4424eb91"' | Set-Content $tomlPfad -Encoding utf8 +$exePfad = "$bauOrt\pokerbench-innovation-vorflopselbst-uhr2.exe" +if (-not (Test-Path $exePfad)) { + Push-Location "$bauOrt\entscheiden\motor"; cargo build --release --locked -j 16 --bin motor 2>&1 | Select-Object -Last 1; $bauRc = $LASTEXITCODE; Pop-Location + if ($bauRc -ne 0) { "BAU fehlgeschlagen $bauRc"; exit 1 } + Copy-Item "$bauOrt\entscheiden\motor\target\release\motor.exe" $exePfad -Force } +"EXE $exePfad SHA256 " + (Get-FileHash $exePfad).Hash +$tafelOrt = 'D:\Projects\pokerfreak-daten\grundstrategie-mitzaehler'; $zielOrt = 'D:\Projects\pokerfreak-daten\innovation\vorflop_selbst'; $archivOrt = 'D:\Projects\pokerfreak-daten\pruefstand\basis-rein' +function Starte([string]$name, [string]$aufrufArgs, [string]$ausDatei, [string]$fehlerDatei, [int]$fristMin = 60) { + "=================== ${name}: $aufrufArgs" + $t0 = Get-Date + $proz = Start-Process -FilePath $exePfad -ArgumentList $aufrufArgs -RedirectStandardOutput $ausDatei -RedirectStandardError $fehlerDatei -NoNewWindow -PassThru + $null = $proz.Handle # sonst bleibt ExitCode leer + $spitze = [long]0 + while (-not $proz.HasExited) { + try { $proz.Refresh(); $spitze = [math]::Max($spitze, [long]$proz.PeakWorkingSet64) } catch { } + if (((Get-Date) - $t0).TotalMinutes -gt $fristMin) { "FRIST $fristMin min erreicht - beende"; Stop-Process -Id $proz.Id -Force; break } + Start-Sleep 2 + } + $proz.WaitForExit() + $rueckgabe = $proz.ExitCode + "RUECKGABE $name $rueckgabe nach $([math]::Round(((Get-Date) - $t0).TotalMinutes, 1)) min, RAM-Spitze $([math]::Round($spitze / 1GB, 2)) GB" + return $rueckgabe +} +function Setze([hashtable]$werte) { foreach ($k in @('R0','MOTOR_RAKE_REGEL','MOTOR_ALLIN_UEBERSETZUNG','MOTOR_FLOP_EXAKT','MOTOR_FLOP_EXAKT_MS','MOTOR_FLOP_EXAKT_VOR_MS','MOTOR_FLOP_EXAKT_S_JE_GB','MOTOR_FLOP_EXAKT_ZIEL','MOTOR_FLOP_EXAKT_GB','MOTOR_FLOP_BIBLIOTHEK','RAYON_NUM_THREADS')) { Remove-Item "env:$k" -ErrorAction SilentlyContinue }; foreach ($k in $werte.Keys) { Set-Item "env:$k" $werte[$k] }; "UMGEBUNG " + (($werte.GetEnumerator() | sort Key | % { "$($_.Key)=$($_.Value)" }) -join ' ') } +$bib = 'D:\Projects\pokerfreak-daten\flopbib\flopbib-v2'; "-- Flop-Bibliothek $bib vorhanden: " + (Test-Path $bib) +$sidecarPfad = "$zielOrt\sechs100-v2-suche-br.vselbst" +foreach ($f in "$zielOrt\farm-vergleich3.txt", $sidecarPfad, "$zielOrt\archiv-roh-br.jsonl", "$zielOrt\archiv-sonstige-br.txt") { if ((Test-Path $f) -and (Get-Item $f).Length -gt 0) { "ZIEL $f existiert mit Inhalt - Abbruch (nichts ueberschreiben)"; exit 3 } } +Setze @{ 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'; MOTOR_FLOP_BIBLIOTHEK = $bib; RAYON_NUM_THREADS = '24' } +$rcA = @(Starte 'vergleich3' "vorflop-selbst-vergleich sechs100 $tafelOrt 2000-600-400 200 $tafelOrt\sechs100-v2.bin $zielOrt\t6s_knoten.jsonl 1 faeden=24 knoten=24 je=8 n_max=1024 m=64 grenze=10800" "$zielOrt\farm-vergleich3.txt" "$zielOrt\farm-vergleich3.err.txt" 190) +$rcA | ? { $_ -is [string] }; $rcA = $rcA[-1] +'--- vergleich3 Ende'; gc "$zielOrt\farm-vergleich3.txt" -Tail 25; '--- vergleich3 stderr Ende'; gc "$zielOrt\farm-vergleich3.err.txt" -Tail 10 +$zeile = (Select-String -Path "$zielOrt\farm-vergleich3.txt" -Pattern 'modus=suche tau_ref2=(\S+) delta=(\S+)' | Select-Object -Last 1) +if ($rcA -ne 0 -or -not $zeile) { "Schritt b) entfaellt (Rueckgabe $rcA, Zeile modus=suche: " + [bool]$zeile + ')'; exit 4 } +$tau = $zeile.Matches[0].Groups[1].Value; $dl = $zeile.Matches[0].Groups[2].Value; "AUS VERGLEICH3: tau_ref2=$tau delta=$dl" +$rcB = @(Starte 'bau-br' "vorflop-selbst-bauen sechs100 $tafelOrt 2000-600-400 200 $tafelOrt\sechs100-v2.bin $sidecarPfad faeden=24 modus=suche tau_ref2=$tau delta=$dl jamregel=1 gewinnregel=1 br=1 br_n=256 saat=24091 n_max=1024 stand=6a293e400" "$zielOrt\bau-br.out.txt" "$zielOrt\bau-br.err.txt" 120) +$rcB | ? { $_ -is [string] }; $rcB = $rcB[-1] +'--- bau-br Ende'; gc "$zielOrt\bau-br.out.txt" | ? { $_ -notmatch '^bauen: \d+/' } | select -Last 25; '--- bau-br stderr Ende'; gc "$zielOrt\bau-br.err.txt" -Tail 10 +if (Test-Path $sidecarPfad) { $g = Get-Item $sidecarPfad; "SIDECAR $sidecarPfad $($g.Length) " + (Get-FileHash $sidecarPfad).Hash } +if ($rcB -ne 0) { "Schritt c) entfaellt (Bau Rueckgabe $rcB)"; exit 5 } +Setze @{ R0 = '1'; MOTOR_ALLIN_UEBERSETZUNG = '1'; MOTOR_RAKE_REGEL = '1' } +$rcC = @(Starte 'archiv-br' "vorflop-selbst-archiv sechs100 $tafelOrt 2000-600-400 200 $tafelOrt\sechs100-v2.bin $sidecarPfad $archivOrt\ein.jsonl $zielOrt\archiv-roh-br.jsonl ref=$archivOrt\ref.jsonl faeden=24 n_max=4096 br_n=512 top=5 saat=41665" "$zielOrt\archiv-sonstige-br.txt" "$zielOrt\archiv-br.err.txt" 60) +$rcC | ? { $_ -is [string] }; $rcC = $rcC[-1] +foreach ($f in "$zielOrt\farm-vergleich3.txt", "$zielOrt\archiv-roh-br.jsonl", "$zielOrt\archiv-sonstige-br.txt", "$zielOrt\archiv-br.err.txt") { if (Test-Path $f) { $g = Get-Item $f; "DATEI $f $($g.Length) " + (Get-FileHash $f).Hash } } +'--- archiv-br sonstige Kopf'; gc "$zielOrt\archiv-sonstige-br.txt" -TotalCount 12 +exit $rcC diff --git a/messung/farm/innovation/vs-uhr2.ps1 b/messung/farm/innovation/vs-uhr2.ps1 new file mode 100644 index 00000000..d1795247 --- /dev/null +++ b/messung/farm/innovation/vs-uhr2.ps1 @@ -0,0 +1,32 @@ +# innovation 05.12.: Gegenprobe uhr2 fuer die Fassung. basis = 4424eb91 (bau-18, nativ), neu = 6a293e400 (nativ, Loeserkopie 4424eb91), volle MOTOR_ZEILE der Entwurfsdatei 4424eb91 +$ErrorActionPreference = 'Continue' +if (Test-Path 'D:\Projects\pokerfreak\scratch\laeufer.pid') { 'SPIELT'; exit 2 } +$bauOrt = 'D:\Projects\pf-vorflopselbst-6a293e400' +if (-not (Test-Path "$bauOrt\entscheiden\motor\Cargo.toml")) { New-Item -ItemType Directory -Force $bauOrt | Out-Null; tar -xf "$bauOrt.tar" -C $bauOrt } +"-- .cargo/config.toml: " + (Test-Path "$bauOrt\.cargo\config.toml") +$tomlPfad = "$bauOrt\entscheiden\motor\Cargo.toml"; (Get-Content $tomlPfad) -replace 'postflop-solver-temp"', 'postflop-solver-temp-4424eb91"' | Set-Content $tomlPfad -Encoding utf8 +$exePfad = "$bauOrt\pokerbench-innovation-vorflopselbst-uhr2.exe" +if (-not (Test-Path $exePfad)) { + Push-Location "$bauOrt\entscheiden\motor"; cargo build --release --locked -j 16 --bin motor 2>&1 | Select-Object -Last 1; $bauRc = $LASTEXITCODE; Pop-Location + if ($bauRc -ne 0) { "BAU fehlgeschlagen $bauRc"; exit 1 } + Copy-Item "$bauOrt\entscheiden\motor\target\release\motor.exe" $exePfad -Force } +"EXE $exePfad SHA256 " + (Get-FileHash $exePfad).Hash +$tafelOrt = 'D:\Projects\pokerfreak-daten\grundstrategie-mitzaehler'; $zielOrt = 'D:\Projects\pokerfreak-daten\innovation\vorflop_selbst'; $archivOrt = 'D:\Projects\pokerfreak-daten\pruefstand\basis-rein' +$basisExe = 'D:\Projects\pf-temperatur\pokerbench-temperatur-rein-4424eb91.exe' +"EXE basis $basisExe SHA256 " + (Get-FileHash $basisExe).Hash +$sidecarPfad = "$zielOrt\sechs100-v2-suche-jam-gewinn-nurallin.vselbst" +"SIDECAR " + (Get-Item $sidecarPfad).Length + ' ' + (Get-FileHash $sidecarPfad).Hash +$schalterDatei = 'D:\Projects\pokerfreak-daten\pruefstand\temperatur-uhr-4424eb91\kern_schalter.txt' +$zeileText = ((Get-Content $schalterDatei | ? { $_ -like 'MOTOR_ZEILE=*' }) | Select-Object -Last 1).Substring(12) +$umgListe = ($zeileText -split ';' | ? { $_ -match '=' }) -join ',' +"UMGEBUNG $umgListe" +$ausOrt = 'D:\Projects\pokerfreak-daten\pruefstand\vorflop-selbst-uhr2-6a293e400'; New-Item -ItemType Directory -Force $ausOrt | Out-Null +Copy-Item 'D:\Projects\pokerfreak-daten\pruefstand\vorflop-selbst-aus-6de8484cb\ein500.jsonl' "$ausOrt\ein500.jsonl" +$env:ZEITPROBE_STRASSEN = 'PREFLOP,FLOP,TURN,RIVER' +Set-Location 'D:\Projects\pokerfreak-daten\pruefstand\sharingan-splash-0312\werkzeuge' +python -X utf8 farm_zeitprobe.py "$ausOrt\ein500.jsonl" $schalterDatei "$ausOrt\aus.json" "basis=$basisExe|$umgListe" "neu_aus=$exePfad|$umgListe" "neu_an=$exePfad|$umgListe,MOTOR_VORFLOP_SELBST=$sidecarPfad" 2>&1 | % { "$_" } +$zeitRc = $LASTEXITCODE +python -X utf8 D:\Projects\pokerfreak-daten\pruefstand\basis-0312\aus-vergleich.py "$ausOrt\aus.json" basis neu_aus neu_an +foreach ($arm in 'basis', 'neu_aus', 'neu_an') { $n = (Select-String -Path "$ausOrt\aus.json.$arm.jsonl" -SimpleMatch 'Lage nicht treu' | Measure-Object).Count; $m = (Select-String -Path "$ausOrt\aus.json.$arm.jsonl" -SimpleMatch '[Vorflop-selbst' | Measure-Object).Count; "MARKEN ${arm}: Lage nicht treu $n, [Vorflop-selbst $m" } +python -X utf8 D:\Projects\pf-vorflopselbst-zeiten.py "$ausOrt\aus.json" basis neu_aus neu_an +exit $zeitRc