Repository navigation
Textures, models, functions and lights come in place; the kernel is made beside the frames - #199
Merged
Merged
Conversation
…g them again A new texture, a material given a map, a new material with maps and a texture's new pixels rebuilt the scene (4.5 s on Bistro: the pages packed whole). The pages keep where each texture is and what they have free (texpack::Atlas); a texture is placed among them and written there, the pages growing by a layer or a side with a copy on the GPU; new pixels of the same size go over the old ones. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…s textures, its mesh Adding a model whose file the scene did not hold rebuilt it (5.2 s on Bistro). Its materials are made as the build makes them and its textures placed in the pages before the edit places it; its mesh is made in the room by the code a scene's mesh is made by (make_mesh, moved out of edit_geometry). A mesh given back is no model's any more. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A feature a scene first uses (fog, glass, a texture) changed the kernel's variant, and the next frame waited for the driver's compile (0.8 to 2.4 s here, tens of seconds on a phone). The view now runs the kernel it has until the scene's is made on another thread (Gpu::warm_kernel; modules and pipelines made without a lock held). In lockstep, and in a browser, the frame makes its kernel itself as before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ce comes in place Each was refused for a kernel feature the scene's structure lacked (F_MASKED, F_IFUNC, F_IGLASS) and rebuilt the scene. The three switch code on over data every scene has: the edit asks for the feature, the commit adds it to the scene's, and the kernel's variant with it is made as any other. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A new or changed material function rebuilt the scene (4.2 s on Bistro, and 7.9 s once a texture had come in place: the pages packed whole). The scene keeps its functions by number, one that comes takes the next; the kernel with them is another module, made while the frames go on with the one the view has, where a material of a function it has not is drawn as one without. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A light created, removed or set again as one of another class rebuilt the scene, and so did a group (1.5 s on Bistro each). A light that is the light table's alone (not a rect light's card, not the atmosphere's sun) has its entry added, dropped or sorted again in place: the table is listed in a build's order, grown where it is full, and the kernel's counts follow. Lights past what the kernel sums exactly still rebuild (the light tiles). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ild; the textures' test holds a shared slot and the grown pages' contents Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… the light table's growth; tests for a model that emits, lights among those resampled, a shelf too low Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ice is one thread's) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
yujiaxu-ops
marked this pull request as ready for review
November 23, 2026 10:19
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit eb3067f. Configure here.
…is made again with the translucency pass's functions as they are now The pass's dispatch has its particles' materials' functions alone, made when the kernel is. A material that changed function in place kept the old one (drawn as without a function). The kernel's functions are remade after the commit's materials, where a function came or changed or the particles' functions are others. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.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.

Textures, models, functions and lights come in place; the kernel is made beside the frames
A game that brought a texture, a model, a material function or a light while it ran had the scene built again from the world, and a feature a scene first used had the next frame wait for the driver's compile. On Bistro (2.8 M triangles, 960 x 540, an M5 Pro), the frame the edit landed in:
Frames are 16.6 ms; each cell is the longest frame within 1.5 s of the edit, over two or three runs.
texpack::Atlas). A texture is placed among them and written there (Gpu::place_texture); pages without room grow by a layer or a side with a copy on the GPU. New pixels of the same size go over the old ones.World::set_material,set_texture: in place).place_models), its mesh bymake_mesh, the code a scene mesh's edit used, moved out ofedit_geometryunchanged.set_functions); the kernel with them is another module.Gpu::warm_kernel); the view runs the one it has until every pipeline a frame asks of the new one is there (choose_kernel). The caches are looked up without a lock held over a compile. In lockstep and in a browser the frame makes its kernel itself, as before.docs/RUNTIME.md "What comes in place" has the rules and what still rebuilds: particle systems, volumes and grids and their functions; geometry functions; a posed model the scene has not got; any new model under software traversal; a rect light's card; lights past what the kernel sums exactly; the scene's first instance, procedural object, instance colours or vertex colours.
Until a new variant is ready, what it draws is missing: fog comes a moment late, a material of a new function is drawn as one without.
Not in this PR
Tests
textures_come_and_change_in_place,a_model_the_scene_has_not_got_comes_in_place,material_functions_come_and_change_in_place,lights_come_and_go_in_place.a_new_kernel_variant_is_made_while_the_frames_go_on;texpack:a_texture_is_placed_among_the_packed_ones; the world's rules.a_translucent_particles_material_takes_another_function_in_place: the translucency pass has its particles' functions alone, so the kernel is made again where those are others (found by review: it kept the old dispatch).Checks
🤖 Generated with Claude Code
Note
High Risk
Touches core live render path (GPU atlas growth, edit commit, kernel selection/pipelines) with complex concurrency; incorrect in-place updates could cause visual glitches or rare GPU/state bugs, though extensive tests mitigate this.
Overview
Live edits no longer force full scene rebuilds for textures, still models, material functions, and simple lights. Edits patch GPU tables and acceleration structures in place; only cases called out in docs (particles, volumes, posed new models, rect-light cards, etc.) still fall back to rebuild.
Texture pages keep an
Atlasand grow on the GPU via copy when full.Gpu::place_texture/rewrite_textureslot new or updated images without repacking the whole set.The live commit path places textures and model materials first, registers functions by number, and can build a new still model mesh via shared
make_mesh. Kernel features such as first cutout or glass caster are requested throughmore_featuresinstead of always rebuilding.Shader compile no longer blocks frames:
KernelMakerrefactors pipeline creation;warm_kernelcompiles on a background thread whilechoose_kernelkeeps rendering with the previous kernel until the new variant is ready (wasm/lockstep still compile synchronously).Lights can be added, removed, and reclassified in the light table with resorting;
tablesgains listing/removal helpers.Documentation (ROADMAP, RUNTIME “What comes in place”) and broad in-place tests cover textures, models, functions, lights, and async kernel warmup.
Reviewed by Cursor Bugbot for commit 0e90d4b. Bugbot is set up for automated code reviews on this repo. Configure here.