Skip to content

Fix the inference of the function coloring for static compilation - #340

Open
amontoison wants to merge 1 commit into
mainfrom
c_interface
Open

Fix the inference of the function coloring for static compilation#340
amontoison wants to merge 1 commit into
mainfrom
c_interface

Conversation

@amontoison

@amontoison amontoison commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

@gdalle I will open a follow-up PR with C and Fortran interfaces but we first need to fix the inference of the function coloring.

@amontoison
amontoison requested a review from gdalle September 5, 2026 04:16
@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.61%. Comparing base (e8d80d6) to head (8625abb).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #340      +/-   ##
==========================================
- Coverage   99.20%   97.61%   -1.60%     
==========================================
  Files          21       21              
  Lines        2151     2219      +68     
==========================================
+ Hits         2134     2166      +32     
- Misses         17       53      +36     

☔ View full report in Codecov by Harness.
📢 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.

#
# The C and Fortran interfaces compile SMC.jl into a standalone shared library.
# The trimming verifier rejects any call whose result type is not fully inferred,
# so `coloring` must return a concrete type.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did these tests use to fail before?

@amontoison amontoison Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, they fail on main. It is why I added them.

Comment thread src/interface.jl
problem::ColoringProblem,
algo::GreedyColoringAlgorithm;
decompression_eltype::Type{R}=Float64,
decompression_eltype::Type=Float64,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The rationale behind the type annotation was to force specialization: https://docs.julialang.org/en/v1/manual/performance-tips/#Be-aware-of-when-Julia-avoids-specializing

Not sure how this change makes anything better in that regard, I would have thought it makes things worse?

@amontoison amontoison Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Me too and it is the contrary that is happening, the compiler widen the type to DataType internally from what I unserstand if we keep Type{R} and we don't have the inference in 3 cases.

I am wondering if it is because the argument with the specialization is a keyword argument.

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