Skip to content

Commit 052831f

Browse files
committed
Match runtime benchmark production heap
1 parent 5da7468 commit 052831f

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ jobs:
400400
runner_sha=$(sha256sum tools/perf/run-upstream-runtime-once.sh | awk '{print $1}')
401401
protocol_source_sha=$(sha256sum tools/perf/phase2-protocol-client.js | awk '{print $1}')
402402
protocol_analyzer_sha=$(sha256sum tools/perf/analyze-phase2-protocol-trace.js | awk '{print $1}')
403-
jvm_fingerprint='-Xms2G -Xmx2G -XX:+UseG1GC -XX:+AlwaysPreTouch -Xlog:gc*=info,safepoint=info:file=jvm-gc-safepoint.log:time,uptime,level,tags:filecount=0 -Dfile.encoding=UTF-8'
403+
jvm_fingerprint='-Xms4G -Xmx4G -XX:+UseG1GC -XX:+AlwaysPreTouch -Xlog:gc*=info,safepoint=info:file=jvm-gc-safepoint.log:time,uptime,level,tags:filecount=0 -Dfile.encoding=UTF-8'
404404
jvm_sha=$(printf '%s' "$jvm_fingerprint" | sha256sum | awk '{print $1}')
405405
stack_sha=$(
406406
{
@@ -634,6 +634,8 @@ jobs:
634634
raise SystemExit("preflight runtime profile mismatch")
635635
if manifest.get("campaignKind") != "preflight":
636636
raise SystemExit("preflight campaign kind mismatch")
637+
if manifest.get("serverHeapGiB") != 4:
638+
raise SystemExit("preflight server heap mismatch")
637639
expected_shutdown = {
638640
"mode": "clean",
639641
"stopGraceSeconds": 120,
@@ -855,6 +857,7 @@ jobs:
855857
"clientCpuSet": expected_client_cpu_set,
856858
"runtimeProfile": runtime_profile,
857859
"campaignKind": campaign_kind,
860+
"serverHeapGiB": 4,
858861
"requestedFlags": expected_requested_flags,
859862
"effectiveFlags": expected_effective_flags,
860863
}
@@ -1162,6 +1165,8 @@ jobs:
11621165
raise SystemExit(f"runtime profile drifted in {row['RunId']}")
11631166
if run_manifest.get("networkTimeoutSeconds") != 300:
11641167
raise SystemExit(f"network timeout drifted in {row['RunId']}")
1168+
if run_manifest.get("serverHeapGiB") != 4:
1169+
raise SystemExit(f"server heap drifted in {row['RunId']}")
11651170
if run_manifest.get("campaignKind") != kind:
11661171
raise SystemExit(f"campaign kind drifted in {row['RunId']}")
11671172
expected_forced_shutdown = (
@@ -1335,6 +1340,7 @@ jobs:
13351340
f"restart-isolated independent runs: `{runs}`.",
13361341
f"Runtime profile: `{runtime_profile}`; shared config requests "
13371342
"`PacketOnlyStatic=true` and `EventDriven=true` for both artifacts.",
1343+
"Server heap: `4 GiB` for both artifacts; target tick rate remains vanilla `20 TPS`.",
13381344
"Runtime assertion: A reports both flags as `unsupported-legacy`; "
13391345
"B exposes both runtime fields as `true`.",
13401346
("Server shutdown evidence: "
@@ -1463,6 +1469,7 @@ jobs:
14631469
"paperSha256": paper_sha,
14641470
"stackSha256": stack_sha,
14651471
"runtimeProfile": runtime_profile,
1472+
"serverHeapGiB": 4,
14661473
"requestedFlags": {
14671474
"packetOnlyStatic": True,
14681475
"eventDrivenBlockUpdates": True,

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ measure_seconds="$COMPARE_MEASURE_SECONDS"
3333
# This only prevents the synthetic observer from being kicked while the
3434
# official upstream stalls; it does not alter the server's 20 TPS target.
3535
network_timeout_seconds=300
36+
# Match the 4 GiB production server represented by the supplied Spark profile.
37+
# A and B always receive the same fixed heap.
38+
server_heap_gib=4
3639
server_port="${COMPARE_SERVER_PORT:-25565}"
3740
protocol_trace_enabled="${COMPARE_PROTOCOL_TRACE_ENABLED:-0}"
3841
protocol_trace_max_events="${COMPARE_PROTOCOL_TRACE_MAX_EVENTS:-500000}"
@@ -250,8 +253,8 @@ client_manifest_sha256="$(sha256sum "$client_root/client-build-manifest.json" |
250253
script_sha256="$(sha256sum "${BASH_SOURCE[0]}" | awk '{print $1}')"
251254

252255
jvm_arguments=(
253-
-Xms2G
254-
-Xmx2G
256+
"-Xms${server_heap_gib}G"
257+
"-Xmx${server_heap_gib}G"
255258
-XX:+UseG1GC
256259
-XX:+AlwaysPreTouch
257260
"-Xlog:gc*=info,safepoint=info:file=$jvm_log_name:time,uptime,level,tags:filecount=0"
@@ -666,7 +669,8 @@ python3 - "$run_directory/run-manifest.json" "$run_id" "$scenario" "$variant" \
666669
"$protocol_trace_aggregate_packet_allowlist" \
667670
"$trace_window_start_epoch_ms" "$trace_window_end_epoch_ms" \
668671
"$available_cpu_count" "$server_cpu_set" "$client_cpu_set" \
669-
"$runtime_profile" "$campaign_kind" "$network_timeout_seconds" "$metrics_path" <<'PY'
672+
"$runtime_profile" "$campaign_kind" "$network_timeout_seconds" \
673+
"$server_heap_gib" "$metrics_path" <<'PY'
670674
from pathlib import Path
671675
import json
672676
import sys
@@ -678,7 +682,8 @@ import sys
678682
trace_enabled, trace_packet_allowlist, trace_aggregate_packet_allowlist,
679683
trace_window_start_epoch_ms, trace_window_end_epoch_ms,
680684
available_cpu_count, server_cpu_set, client_cpu_set,
681-
runtime_profile, campaign_kind, network_timeout_seconds, metrics_path,
685+
runtime_profile, campaign_kind, network_timeout_seconds, server_heap_gib,
686+
metrics_path,
682687
) = sys.argv[1:]
683688
metrics = json.load(open(metrics_path, encoding="utf-8"))
684689
Path(output).write_text(json.dumps({
@@ -690,6 +695,7 @@ Path(output).write_text(json.dumps({
690695
"runtimeProfile": runtime_profile,
691696
"campaignKind": campaign_kind,
692697
"networkTimeoutSeconds": int(network_timeout_seconds),
698+
"serverHeapGiB": int(server_heap_gib),
693699
"requestedFlags": metrics["requestedFlags"],
694700
"effectiveFlags": metrics["effectiveFlags"],
695701
"sceneSize": int(scene_size),

0 commit comments

Comments
 (0)