-
-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Using a Compute graph as alternative to Observables #4630
base: master
Are you sure you want to change the base?
Conversation
… into sd/compute-graph
if isnothing(value) | ||
edge.outputs_dirty[i] = false | ||
else | ||
edge.outputs_dirty[i] = true | ||
edge.outputs[i][] = value | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly this interprets nothing
as "the value has not changed". In that case shouldn't it leave the dirty state untouched? If a previous call has dirtied output i and this call has not changed it, it should still dirty, right?
if isnothing(value) | |
edge.outputs_dirty[i] = false | |
else | |
edge.outputs_dirty[i] = true | |
edge.outputs[i][] = value | |
end | |
if !isnothing(value) | |
edge.outputs_dirty[i] = true | |
edge.outputs[i][] = value | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case shouldn't it leave the dirty state untouched? If a previous call has dirtied output i and this call has not changed it, it should still dirty, right?
No, the dirty state is local to the current resolve.
So needs to be set to the correct value when setting the new value.
We still need to double check if there's a simpler and more consistent way and add some tests if this works 100% as intended, but right now outputs_dirty
is only for the children of an edge to figure out after a resolve if a value has changed from that particular resolve.
Benchmark ResultsSHA: b972279598d735ea8fd73453b3855b3e38cb2498 Warning These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking. |
@@ -176,7 +176,7 @@ is called. Note that resolution must be smaller than `1 / eps(Float32)`. | |||
""" | |||
function Float32Convert(resolution = 1e4) | |||
scaling = LinearScaling(Vec{3, Float64}(1.0), Vec{3, Float64}(0.0)) | |||
return Float32Convert(Observable(scaling), resolution) | |||
return Float32Convert(Observable(scaling; ignore_equal_values=true), resolution) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be useless because update_limits!()
already skips updates when the current scaling is acceptable.
add Colorbar glue code
… into sd/compute-graph
…omputePipeline package (#4656) * Update ci.yml * Update reference_tests.yml * Update ci.yml * Update reference_tests.yml * Update ci.yml * Update reference_tests.yml --------- Co-authored-by: Simon <[email protected]>
Just a thought related to #4752 - would it make sense to have "versioned" nodes in the compute graph? For example with linesegments we have This would make the pipeline easier to adjust because naming would become easier. E.g. if I wanted to hack the linesegments pipeline to do something to That would be quite useful for transform functions that change geometry as described in #4752. Maybe it would also be useful in recipes? |
attribute_per_pos!(attr, :scaled_color, :synched_color) | ||
attribute_per_pos!(attr, :linewidth, :synched_linewidth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only applies to LineSegments. For them it maps a value per point pair to two values for the vertices, which results in per-segment colors/linewidths. In Lines this would result in a const value segment, then a gradient segment, then a const value segment, etc.
This introcudes
ComputePipeline
(all names very WIP) as an alternative to Observables, which solves:State of this PR: first implementation for Scatter, hacking into the plot pipeline to replace the Scatter constructor and hijack it with a computegraph implementation for convert_arguments/convert_attributes and any backend computation.
Only prototyped for GLMakie right now.
It currently leaves the plot type unchanged and stores the compute graph in
plot.args[1]
(lol) and overloads a few methods already just for Scatter (not getproperty etc though, yet).Next steps:
Continuation of: #4550 and #4360