Remove shader packs

A developer of Iris showed that Horizon's shader pack code was written from
Iris's source. This removes it: the horizon-shaderpack crate, Java pack
loading and its render stages, Horizon's own WGSL packs and the example
packs, the Shader Packs screen and its option, the launcher's shader pack
browsing and installing, and the docs about them. Shader packs may come
back later as a clean-room rewrite.

The vanilla renderer and its post-processing (resolution scale, FXAA) are
unchanged. Options files that name a pack load and drop the key; the
launcher reads manifests that list a shader pack, and files in
`shaderpacks/` are never deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-24 16:15:39 +02:00
parent 535f2d2a04
commit 4e7c25bb55
123 changed files with 291 additions and 19190 deletions
+2 -4
View File
@@ -30,7 +30,7 @@
</main>
<script>
'use strict';
const SETTINGS=['minecraft','kind','os','os_version','architecture','gpu','graphics_backend','graphics_driver','server_runtime_kind','client_graphics_capture_status','java_version','heap_max_bytes','framebuffer_width','framebuffer_height','render_distance','simulation_distance','vsync','fps_limit','graphics_preset','ambient_occlusion','improved_transparency','mipmap_levels','entity_distance_scaling','entity_shadows','particles','clouds','cloud_range','fov','world_difficulty','dh_capture_status','dh_rendering_enabled','dh_renderer_mode','dh_lod_radius_chunks','dh_horizontal_quality','dh_vertical_quality','dh_max_horizontal_resolution','dh_transparency','dh_lod_shading','dh_lod_only_mode','dh_camera_quality_dropoff','dh_ambient_occlusion','iris_capture_status','iris_shaders_enabled','iris_shader_pack'];
const SETTINGS=['minecraft','kind','os','os_version','architecture','gpu','graphics_backend','graphics_driver','server_runtime_kind','client_graphics_capture_status','java_version','heap_max_bytes','framebuffer_width','framebuffer_height','render_distance','simulation_distance','vsync','fps_limit','graphics_preset','ambient_occlusion','improved_transparency','mipmap_levels','entity_distance_scaling','entity_shadows','particles','clouds','cloud_range','fov','world_difficulty','dh_capture_status','dh_rendering_enabled','dh_renderer_mode','dh_lod_radius_chunks','dh_horizontal_quality','dh_vertical_quality','dh_max_horizontal_resolution','dh_transparency','dh_lod_shading','dh_lod_only_mode','dh_camera_quality_dropoff','dh_ambient_occlusion'];
const state={baseline:null,candidate:null},generation={baseline:0,candidate:0};
let comparison=null,chartData=null;
const $=id=>document.getElementById(id);
@@ -115,7 +115,7 @@ function compareReports(a,b){
if(a.kind!==b.kind)throw Error('Compare frame runs with frame runs, or tick runs with tick runs.');
const differences=SETTINGS.filter(key=>JSON.stringify(a[key])!==JSON.stringify(b[key])).map(key=>({setting:key,baseline:a[key]??null,candidate:b[key]??null}));
if(a.kind==='ticks'&&a.peak_players!==b.peak_players)differences.push({setting:'peak_players',baseline:a.peak_players??null,candidate:b.peak_players??null});
const warnings=['World, camera route, shaders and terrain-cache warm-up still need to match. These are not verified by the captured settings.'];
const warnings=['World, camera route and terrain-cache warm-up still need to match. These are not verified by the captured settings.'];
warnings.push(...softwareWarnings(a,b));
if(a.kind==='ticks'){
warnings.push(...serverContextWarnings(a,b));
@@ -131,7 +131,6 @@ function compareReports(a,b){
}
for(const [label,r] of [['Baseline',a],['Candidate',b]]){
if(!['available','not_installed'].includes(r.dh_capture_status))warnings.push(label+' distant-terrain configuration was not captured; quality equivalence is unknown.');
if(!['available','not_installed'].includes(r.iris_capture_status))warnings.push(label+' Iris state was not captured; shader equivalence is unknown.');
if(Array.isArray(r.visual_settings_changed)&&r.visual_settings_changed.length){
differences.push({setting:label+' visual settings changed during recording',baseline:label==='Baseline'?r.visual_settings_changed:null,candidate:label==='Candidate'?r.visual_settings_changed:null});
warnings.push(label+' visual settings changed between capture boundaries: '+r.visual_settings_changed.join(', ')+'.');
@@ -188,7 +187,6 @@ function renderDetails(side){
if(r.kind==='frames'){
fields.push(['Distant terrain',r.dh_capture_status==='not_installed'?'Not installed':r.dh_capture_status==='available'?(r.dh_rendering_enabled?'Enabled':'Disabled')+' · '+r.dh_lod_radius_chunks+' chunk radius · '+r.dh_horizontal_quality+'/'+r.dh_vertical_quality+' quality · '+r.dh_max_horizontal_resolution+' resolution':'Not captured']);
if(number(r.dh_thread_count))fields.push(['Terrain workers',r.dh_thread_count+' · runtime ratio at start '+format(r.dh_runtime_ratio)+(number(r.visual_settings_end?.dh_runtime_ratio)?' / end '+format(r.visual_settings_end.dh_runtime_ratio):'')]);
fields.push(['Iris shaders',r.iris_capture_status==='not_installed'?'Not installed':r.iris_capture_status==='available'?r.iris_shaders_enabled?'Enabled · '+(r.iris_shader_pack||'pack name unavailable'):'Disabled':'Not captured']);
if(number(r.fov))fields.push(['Field of view',format(r.fov)]);
if(r.world_difficulty)fields.push(['World difficulty',r.world_difficulty]);
fields.push(['Frame limit',r.fps_limit_unlimited===true||(r.minecraft==='26.3'&&number(r.fps_limit)&&r.fps_limit>=260)?'Uncapped':number(r.fps_limit)?r.fps_limit+' FPS':'not captured']);
+2 -6
View File
@@ -34,7 +34,6 @@ PROFILES = {
"foreground-vulkan": {"title": "Foreground-first Vulkan experiment", "mods": CORE + ["distanthorizons"], "render": 12, "lod": 128, "heap": 6144, "adaptive": True, "pacing": True, "queue_wait": True, "dispatch_retry": True, "tick_dedup": True, "target_fps": 120, "backend": "vulkan"},
"low-memory": {"title": "Low memory", "mods": CORE, "render": 8, "lod": 0, "heap": 3072},
"far-distance": {"title": "Far distance", "mods": CORE + ["distanthorizons"], "render": 12, "lod": 256, "heap": 8192},
"cinematic": {"title": "Cinematic (optional)", "mods": CORE + ["distanthorizons", "iris", "complementary-reimagined"], "render": 12, "lod": 128, "heap": 6144},
"vulkan": {"title": "Vulkan experiment", "mods": CORE + ["distanthorizons"], "render": 12, "lod": 128, "heap": 6144, "backend": "vulkan"},
}
@@ -51,7 +50,7 @@ def validate_selection(lock, selection):
entry = projects[name]
if lock["minecraft"] not in entry["game_versions"]:
raise ValueError(f"Wrong game version: {name}")
if not entry["filename"].endswith(".zip") and "fabric" not in entry["loaders"]:
if "fabric" not in entry["loaders"]:
raise ValueError(f"Wrong loader: {name}")
if Path(entry["filename"]).name != entry["filename"] or "\\" in entry["filename"]:
raise ValueError(f"Unsafe filename: {name}")
@@ -68,7 +67,7 @@ def validate_selection(lock, selection):
def mod_path(entry):
return ("shaderpacks/" if entry["filename"].endswith(".zip") else "mods/") + entry["filename"]
return "mods/" + entry["filename"]
def options(profile):
@@ -111,9 +110,6 @@ def overrides(profile_name, mod_bytes):
if not config.exists():
raise FileNotFoundError(f"Missing verified DH profile config: {config}")
files["config/DistantHorizons.toml"] = config.read_bytes()
if profile_name == "cinematic":
# Start with shaders disabled: users explicitly select their visual/performance budget.
files["config/iris.properties"] = b"enableShaders=false\nshaderPack=ComplementaryReimagined_r5.9.3.zip\n"
return files
+2 -4
View File
@@ -13,7 +13,7 @@ MATCH_FIELDS = ("minecraft", "kind", "os", "os_version", "architecture", "gpu",
"clouds", "cloud_range", "fov", "world_difficulty", "dh_capture_status", "dh_rendering_enabled", "dh_renderer_mode",
"dh_lod_radius_chunks", "dh_horizontal_quality", "dh_vertical_quality", "dh_max_horizontal_resolution",
"dh_transparency", "dh_lod_shading", "dh_lod_only_mode", "dh_camera_quality_dropoff",
"dh_ambient_occlusion", "iris_capture_status", "iris_shaders_enabled", "iris_shader_pack")
"dh_ambient_occlusion")
TICK_STATE_FIELDS = ("configured_tick_rate", "frozen", "stepping", "sprinting", "runs_game_elements")
@@ -117,7 +117,7 @@ def compare(baseline, candidate):
raise ValueError("Compare frames with frames, or ticks with ticks")
mismatches = [f"{key}: {baseline.get(key)!r} vs {candidate.get(key)!r}" for key in MATCH_FIELDS
if baseline.get(key) != candidate.get(key)]
warnings = ["World, route, warm-up, shader state and LOD cache must also match; these are not verified by this tool."]
warnings = ["World, route, warm-up and LOD cache must also match; these are not verified by this tool."]
warnings.extend(software_warnings(baseline, candidate))
if baseline["kind"] == "ticks":
warnings.extend(server_context_warnings(baseline, candidate))
@@ -133,8 +133,6 @@ def compare(baseline, candidate):
for name, report in [("baseline", baseline), ("candidate", candidate)]:
if report.get("dh_capture_status") not in ["available", "not_installed"]:
warnings.append(f"{name} distant-terrain configuration was not captured; quality equivalence is unknown.")
if report.get("iris_capture_status") not in ["available", "not_installed"]:
warnings.append(f"{name} Iris state was not captured; shader equivalence is unknown.")
if report.get("visual_settings_changed"):
mismatches.append(f"{name} visual settings changed during recording")
warnings.append(f"{name} visual settings changed between capture boundaries: {report['visual_settings_changed']!r}.")
+4 -23
View File
@@ -75,9 +75,7 @@ def graphics_failure_summary(run, report_count):
# exception messages or infer that a separately logged Vulkan code caused it.
categories = {'Uniform title readback': 'uniform_readback',
'Incomplete title framebuffer': 'small_framebuffer',
'Private client graphics readback failed': 'callback_exception',
'Required shader pack is inactive': 'shader_inactive',
'Unexpected active shader pack': 'unexpected_shader_pack'}
'Private client graphics readback failed': 'callback_exception'}
result['probe_failure_categories'] = [category for message, category in categories.items()
if 'java.lang.AssertionError: ' + message in run.stdout]
result['vulkan_error_codes'] = sorted(set(re.findall(r'\bVK_ERROR_[A-Z_0-9]{1,100}\b', run.stdout)))[:16]
@@ -93,24 +91,13 @@ def graphics_failure_summary(run, report_count):
return result
def validate_shader_report(report, required):
if required and (report.get('shader_required') is not True
or report.get('iris_capture_status') != 'available'
or report.get('iris_shaders_enabled') is not True
or report.get('iris_expected_pack_matches') is not True):
raise AssertionError('Required runtime shader activation was not verified')
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--native-display', action='store_true')
parser.add_argument('--profile', action='append', choices=sorted(build_pack.PROFILES))
parser.add_argument('--backend', choices=['opengl', 'vulkan'], help='Override backend in these private instances only')
parser.add_argument('--world', action='store_true', help='Create/open a disposable built-in demo world instead of stopping at the title')
parser.add_argument('--shaders', action='store_true', help='Require the pinned cinematic shader pack in a private world instance')
args = parser.parse_args()
if args.shaders and (not args.world or args.profile not in [None, ['cinematic']]):
parser.error('--shaders requires --world and the cinematic profile')
root = build_pack.ROOT
fixture = build_mod.build_integration_fixture('client-graphics',
'dev.horizonlab.metrics.ClientGraphicsIntegration',
@@ -119,17 +106,12 @@ def main():
mod = root / 'dist' / f'horizon-{version}.jar'
original_hash = hashlib.sha256(mod.read_bytes()).hexdigest()
results = []
for profile in args.profile or (['cinematic'] if args.shaders else ['core-performance', 'm2-balanced']):
for profile in args.profile or ['core-performance', 'm2-balanced']:
instance = root / '.local/runtime' / ('client-graphics-' + profile
+ ('-override-' + args.backend if args.backend else '') + ('-world' if args.world else '')
+ ('-shaders' if args.shaders else ''))
+ ('-override-' + args.backend if args.backend else '') + ('-world' if args.world else ''))
build_pack.prepare_instance(profile, instance, mod)
if args.world:
(instance / 'config/client-graphics-world.flag').touch()
if args.shaders:
expected = build_pack.read_lock()['projects']['complementary-reimagined']['filename']
(instance / 'config/iris.properties').write_text('enableShaders=true\nshaderPack=' + expected + '\n')
(instance / 'config/client-graphics-shaders.flag').write_text(expected + '\n')
if args.backend:
options = instance / 'options.txt'
text, count = re.subn(r'^preferredGraphicsBackend:.*$',
@@ -139,7 +121,7 @@ def main():
options.write_text(text)
shutil.copy2(fixture, instance / 'mods/client-graphics-fixture.jar')
command = [sys.executable, str(root / 'tools/runtime.py'), 'demo',
'--instance', str(instance), '--heap', '6G' if args.shaders else '3G']
'--instance', str(instance), '--heap', '3G']
if platform.system() == 'Linux' and not args.native_display:
command = ['xvfb-run', '-a', *command]
try:
@@ -161,7 +143,6 @@ def main():
print('HORIZON_FIXTURE_FAILURE ' + json.dumps(diagnostics), flush=True)
raise RuntimeError('Graphics probe failed; diagnostics remain private')
report = reports[0]
validate_shader_report(report, args.shaders)
if report['observed_mode'] != ('world' if args.world else 'title') or report['ready_client_ticks'] < 40:
raise AssertionError('Client never reached the requested graphics scene')
if report['overlay_present'] is not False: