Kevin Coughlin. Blog

The benchmark said REJECT and measured nothing

The harness said REJECT on a +28.1% heap. Neither run collected after the warmup mark, so heap used was allocation and the pause gate compared 0 with 0.

The harness is the one from Don't flip the JVM flag, measure it on a copy of the world. The write-up is on minecraft-server#129.

The run

I measured on 2026-11-28 with scripts/measure-compact-headers.sh at 51db676. Paper 26.3, the server's own jar. Temurin 25.0.5.1. An AMD Ryzen AI 7 PRO 350 on Fedora 46. The live server stayed up. I saved with save-all flush and copied the world out, so the copy is of an open world. The copy was 6680 KB.

Defaults: -Xms4G -Xmx4G, G1, view and simulation distance 10, 120 s warmup, 180 s soak.

MetricBaselineCompactDelta
Heap used after warmup (MB)845.21082.7+28.1%
Heap high-water during soak (MB)912.81150.7+26.1%
GC pauses in soak (count)00
TPS 1m20.020.0
MSPT 1m avg0.10.1

Nothing collected

Both runs had zero collections after startup. The last GC line in each gc.log is at 12 s on the baseline and 7 s on the compact run, both before Done. A 4G heap and a 6.6 MB idle world never fill the young generation in that window. Heap used is garbage allocated since the last startup collection. The compact run's last startup collection happened earlier and left more behind, 501M on that run and 296M on the baseline. The +28% says nothing about the flag.

Pauses before the warmup mark are ignored. An empty list after the mark is stored as max 0 and p99 0. float_le_tol is c <= b + tolerance, and the tolerance here is 0, so 0 against 0 passes. TPS was 20.0 on both sides. MSPT was 0.1 on both sides. Those gates write verdict only for a miss or a regression, so they left it alone. The heap gate set REJECT: the post-warmup sample and the soak high-water both have to be strictly lower, and 1082.7 and 1150.7 are higher.

Live bytes after a forced collection

To get a comparable number I started each configuration again from its run directory with the same flags.txt, waited 120 s after Done, and took jcmd <pid> GC.class_histogram three times, 20 s apart. That command runs a full collection and totals what survives. The harness still summarizes heap samples and the pause log.

BaselineCompactDelta
Live objects5,578,326 / 5,575,427 / 5,577,2345,577,991 / 5,574,239 / 5,576,040same
Live bytes (MB)258.3 / 258.3 / 258.4239.1 / 239.0 / 239.1-7.4%
net.minecraft.world.phys.AABB (bytes)26,770,36823,428,496-12.5%

Same object count, about 19 MB less live heap. The flag does shrink the live heap on this world, by about 7%. There were no pauses to compare, so no pause or TPS difference could be measured. The issue's bar is a smaller heap with pauses and TPS no worse. This idle copy produced no pauses, and a larger world under load is still the measurement that decides it. The harness verdict was REJECT for the wrong reason.

INCONCLUSIVE, then one place that writes the verdict

minecraft-server#139 (8a807aa) changes scripts/measure-compact-headers.sh. If either run has no GC pause during the soak, the heap and pause gates are inconclusive, and summary.md names the run. The note says to use a longer --soak, a smaller --max-ram, or a busier world.

verdict starts as ACCEPT. Each gate used to assign it. The TPS gate was this, and the heap, pause, and MSPT gates assigned verdict the same way:

if [[ -z "$b_tps" || -z "$c_tps" ]]; then
    verdict=INCONCLUSIVE
    reasons="${reasons}Paper 1m TPS is missing. The server must be up long enough for /tps to print a number, not *."$'\n'
elif ! float_ge_tol "$c_tps" "$b_tps" 0.05; then
    verdict=REJECT
    reasons="${reasons}TPS is worse."$'\n'
fi

A pass wrote nothing, so a missing heap sample followed by equal TPS stayed INCONCLUSIVE. Missing TPS after a worse heap wrote INCONCLUSIVE over that REJECT. The last assignment decided.

The gates now set two flags. A measured regression is REJECT. Otherwise a missing or unusable number, including a run that never collects, is INCONCLUSIVE. Otherwise verdict stays ACCEPT.

# Heap and pause figures only mean something if each run collected during
# the soak. With no collection, "heap used" is garbage allocated since the
# last startup GC, not live data, and an empty pause list compares 0 to 0.
local no_gc=""
[[ "$b_pause_n" -gt 0 ]] || no_gc="${no_gc}baseline "
[[ "$c_pause_n" -gt 0 ]] || no_gc="${no_gc}compact "

# Missing or unusable numbers make the run inconclusive. Worse numbers that
# were measured properly reject it, and that wins over inconclusive.
local rejected=0 inconclusive=0

if [[ -n "$no_gc" ]]; then
    inconclusive=1
    reasons="${reasons}No GC ran during the soak in: ${no_gc% }. Heap and pause figures are not comparable (heap used is allocation since the last startup collection, not live data). Use a longer --soak, a smaller --max-ram, or a busier world."$'\n'
elif [[ -z "$b_heap" || -z "$c_heap" || -z "$b_high" || -z "$c_high" ]]; then
    inconclusive=1
    reasons="${reasons}Heap samples are missing (jcmd GC.heap_info or jstat -gc)."$'\n'
elif ! float_lt "$c_heap" "$b_heap" || ! float_lt "$c_high" "$b_high"; then
    rejected=1
    reasons="${reasons}Heap is not smaller on both the post-warmup sample and the soak high-water."$'\n'
fi

if [[ -n "$no_gc" ]]; then
    : # reported above
elif [[ -z "$b_pause_max" || -z "$c_pause_max" || -z "$b_p99" || -z "$c_p99" ]]; then
    inconclusive=1
    reasons="${reasons}GC pause stats are missing."$'\n'
elif ! float_le_tol "$c_pause_max" "$b_pause_max" 0 || ! float_le_tol "$c_p99" "$b_p99" 0; then
    rejected=1
    reasons="${reasons}GC pauses are worse (max or p99)."$'\n'
fi

TPS and MSPT set the same flags. Then one block writes the word:

if [[ "$rejected" -eq 1 ]]; then
    verdict=REJECT
elif [[ "$inconclusive" -eq 1 ]]; then
    verdict=INCONCLUSIVE
fi

docs/compact-object-headers.md states the same rule. A measured regression (bigger heap, worse pauses, TPS, or MSPT) is REJECT even when another number is missing.

What the fixtures lock in

tests/compact-headers.sh builds synthetic logs. The heap and TPS figures below are the fixture's, not the run above. drop_soak_gc removes GC(1). That is the fixture's pause after the warmup mark. GC(0) at 1 s stays, and the fixture's warmup mark is 100, so the comparison already ignores it.

drop_soak_gc() {
    local log="$1"
    grep -v 'GC(1)' "$log" > "$log.tmp"
    mv "$log.tmp" "$log"
}

# 2026-11-28 real run (#129): neither run collected after startup, so the
# heap numbers were allocation since the startup GC and the harness said
# REJECT on a +28% that meant nothing. No soak GC must be INCONCLUSIVE.
nogc_work="$TMP/sum-nogc"
mkdir -p "$nogc_work"
write_run_env "$nogc_work"
write_fixture_run "$nogc_work/baseline" 700000 720000 10.000 '20.0, *, *' '[00:00:03] [Server thread/INFO]: 1m 5.00/1.00/12.00'
write_fixture_run "$nogc_work/compact" 900000 950000 10.000 '20.0, *, *' '[00:00:03] [Server thread/INFO]: 1m 5.00/1.00/12.00'
for side in baseline compact; do
    drop_soak_gc "$nogc_work/$side/gc.log"
done
expect_verdict "$nogc_work" INCONCLUSIVE
grep -q 'No GC ran during the soak in: baseline compact' "$nogc_work/summary.md" || fail "no-GC summary did not name both runs"

# One run collected and the other did not: still not comparable.
nogc1_work="$TMP/sum-nogc-one"
mkdir -p "$nogc1_work"
write_run_env "$nogc1_work"
write_fixture_run "$nogc1_work/baseline" 900000 950000 10.000 '20.0, *, *' '[00:00:03] [Server thread/INFO]: 1m 5.00/1.00/12.00'
write_fixture_run "$nogc1_work/compact" 700000 720000 8.000 '20.0, *, *' '[00:00:03] [Server thread/INFO]: 1m 4.00/1.00/8.00'
drop_soak_gc "$nogc1_work/compact/gc.log"
expect_verdict "$nogc1_work" INCONCLUSIVE
grep -q 'No GC ran during the soak in: compact' "$nogc1_work/summary.md" || fail "no-GC summary did not name the compact run"

# Worse TPS is measured evidence and still rejects without soak GC.
nogctps_work="$TMP/sum-nogc-tps"
mkdir -p "$nogctps_work"
write_run_env "$nogctps_work"
write_fixture_run "$nogctps_work/baseline" 900000 950000 10.000 '20.0, *, *' '[00:00:03] [Server thread/INFO]: 1m 5.00/1.00/12.00'
write_fixture_run "$nogctps_work/compact" 700000 720000 10.000 '19.0, *, *' '[00:00:03] [Server thread/INFO]: 1m 5.00/1.00/12.00'
for side in baseline compact; do
    drop_soak_gc "$nogctps_work/$side/gc.log"
done
expect_verdict "$nogctps_work" REJECT

# Missing TPS plus worse heap: the measured regression decides.
mixed_work="$TMP/sum-mixed"
mkdir -p "$mixed_work"
write_run_env "$mixed_work"
write_fixture_run "$mixed_work/baseline" 700000 720000 10.000 '*, *, *' '[00:00:03] [Server thread/INFO]: 1m 5.00/1.00/12.00'
write_fixture_run "$mixed_work/compact" 900000 950000 10.000 '20.0, *, *' '[00:00:03] [Server thread/INFO]: 1m 5.00/1.00/12.00'
expect_verdict "$mixed_work" REJECT

No soak GC in both runs is INCONCLUSIVE, and so is one run with no soak GC. No soak GC with a worse TPS is REJECT. Missing TPS on top of a worse heap is REJECT too. Before that last case, the missing TPS would have replaced the heap's REJECT.

Still to measure

A new measurement still needs a larger world under load. That is still minecraft-server#129. The default is unchanged. The flag stays off.

An idle soak on a 4G heap can finish with no collection. The figure called heap used is allocation since startup. A verdict made of successive assignments lets the last write win. The gates now keep a regression and a missing number apart, and the regression wins.