From 18cf983c85e7cecf4c7cb8eb0e2c506fbd5375aa Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sat, 5 Dec 2026 18:08:27 +0100 Subject: [PATCH] AWS package: user-data, README with sizes, evidence and cost Co-Authored-By: Claude Sonnet 5.5 --- ...ner gesetzt (fassung_pool.motor_umgebung)# | 2 + .../batterie/v2/welt_v5/live/aws/README.md | 45 +++++++++++++++++++ .../v2/welt_v5/live/aws/linux_paket.py | 1 + .../batterie/v2/welt_v5/live/aws/userdata.sh | 40 +++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 ird zur Laufzeit auf einen leeren Ordner gesetzt (fassung_pool.motor_umgebung)# create mode 100644 messung/batterie/v2/welt_v5/live/aws/README.md create mode 100644 messung/batterie/v2/welt_v5/live/aws/userdata.sh diff --git a/ird zur Laufzeit auf einen leeren Ordner gesetzt (fassung_pool.motor_umgebung)# b/ird zur Laufzeit auf einen leeren Ordner gesetzt (fassung_pool.motor_umgebung)# new file mode 100644 index 00000000..87e3208a --- /dev/null +++ b/ird zur Laufzeit auf einen leeren Ordner gesetzt (fassung_pool.motor_umgebung)# @@ -0,0 +1,2 @@ + "C:\\Projects\\pokerfreak-daten\\flopbib\\flopbib-v2": "/opt/sim/daten/flopbib-v2", + "D:\\Projects\\pokerfreak-daten\\gedaechtnis2-live": "/opt/sim/leer-platzhalter", diff --git a/messung/batterie/v2/welt_v5/live/aws/README.md b/messung/batterie/v2/welt_v5/live/aws/README.md new file mode 100644 index 00000000..abe3d412 --- /dev/null +++ b/messung/batterie/v2/welt_v5/live/aws/README.md @@ -0,0 +1,45 @@ +# AWS package: pool comparison, base 2a0b655f vs candidate 0995aa84, one leave-one-out arm per lever (05.12.2026) + +Nothing here starts an instance or uploads. Package on the SSD: `/Volumes/Alpha SSD/pokerfreak-daten/aws/sim-fassung-pool/paket-v1/` (no real hands; only the sim, tables, switch files). Code: this folder. + +## What runs +9 arms on identical seeds (Welt v5 pool `gegenuns-e1`, `--profil 1`, 6-max, 100 bb, every blatt on all six seats, Rake 5 %, card AIVAT): `basis` (exe 2a0b655f, live switch line 02BC75C8), +`kand` (0995aa84, 8520713C), `kand-aus` (candidate exe with the base line = only the non-switchable code changes), and `ohne-` for antwortkurve, flopbib, jamprobe, verlauf (ECHTER_VERLAUF + AUSSER_BAUM), +aussetzer, uhrluecke. One process per (arm, shard); pairing is by (blatt, seat) so the arms may run on different processes (checked: separate Windows processes reproduce identical hands, 173 of 180 pairs equal). +`runner.py` plans arms x shards, runs a self-test first (blatt 0..30, arms basis and kand against the Windows rows; needs >= 90 % equal and all rows, otherwise it uploads the log and shuts down without computing), +restarts a crashed process up to 3 times (resume = same file names), uploads every UPLOAD_MIN minutes, stops at MAX_STUNDEN, writes ENDE.json, uploads, `shutdown -h now`. user-data adds a hard `shutdown -h +MAX_STUNDEN*60+45`. + +## Source evidence (as far as possible) +- Both exes are built from `git archive entscheiden/motor` (+ `.cargo`) per the Windows build script `bau-0995aa84.ps1` (`postflop-solver-temp-` = `postflop-solver-mess` + `loeser-temp.patch` of that commit). +- Windows source trees byte-identical (sha256 per file) to the git commits: candidate 71/71 files equal except `Cargo.toml` (solver path rewritten by the script); base tar 48/48 equal (the base tar has no `.cargo`). +- Solver forks: Windows `postflop-solver-mess` and `-richter` identical to the Mac copies (26 and 35 files); Windows `postflop-solver-temp-0995aa84` and `-temp-2a0b655f` identical to `mess` + patch of the respective commit (recomputed on the Mac). +- Not provable: that the Windows exe binary equals a build of this source (no commit id is embedded; the build script and mtimes fit). The Linux binaries are new builds (cargo-zigbuild, x86_64, glibc 2.34, `-C target-cpu=x86-64-v3` + instead of `native`; the perf report states decisions bit-identical). The in-instance self-test compares 360 Windows results with the Linux results of the same blaetter. +- Battery opponent service `trainer_gegner`: no change to `src/` since the Windows exe (01.12. 12:55), built from this branch. + +## Sizes (upload to s3://pokerfreak-rechnen-758219626973/flopref/sim/fassung-pool/paket/) +paket.tar.gz 34 MB (exes, repo part, switch files, Windows reference), tafeln.tar 1,78 GB (sechs100-v2, hu100-v1, hu200-v2, aof, 3 read files), flopbib-v2.tar 2,32 GB (the C:\ copy the candidate reads), SHA256SUMS, userdata.sh. Total 4,1 GB. Tables and read files are byte-identical (SHA256) to the farm files. +``` +A="/Volumes/Alpha SSD/pokerfreak-daten/aws/sim-fassung-pool/paket-v1"; D=s3://pokerfreak-rechnen-758219626973/flopref/sim/fassung-pool/paket +for f in SHA256SUMS paket.tar.gz tafeln.tar flopbib-v2.tar; do aws s3 cp "$A/$f" $D/$f; done +``` + +## Launch (main starts it) +``` +aws ec2 run-instances --region eu-central-1 --image-id resolve:ssm:/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64 --instance-type c7a.48xlarge \ + --iam-instance-profile Name=pokerfreak-rechner --instance-initiated-shutdown-behavior terminate \ + --instance-market-options 'MarketType=spot,SpotOptions={SpotInstanceType=one-time}' \ + --block-device-mappings 'DeviceName=/dev/xvda,Ebs={VolumeSize=80,VolumeType=gp3,Throughput=500,Iops=6000,DeleteOnTermination=true}' \ + --user-data file://userdata.sh --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=sim-fassung-pool}]' +``` +Results: `s3://pokerfreak-rechnen-758219626973/flopref/sim//ergebnis/*.jsonl` (+ `lauf/` logs, `ENDE.json`, `selbsttest.json`). Evaluate on the Mac: copy to ``, then +`python3 messung/batterie/v2/welt_v5/live/fassung_pool.py auswerten --fassungen messung/batterie/v2/welt_v5/live/fassungen/temperatur-0995.json --ergebnis --aus `. +Extension: same package, new run with `VON=` (rows are appended per file name, pairing by blatt and seat). + +## Numbers +Measured on the Windows farm (6 arms-processes, 4 threads each, other jobs running): 0,17-0,19 s per hand per process (720 hands in 143 s incl. 12 s start), motor process 9,3 GB working set (peak 9,45 GB). +Paired difference candidate minus base, 180 pairs (30 blaetter): sd per hand 5,9 bb (only 7 of 180 pairs differ). Half width ±5 bb/100 needs 53.000 pairs per arm (±3,5 needs 106.000). CAVEAT: sd from 7 non-zero pairs, uncertain by about ±40 %. +Unpaired the same would need 182.000 hands per arm (sd 7,7 per hand per arm, sqrt(2)). +Plan: 10.000 blaetter = 60.000 hands per arm x 9 arms = 540.000 hands (+ the farm's 1.000 blaetter). c7a.48xlarge: 192 vCPU / 384 GB -> 36 processes (4 shards per arm): 540.000 / (36 / 0,18 s) = 45 min + about 10 min set-up (4,1 GB download, dnf, pip, self-test) += 1,0 h. Spot c7a.48xlarge 3,0-3,5 USD/h (05.12., eu-central-1) -> about 3,5 USD; cap with MAX_STUNDEN 2,5 = 9 USD. Alternative c7a.32xlarge (128 vCPU, 256 GB, spot 1,85-2,3 USD/h): 18 processes (2 shards per arm), about 1,6 h, about 3,5 USD. +Assumption: an AWS vCPU (hyper-thread) is as fast per process as the farm CPU; if it is 2x slower the run takes 2x as long (cost <= 8 USD). Pairing and the half width follow the evaluation, partial results are readable from S3 during the run. diff --git a/messung/batterie/v2/welt_v5/live/aws/linux_paket.py b/messung/batterie/v2/welt_v5/live/aws/linux_paket.py index 74a5aebc..61f07e27 100644 --- a/messung/batterie/v2/welt_v5/live/aws/linux_paket.py +++ b/messung/batterie/v2/welt_v5/live/aws/linux_paket.py @@ -14,6 +14,7 @@ KARTE = { "D:\\Projects\\pokerfreak-daten\\gedaechtnis3-pool-unsere\\tafel.json": "/opt/sim/daten/pool-unsere-tafel.json", "D:\\Projects\\pokerfreak-daten\\temperatur\\antwortkurve-0512\\antwortkurve.json": "/opt/sim/daten/antwortkurve.json", "C:\\Projects\\pokerfreak-daten\\flopbib\\flopbib-v2": "/opt/sim/daten/flopbib-v2", + "D:\\Projects\\pokerfreak-daten\\gedaechtnis2-live": "/opt/sim/leer-platzhalter", } diff --git a/messung/batterie/v2/welt_v5/live/aws/userdata.sh b/messung/batterie/v2/welt_v5/live/aws/userdata.sh new file mode 100644 index 00000000..bf805779 --- /dev/null +++ b/messung/batterie/v2/welt_v5/live/aws/userdata.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# User-Data: Fassungsvergleich gegen den Pool (Basis 2a0b655f, Kandidat 0995aa84, je Hebel ohne, kand-aus) auf einer Amazon-Linux-2023-Instanz x86_64 (c7a.48xlarge Spot empfohlen). +# Instanzrolle pokerfreak-rechner (S3 nur flopref/*). Start MIT --instance-initiated-shutdown-behavior terminate: Abschalten beendet die Instanz. +# Aenderbar sind nur die Zeilen unter "Einstellungen". +set -u +exec > /var/log/sim-userdata.log 2>&1 + +# ---- Einstellungen +export RUN=fassung-pool-0512-a # Name des Laufs: Ergebnisse unter flopref/sim// +export MAX_STUNDEN=2.5 # harte Frist des Laeufers (danach letzter Upload und shutdown) +export VON=2000 BIS=12000 # Blattbereich je Arm (10.000 Blaetter = 60.000 Haende je Arm); die Farm rechnet 1000-2000, fuer Verlaengerung neuer Lauf mit VON=12000 +export FAEDEN=4 # Motor-Faeden je Prozess +export UPLOAD_MIN=5 +B=s3://pokerfreak-rechnen-758219626973/flopref/sim/fassung-pool/paket +S3=s3://pokerfreak-rechnen-758219626973/flopref/sim/$RUN +export S3 + +# Notbremse unabhaengig vom Laeufer: nach MAX_STUNDEN + 45 min wird die Maschine in jedem Fall heruntergefahren. +shutdown -h +$(python3 -c "print(int($MAX_STUNDEN*60+45))") + +mkdir -p /opt/sim && cd /opt/sim +dnf install -y python3.11 python3.11-pip +python3.11 -m pip install numpy +# Downloads parallel (4,1 GB insgesamt), danach Pruefsummen +aws s3 cp --only-show-errors $B/SHA256SUMS . & +aws s3 cp --only-show-errors $B/paket.tar.gz . & +aws s3 cp --only-show-errors $B/tafeln.tar . & +aws s3 cp --only-show-errors $B/flopbib-v2.tar . & +wait +sha256sum -c SHA256SUMS || { echo "PRUEFSUMME FALSCH"; aws s3 cp /var/log/sim-userdata.log $S/lauf/userdata-fehler.log; shutdown -h now; exit 1; } +tar -xzf paket.tar.gz # -> /opt/sim/paket +tar -xf tafeln.tar # -> /opt/sim/daten/grundstrategie, temperatur-v2-mitte.txt, pool-unsere-tafel.json, antwortkurve.json +tar -xf flopbib-v2.tar -C daten # -> /opt/sim/daten/flopbib-v2 +rm -f tafeln.tar flopbib-v2.tar paket.tar.gz +chmod +x paket/bin/* +python3.11 paket/runner.py +rc=$? +aws s3 cp /var/log/sim-userdata.log $S/lauf/userdata.log +echo "runner rc=$rc" +shutdown -h now