Repository navigation
Release the graph held by the layouts at the end, and write the OpenOrd positions through its own nodes - #3366
Merged
Merged
Conversation
…orceAtlas2 pass The layouts kept the graph of their last run in a field, which may be the graph of a view the filter has since destroyed. Each one keeps the destroyed view updated by the graph store for as long as it is held, so it is released in `endAlgo` once the layout data is cleaned up. ForceAtlas, Fruchterman-Reingold and Label Adjust only get their graph in `goAlgo`, so their `endAlgo` returns early if a run was stopped before it. OpenOrd's workers can still combine once after `endAlgo`, which no longer writes the positions then. ForceAtlas2 also skips the pass when no node moves, as the speed was NaN for good after 0 / 0, whether the graph is empty or all the nodes are fixed or at rest. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The held graph may be emptied once the filter has destroyed its view more than 8 times, after which the positions were never written again. The node array captured at init has no such dependency, and the node id is the index. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
3 of 8 tasks
Reset computed the optimal distance from the graph of the last run, whose view may have been destroyed and emptied since. The average edge length was then 0, which left the step at 0, and Yifan Hu never moved a node again. Reset now reads the visible graph under the read lock, taken before the fetch, so endAlgo can release the graph like the other layouts. Before any run, Reset still sets 100. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stopped run still combines once more. When the next run on the same layout had already started, that combine read the next run's workers and node array from the layout, and could mix them with its own, writing wrong positions or failing on an out-of-bounds index. Combine now gets the workers and the node array of its run, so the last combine of a stopped run writes its positions to its own nodes, as before the graph was released. The OpenOrdLayoutData set on every node was only read by the old combine and is no longer set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 29, 2026
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.
Description
Companion to gephi/graphstore#364, which makes the most recently destroyed views keep following the graph store for as long as a graph of them is held (this replaces #3363, which re-fetched the visible graph in each layout). A destroyed view that is held costs about as much as a live one on every change of the store, so the layouts should not keep one for no reason.
endAlgonow releases it, after the layout data is cleaned up (ForceAtlas, Fruchterman-Reingold, Noverlap, Label Adjust and Yifan Hu; ForceAtlas2 and Random already do it). ForceAtlas, Fruchterman-Reingold, Label Adjust and Yifan Hu only get their graph ingoAlgoorinitAlgo, so theirendAlgoreturns early if a run was stopped before it.ranOnceflag now that the graph is released.Combinenow writes through the node array captured at init, where the node id is the index, and uses the workers of its own run, so the last combine of a stopped run still writes its positions, as before, and never mixes them with the next run. Nodes that left the view meanwhile are written too, which is harmless. This removes the publicOpenOrdLayout.getGraph()and changes theCombineconstructor, which nothing outside OpenOrd used, and theOpenOrdLayoutDatais no longer set on the nodes, as nothing reads it.Checklist
Added tests?
Added to documentation?
🤖 Generated with Claude Code