From d8c05208d75caa306dec0a598d810ca07e63dbbf Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sat, 5 Dec 2026 06:44:05 +0100 Subject: [PATCH] Farm: vorflop-selbst Gewinnregel (Bau 66126de71, Sidecar und Archivlauf, Exit-Code ueber Prozess-Handle) Co-Authored-By: Claude Opus 5.5 --- messung/farm/innovation/vs-gewinn.ps1 | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 messung/farm/innovation/vs-gewinn.ps1 diff --git a/messung/farm/innovation/vs-gewinn.ps1 b/messung/farm/innovation/vs-gewinn.ps1 new file mode 100644 index 00000000..90641150 --- /dev/null +++ b/messung/farm/innovation/vs-gewinn.ps1 @@ -0,0 +1,44 @@ +# innovation 05.12.: Bau 66126de71 (nativ), 1) vorflop-selbst-bauen mit Gewinnregel, 2) Archiv mit dem neuen Sidecar (nur wenn 1) Rueckgabe 0) +$ErrorActionPreference = 'Continue' +if (Test-Path 'D:\Projects\pokerfreak\scratch\laeufer.pid') { 'SPIELT'; exit 2 } +$bauOrt = 'D:\Projects\pf-vorflopselbst-66126de71' +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-28bcd38f"' | Set-Content $tomlPfad -Encoding utf8 +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 } +$exePfad = "$bauOrt\pokerbench-innovation-vorflopselbst-gewinn.exe"; Copy-Item "$bauOrt\entscheiden\motor\target\release\motor.exe" $exePfad -Force +"EXE $exePfad SHA256 " + (Get-FileHash $exePfad).Hash +$umgebung = [ordered]@{ R0 = '1'; MOTOR_ALLIN_UEBERSETZUNG = '1'; MOTOR_RAKE_REGEL = '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' } +foreach ($k in $umgebung.Keys) { Set-Item "env:$k" $umgebung[$k] } +"UMGEBUNG " + (($umgebung.GetEnumerator() | % { "$($_.Key)=$($_.Value)" }) -join ' ') +$tafelOrt = 'D:\Projects\pokerfreak-daten\grundstrategie-mitzaehler'; $zielOrt = 'D:\Projects\pokerfreak-daten\innovation\vorflop_selbst'; $archivOrt = 'D:\Projects\pokerfreak-daten\pruefstand\basis-rein' +$sidecarPfad = "$zielOrt\sechs100-v2-suche-jam-gewinn.vselbst" +foreach ($f in $sidecarPfad, "$zielOrt\archiv-roh-gewinn.jsonl", "$zielOrt\archiv-sonstige-gewinn.txt") { if ((Test-Path $f) -and (Get-Item $f).Length -gt 0) { "ZIEL $f existiert mit Inhalt - Abbruch (nichts ueberschreiben)"; exit 3 } } +function Starte([string]$name, [string]$aufrufArgs, [string]$ausDatei, [string]$fehlerDatei) { + "=================== ${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 60) { 'FRIST 60 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 +} +$rc1 = @(Starte 'bau' "vorflop-selbst-bauen sechs100 $tafelOrt 2000-600-400 200 $tafelOrt\sechs100-v2.bin $sidecarPfad faeden=24 modus=suche tau_ref2=0.000000 delta=0.069134,1.817251,0.080857,0.210826 jamregel=1 gewinnregel=1 saat=24091 n_max=1024 stand=66126de71" "$zielOrt\bau-gewinn.out.txt" "$zielOrt\bau-gewinn.err.txt") +$rc1 | ? { $_ -is [string] }; $rc1 = $rc1[-1] +'--- bau stdout Ende'; gc "$zielOrt\bau-gewinn.out.txt" -Tail 30; '--- bau stderr Ende'; gc "$zielOrt\bau-gewinn.err.txt" -Tail 30 +if (Test-Path $sidecarPfad) { $g = Get-Item $sidecarPfad; "SIDECAR $sidecarPfad $($g.Length) " + (Get-FileHash $sidecarPfad).Hash } +if ($rc1 -ne 0) { "Schritt 2 entfaellt (Bau Rueckgabe $rc1)"; exit 4 } +$rc2 = @(Starte 'archiv' "vorflop-selbst-archiv sechs100 $tafelOrt 2000-600-400 200 $tafelOrt\sechs100-v2.bin $sidecarPfad $archivOrt\ein.jsonl $zielOrt\archiv-roh-gewinn.jsonl ref=$archivOrt\ref.jsonl faeden=24 n_max=4096 top=5 saat=41665" "$zielOrt\archiv-sonstige-gewinn.txt" "$zielOrt\archiv-gewinn.err.txt") +$rc2 | ? { $_ -is [string] }; $rc2 = $rc2[-1] +foreach ($f in "$zielOrt\archiv-roh-gewinn.jsonl", "$zielOrt\archiv-sonstige-gewinn.txt", "$zielOrt\archiv-gewinn.err.txt") { if (Test-Path $f) { $g = Get-Item $f; "DATEI $f $($g.Length) " + (Get-FileHash $f).Hash } } +'--- archiv stderr Ende'; gc "$zielOrt\archiv-gewinn.err.txt" -Tail 15 +'--- archiv sonstige Kopf'; gc "$zielOrt\archiv-sonstige-gewinn.txt" -TotalCount 12 +exit $rc2