Skip to content

add non-allocating enumerate_paths! #428

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

Merged
merged 2 commits into from
Jun 4, 2025

Conversation

rafaqz
Copy link
Contributor

@rafaqz rafaqz commented Apr 13, 2025

This PR adds an in-place version of enumerate_paths - enumerate_paths!, that enumerate_paths now calls itself after making the required allocations.

This can greatly improve performance where you need to call it many times. I also removed allocations in enumerate_paths functions, such as allocations of Vector{Int} where UnitRange works fine in its place.

(This may need a specific test, although it will run in the current tests anyway - I can write that if its considered to be merged)

@rafaqz
Copy link
Contributor Author

rafaqz commented May 2, 2025

Bump

@Krastanov
Copy link
Member

the failures seem to be only in JuliaFormating tests. Do you mind running the formater?

@rafaqz
Copy link
Contributor Author

rafaqz commented May 9, 2025

Ok, thats done.

I have a few requests:

  • please remove the need for approval to run workflows in the github settings
  • please, lets remove this formatter check. Formatter could be run by julia-format to make its own PR, instead of blocking contributions without perfect formatting

@Krastanov
Copy link
Member

I am not really a core part of the team, so I can not address these requests, but I am in favor of the changes you are requesting. @gdalle , are you a good person to tag on this (see previous comment)?

Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.41%. Comparing base (6130332) to head (f2e2f16).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #428      +/-   ##
==========================================
+ Coverage   97.31%   97.41%   +0.10%     
==========================================
  Files         117      120       +3     
  Lines        6956     6959       +3     
==========================================
+ Hits         6769     6779      +10     
+ Misses        187      180       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Krastanov
Copy link
Member

I am rerunning the timed-out jobs now.

@gdalle
Copy link
Member

gdalle commented May 14, 2025

Sorry @Krastanov, as I announced on Slack and Discourse a while back, I have decided to retreat from JuliaGraphs maintenance tasks. I already have much on my plate with the JuliaDiff ecosystem, so it wouldn't be fair to pretend that I can take care of a second large project.
Unfortunately I don't know who's active around here anymore. Perhaps @etiennedeg or @simonschoelly?

@Krastanov
Copy link
Member

@gdalle , @etiennedeg , @simonschoelly , I am happy to take on some small part of the review and support burden.

  • if there is already very little support for this package, it might make sense to relax some of the contribution requirements (e.g. formatting in a particular style)
  • what are the rules for adding contributors to the team (like the author of this PR) so that running tests and other similar issues are not blocked on a volunteer remembering to enable something
  • who are the current decision makers for this github organization
  • may I get higher level access to the org (e.g. so that I can add community members to the team)
  • I will copy this on slack so that we do not pollute the PR discussion page

Copy link
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rafaqz
Copy link
Contributor Author

rafaqz commented May 14, 2025

I'm also happy to help out a bit, Im committed to some packages building on the graphs ecosystem.

@Krastanov
Copy link
Member

Thanks! You were added to the list of maintainers! I have left a review approving of a merge, so the merge option should now be unlocked for you. Please feel free to squash and merge unless there are other changes you would like to discuss.

@rafaqz
Copy link
Contributor Author

rafaqz commented Jun 3, 2025

Guys, format is deleting things... and having formats mixed with my PR code is making it look pretty awful.

This stuff has now been 3x the work of writing the alg, which took 10 minutes

@simonschoelly
Copy link
Member

This seems to be an issue with JuliaFormatter v2.0 See #435

@rafaqz rafaqz force-pushed the no_alloc_enumerate_paths branch from a1f8b6f to 14bb353 Compare June 3, 2025 09:28
@rafaqz
Copy link
Contributor Author

rafaqz commented Jun 3, 2025

Yeah, but it does add to my suggestion to not have these things enforced for PRs, but later with a bot where we can ignore it when its broken

@Krastanov
Copy link
Member

I am sorry for the bad experience -- it is difficult to balance defensive aggressive linting with approachability for new contributors with different workflows when a project is starved for volunteers. I acknowledge that this leads to negative feedback loop on the number of volunteers though. I will try to add a github action that does the reformatting automatically on each PR. Hopefully that would alleviate this particular issue.

@rafaqz
Copy link
Contributor Author

rafaqz commented Jun 3, 2025

Thanks.

I'm on extremely limited time and stealing time to finish this so small delays lead to weeks.

For efficiency doing this inside our framework would have been much easier, but its totally unprincipled to do that. I'm just hoping we can keep people making the principled decision to contribute small improvements to Graphs.jl, and for that I believe the overheads need to be lower.

@rafaqz
Copy link
Contributor Author

rafaqz commented Jun 4, 2025

Ok I restarted from main and this seems ok now, so good to merge from my perpective

(also can we get a patch version registered with the merge? so ConScape.jl can use it!)

@Krastanov
Copy link
Member

Tests pass, formatting passes, @simonschoelly 's comments are addressed, and a quick cursory additional review from me does not uncover issues. Merging.

Thank you for sticking with this! I will try to make future reviews less painful!

@Krastanov Krastanov merged commit 9689498 into JuliaGraphs:master Jun 4, 2025
12 checks passed
@rafaqz rafaqz deleted the no_alloc_enumerate_paths branch June 4, 2025 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants