Wait for loading overlays before graphics readback readiness

This commit is contained in:
Ludovic Marie
2026-10-04 12:13:40 +02:00
parent 213498c77e
commit a1d8c1b824
4 changed files with 225 additions and 2 deletions
@@ -151,7 +151,8 @@
"All failures retained; neither successful rendering nor a screenshot-specific root cause is established.",
"Baseline includes the same original measurement mod and private test fixture; no core optimization mods or distant terrain.",
"Full logs, screenshots, game binaries and assets remain private.",
"Later selected stack locations place the observed failures in the screenshot callback; the independently logged Vulkan identifier is not established as their cause."
"Later selected stack locations place the observed failures in the screenshot callback; the independently logged Vulkan identifier is not established as their cause.",
"Actual assertions rejected uniform callback images in all three cases. Overlay state was not recorded, and displayed-window correctness is not established."
],
"later_stack_run": {
"source_commit": "a77476b54e7bf4a1b3a96cb9d8108ed7c1c7b2b0",
@@ -315,5 +316,204 @@
]
}
]
},
"later_pixel_run": {
"source_commit": "213498c77ed643617083dacf4aaa283a1cb4815a",
"run_url": "https://github.com/ludovic111/minecraft-optimization-lab/actions/runs/37194354615",
"cases": [
{
"case": [
"--profile",
"baseline",
"--backend",
"vulkan"
],
"exit_code": 1,
"failure": [
{
"exit_code": 1,
"result_count": 0,
"java_exception_types": [
"java.lang.AssertionError",
"java.lang.RuntimeException"
],
"expected_demo_authentication_errors_observed": true,
"backend_attempts": [
{
"backend": "Vulkan",
"operation": "load_library",
"result": "success"
},
{
"backend": "Vulkan",
"operation": "create_device",
"result": "success"
}
],
"created_devices": [
{
"gpu": "Apple Paravirtual device",
"graphics_backend": "Vulkan",
"graphics_driver": "1.2.350 MoltenVK 1.4.2"
}
],
"client_initializer_reached": true,
"readback_requested": true,
"readback_callback_received": true,
"readback_inspections": [
{
"framebuffer_width": 1280,
"framebuffer_height": 646,
"sampled_pixels": 4160,
"distinct_sampled_rgb": 1
}
],
"probe_failure_categories": [
"uniform_readback"
],
"vulkan_error_codes": [
"VK_ERROR_FEATURE_NOT_PRESENT"
],
"fatal_jvm_error": false,
"observed_graphics_stack_methods": [
"net.minecraft.client.Screenshot.lambda$takeScreenshot$1",
"com.mojang.renderpearl.backend.vulkan.DestructionQueue.rotate",
"com.mojang.renderpearl.backend.vulkan.VulkanCommandEncoder.submit",
"com.mojang.renderpearl.frontend.FrontendCommandEncoder.submit"
],
"profile": "baseline",
"preferred_backend": "vulkan"
}
]
},
{
"case": [
"--profile",
"core-performance",
"--backend",
"vulkan"
],
"exit_code": 1,
"failure": [
{
"exit_code": 1,
"result_count": 0,
"java_exception_types": [
"java.lang.AssertionError",
"java.lang.RuntimeException"
],
"expected_demo_authentication_errors_observed": true,
"backend_attempts": [
{
"backend": "Vulkan",
"operation": "load_library",
"result": "success"
},
{
"backend": "Vulkan",
"operation": "create_device",
"result": "success"
}
],
"created_devices": [
{
"gpu": "Apple Paravirtual device",
"graphics_backend": "Vulkan",
"graphics_driver": "1.2.350 MoltenVK 1.4.2"
}
],
"client_initializer_reached": true,
"readback_requested": true,
"readback_callback_received": true,
"readback_inspections": [
{
"framebuffer_width": 1280,
"framebuffer_height": 646,
"sampled_pixels": 4160,
"distinct_sampled_rgb": 1
}
],
"probe_failure_categories": [
"uniform_readback"
],
"vulkan_error_codes": [
"VK_ERROR_FEATURE_NOT_PRESENT"
],
"fatal_jvm_error": false,
"observed_graphics_stack_methods": [
"net.minecraft.client.Screenshot.lambda$takeScreenshot$1",
"com.mojang.renderpearl.backend.vulkan.DestructionQueue.rotate",
"com.mojang.renderpearl.backend.vulkan.VulkanCommandEncoder.submit",
"com.mojang.renderpearl.frontend.FrontendCommandEncoder.submit"
],
"profile": "core-performance",
"preferred_backend": "vulkan"
}
]
},
{
"case": [
"--profile",
"vulkan"
],
"exit_code": 1,
"failure": [
{
"exit_code": 1,
"result_count": 0,
"java_exception_types": [
"java.lang.AssertionError",
"java.lang.RuntimeException"
],
"expected_demo_authentication_errors_observed": true,
"backend_attempts": [
{
"backend": "Vulkan",
"operation": "load_library",
"result": "success"
},
{
"backend": "Vulkan",
"operation": "create_device",
"result": "success"
}
],
"created_devices": [
{
"gpu": "Apple Paravirtual device",
"graphics_backend": "Vulkan",
"graphics_driver": "1.2.350 MoltenVK 1.4.2"
}
],
"client_initializer_reached": true,
"readback_requested": true,
"readback_callback_received": true,
"readback_inspections": [
{
"framebuffer_width": 1280,
"framebuffer_height": 646,
"sampled_pixels": 4160,
"distinct_sampled_rgb": 1
}
],
"probe_failure_categories": [
"uniform_readback"
],
"vulkan_error_codes": [
"VK_ERROR_FEATURE_NOT_PRESENT"
],
"fatal_jvm_error": false,
"observed_graphics_stack_methods": [
"net.minecraft.client.Screenshot.lambda$takeScreenshot$1",
"com.mojang.renderpearl.backend.vulkan.DestructionQueue.rotate",
"com.mojang.renderpearl.backend.vulkan.VulkanCommandEncoder.submit",
"com.mojang.renderpearl.frontend.FrontendCommandEncoder.submit"
],
"profile": "vulkan",
"preferred_backend": "vulkan"
}
]
}
]
}
}
+11 -1
View File
@@ -10,7 +10,9 @@ The required macOS CI cases use the recommended OpenGL `core-performance` and
separate instance, creates or opens an ordinary limited-demo world. World mode
dismisses the demo-help popup, waits for focused, unpaused gameplay, reads back
the main render target, and stops the client so its integrated server saves.
Private screenshots must have a nonuniform sample grid and a verified file hash;
The readiness counter resets while a loading overlay is present: a title screen
object can already exist underneath asynchronous loading. Private screenshots
must have a nonuniform sample grid and a verified file hash;
world mode also checks for saved world data after a clean process exit.
The startup wrapper observes backend library/device creation and preserves the
@@ -79,6 +81,14 @@ entry, a whitelist of numeric readback dimensions/sample counts, and fixed failu
categories from our own assertions. Separately logged Vulkan codes are not
treated as the cause of a probe assertion.
Run 37194354615 identifies the actual probe assertion: each callback received a
1280×646 image, but its 4,160 sampled pixels had only one distinct RGB colour.
The strict nonuniform-readback assertion rejected all three cases. Overlay state
was not recorded in those failures; later probes wait for its removal before
counting readiness. This tests an initialization hypothesis while preserving the
same nonuniform-image requirement. It is not evidence that the game's displayed
Vulkan window was uniform or that a physical M2 GPU has the same problem.
For an isolated private preference override:
```sh
@@ -22,12 +22,21 @@ public final class ClientGraphicsIntegration implements ClientModInitializer {
private int titleTicks;
private boolean requested;
private boolean opening;
private int overlayWaitTicks;
private final boolean worldMode = Files.exists(FabricLoader.getInstance().getConfigDir().resolve("client-graphics-world.flag"));
@Override public void onInitializeClient() {
System.out.println("HORIZON_CLIENT_GRAPHICS_INITIALIZER_READY");
ClientTickEvents.END_CLIENT_TICK.register(client -> {
if (requested) return;
// TitleScreen can exist beneath the asynchronous loading overlay.
// Count readiness only after it clears, for both title and world mode.
if (client.gui.overlay() != null) {
overlayWaitTicks++;
titleStarted = 0;
titleTicks = 0;
return;
}
if (worldMode) {
if (!opening && client.gui.screen() instanceof TitleScreen screen) {
opening = true;
@@ -83,6 +92,8 @@ public final class ClientGraphicsIntegration implements ClientModInitializer {
result.addProperty("world_loaded", worldMode && client.level != null);
result.addProperty("ready_client_ticks", titleTicks);
result.addProperty("window_active", client.isWindowActive());
result.addProperty("overlay_present", client.gui.overlay() != null);
result.addProperty("overlay_wait_ticks", overlayWaitTicks);
result.addProperty("framebuffer_width", width);
result.addProperty("framebuffer_height", height);
result.addProperty("sampled_pixels", samples);
+2
View File
@@ -124,6 +124,8 @@ def main():
report = reports[0]
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:
raise AssertionError('Client graphics scene still has a loading overlay')
if args.world:
if report['world_loaded'] is not True or report['window_active'] is not True:
raise AssertionError('Client never reached focused demo-world gameplay')