Skip to content

Conversation

@amontoison
Copy link
Collaborator

Related to #264
Guillaume, it is still a draft but you can already have a look.

@amontoison amontoison requested a review from gdalle October 14, 2025 04:48
@amontoison amontoison marked this pull request as draft October 14, 2025 04:54
@codecov
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 96.89922% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.80%. Comparing base (2cf5f8b) to head (6b0fbb1).

Files with missing lines Patch % Lines
src/postprocessing.jl 96.52% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main     #267      +/-   ##
===========================================
- Coverage   100.00%   99.80%   -0.20%     
===========================================
  Files           20       20              
  Lines         2005     2102      +97     
===========================================
+ Hits          2005     2098      +93     
- Misses           0        4       +4     

☔ 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.

@gdalle
Copy link
Owner

gdalle commented Oct 14, 2025

Also, how does this all generalize to the acyclic bicoloring?

@amontoison
Copy link
Collaborator Author

Also, how does this all generalize to the acyclic bicoloring?

It is exactly the same in terms of handling trivial edges.
The only difference is that we need to check the non-leaf nodes in non-trivial trees and mark them as needed for decompression, but this process is fully deterministic, just like checking hubs in non-trivial stars.

It was just late yesterday, and I didn’t find the energy to finalize the PR.
I will continue it tonight.

@amontoison amontoison force-pushed the am/postprocessing_v2 branch 2 times, most recently from 6134b6b to 126f4bb Compare October 23, 2025 08:21
@amontoison
Copy link
Collaborator Author

amontoison commented Oct 24, 2025

@gdalle I have an issue in my new function postprocess_star_bicoloring, I need to check if the hub h is in the column partition (1 <= h <= n) or the row partition (n+1 <= h <= n+m) but I didn't find a way to obtain n or m from the arguments.
Because we pass the AdjacencyGraph of the augmented matrix, we can only recover n+m.

@gdalle
Copy link
Owner

gdalle commented Oct 24, 2025

We could store this information in the adjacency graph, to know whether it comes from a symmetric matrix or not, and in the latter case have access to the row/column split

@gdalle
Copy link
Owner

gdalle commented Oct 24, 2025

Or we pass an additional argument to the coloring

@amontoison
Copy link
Collaborator Author

amontoison commented Oct 24, 2025

We could store this information in the adjacency graph, to know whether it comes from a symmetric matrix or not, and in the latter case have access to the row/column split

I prefer this approach because we can know that we have "augmented adjacency matrix" this way, and thus know that we are in bicoloring context for the function postprocess!.

I will not need to pass the boolean parameter bicoloring everywhere.

@gdalle
Copy link
Owner

gdalle commented Oct 24, 2025

I suggest replacing AdjacencyGraph with:

struct AdjacencyGraph{T<:Integer,bicoloring}
    S::SparsityPatternCSC{T}
    edge_to_index::Vector{T}
    original_size::Tuple{Int,Int}
end

We no longer need has_diagonal because we have bicoloring => !has_diagonal

@amontoison
Copy link
Collaborator Author

amontoison commented Oct 24, 2025

I suggest replacing AdjacencyGraph with:

struct AdjacencyGraph{T<:Integer,bicoloring}
    S::SparsityPatternCSC{T}
    edge_to_index::Vector{T}
    original_size::Tuple{Int,Int}
end

Ok for me 👍

We no longer need has_diagonal because we have bicoloring => !has_diagonal

Yes but we don't have !has_diagonal => bicoloring. Is it fine for you that the user can't specify anymore has_diagonal = false in a non-bicoloring case?

I think adding a field bicoloring::Bool in AdjacencyGraph can handle more corner cases.

@amontoison amontoison marked this pull request as ready for review October 24, 2025 17:12
@amontoison amontoison requested a review from gdalle October 24, 2025 17:12
@gdalle
Copy link
Owner

gdalle commented Oct 24, 2025

Yes but we don't have !has_diagonal => bicoloring. Is it fine for you that the user can't specify anymore has_diagonal = false in a non-bicoloring case?

has_diagonal was never part of our public API to begin with, so the user never gets to specify it. I think the cases where someone wants to color a Hessian whose entire diagonal is zero are sufficiently rare for us to ignore them.
In addition, they would lead to type instabilities because they require a check on the values of the matrix before creating the AdjacencyGraph object.

@amontoison
Copy link
Collaborator Author

amontoison commented Oct 24, 2025

has_diagonal was never part of our public API to begin with, so the user never gets to specify it. I think the cases where someone wants to color a Hessian whose entire diagonal is zero are sufficiently rare for us to ignore them.

Fair point 👍
I updated the PR.

@amontoison amontoison changed the title Add an option neutralized_first in the post-processing Revisit the post-processing Oct 24, 2025
Copy link
Owner

@gdalle gdalle left a comment

Choose a reason for hiding this comment

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

Aside from my remarks above, do you have any ideas for test cases where our heuristics actually produce the result we want?

@amontoison
Copy link
Collaborator Author

Aside from my remarks above, do you have any ideas for test cases where our heuristics actually produce the result we want?

@gdalle I added the heuristic that I quickly described on Messenger in the following commit: 5fa3f7a
I only need to fuse the post-processing functions together and it should be good.

@amontoison amontoison force-pushed the am/postprocessing_v2 branch from a132593 to 6b0fbb1 Compare November 5, 2025 04:30
@amontoison amontoison requested a review from gdalle November 5, 2025 04:30
@amontoison
Copy link
Collaborator Author

@gdalle It is finally ready for a review!!

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.

2 participants