Skip to content

Commit 985074f

Browse files
committed
Separate stable CPU and stress regimes
1 parent 052831f commit 985074f

2 files changed

Lines changed: 38 additions & 26 deletions

File tree

.github/workflows/upstream-runtime-comparison.yml

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ jobs:
314314
CAMPAIGN_SETTLE_SECONDS: ${{ (github.event_name == 'workflow_dispatch' || (github.event.action == 'labeled' && github.event.label.name == 'upstream-runtime-formal')) && '20' || '5' }}
315315
CAMPAIGN_MEASURE_SECONDS: ${{ (github.event_name == 'workflow_dispatch' || (github.event.action == 'labeled' && github.event.label.name == 'upstream-runtime-formal')) && '120' || '10' }}
316316
CAMPAIGN_SCENARIO: ${{ matrix.scenario }}
317-
CAMPAIGN_SCENE_SIZE: ${{ matrix.scenario == 'dropped-items' && '512' || '1024' }}
317+
# The 1024-block stress campaign is retained separately as stability
318+
# evidence: official upstream lost its observer in 6/6 formal A runs.
319+
# Use a still-heavy stable regime here so both sides produce valid CPU data.
320+
CAMPAIGN_SCENE_SIZE: ${{ matrix.scenario == 'dropped-items' && '512' || '256' }}
318321
CAMPAIGN_RUN_NUMBER: ${{ matrix.run_number }}
319322
EXPECTED_HARNESS_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
320323

@@ -709,14 +712,15 @@ jobs:
709712
raise SystemExit(
710713
"rewritten dropped-item preflight produced no visual spawns beyond source items")
711714
if scenario == "block-active":
712-
block_guards = {
713-
"furnaceBlocks": 205,
714-
"blastFurnaceBlocks": 205,
715-
"smokerBlocks": 205,
716-
"beehiveBlocks": 205,
717-
"beeNestBlocks": 204,
718-
"activeFurnaces": 615,
719-
}
715+
block_fields = (
716+
"furnaceBlocks", "blastFurnaceBlocks", "smokerBlocks",
717+
"beehiveBlocks", "beeNestBlocks",
718+
)
719+
block_guards = {field: 0 for field in block_fields}
720+
for index in range(scene_size):
721+
block_guards[block_fields[index % len(block_fields)]] += 1
722+
block_guards["activeFurnaces"] = sum(
723+
block_guards[field] for field in block_fields[:3])
720724
for field, expected in block_guards.items():
721725
if metrics.get(field) != expected:
722726
raise SystemExit(
@@ -866,7 +870,8 @@ jobs:
866870
raise SystemExit(
867871
f"run manifest mismatch {run_id}/{field}: {run_manifest.get(field)!r} != {expected!r}")
868872
expected_forced_shutdown = (
869-
campaign_kind == "formal" and scenario == "block-active" and variant == "A")
873+
campaign_kind == "formal" and scenario == "block-active"
874+
and variant == "A" and scene_size >= 1024)
870875
expected_shutdown = {
871876
"stopGraceSeconds": 120,
872877
"termGraceSeconds": 10,
@@ -946,7 +951,7 @@ jobs:
946951
CAMPAIGN_SETTLE_SECONDS: ${{ (github.event_name == 'workflow_dispatch' || (github.event.action == 'labeled' && github.event.label.name == 'upstream-runtime-formal')) && '20' || '5' }}
947952
CAMPAIGN_MEASURE_SECONDS: ${{ (github.event_name == 'workflow_dispatch' || (github.event.action == 'labeled' && github.event.label.name == 'upstream-runtime-formal')) && '120' || '10' }}
948953
CAMPAIGN_SCENARIO: ${{ matrix.scenario }}
949-
CAMPAIGN_SCENE_SIZE: ${{ matrix.scenario == 'dropped-items' && '512' || '1024' }}
954+
CAMPAIGN_SCENE_SIZE: ${{ matrix.scenario == 'dropped-items' && '512' || '256' }}
950955

951956
steps:
952957
- name: Check out harness source
@@ -1170,7 +1175,8 @@ jobs:
11701175
if run_manifest.get("campaignKind") != kind:
11711176
raise SystemExit(f"campaign kind drifted in {row['RunId']}")
11721177
expected_forced_shutdown = (
1173-
kind == "formal" and scenario == "block-active" and variant == "A")
1178+
kind == "formal" and scenario == "block-active" and variant == "A"
1179+
and scene_size >= 1024)
11741180
expected_shutdown = {
11751181
"stopGraceSeconds": 120,
11761182
"termGraceSeconds": 10,
@@ -1190,14 +1196,15 @@ jobs:
11901196
if shutdown.get("mode") != "clean" and not expected_forced_shutdown:
11911197
raise SystemExit(f"unexpected forced server shutdown in {row['RunId']}")
11921198
if scenario == "block-active":
1193-
block_guards = {
1194-
"furnaceBlocks": 205,
1195-
"blastFurnaceBlocks": 205,
1196-
"smokerBlocks": 205,
1197-
"beehiveBlocks": 205,
1198-
"beeNestBlocks": 204,
1199-
"activeFurnaces": 615,
1200-
}
1199+
block_fields = (
1200+
"furnaceBlocks", "blastFurnaceBlocks", "smokerBlocks",
1201+
"beehiveBlocks", "beeNestBlocks",
1202+
)
1203+
block_guards = {field: 0 for field in block_fields}
1204+
for index in range(scene_size):
1205+
block_guards[block_fields[index % len(block_fields)]] += 1
1206+
block_guards["activeFurnaces"] = sum(
1207+
block_guards[field] for field in block_fields[:3])
12011208
for field, expected in block_guards.items():
12021209
if metrics.get(field) != expected:
12031210
raise SystemExit(
@@ -1358,7 +1365,7 @@ jobs:
13581365
"| Metric | Upstream median | Rewrite median | Median B/A | Ratio 95% CI | Registered use |",
13591366
"|---|---:|---:|---:|---:|---|",
13601367
]
1361-
if formal and scenario == "block-active":
1368+
if formal and scenario == "block-active" and int(scene_size) >= 1024:
13621369
lines[5:5] = [
13631370
"Load-regime rule: sustained block load may saturate official upstream A "
13641371
"when the 120-second window still contains at least 100 tick samples; "
@@ -1395,7 +1402,7 @@ jobs:
13951402
("Candidate `observedTps` must stay near 20; saturated upstream throughput is "
13961403
"reported directly for the sustained block load. MSPT remains the primary "
13971404
"effect-size evidence."
1398-
if formal and scenario == "block-active" else
1405+
if (formal and scenario == "block-active" and int(scene_size) >= 1024) else
13991406
"`observedTps` is capped near 20 on a healthy server; MSPT is the primary "
14001407
"effect-size evidence."),
14011408
"",
@@ -1445,13 +1452,16 @@ jobs:
14451452
},
14461453
},
14471454
"loadRegimePolicy": {
1448-
"upstreamSaturationAllowed": formal and scenario == "block-active",
1455+
"upstreamSaturationAllowed": (
1456+
formal and scenario == "block-active" and int(scene_size) >= 1024
1457+
),
14491458
"minimumUpstreamTickSamples": (
1450-
100 if formal and scenario == "block-active" else None
1459+
100 if (formal and scenario == "block-active"
1460+
and int(scene_size) >= 1024) else None
14511461
),
14521462
},
14531463
"serverShutdown": {
1454-
"forcedTerminationAllowedOnlyForFormalBlockActiveUpstream": True,
1464+
"forcedTerminationAllowedOnlyForFormalBlockActiveStressUpstream": True,
14551465
"modeCountsByVariant": shutdown_mode_counts,
14561466
},
14571467
"metrics": {

tools/perf/run-upstream-runtime-once.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ if data.get("effectiveFlags") != expected_effective_flags:
589589
)
590590
allows_upstream_saturation = (
591591
measure >= 60 and scenario == "block-active" and variant == "A"
592+
and scene_size >= 1024
592593
)
593594
# The stop command is handled on the saturated main thread, so its wall-clock
594595
# acknowledgement can trail the requested window without invalidating it.
@@ -842,7 +843,8 @@ fi
842843
send_console "stop"
843844
server_shutdown_mode=clean
844845
server_shutdown_forced_allowed=false
845-
if [[ "$campaign_kind" == formal && "$scenario" == block-active && "$variant" == A ]]; then
846+
if [[ "$campaign_kind" == formal && "$scenario" == block-active \
847+
&& "$variant" == A && "$scene_size" -ge 1024 ]]; then
846848
server_shutdown_forced_allowed=true
847849
fi
848850
if kill -0 "$server_pid" 2>/dev/null; then

0 commit comments

Comments
 (0)