Skip to content

Conversation

@speth
Copy link
Member

@speth speth commented Dec 1, 2025

Changes proposed in this pull request

This PR includes some broad-ranging refactoring and cleanup of the "VCS" equilibrium solver. I've done this with the idea that the only real "public" interface is through the Mixture class, so there are numerous API changes within the vcs_* classes without any attempt to keep backward compatibility. Some specific changes

  • Eliminate some unnecessary classes, namely vcs_SpeciesProperties and VCS_SPECIES_THERMO
  • Simplify call paths by eliminating numerous functions that were only called from a single location
  • Eliminate the remaining goto statements
  • Remove some solver options and debugging modes that were unused based on the Mixture interface
  • Add a regression test for multiphase equilibrium at a pressure different from the standard-state reference pressure

There are no changes to the results from the solver, other than some minor changes in the high logging level outputs. This was done with the hopes of making it a little bit easier to investigate some of the long-standing bugs in the VCS equilibrium solver, but I didn't run across any smoking guns while putting this together, so all of those issues are still unresolved.

AI Statement (required)

  • Extensive use of generative AI.
    Significant portions of code or documentation were generated with AI (ChatGPT Codex using the GPT-5.1-Codex model), including logic and implementation decisions. All generated code and documentation were reviewed and understood by the contributor.

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 68.40731% with 121 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.21%. Comparing base (976f6f2) to head (7e49811).
⚠️ Report is 40 commits behind head on main.

Files with missing lines Patch % Lines
src/equil/vcs_solve.cpp 58.73% 72 Missing and 13 partials ⚠️
src/equil/vcs_solve_TP.cpp 75.00% 22 Missing and 8 partials ⚠️
src/equil/vcs_VolPhase.cpp 89.09% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2061      +/-   ##
==========================================
+ Coverage   76.75%   77.21%   +0.45%     
==========================================
  Files         457      456       -1     
  Lines       53742    53072     -670     
  Branches     9122     8999     -123     
==========================================
- Hits        41250    40979     -271     
+ Misses       9384     9046     -338     
+ Partials     3108     3047      -61     

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

@speth speth requested a review from a team December 15, 2025 13:24
Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

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

Thanks, @speth, for preparing to tackle some long-standing issues. Given the late review, I'll approve as is, as I'm also under the assumption that this will have additional rounds of follow-up (apart from my comment, I'm also not a big fan of plogf logging, but all of this is definitely out of scope).

The CI coverage of 68.4% could be higher, but then there's always the issue that some of the corner cases are hard to catch.

Copy link
Member

Choose a reason for hiding this comment

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

Great to see most of those defines gone, but I'm wondering whether we'd like to keep this at all? Shouldn't we at least use some enum's? At the same time, it's ok to leave this for a later phase in the cleanup.

@speth
Copy link
Member Author

speth commented Jan 5, 2026

Yes, this is certainly not the end of what's possible for cleanup of the VCS solver, but I thought this was a good start. The low patch coverage is driven in large part by the verbose logging options, most of which are not exercised in the test suite since minor numerical differences could lead to large differences in the exact solver path. I'd look more at the increase in overall project coverage (+0.45%) as a win.

@speth speth merged commit 630ba99 into Cantera:main Jan 5, 2026
162 of 168 checks passed
@speth speth deleted the equil-cleanup branch January 5, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants