feat(perf): add one-step tier setup script for existing players

Default Options only seeds configs when absent, so existing players never
got the tuned settings. build.py --ship now also writes the Deck/Mid/High
tier files to config/onion-perf/<tier>/, and onion-perf-setup.{sh,ps1,bat}
(installed into the instance folder) backs up and replaces the tier's
config files and merges only the tuned video keys into options.txt,
keeping keybinds, audio and vsync/max-FPS choices.

PLAYER-TUNING: point players at the script; bench B4 GC verdict (G1 for
everyone; ZGC/Shenandoah tested worse); 16 GB PCs 5-6 GB heap.
This commit is contained in:
logan committed 2026-10-18 15:31:20 -04:00
1 parent cf7ea5617e
commit f949c169a2
34 files changed
+4348 -22

No files matched your search

+20 -1
View File
@@ -11,7 +11,8 @@ pinned jar's source (see README.md, "Key provenance").
Output: out/<variant>/<path relative to the game dir>, plus out/MANIFEST.md.
python3 build.py # from this directory; stdlib only
python3 build.py --ship # also copy T-default into the repo (see SHIP), then
python3 build.py --ship # also copy T-default into the repo (see SHIP) and the
# player tiers into config/onion-perf/ (see PERF), then
# run `packwiz refresh` from the repo root
"""
import json
@@ -48,6 +49,15 @@ SHIP = {
"config/modernfix-mixins.properties": "config/modernfix-mixins.properties",
}
# Player tiers `--ship` also writes to config/onion-perf/<tier>/ (paths relative to
# the game dir) for onion-perf-setup.sh/.ps1, which existing players run to apply a
# tier over their configs. A tier carries only the files its layers tune, so
# untuned files (sable-client.toml; sodium-options.json except on deck) keep the
# player's own settings. modernfix-mixins.properties is enforced by packwiz already.
PERF = "config/onion-perf"
PERF_TIERS = {"deck": "T-deck", "mid": "T-default", "high": "T-high"} # mid == pack default
PERF_SKIP = {"config/modernfix-mixins.properties"}
# game-dir path -> (base file, format, may_append_new_keys)
FILES = {
"options.txt": (TEMPLATES / "options.txt", "options", False),
@@ -384,6 +394,15 @@ def main():
(REPO / dst).parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(OUT / "T-default" / src, REPO / dst)
print(f"shipped {len(SHIP)} files to {REPO / DO}; now run `packwiz refresh`")
shutil.rmtree(REPO / PERF, ignore_errors=True)
for tier, vid in PERF_TIERS.items():
layers, _ = VARIANTS[vid]
names = sorted({n for layer in layers for n in layer} - PERF_SKIP)
for name in names:
dst = REPO / PERF / tier / name
dst.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(OUT / vid / name, dst)
print(f"shipped tier {tier} ({vid}): {len(names)} files to {REPO / PERF / tier}")
main()