From 1f9bee2b4d1eeae9a6536de7bc368e1239f80f11 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Fri, 31 Jul 2026 23:48:05 -0700 Subject: [PATCH] qa: stabilize fixed-work admission samples --- .../core/storage/walstore_fixed_work_test.go | 24 +++++++++---------- .../phase173-d1-fixed-work-baseline-qa.md | 7 ++++-- .../run-phase173-fixed-work-baseline-gate.sh | 17 +++++++++---- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/seaweed-block/core/storage/walstore_fixed_work_test.go b/seaweed-block/core/storage/walstore_fixed_work_test.go index 7f41874470..9d56f07671 100644 --- a/seaweed-block/core/storage/walstore_fixed_work_test.go +++ b/seaweed-block/core/storage/walstore_fixed_work_test.go @@ -19,7 +19,7 @@ const ( phase173FixedWorkStoreEnv = "SW_BLOCK_PHASE173_STORE_DIR" phase173FixedWorkBlockSize = 4096 - phase173FixedWorkNumBlocks = 32768 + phase173FixedWorkNumBlocks = 131072 phase173FixedWorkRegionBlocks = phase173FixedWorkNumBlocks / 2 ) @@ -85,11 +85,11 @@ func TestPhase173FixedWorkContract(t *testing.T) { if err != nil { t.Fatalf("shape=%s writers=%d: %v", shape, writers, err) } - if cfg.APILogicalBlocks() < 8000 || cfg.APILogicalBlocks() > 8192 { - t.Fatalf("shape=%s logical blocks=%d want [8000,8192]", shape, cfg.APILogicalBlocks()) + if cfg.APILogicalBlocks() < 64000 || cfg.APILogicalBlocks() > 65536 { + t.Fatalf("shape=%s logical blocks=%d want [64000,65536]", shape, cfg.APILogicalBlocks()) } - if cfg.WarmupLogicalBlocks() < 500 || cfg.WarmupLogicalBlocks() > 512 { - t.Fatalf("shape=%s warmup logical blocks=%d want [500,512]", shape, cfg.WarmupLogicalBlocks()) + if cfg.WarmupLogicalBlocks() < 4000 || cfg.WarmupLogicalBlocks() > 4096 { + t.Fatalf("shape=%s warmup logical blocks=%d want [4000,4096]", shape, cfg.WarmupLogicalBlocks()) } for index := 0; index < cfg.APIOperations; index++ { start, blocks := cfg.operation(index, 0) @@ -139,15 +139,15 @@ func newPhase173FixedWorkConfig(shape string, writers int) (phase173FixedWorkCon cfg := phase173FixedWorkConfig{Shape: shape, Writers: writers} switch shape { case "sequential_4k", "scattered_4k": - cfg.APIOperations = 8192 - cfg.WarmupAPIOps = 512 + cfg.APIOperations = 65536 + cfg.WarmupAPIOps = 4096 case "batch_16": - cfg.APIOperations = 512 - cfg.WarmupAPIOps = 32 + cfg.APIOperations = 4096 + cfg.WarmupAPIOps = 256 case "mounted_mixed": - // 320 fixed cycles of 4K, 16K, 64K, and 16K requests. - cfg.APIOperations = 1280 - cfg.WarmupAPIOps = 80 + // 2560 fixed cycles of 4K, 16K, 64K, and 16K requests. + cfg.APIOperations = 10240 + cfg.WarmupAPIOps = 640 default: return phase173FixedWorkConfig{}, fmt.Errorf("phase173: unsupported shape %q", shape) } diff --git a/seaweed-block/internal/docs/qa-assignments/phase173-d1-fixed-work-baseline-qa.md b/seaweed-block/internal/docs/qa-assignments/phase173-d1-fixed-work-baseline-qa.md index e08373d0eb..45356c83ca 100644 --- a/seaweed-block/internal/docs/qa-assignments/phase173-d1-fixed-work-baseline-qa.md +++ b/seaweed-block/internal/docs/qa-assignments/phase173-d1-fixed-work-baseline-qa.md @@ -29,7 +29,7 @@ Do not lower run counts or change the `1.25x` threshold after seeing results. ## Required Evidence - `phase173_fixed_work_baseline_status=ok` -- `fixed_work_result_count=160` +- `fixed_work_result_count=64` - `fixed_work_counter_reconciliation=true` - `fixed_work_complete_drain=true` - `fixed_work_correctness_samples=true` @@ -50,7 +50,10 @@ may encode 16 records while coalescing them into one physical append. ## Verdict - `PASS`: all required evidence is present and both independent five-run - four-writer sets remain within the predeclared range. + four-writer sets remain within the predeclared range. Each fixed-work sample + writes about 256 MiB so foreground execution crosses multiple 100 ms flusher + periods; 1/2/8 writers are diagnostic matrix points, while four writers use + the two independent five-run admission sets. - `FAIL`: a correctness, counter, drain, or residue invariant fails. - `HOLD`: the stability range exceeds `1.25x`; fix the harness or lab before D2/D3 and do not implement an architecture candidate. diff --git a/seaweed-block/scripts/run-phase173-fixed-work-baseline-gate.sh b/seaweed-block/scripts/run-phase173-fixed-work-baseline-gate.sh index ac66e7b6ba..f42c1b8ac6 100755 --- a/seaweed-block/scripts/run-phase173-fixed-work-baseline-gate.sh +++ b/seaweed-block/scripts/run-phase173-fixed-work-baseline-gate.sh @@ -11,6 +11,7 @@ SHAPES=(sequential_4k scattered_4k batch_16 mounted_mixed) WRITERS=(1 2 4 8) SETS=2 RUNS=5 +DIAGNOSTIC_RUNS=1 MAX_RANGE="1.25" mkdir -p "${ARTIFACT_DIR}" "${STORE_DIR}" "${ARTIFACT_DIR}/environment" "${ARTIFACT_DIR}/logs" @@ -30,7 +31,8 @@ capture() { write_summary "phase173_fixed_work_baseline_status=running" write_summary "contract=phase173-fixed-work-v1" write_summary "sets=${SETS}" -write_summary "runs_per_matrix_point=${RUNS}" +write_summary "four_writer_runs_per_set=${RUNS}" +write_summary "diagnostic_runs_per_set=${DIAGNOSTIC_RUNS}" write_summary "four_writer_max_min_limit=${MAX_RANGE}" write_summary "flusher_interval_ms=100" write_summary "page_cache_policy=warm_process_and_filesystem_no_drop_caches" @@ -67,7 +69,11 @@ go test -c -o "${TEST_BINARY}" ./core/storage for set_id in $(seq 1 "${SETS}"); do for shape in "${SHAPES[@]}"; do for writers in "${WRITERS[@]}"; do - for run_id in $(seq 1 "${RUNS}"); do + point_runs="${DIAGNOSTIC_RUNS}" + if [[ "${writers}" == "4" ]]; then + point_runs="${RUNS}" + fi + for run_id in $(seq 1 "${point_runs}"); do id="set${set_id}-${shape}-writers${writers}-run${run_id}" log="${ARTIFACT_DIR}/logs/${id}.log" SW_BLOCK_PHASE173_SHAPE="${shape}" \ @@ -101,7 +107,7 @@ max_range = float(max_range_text) rows = [json.loads(line) for line in open(results_path, encoding="utf-8") if line.strip()] shapes = ("sequential_4k", "scattered_4k", "batch_16", "mounted_mixed") writers_values = (1, 2, 4, 8) -expected = sets * runs * len(shapes) * len(writers_values) +expected = sets * len(shapes) * (runs + len(writers_values) - 1) if len(rows) != expected: raise SystemExit(f"fixed-work rows={len(rows)} want {expected}") @@ -131,8 +137,9 @@ gate_ok = True for shape in shapes: for writers in writers_values: group = grouped[(shape, writers)] - if len(group) != sets * runs: - raise SystemExit(f"shape={shape} writers={writers} rows={len(group)}") + expected_group = sets * (runs if writers == 4 else 1) + if len(group) != expected_group: + raise SystemExit(f"shape={shape} writers={writers} rows={len(group)} want {expected_group}") values = [float(row["foreground_mib_per_second"]) for row in group] summary.append(f"{shape}_writers_{writers}_median_mibps={statistics.median(values):.3f}") summary.append(f"{shape}_writers_{writers}_median_p99_ns={statistics.median(row['p99_ns'] for row in group):.0f}")