Repository navigation
Gpu raster kernels - #4900
Gpu raster kernels#4900TrueDoctor wants to merge 14 commits into
Conversation
There was a problem hiding this comment.
5 issues found across 107 files
Confidence score: 3/5
raster_kernel_runtime.rscaches pipelines without the parameter-slot count, so running the same kernel with a differentparamslength can reuse an incompatible shader pipeline. Include the slot count in the cache key.INPUT_samplecan divide by zero for an empty input and return an indeterminate sample instead of transparent output. Return transparent when either size component is zero.finish_evaluationintest_utils.rscan let tests pass despite runtime evaluation errors. Checktake_evaluation_errors()after dispatch.lookup_textureinraster_kernel_runtime.rsuploads LUT data without checking it against the shape or the documented 4096-entry limit. Validate the data before creating the texture.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="node-graph/libraries/wgpu-executor/src/shader_runtime/raster_kernel_runtime.rs">
<violation number="1" location="node-graph/libraries/wgpu-executor/src/shader_runtime/raster_kernel_runtime.rs:123">
P2: `lookup_texture` uploads `lookup.data()` without validating it against the lookup's shape. An empty Lut1d gives a zero-width texture, a Lut1d over 4096 entries breaks the documented limit, and a Lut3d whose data is not `size^3` entries makes `write_texture` fail validation. Validate these in `RasterKernelLookup` or in `run`, and return a graceful result instead of relying on wgpu to panic.</violation>
<violation number="2" location="node-graph/libraries/wgpu-executor/src/shader_runtime/raster_kernel_runtime.rs:183">
P2: The pipeline cache key `(args.kernel, args.output_format)` omits the param slot count that is compiled into the shader's `uniform_params` array. If the same kernel runs with a different `params` length, the cached pipeline keeps the old array size. Include `param_slots` in the cache key, or assert that the params length is fixed per kernel.</violation>
</file>
<file name="editor/src/test_utils.rs">
<violation number="1" location="editor/src/test_utils.rs:128">
P2: `finish_evaluation` ignores runtime evaluation errors, so a graph that renders a fallback after a node failure can pass these tests. Check `take_evaluation_errors()` after dispatch, as `eval_graph_once` does.</violation>
</file>
<file name="node-graph/libraries/wgpu-executor/src/shader_runtime/raster_kernel_input_sample.wgsl">
<violation number="1" location="node-graph/libraries/wgpu-executor/src/shader_runtime/raster_kernel_input_sample.wgsl:2">
P2: `INPUT_sample` divides by zero for an empty input, producing non-finite texture coordinates and an indeterminate sample instead of the documented transparent result. Return transparent when either size component is zero before sampling.</violation>
</file>
<file name="node-graph/nodes/raster/src/wgsl/brightness_contrast.wgsl">
<violation number="1" location="node-graph/nodes/raster/src/wgsl/brightness_contrast.wgsl:1">
P2: Custom agent: **PR title enforcement**
Start the title with an imperative verb and capitalize the abbreviation as `GPU`; `Gpu raster kernels` is a noun phrase and does not follow the required title format.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| @@ -0,0 +1,97 @@ | |||
| fn apply_levels(value: f32, input_shadows: f32, input_highlights: f32, inverse_gamma: f32, output_minimum: f32, output_maximum: f32) -> f32 { | |||
There was a problem hiding this comment.
P2: Custom agent: PR title enforcement
Start the title with an imperative verb and capitalize the abbreviation as GPU; Gpu raster kernels is a noun phrase and does not follow the required title format.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At node-graph/nodes/raster/src/wgsl/brightness_contrast.wgsl:
<comment>Start the title with an imperative verb and capitalize the abbreviation as `GPU`; `Gpu raster kernels` is a noun phrase and does not follow the required title format.</comment>
<file context>
@@ -0,0 +1,97 @@
+fn apply_levels(value: f32, input_shadows: f32, input_highlights: f32, inverse_gamma: f32, output_minimum: f32, output_maximum: f32) -> f32 {
+ let highlights_minus_shadows = clamp(input_highlights - input_shadows, 1.1920929e-7, 1.);
+ let clamped = min(max(value - input_shadows, 0.) / highlights_minus_shadows, 1.);
+ let curved = pow(clamped, inverse_gamma);
+
+ return curved * (output_maximum - output_minimum) + output_minimum;
+}
+
+fn brightness_contrast_classic(value: f32, brightness: f32, contrast: f32, pivot: f32) -> f32 {
</file context>
| async fn finish_evaluation(&mut self) -> Result<(), String> { | ||
| self.runtime.run().await; | ||
|
|
||
| let frontend_messages = self.dispatch(Message::Wake); |
There was a problem hiding this comment.
P2: finish_evaluation ignores runtime evaluation errors, so a graph that renders a fallback after a node failure can pass these tests. Check take_evaluation_errors() after dispatch, as eval_graph_once does.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At editor/src/test_utils.rs, line 128:
<comment>`finish_evaluation` ignores runtime evaluation errors, so a graph that renders a fallback after a node failure can pass these tests. Check `take_evaluation_errors()` after dispatch, as `eval_graph_once` does.</comment>
<file context>
@@ -113,6 +108,33 @@ impl EditorTestUtils {
+ async fn finish_evaluation(&mut self) -> Result<(), String> {
+ self.runtime.run().await;
+
+ let frontend_messages = self.dispatch(Message::Wake);
+ if frontend_messages.contains(&FrontendMessage::UpdateRenderStatus { status: RenderStatus::Error }) {
+ return Err("Graph should render".to_string());
</file context>
| let frontend_messages = self.dispatch(Message::Wake); | |
| let frontend_messages = self.dispatch(Message::Wake); | |
| if let Some(errors) = self.portfolio_message_handler_mut().executor.take_evaluation_errors() { | |
| return Err(format!("Graph evaluation failed\n\n{errors}")); | |
| } |
| @@ -0,0 +1,3 @@ | |||
| fn INPUT_sample(texel: vec2<f32>) -> vec4<f32> { | |||
| return textureSampleLevel(INPUT_texture, raster_kernel_sampler, texel / vec2<f32>(INPUT_size()), 0.); | |||
There was a problem hiding this comment.
P2: INPUT_sample divides by zero for an empty input, producing non-finite texture coordinates and an indeterminate sample instead of the documented transparent result. Return transparent when either size component is zero before sampling.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At node-graph/libraries/wgpu-executor/src/shader_runtime/raster_kernel_input_sample.wgsl, line 2:
<comment>`INPUT_sample` divides by zero for an empty input, producing non-finite texture coordinates and an indeterminate sample instead of the documented transparent result. Return transparent when either size component is zero before sampling.</comment>
<file context>
@@ -0,0 +1,3 @@
+fn INPUT_sample(texel: vec2<f32>) -> vec4<f32> {
+ return textureSampleLevel(INPUT_texture, raster_kernel_sampler, texel / vec2<f32>(INPUT_size()), 0.);
+}
</file context>
eebebe2 to
9c35975
Compare
Performance Benchmark Results
|
…an saying a GPU is required
…it, and a footprint-dependent raster warns at Dehaze
…ut struct can't be generic over its raster
9c35975 to
c22fb0e
Compare
…d of the backdrop by the source
No description provided.