You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(render): keep each layer's GPU mesh between scenes of the same view (#1057) - #2628
The fourth part of #1057 step 2. A GPU scene keeps each layer's mesh for the next scene of the same view. Restyling, editing or filtering one layer tessellates that layer again, not every layer, and the GPU doesn't upload the others again either.
render_frame (a GPU scene for the screen)
for each layer the GPU draws
- tessellate it (mesh::collect_layer)+ take its kept mesh, while it looks the same and draws the same rows in the same view,+ or tessellate it and keep it
SceneBuffers::from_scene
- upload every mesh+ draw a kept mesh from the buffers already uploaded for it
When a mesh is taken. The layer looks as it did (its look, #2531), draws the same rows (definition query, display filters at the scale, time), from the same geometry copy (projected, thinned or display, at the same level), in the same projection, view and pixel scale. The mesh is then the one tessellating it again would make, vertex for vertex. Only screen scenes keep meshes: not a turned or tilted view's bands, exports, or a layer read from its source.
Pans and zooms still tessellate. The GPU map moves a scene with the camera over the ground it was drawn for (scene_covers), so a scene has to reach as far past the view as a new one would. A mesh kept for another view doesn't: panned, it falls short on one side; zoomed in, its 0.35 px decimation is coarser than a new one's; zoomed out, it reaches less far. Reusing meshes while navigating needs them made by tile or band (#635, #2541).
Left for later in #1057. Layers the GPU scene draws as pictures (rasters read into memory, see-through or blended layers, those too dense to mesh) are drawn and uploaded again in every scene, and a transparency change still draws its layer again. Keeping those pictures, and opacity as a GPU setting, is a separate change.
Sharing.DrawCmd::Mesh and Points hold their data in an Arc. A kept mesh is shared with the scenes that draw it, and mapgpu keeps the buffers uploaded for it by its address, held weakly on both sides: a buffer lives as long as a scene that draws it.
Memory
The kept meshes share their data with the scenes that draw them. What they hold beside a scene on screen is the last scenes' meshes, capped at 128 MiB on the desktop and 32 MiB in the browser, counted as allocated with their rows (1 byte a row), 16 KiB an entry and the layer's selection. Past the cap, the meshes used longest ago go, but never one a scene still being drawn has used; when the new one doesn't fit beside those, it isn't kept, and nothing goes. A layer keeps two views at most and one look, shared by its views: what the cache holds of a layer's settings is one copy, as the CPU's kept pictures hold (#2564).
As a multiple of the layer: a mesh is of the features in view, not the layer's rows, and one layer's is at most MAX_LAYER_VERTICES (2 million vertices, 80 MB). Against the 448k-row parcel layer at 2.5 GB (#2431), the whole cache is 5% of it. On the GPU, the kept buffers are those of the scenes on screen: none beside them. cargo xtask memory doesn't move: its workflows export, and exports keep nothing.
Benchmark
vector_layers_bench gains a restyle sequence (the top layer's fill changed in each of 8 frames of one view) and takes several files. "Every layer changed" renames each layer every frame as well, so that none looks as it did: what every frame did before. BENCH_BACKEND=gpu, Shelby County, TN: buildings, census blocks, block groups and the county outline, 338,786 features, 2.9 million vertices, 1920 × 1080 points, median of the 7 frames after the first.
view
every layer changed
top layer restyled
whole county, 1×
958 ms
646 ms
10 m a point, 1×
537 ms
427 ms
whole county, 2×
3445 ms
3066 ms
10 m a point, 2×
800 ms
649 ms
This times the CPU's part of a GPU scene, not the upload. Each of these scenes still draws one picture on the CPU (2.1 Mpx at 1×), drawn again in every frame: the part left for later.
Testing
cargo test -p rustgis-render: all pass. New layer_meshes tests: a scene of the same view after one layer is restyled takes the other's mesh, shared with the last scene, and makes the same commands, vertex for vertex, as one drawn with nothing kept. A pan, a zoom, an edit to a layer's rows and a definition query make its mesh again; the CPU renderer keeps none. With a small cap: a scene keeps the meshes it uses when they don't all fit, also while another scene is drawn; a mesh that doesn't fit puts nothing out; a third view leaves the layer's two when it can't be kept; a mesh kept for a view isn't replaced while in use; two maps' layers of the same id keep theirs apart.
cargo test -p rustgis-ui-egui --lib mapgpu: all pass on a headless adapter. The upload test checks a second scene sharing the data draws from the same buffers, and new data is uploaded again.
cargo clippy -p rustgis-render -p rustgis-ui-egui --all-targets -D warnings; cargo check -p rustgis-render --target wasm32-unknown-unknown with warnings as errors; cargo fmt --check. The full gate on CI.
Reach: the map view on the GPU backend, on the desktop and in the browser; the phone's map is the same view. The command line, Python and exports draw on the CPU or keep nothing. Nothing saved, undoable or visible changes beyond speed.
…iew (opengeos#1057)
A GPU scene keeps each layer's tessellated mesh for the next scene of the
same view, and takes it again while the layer looks as it did
(rustgis_map::look), draws the same rows, from the same geometry copy, in
the same projection, view and pixel scale. Restyling, editing or
filtering one layer tessellates that layer again, not every layer.
The meshes are shared (Arc) between the scenes that draw them, and the GPU
map keeps the buffers it uploaded for them by their address, so the
layers that look the same are not uploaded again either.
A pan or a zoom still makes every mesh again: the GPU map moves a scene
over the ground it was drawn for (scene_covers), which a kept mesh panned
to no longer reaches, and a zoom changes the 0.35 px decimation.
The kept meshes hold at most 128 MiB (32 MiB in the browser), two views a
layer and one look a layer; none a scene being drawn uses goes.
vector_layers_bench gains a restyle sequence and takes several files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No actionable comments were generated in the recent review.
Walkthrough
GPU screen renders now reuse eligible layer meshes across scenes. Draw commands and uploaded GPU buffers share allocations. The vector-layer benchmark accepts multiple inputs and adds restyle scenarios.
Changes: GPU Mesh Reuse
Layer / File(s)
Summary
Shared draw-command data crates/render/src/gpu_scene.rs, crates/render/src/mesh.rs, crates/render/src/lib.rs
Mesh and point draw commands store their data in Arc allocations. GPU band scaling uses Arc::make_mut when it modifies shared data.
Layer mesh cache and render integration crates/render/src/layer_meshes.rs, crates/render/src/lib.rs, crates/map/src/look.rs
GPU screen renders use a cache keyed by layer identity and render inputs. The cache tracks active scenes and limits retained views and memory. Tests cover reuse, invalidation, and eviction.
The GPU map renderer caches uploaded mesh and marker buffers for shared source data. Tests check reuse across scenes and new uploads for copied mesh data.
Multi-file and restyle benchmark crates/render/examples/vector_layers_bench.rs
The benchmark accepts multiple files and runs eight-frame restyle scenarios for top-layer-only and all-layer changes at two resolutions and pixel scales.
sequenceDiagram
participant ScreenRender
participant LayerMeshCache
participant GpuMapRenderer
participant LayerBuffers
ScreenRender->>LayerMeshCache: Look up eligible layer meshes
LayerMeshCache-->>ScreenRender: Return shared commands or store collected meshes
ScreenRender->>GpuMapRenderer: Build scene buffers
GpuMapRenderer->>LayerBuffers: Reuse or upload buffers for shared data
LayerBuffers-->>GpuMapRenderer: Return shared GPU buffers
Loading
Possibly related issues
opengeos/RustGIS#2541: The PR caches layer meshes between scenes, which relates to the issue’s repeated layer tessellation on full redraws. Its threading proposal is not included.
opengeos/RustGIS#1057: The PR implements the issue’s mesh-retention step for GPU screen scenes. The CPU picture cache, per-layer change counters, and label work remain outside this change.
opengeos/RustGIS#1051: The PR reuses meshes for unchanged layers in GPU screen scenes, but each scene still redraws a CPU-rendered picture.
Possibly related PRs
opengeos/RustGIS#2539: It changes the same benchmark and measures GPU scene construction without reusing meshes between scenes.
Suggested reviewers:giswqs, pick2510
Merge Risk: Minimal · up to e5a11
This change reuses layer meshes and uploaded GPU buffers across screen scenes, and it caps retained memory. No actionable merge-blocking risk was found in the supplied material. The normal CI gate should still run.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "perf(render): keep each layer's GPU mesh between scenes of the same view (#1057)" matches the main change: the GPU renderer now keeps and reuses each layer's mesh and uploaded buffers acros…
Description check
The description follows the template's main sections. The Summary explains what changes and why, with a diff and the rules for when a mesh is reused. The Testing section lists the commands run and the…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "perf(render): keep each layer's GPU mesh between scenes of the same view (#1057)" matches the main change: the GPU renderer now keeps and reuses each layer's mesh and uploaded buffers across screen scenes of the same view. It follows the conventional-commit style and names the subsystem. The issue number is a minor addition but does not make it misleading. The 80-character length is acceptable.
Full details: Description check
Explanation
The description follows the template's main sections. The Summary explains what changes and why, with a diff and the rules for when a mesh is reused. The Testing section lists the commands run and the new tests. The UI evidence section is not filled in with the 'No visible UI change.' line, and the description does not state that line explicitly, but the change is a performance change with no visible UI difference, and the description says 'Nothing saved, undoable or visible changes beyond speed.' The Related issue section names Part of #1057. The main gap is the UI evidence section: the template asks authors to keep the 'No visible UI change.' line or replace it, and the description does not clearly keep it. The benchmark table is a useful addition beyond the template. The description is mostly complete, so it passes with a note.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit sees shared meshes stay, As scenes return from hop to hop. New styles refresh the changed layer, While old buffers wait in place. Many maps now join the run, And restyle frames fill the chart.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 1351680a-6b88-4d99-84ce-9ece69b8788d
Commits
Reviewing files that changed from the base of the PR and between eecf66d and e5a1168.
Files selected for processing: 3
crates/map/src/look.rs
crates/render/src/layer_meshes.rs
crates/render/src/lib.rs
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Kept meshes outlive their map (Medium, confidence ~0.6).MESHES is a process-wide static, and nothing clears it when a map is closed, a project is replaced, or a layer is removed. Entries leave only when a later keep evicts them. Up to 128 MiB of CPU-side mesh data (32 MiB in the browser) can therefore stay resident after the user closes the map, until another GPU-screen scene happens to keep something.
The PR text says the cache costs nothing "once the map leaves the GPU". That holds for the GPU buffers (they are held weakly in mapgpu), but not for the Arc<Vec<MeshVertex>> data kept here.
Suggestion: release the entries of a map when its GPU renderer or map is dropped, or key entries by map so they can be dropped with it. Adding a test that closes a map and checks kept_bytes() would pin this down.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in e5a1168: every frame, on the GPU or not, first drops the kept meshes whose layer's rows are no longer held (the layer removed, its map or project closed, or its rows edited since). a_closed_map_lets_go_of_its_meshes checks a closed map's meshes go with the next frame of another map.
The reason will be displayed to describe this comment to others. Learn more.
LayerLook::of now runs twice per GPU layer per frame (Low, confidence ~0.35). The frame cache already calls it for every layer at line 4309, and this closure calls it again. Each call copies the layer's settings through bare(), including selection: Vec<usize>, so a layer with a large selection pays two O(selection) copies per frame before any mesh is taken.
Suggestion: compute the look once per layer per frame (for example, collect the frame-cache look per layer index and reuse it here) and pass that to take and keep. This is a performance point only; the keyed comparison is still correct.
The reason will be displayed to describe this comment to others. Learn more.
Not the case on the GPU: the frame cache's LayerLook::of at line 4309 runs only inside its !gpu gate (cached is None for a GPU scene), so a GPU scene takes each layer's look once, here.
I found no correctness bugs in the cache logic. The take/keep keys (look, projection, drawn copy, cull extent, map_per_px, ppp, wireframe, rows) cover what collect_layer reads. The globe path is excluded by gpu, mesh_room is per layer so a kept mesh's vertex count stays within the limit, the thinned cache is keyed by level, and Arc::make_mut in gpu_turned clones instead of mutating shared data. There are no unwrap/expect calls in non-test code and no unsafe.
Bugs
None confirmed.
Security
None found.
Performance
Kept meshes are a process-wide static (layer_meshes.rs:150) with no release on map close, project replacement or layer removal. Up to 128 MiB stays resident after a map closes. Confidence ~0.6. Posted inline.
LayerLook::of runs at lib.rs:4309 and again at lib.rs:5058 for every GPU layer each frame, copying selection each time. Confidence ~0.35. Posted inline.
Nit: take and keep_within scan the kept list linearly, and keep_within calls out.contains inside a filter. This is O(layers × entries) per frame, which is small in practice. Not posted.
Quality (nits, not posted; per AGENTS.md these can wait for the release quality pass)
lib.rs:5045 detects "no thinning" with std::ptr::eq on slices. It works, but it depends on thinned_cache's fallback behaviour. An explicit check would be clearer.
AGENTS.md
The PR body states the memory multiple, the wasm check, the reach and the undo story. The bench change compiles against the helpers in the file (run_drawn, scenes, summary are closures defined there).
Not checked: the benchmark numbers, the wasm and cargo builds, and the ui_shot output. I have no shell, so none of these were run.
Already raised: 0 prior review threads, so none were left alone.
Change size
Compared: the whole PR against main (merge base 76a6f33 to PR head eecf66d).
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Counterbalance the restyle comparison order.
The benchmark always runs the top-only block before the all-layer block. Removing the first frame does not counterbalance that order. (raw.githubusercontent.com)
Repeat paired runs and alternate which mode runs first. Keep each eight-frame block contiguous to preserve its cache-reuse sequence. Record the executed order and raw frame timings.
Based on learnings, fixed-order benchmark comparisons need order controls or alternating/randomized order with recorded timings.
Source: Learnings
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 25184897-78e2-409b-84c9-db48c83aa401
Commits
Reviewing files that changed from the base of the PR and between 33d03c0 and eecf66d.
Files selected for processing: 6
crates/render/examples/vector_layers_bench.rs
crates/render/src/gpu_scene.rs
crates/render/src/layer_meshes.rs
crates/render/src/lib.rs
crates/render/src/mesh.rs
crates/ui-egui/src/mapgpu.rs
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).
Every frame, on the GPU or not, first drops the kept meshes whose layer's
rows are no longer held: the layer removed, its map or project closed, or
its rows edited since. No scene could take them again, and up to the
cache's cap stayed resident after a map was closed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
rows_held releases less than its doc and the PR text say (Low-Medium, confidence ~0.5).let_go only drops a mesh once the Arc of its rows is gone. A layer that is removed or whose map closes keeps its rows alive while anything else shares them, for example an Undo step that holds the pre-removal dataset. Its mesh then stays in the cache until a later keep for that layer or the 128 MiB budget evicts it, even though the doc says nothing can use it again.
Nothing is wrong with the output, since no live layer can match the look. This is memory retention only, and it is bounded. Either reword the doc to say "the mesh is freed once its rows are", or make removal explicit (for example, let_go also drops entries whose instance_id no longer belongs to a live layer, if the caller can supply that).
The reason will be displayed to describe this comment to others. Learn more.
Right: a mesh goes once its rows do, so rows an Undo step still shares keep it until it is put out within the cap. Output is unaffected and the retention stays within the cap; the doc wording is left for the release quality pass.
The reason will be displayed to describe this comment to others. Learn more.
The look is counted as a flat 16 KiB (Low, confidence ~0.4).LayerLook is a copy of the layer's settings: bare() clones renderer, labels, design.domains/rules/templates, and dataset.fields (value lists included). None of that is bounded by this constant, and the look is not part of the 128 MiB accounting. A layer with a large coded-value domain or a many-class renderer can hold more than 16 KiB here.
AGENTS asks for what a change holds as a multiple of the layer. Please either measure the look's size with cargo xtask memory and state it in the PR, or count it from its actual contents instead of this constant.
The reason will be displayed to describe this comment to others. Learn more.
The look isn't bounded by the 16 KiB charge, but by count: a layer keeps one look, shared by its views, and drops the meshes of a look it no longer has. So the cache holds at most one copy of each live layer's settings, 1× them, as the CPU frame cache's kept looks do (#2564). The PR's Memory section states this. cargo xtask memory doesn't cover it: its workflows export, and exports keep nothing.
I read the full diff and the prior threads, and I traced the core paths: the kept-mesh lookup and eviction, the thinned/Drawn identity, the mesh_room budget, the clip pairing in render_frame, and the buffer cache in mapgpu. I found no crash, data-loss, or output-correctness bug. I could not build or run tests here (no shell), so the claims below come from reading the code.
Bugs
No new bugs found. The take path yields the same commands collect_layer would, because Made covers the projection, drawn copy, cull, map_per_px, ppp and wireframe, and Made/take also match on rows and look. mesh_room is per layer, and streamed layers are excluded. Clip pairing is unaffected, since flat scenes don't use clips. (confidence ~0.8)
Security
None found. The change adds no input parsing, and the vertex limits still apply on the build path.
Performance
LayerLook::of runs twice per GPU layer per frame (the frame cache and the new keep closure). Already raised in an existing thread and still present, so I left it alone. (confidence ~0.35)
keep copies rows (1 byte a row) and runs an O(entries) scan under the global lock on every rebuild. Both are small, but worth noting for animated layers, where every frame rebuilds. (confidence ~0.3)
Quality
rows_held overstates release (inline, crates/map/src/look.rs:331). Removal or closing only frees the mesh once the rows Arc is gone, so an Undo step that still shares rows keeps it until eviction. (confidence ~0.5)
Benchmark comparability. The existing whole and zoom sequences now reuse meshes across repeated frames of one view, so their numbers no longer measure the per-frame cost they measured before. The restyle table is valid. Any docs that cite the older whole-map figures should be re-measured. (confidence ~0.4)
Nits, grouped:share is duplicated in mapgpu.rs tests, and the mesh closure is repeated in layer_meshes.rs tests. Left for the release quality pass.
AGENTS.md
The look's size is not counted (inline, crates/render/src/layer_meshes.rs:42). ENTRY_BYTES is a flat 16 KiB, but the look holds the layer's settings, domains and field value lists. AGENTS asks for a measured multiple. (confidence ~0.4)
The rustgis-ui-egui wasm path and #[expect] usage look compliant. I could not check cargo xtask rows, which needs a run.
Earlier concerns
Kept meshes outlive their map (existing thread, layer_meshes.rs:150). let_go addresses the rows-gone case, which is progress. The residual is that let_go runs only inside render_frame, so after the last map closes, up to 128 MiB stays until the next map frame. I left the thread as is.
LayerLook::of runs twice per frame (existing thread, lib.rs:5059). Still present, so I left it alone.
I left 2 earlier concerns alone because they were already raised: the double LayerLook::of call, and the outliving meshes (partly fixed by let_go).
Change size
Compared: the whole PR against main (merge base 76a6f33 to PR head e5a1168).
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
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.
Summary
The fourth part of #1057 step 2. A GPU scene keeps each layer's mesh for the next scene of the same view. Restyling, editing or filtering one layer tessellates that layer again, not every layer, and the GPU doesn't upload the others again either.
When a mesh is taken. The layer looks as it did (its look, #2531), draws the same rows (definition query, display filters at the scale, time), from the same geometry copy (projected, thinned or display, at the same level), in the same projection, view and pixel scale. The mesh is then the one tessellating it again would make, vertex for vertex. Only screen scenes keep meshes: not a turned or tilted view's bands, exports, or a layer read from its source.
Pans and zooms still tessellate. The GPU map moves a scene with the camera over the ground it was drawn for (
scene_covers), so a scene has to reach as far past the view as a new one would. A mesh kept for another view doesn't: panned, it falls short on one side; zoomed in, its 0.35 px decimation is coarser than a new one's; zoomed out, it reaches less far. Reusing meshes while navigating needs them made by tile or band (#635, #2541).Left for later in #1057. Layers the GPU scene draws as pictures (rasters read into memory, see-through or blended layers, those too dense to mesh) are drawn and uploaded again in every scene, and a transparency change still draws its layer again. Keeping those pictures, and opacity as a GPU setting, is a separate change.
Sharing.
DrawCmd::MeshandPointshold their data in anArc. A kept mesh is shared with the scenes that draw it, andmapgpukeeps the buffers uploaded for it by its address, held weakly on both sides: a buffer lives as long as a scene that draws it.Memory
The kept meshes share their data with the scenes that draw them. What they hold beside a scene on screen is the last scenes' meshes, capped at 128 MiB on the desktop and 32 MiB in the browser, counted as allocated with their rows (1 byte a row), 16 KiB an entry and the layer's selection. Past the cap, the meshes used longest ago go, but never one a scene still being drawn has used; when the new one doesn't fit beside those, it isn't kept, and nothing goes. A layer keeps two views at most and one look, shared by its views: what the cache holds of a layer's settings is one copy, as the CPU's kept pictures hold (#2564).
As a multiple of the layer: a mesh is of the features in view, not the layer's rows, and one layer's is at most
MAX_LAYER_VERTICES(2 million vertices, 80 MB). Against the 448k-row parcel layer at 2.5 GB (#2431), the whole cache is 5% of it. On the GPU, the kept buffers are those of the scenes on screen: none beside them.cargo xtask memorydoesn't move: its workflows export, and exports keep nothing.Benchmark
vector_layers_benchgains a restyle sequence (the top layer's fill changed in each of 8 frames of one view) and takes several files. "Every layer changed" renames each layer every frame as well, so that none looks as it did: what every frame did before.BENCH_BACKEND=gpu, Shelby County, TN: buildings, census blocks, block groups and the county outline, 338,786 features, 2.9 million vertices, 1920 × 1080 points, median of the 7 frames after the first.This times the CPU's part of a GPU scene, not the upload. Each of these scenes still draws one picture on the CPU (2.1 Mpx at 1×), drawn again in every frame: the part left for later.
Testing
cargo test -p rustgis-render: all pass. Newlayer_meshestests: a scene of the same view after one layer is restyled takes the other's mesh, shared with the last scene, and makes the same commands, vertex for vertex, as one drawn with nothing kept. A pan, a zoom, an edit to a layer's rows and a definition query make its mesh again; the CPU renderer keeps none. With a small cap: a scene keeps the meshes it uses when they don't all fit, also while another scene is drawn; a mesh that doesn't fit puts nothing out; a third view leaves the layer's two when it can't be kept; a mesh kept for a view isn't replaced while in use; two maps' layers of the same id keep theirs apart.cargo test -p rustgis-ui-egui --lib mapgpu: all pass on a headless adapter. The upload test checks a second scene sharing the data draws from the same buffers, and new data is uploaded again.cargo clippy -p rustgis-render -p rustgis-ui-egui --all-targets -D warnings;cargo check -p rustgis-render --target wasm32-unknown-unknownwith warnings as errors;cargo fmt --check. The full gate on CI.Reach: the map view on the GPU backend, on the desktop and in the browser; the phone's map is the same view. The command line, Python and exports draw on the CPU or keep nothing. Nothing saved, undoable or visible changes beyond speed.
Related issue
Part of #1057 (step 2, part 4 of 4).
🤖 Generated with Claude Code
Summary by CodeRabbit