From c5356bf85af307e938976bbbe978a528d430575e Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 1 Aug 2026 01:05:57 -0700 Subject: [PATCH] test: pin phase173 controls to comparable CPUs --- ...se173-d3-local-architecture-controls-qa.md | 5 +++++ ...run-phase173-architecture-controls-gate.sh | 20 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/seaweed-block/internal/docs/qa-assignments/phase173-d3-local-architecture-controls-qa.md b/seaweed-block/internal/docs/qa-assignments/phase173-d3-local-architecture-controls-qa.md index 9543fdc5ab..7d3ed1b0eb 100644 --- a/seaweed-block/internal/docs/qa-assignments/phase173-d3-local-architecture-controls-qa.md +++ b/seaweed-block/internal/docs/qa-assignments/phase173-d3-local-architecture-controls-qa.md @@ -22,11 +22,15 @@ has no WALStore format or recovery contract. cd /path/to/seaweed_block export SW_BLOCK_ARTIFACT_DIR=/path/to/results/phase173-d3-local export SW_BLOCK_PHASE173_STORE_DIR=/path/on/evaluated/filesystem/phase173-d3-stores +export SW_BLOCK_PHASE173_CONTROL_CPUSET=0,2,4,6 bash scripts/run-phase173-architecture-controls-gate.sh "$PWD" ``` The store directory must resolve to the dedicated local block device. Do not run the formal gate on a network share, tmpfs, overlay, or OS-root filesystem. +The CPU set must contain at least four comparable physical cores. Do not mix +performance and efficiency cores or sibling SMT threads; the gate records the +set and constrains both process affinity and `GOMAXPROCS`. ## Fixed Controls @@ -47,6 +51,7 @@ running long enough on the admission host to cross normal flusher periods. ## Required Evidence - `phase173_architecture_controls_status=ok` +- the expected `control_cpuset` and `control_gomaxprocs` - `local_control_stability_gate=pass` - all six `*_max_min_ratio` values at most `1.25` - `rf1_rf3_component_attribution=complete` diff --git a/seaweed-block/scripts/run-phase173-architecture-controls-gate.sh b/seaweed-block/scripts/run-phase173-architecture-controls-gate.sh index 6d40f0104c..1d6b3cee3f 100644 --- a/seaweed-block/scripts/run-phase173-architecture-controls-gate.sh +++ b/seaweed-block/scripts/run-phase173-architecture-controls-gate.sh @@ -10,6 +10,7 @@ TEST_BINARY="${ARTIFACT_DIR}/storage.test" MAX_RANGE="1.25" MATERIAL_RATIO="1.30" RUNS=5 +CONTROL_CPUSET="${SW_BLOCK_PHASE173_CONTROL_CPUSET:-}" mkdir -p "${ARTIFACT_DIR}" "${STORE_DIR}" "${ARTIFACT_DIR}/environment" : >"${SUMMARY}" @@ -31,13 +32,23 @@ capture() { "$@" >"${ARTIFACT_DIR}/environment/${name}.txt" 2>&1 || true } -for tool in go python3 findmnt; do +for tool in go python3 findmnt taskset nproc; do command -v "${tool}" >/dev/null 2>&1 || { echo "required tool ${tool} is unavailable" >&2 exit 1 } done +if [[ -z "${CONTROL_CPUSET}" ]]; then + echo "SW_BLOCK_PHASE173_CONTROL_CPUSET must name at least four comparable CPUs" >&2 + exit 1 +fi +CONTROL_GOMAXPROCS="$(taskset -c "${CONTROL_CPUSET}" nproc)" +if (( CONTROL_GOMAXPROCS < 4 )); then + echo "control cpuset ${CONTROL_CPUSET} exposes ${CONTROL_GOMAXPROCS} CPUs; need at least four" >&2 + exit 1 +fi + store_source="$(findmnt -n -T "${STORE_DIR}" -o SOURCE)" store_filesystem="$(findmnt -n -T "${STORE_DIR}" -o FSTYPE)" root_source="$(findmnt -n -T / -o SOURCE)" @@ -60,6 +71,8 @@ write_summary "store_source=${store_source}" write_summary "store_filesystem=${store_filesystem}" write_summary "root_source=${root_source}" write_summary "dedicated_store_source=true" +write_summary "control_cpuset=${CONTROL_CPUSET}" +write_summary "control_gomaxprocs=${CONTROL_GOMAXPROCS}" write_summary "architecture_candidate_selected=false" write_summary "product_mutation_present=false" write_summary "deferred_foreground_product_claim_allowed=false" @@ -79,16 +92,17 @@ go test -c -o "${TEST_BINARY}" ./core/storage control_log="${ARTIFACT_DIR}/architecture-controls.log" SW_BLOCK_PHASE173_ARCH_CONTROL_STORE_DIR="${STORE_DIR}" \ + GOMAXPROCS="${CONTROL_GOMAXPROCS}" taskset -c "${CONTROL_CPUSET}" \ "${TEST_BINARY}" -test.run '^TestPhase173ArchitectureControls$' -test.v -test.count=1 \ >"${control_log}" 2>&1 sed -n 's/^phase173_architecture_control_result=//p' "${control_log}" >"${RESULTS}" mkdir -p "${STORE_DIR}/tmp" -TMPDIR="${STORE_DIR}/tmp" go test ./core/frontend/durable \ +TMPDIR="${STORE_DIR}/tmp" GOMAXPROCS="${CONTROL_GOMAXPROCS}" taskset -c "${CONTROL_CPUSET}" go test ./core/frontend/durable \ -run '^$' -bench '^BenchmarkT3c_DurablePerf/walstore$' \ -benchtime=8000x -count=1 \ >"${ARTIFACT_DIR}/rf1-durable-adapter-benchmark.txt" 2>&1 -TMPDIR="${STORE_DIR}/tmp" go test ./core/replication \ +TMPDIR="${STORE_DIR}/tmp" GOMAXPROCS="${CONTROL_GOMAXPROCS}" taskset -c "${CONTROL_CPUSET}" go test ./core/replication \ -run '^$' -bench '^BenchmarkPhase167RF3SyncQuorumContention/(writers_1|writers_4)$' \ -benchtime=2048x -count=1 \ >"${ARTIFACT_DIR}/rf3-real-tcp-benchmark.txt" 2>&1