Optimize visual runtime and add upstream A/B validation#4
Merged
Conversation
TypeThe0ry
marked this pull request as ready for review
July 16, 2026 19:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary - optimize the production rewrite fixed at
c28db0146ec2f35eaf066b4202b33f08d06bbc4b- reduce dropped-item visibility queue churn, bound text parsing caches, avoid empty drains, and clear retained manager/cache state on shutdown - remove avoidable block-state snapshots in furnace/beehive paths and tighten tile-entity lifecycle/index cleanup - preserve preference save/load ordering across quit/rejoin and plugin shutdown - add reproducible official-upstream vs rewrite runtime comparison with one prepare/download/build job and locally distributed, hash-verified artifacts - run independent restart-isolated samples in parallel; no fake cross-runner A/B pairing ## Correctness review No merge-blocking correctness issue remains in the fixed production candidate. Runtime optimization flags retain conservative production defaults; the benchmark requests them only in its controlled profile. ## GitHub validation All checks onfbcd0d569a65e3e46b161cd62151e79091e894e1are green: - Java 25 build/test - A-B Performance Benchmark - Phase 2 Packet Capture A-B - Phase 2 Runtime A-B - Upstream Runtime Comparison smoke (12/12 jobs) - formal upstream runtime comparison (24/24 samples plus both aggregates and global gate) Formal run: https://github.com/EllanServer/InteractionVisualizer/actions/runs/29525891826 ## Formal stable-regime results Paper 26.1.2-74, 4 GiB symmetric heap, 20 TPS target, one protocol observer, 60 s warmup + 20 s settle + 120 s measurement. Each scenario has 12 independent restart-isolated samples (official A = 6, rewrite B = 6). | Scenario | Metric | Official median | Rewrite median | Median B/A | Bootstrap 95% CI | |---|---|---:|---:|---:|---:| | 512 dropped items | mean MSPT | 3.397374 ms | 2.460815 ms | 0.724329 | [0.545511, 0.918597] | | 512 dropped items | P95 MSPT | 30.005560 ms | 14.885620 ms | 0.496095 | [0.236532, 1.035402] | | 512 dropped items | P99 MSPT | 52.528233 ms | 17.202398 ms | 0.327489 | [0.242151, 0.440776] | | 256 active blocks | mean MSPT | 3.818482 ms | 0.941192 ms | 0.246483 | [0.212393, 0.283162] | | 256 active blocks | P95 MSPT | 4.495410 ms | 1.317267 ms | 0.293025 | [0.266592, 0.329043] | | 256 active blocks | P99 MSPT | 5.240943 ms | 1.567224 ms | 0.299035 | [0.262858, 0.354392] | Both scenarios pass the registered improvement and non-regression gates. A and B remain near 20 TPS, every formal sample keeps the observer online, and all 24 server processes exit cleanly. Global verdict:rewrite-better-across-both-scenarios. ## Stress evidence At 4 GiB with 1024 active blocks, official upstream A lost the observer to keepalive/packet-flood pressure in 6/6 runs; rewrite B completed 6/6. The failed upstream MSPT is not mixed into the stable CPU statistics because observer loss would underestimate its work. Stress run: https://github.com/EllanServer/InteractionVisualizer/actions/runs/29524047760 An earlier 2 GiB feasibility run also produced official-upstreamOutOfMemoryError: Java heap space, while rewrite samples completed. Treat this as stability/memory evidence, not a retained-heap curve. ## Benchmark policy - build and download dependencies exactly once per campaign - distribute one internal tar artifact to measurement runners and verify the tar plus critical-file hashes - preserve the normal 20 TPS target - isolate server and protocol client CPU sets - use independent-sample bootstrap for parallel runners - require artifact/config/JVM/CPU/scenario/runtime-flag/TPS/observer/shutdown provenance before aggregation ## Caveat This is a synthetic single-observer GitHub-runner comparison, not a long multi-player production soak. A 30–60 minute multi-player retained-heap/JFR run remains a useful post-merge follow-up, but it is not a blocker for this PR.