-
-
Notifications
You must be signed in to change notification settings - Fork 206
fix: biconnected_components() returns invalid result fields
#2427
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
Draft
Copilot
wants to merge
6
commits into
main
Choose a base branch
from
copilot/fix-biconnected-components-results
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+7
−37
Conversation
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
Fixed the auto-generated biconnected_components_impl() to use underscore field names (tree_edges, component_edges, articulation_points) instead of incorrectly creating dot versions. Simplified the wrapper function as it no longer needs to fix the field names. Co-authored-by: krlmlr <[email protected]>
Updated test snapshot to reflect the fix - now correctly shows only underscore field names without the empty dot versions. Co-authored-by: krlmlr <[email protected]>
Copilot
AI
changed the title
[WIP] Fix invalid result fields in biconnected_components()
fix: Oct 26, 2025
biconnected_components() returns invalid result fields
Copilot finished work on behalf of
krlmlr
October 26, 2025 18:27
krlmlr
requested changes
Oct 26, 2025
Contributor
krlmlr
left a comment
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.
@copilot: The changes won't survive regeneration of aaa-auto.R . Ensure stability.
Co-authored-by: krlmlr <[email protected]>
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.
The auto-generated
biconnected_components_impl()was creating duplicate empty fields with dot notation (tree.edges,component.edges,articulation.points) alongside the correct underscore fields from the C layer.Root Cause
The impl function received underscore field names from C but incorrectly accessed them using dot notation:
This created new empty dot fields while leaving the original underscore fields unchanged, resulting in:
Changes
res$tree_edges,res$component_edges,res$articulation_points)Result
All fields now contain properly typed
igraph.vs/igraph.esobjects.Original prompt
This section details on the original issue you should resolve
<issue_title>
biconnected_components()returns invalid result fields</issue_title><issue_description>
biconnected_components()returns a result list with named componentstree_edges,component_edges,articulation_points. These list components have valid values, However, the result also has componentstree.edges,component.edgesandarticulation.points. These are empty.Note that
biconnected_components()is fully auto-generated, but somewhere during auto-generation the_is changed to a., but only in some places, not everywhere.Also notice the function definition:
</issue_description>
Comments on the Issue (you are @copilot in this section)
@ntamas The replacement is done in Stimulus in `src/stimulus/generators/r.py` in the function named `get_r_parameter_name` -- that part of the code is actually replacing underscores with dots. I don't have more time to debug this, but start looking there. @szhorvat This broke between 1.2.11 and 1.3.0. Isn't that when stimulus was separated into a library?This specific function used underscore names in 1.2.11,
res$articulation_pointsThe autogenerated code in 1.3.0 uses a buggy mixture of underscore and dot, and ends up with the mess I showed above. Furthermore, the outputs are no longer a proper vertex/edges sequences.
As Tamás said in chat, we need to decide whether we go with dots or underscores for output parameter names. Input parameters and attributes already use dots, so that's a natural choice, but that would involve a breaking change for
biconnected_components().</comment_new><comment_new>@szhorvat
I would have expected this to be fixable using
but this doesn't disable the
_->.replacement. If the parameters are renamed to anything but the original name, then the replacement is disabled. It would be good to fix this in Stimulus, to allow for special cases when we DON'T want the.-renaming.</comment_new><comment_new>@ntamas
The
_->.replacement is specific to the R code generator and it was there to enforce R's then-preferred dotted notation without having to spell out the alternative names one by one for each argument. Also, this came before we've hadPARAM_NAMES. I wouldn't try to fix the treatment ofPARAM_NAMESvs the replacement, I'd rather prefer first to decide once and for all which of the two formats (dotted or underscored) is preferred in the R interface. If it is the dotted notation, then everything is fine and we don't need any special treatment inPARAM_NAMES. If it is the underscored notation, we need to remove the replacement code and that's all.</comment_new><comment_new>@szhorvat
@krlmlr, the ball's in your court on this one.</comment_new>
<comment_new>@krlmlr
Changing the component names in a back-compatible way seems difficult, I wonder if it's worth the effort.
Just breaking the functionality seems to require a...
biconnected_components()returns invalid result fields #1203✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.