Phase 68: PGO training set diversification (seed/WS expansion)

Changes:
- scripts/box/pgo_fast_profile_config.sh: Expanded WS patterns (3→5) and seeds (1→3)
  for reduced overfitting and better production workload representativeness
- PERFORMANCE_TARGETS_SCORECARD.md: Phase 68 baseline promoted (61.614M = 50.93%)
- CURRENT_TASK.md: Phase 68 marked complete, Phase 67a (layout tax forensics) set Active

Results:
- 10-run verification: +1.19% vs Phase 66 baseline (GO, >+1.0% threshold)
- M1 milestone: 50.93% of mimalloc (target 50%, exceeded by +0.93pp)
- Stability: 10-run mean/median with <2.1% CV

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Moe Charm (CI)
2025-12-17 21:08:17 +09:00
parent 10fb0497e2
commit 84f5034e45
44 changed files with 1520 additions and 583 deletions

View File

@ -0,0 +1,46 @@
#!/bin/bash
# Box: PGO Profile Configuration (FAST minimal)
# Purpose: Define representative workloads for FAST minimal PGO collection.
# Contract:
# - Only deterministic workloads (fixed args/seeds).
# - Must complete quickly per workload (PGO box enforces timeout).
# - Keep baseline toolchain consistent (GCC + LTO; profile-generate/use handled by Makefile).
# Binaries to profile (must exist after `make pgo-fast-profile`)
PGO_BINARIES=(
"./bench_random_mixed_hakmem"
"./bench_tiny_hot_hakmem"
)
# Representative workloads (deterministic).
#
# Notes:
# - Keep these as shell strings: pgo_tiny_profile_box.sh runs them via `bash -lc`.
# - Prefer the same (iter, ws, seed) shape as the canonical Mixed 10-run, but shorter.
#
# Phase 68 Update: Diversify WS and seeds to reduce overfitting.
# - Mixed WS: Added 100, 256, 512, 1024 to existing 400 (5 patterns total).
# - Tiny hot: Added seed variants 60001, 60002 to 60000 (3 seeds total).
PGO_WORKLOADS=(
# Mixed: run via cleanenv to match benchmark presets (prevents PGO mismatch).
# Keep runs small; collector enforces per-workload timeout.
# Expanded WS range: 100, 256, 400, 512, 1024 (was: 128, 400, 800)
"HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE RUNS=2 ITERS=20000000 WS=100 BENCH_BIN=./bench_random_mixed_hakmem scripts/run_mixed_10_cleanenv.sh"
"HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE RUNS=2 ITERS=20000000 WS=256 BENCH_BIN=./bench_random_mixed_hakmem scripts/run_mixed_10_cleanenv.sh"
"HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE RUNS=2 ITERS=20000000 WS=400 BENCH_BIN=./bench_random_mixed_hakmem scripts/run_mixed_10_cleanenv.sh"
"HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE RUNS=2 ITERS=20000000 WS=512 BENCH_BIN=./bench_random_mixed_hakmem scripts/run_mixed_10_cleanenv.sh"
"HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE RUNS=2 ITERS=20000000 WS=1024 BENCH_BIN=./bench_random_mixed_hakmem scripts/run_mixed_10_cleanenv.sh"
# Tiny hot: C0-ish (16B) and C3-ish (64B) patterns with seed diversification.
# Extended seed set: 60000, 60001, 60002 (was: 60000 only)
"./bench_tiny_hot_hakmem 16 100 60000"
"./bench_tiny_hot_hakmem 16 100 60001"
"./bench_tiny_hot_hakmem 16 100 60002"
"./bench_tiny_hot_hakmem 64 100 60000"
"./bench_tiny_hot_hakmem 64 100 60001"
"./bench_tiny_hot_hakmem 64 100 60002"
)
# Configuration summary
PGO_WORKLOAD_COUNT=${#PGO_WORKLOADS[@]}
PGO_BINARY_COUNT=${#PGO_BINARIES[@]}

View File

@ -10,7 +10,8 @@
set -e # Fail fast on errors
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
source "${SCRIPT_DIR}/pgo_tiny_profile_config.sh"
PGO_CONFIG_BASENAME="${PGO_CONFIG:-pgo_tiny_profile_config.sh}"
source "${SCRIPT_DIR}/${PGO_CONFIG_BASENAME}"
echo "========================================="
echo "Box: PGO Profile Collection (Tiny Front)"
@ -18,6 +19,7 @@ echo "========================================="
echo "Date: $(date)"
echo "Workloads: $PGO_WORKLOAD_COUNT"
echo "Binaries: $PGO_BINARY_COUNT"
echo "Config: $PGO_CONFIG_BASENAME"
echo ""
# Validate binaries exist and are executable
@ -58,7 +60,7 @@ for workload in "${PGO_WORKLOADS[@]}"; do
echo "-------------------------------------------"
# Execute with timeout (30s per workload)
if timeout 30 $workload; then
if timeout 30 bash -lc "$workload"; then
echo " ✓ Success"
else
EXIT_CODE=$?