feat(bench): add matrix runner, gamescope and per-session controls
- bench.py: gamescope-headless display (default, 1920x1080; ~2% cost vs desktop for isolation from the shared Wayland desktop), --shader, --dh, --disable-mods/--add-mods, --world-zip, crash-safe restore journal, spectator mode in the plan (elevated cameras fell to the sea floor and S4 measured underwater darkness) - matrix.toml/matrix.py: declarative, resumable B0-B14 runner keyed on mods hash (warns when B0 must be re-run) - build.py: bench-only resource-pack variants (C1-fa, C1-fa-ext, emf-lod*-fa, C1-bl); every bench variant pins resourcePacks so packs don't leak between sessions; shipped tier output unchanged - analyze.py: tagged labels use their own block's baseline
This commit is contained in:
1 parent
8f56e2f780
commit
a15c912ad0
10 files changed
+2196
-58
No files matched your search
@@ -190,8 +190,27 @@ BENCH = {
|
||||
}
|
||||
|
||||
|
||||
def c1(extra):
|
||||
return [DEFAULT, extra]
|
||||
# Resource packs (names = zips in the bench instance's resourcepacks/). Every bench
|
||||
# variant pins the list: apply_variant.py merges options.txt key by key, so a variant
|
||||
# without the key would keep the previous session's packs. Later entries win.
|
||||
FA = "file/FreshAnimations_v1.10.4.zip"
|
||||
FA_EXT = "file/FA+All_Extensions-v1.8.1.zip"
|
||||
BETTER_LEAVES = "file/Better-Leaves-9.6.zip"
|
||||
|
||||
|
||||
def packs(*extra):
|
||||
return {"options.txt": {"resourcePacks": json.dumps(["vanilla", "mod_resources", *extra],
|
||||
separators=(",", ":"))}}
|
||||
|
||||
|
||||
PACKS_BASE = packs()
|
||||
# Keys the bench layers may add to a base that lacks them (the options.txt template
|
||||
# has no resourcePacks line; tiers never set it, so shipped output is unaffected).
|
||||
ALLOW_NEW = {"options.txt": {"resourcePacks"}}
|
||||
|
||||
|
||||
def c1(*extra):
|
||||
return [DEFAULT, PACKS_BASE, *extra]
|
||||
|
||||
|
||||
VARIANTS = {
|
||||
@@ -201,10 +220,10 @@ VARIANTS = {
|
||||
"T-mid": ([DEFAULT], False),
|
||||
"T-high": ([DEFAULT, HIGH], False),
|
||||
# bench: composites
|
||||
"C0": ([], True),
|
||||
"C1": ([DEFAULT], True),
|
||||
"C1-deck": ([DEFAULT, DECK], True),
|
||||
"C1-high": ([DEFAULT, HIGH], True),
|
||||
"C0": ([PACKS_BASE], True),
|
||||
"C1": (c1(), True),
|
||||
"C1-deck": (c1(DECK), True),
|
||||
"C1-high": (c1(HIGH), True),
|
||||
# bench: Distant Horizons
|
||||
"dh-r256": (c1({"config/DistantHorizons.toml": {(DH_Q, "lodChunkRenderDistanceRadius"): 256}}), True),
|
||||
"dh-r192": (c1({"config/DistantHorizons.toml": {(DH_Q, "lodChunkRenderDistanceRadius"): 192}}), True),
|
||||
@@ -226,6 +245,15 @@ VARIANTS = {
|
||||
"modelUpdateFrequency": "Average"}}), True),
|
||||
"emf-lod8": (c1({"config/entity_model_features.json": {"animationLODDistance": 8,
|
||||
"retainDetailOnLowFps": False}}), True),
|
||||
"C1-fa": (c1(packs(FA)), True),
|
||||
"C1-fa-ext": (c1(packs(FA, FA_EXT)), True),
|
||||
"emf-lod20-fa": (c1({"config/entity_model_features.json": {"animationLODDistance": 20,
|
||||
"modelUpdateFrequency": "Average"}},
|
||||
packs(FA)), True),
|
||||
"emf-lod8-fa": (c1({"config/entity_model_features.json": {"animationLODDistance": 8,
|
||||
"retainDetailOnLowFps": False}},
|
||||
packs(FA)), True),
|
||||
"C1-bl": (c1(packs(BETTER_LEAVES)), True),
|
||||
"ldl-fancy": (c1({"config/lambdynlights.toml": {("", "mode"): "fancy"}}), True),
|
||||
"ldl-fastest": (c1({"config/lambdynlights.toml": {("", "mode"): "fastest",
|
||||
("light_sources", "entities"): False}}), True),
|
||||
@@ -290,7 +318,8 @@ def apply_kv(text, ov, name, sep, append):
|
||||
sval = toml_val(val) if isinstance(val, bool) else str(val)
|
||||
rx = re.compile(rf"^{re.escape(key)}{re.escape(sep)}")
|
||||
hits = [i for i, ln in enumerate(lines) if rx.match(ln)]
|
||||
if len(hits) > 1 or (not hits and not append):
|
||||
may_add = append if isinstance(append, bool) else key in append
|
||||
if len(hits) > 1 or (not hits and not may_add):
|
||||
raise SystemExit(f"{name}: {key}: {len(hits)} matches in base")
|
||||
if hits:
|
||||
lines[hits[0]] = f"{key}{sep}{sval}"
|
||||
@@ -327,7 +356,7 @@ def render(layers, name):
|
||||
if fmt == "json":
|
||||
return apply_json(text, merged, name), merged
|
||||
sep = ":" if fmt == "options" else "="
|
||||
return apply_kv(text, merged, name, sep, append), merged
|
||||
return apply_kv(text, merged, name, sep, append or ALLOW_NEW.get(name, set())), merged
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in new issue
Block a user