Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Stem GPU buffer underallocated when baseline hidden
- The bug was real, and I fixed it by making the stem vertex base offset conditional on
baseline_visibleso hidden-baseline draws no longer write past the allocated buffer.
- The bug was real, and I fixed it by making the stem vertex base offset conditional on
Or push these changes by commenting:
@cursor push 6b597cb148
Preview (6b597cb148)
diff --git a/crates/runmat-plot/src/gpu/shaders/stem.rs b/crates/runmat-plot/src/gpu/shaders/stem.rs
--- a/crates/runmat-plot/src/gpu/shaders/stem.rs
+++ b/crates/runmat-plot/src/gpu/shaders/stem.rs
@@ -74,7 +74,7 @@
return;
}
- let base = 2u + i * 2u;
+ let base = select(0u, 2u, params.baseline_visible != 0u) + i * 2u;
write_vertex(base, vec3<f32>(buf_x[i], params.baseline, 0.0), params.color);
write_vertex(base + 1u, vec3<f32>(buf_x[i], buf_y[i], 0.0), params.color);
}
@@ -156,7 +156,7 @@
return;
}
- let base = 2u + i * 2u;
+ let base = select(0u, 2u, params.baseline_visible != 0u) + i * 2u;
write_vertex(base, vec3<f32>(f32(buf_x[i]), params.baseline, 0.0), params.color);
write_vertex(base + 1u, vec3<f32>(f32(buf_x[i]), f32(buf_y[i]), 0.0), params.color);
}This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
| entry_point: "main", | ||
| }); | ||
| let baseline_count = if params.baseline_visible { 2 } else { 0 }; | ||
| let vertex_count = baseline_count as u64 + inputs.len as u64 * 2; |
There was a problem hiding this comment.
Stem GPU buffer underallocated when baseline hidden
High Severity
The GPU output buffer is too small when baseline_visible is false. The shader always writes stem vertices at base = 2u + i * 2u (reserving indices 0–1 for the baseline regardless of visibility), but the Rust allocator uses baseline_count + len * 2 which drops to len * 2 when the baseline is hidden. The last point writes at index 2*len + 1, exceeding the 2*len-sized buffer by 2 vertices — an out-of-bounds GPU storage write.



Note
High Risk
Touches core plotting render and serialization paths, adding per-axes uniform state and new scene schema fields; regressions could affect subplot rendering correctness and backward compatibility of figure snapshots/scenes.
Overview
Expands plotting capabilities and scene serialization. Adds new plot kinds and metadata to the figure scene/event schema (e.g.
line3,quiver,pie, richererrorbar/stemstyling, area lower curve, surfaceimage_mode+ optional per-cell colors), plus per-axes metadata (limits, log modes, view angles, labels/styles, legend style, annotations, active axes).Reworks subplot rendering to be truly per-axes. The renderer now maintains per-axes cameras, applies stored 3D view angles, fits extents per-axes (including honoring axes-specific limits/
axis_equal), and uses per-axes uniform/direct-uniform/grid-uniform bind groups to avoid state bleed between subplots; subplot passes also forcemsaa_samples=1to prevent resolves from overwriting other panels.Adds GPU compute “packers” for more primitives. Introduces new WGPU compute shaders and Rust wrappers for generating vertex buffers on-GPU for
area,errorbar,image(truecolor),line3,quiver, andstem.Also bumps the TS bindings package version to
0.3.4and updates exports to include pie labels in image/SVG exports.Written by Cursor Bugbot for commit b0df409. This will update automatically on new commits. Configure here.