Repository navigation
Show and shorten the cold compile of the pipelines, and stop frames waiting behind speculative ones - #110
Closed
5hif7y wants to merge 3 commits into
Closed
Show and shorten the cold compile of the pipelines, and stop frames waiting behind speculative ones#1105hif7y wants to merge 3 commits into
5hif7y wants to merge 3 commits into
Conversation
…with On a cold driver cache the renderer compiled its pipelines synchronously for minutes (4.5 to 7 on an RX 580 without hardware ray tracing) behind a blank window that did not answer, and quitting waited for driver calls that cannot be cut. With 4 cores a single pipeline thread made frames wait behind speculative variants, so materials drew as their rows in almost every frame even with a warm store. - The start compiles on a thread while the window shows how many are made, with a screen drawn without pipelines (a clear and a copy of text painted on the CPU, ui.text_paint) and the title saying the same. - A window closed meanwhile, or a quit while a pipeline is inside the driver (app_quit_compiling), writes the kept pipelines and ends the process at once: the one exception to the engine never ending it. - The first pipeline thread takes no speculative job; speculative jobs go cheapest first and no frame waits for one. - Graphics_Settings.shaders: While_Playing, or Before_Playing, where a frame waits for the pipelines that are not speculative. - Device_Stats counts the pipelines made, those read from the store and the driver time; pipeline_store_load says what it found (Read, Missing, Other_Device after a driver update, Unreadable). - profile.load and the player log give each load its pipelines, with a note on why they compiled. - project.user_folder takes the user folder of a project out of platform, so the tools find the kept pipelines without SDL. Refs mirai-engine#109 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It plays the project twice with a window and prints their table: the start of the renderer, the pipelines the driver compiled and the frames that lost them. Cold empties both caches: the kept pipelines go aside and come back after, and the driver's own is pointed at an empty folder by its variables. The table says when the cold start may not have been cold (the kept pipelines were read, or the driver kept its own cache). Refs mirai-engine#109 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Graphics_Settings.shaders is a tagged field of the machine settings, so the popup has one row more. Refs mirai-engine#109 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tomaszbk
added a commit
that referenced
this pull request
Nov 21, 2026
Port pull request #110 onto the expanded pipeline variant set. Keep the window responsive during driver compilation and reserve a worker for non-speculative work. Isolate the benchmark's cache from the project. Ported-from: 4498ba7 Refs: #109, #110 Co-authored-by: 5hif7y <44300833+5hif7y@users.noreply.github.com>
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.
Closes #109.
On a cold driver cache the renderer compiled its pipelines synchronously for minutes behind a blank window that did not answer. Quitting waited for driver calls that cannot be cut. A single pipeline thread (with 4 cores) made frames wait behind speculative variants, so materials drew as their rows almost every frame, even with a warm store.
Changes
platform.window_wait) and showsCompiling shaders N/Mwith a clock, drawn without pipelines: a clear plus a copy of text painted on the CPU (ui.text_paint). The title says the same.host.app_quit_compiling), writes the kept pipelines and ends the process at once. This is the one exception to the engine never ending the process, decided explicitly and written in the rendering skill.pipeline_job_next).Graphics_Settings.shaders.While_Playing(default) orBefore_Playing: a frame waits for the pipelines that are not speculative.Device_Statscounts pipelines made, read from the store and driver time.pipeline_store_loadreturnsRead,Missing,Other_Device(a driver update) orUnreadable. On rebase this reuses Weigh the pipeline store's saves by the time measured around creation #107's CPU measurement of the creation call, so there is one measurement.profile.loadand the player log give each load its pipelines, with a note saying why they compiled.mirai bench pipelines. Plays a cold start against a warm one with both caches emptied: the kept pipelines are set aside and restored, and the driver cache is pointed at an empty folder. It warns when the cold start may not have been cold.project.user_folder. The user folder of a project moves out ofplatform, so the tools reach the kept pipelines without SDL.Measurements (Radeon RX 580, no hardware RT, 4 cores, Windows)
Before_Playingwait, cold (first draft waited for everything)mirai bench pipelines demo --scene ocean/ocean.scene:mirai render check demo --views nightagainst main: 5.86 → 5.86 ms, stability 0.001 → 0.001, no regressions.What ran
mirai check: rhi, render, host, platform, project, ui, editor, tools/mirai, engine/render, engine/save.mirai test --no-gpu: rhi 31, render 98, host 70, platform 46, project 38, ui 271, tools/mirai 82, editor (all pass after counting the new Shaders row).mirai testwith the GPU: rhi 31/31. render all pass but one, which also fails onorigin/main(below).mirai build editor demo,mirai play test demo(2/2),mirai scene check --project demo(no problems).--validation: no Vulkan validation errors from the start screen.profile.loadthroughmirai rpcin an editor session.Fails on main too:
render_far_from_the_centre_looks_as_at_it_and_a_jump_keeps_the_history("a view 15 km from the origin is the one at it: mean 0.000117, most 0.137"). It fails identically onorigin/main(4aae7bb), twice on each.Not verified
Open for review
Graphics_Settings.shaders.Before_Playingnow costs under a second, so it may be the better default.🤖 Generated with Claude Code