Skip to content

Fix: If lower bound specified for availability, upper bound should be 1.0#955

Merged
alexdewar merged 1 commit intomainfrom
fix-availability-lower-bound
Oct 21, 2025
Merged

Fix: If lower bound specified for availability, upper bound should be 1.0#955
alexdewar merged 1 commit intomainfrom
fix-availability-lower-bound

Conversation

@alexdewar
Copy link
Copy Markdown
Member

Description

I stumbled across this while I was looking something up and it seemed fishy to me.

If you specify a lower bound for a process availability, the upper bound is set to infinity, whereas it should be 100% instead. It would be ok if we had other constraints which prevented activity from exceeding 100%, but we don't. In practice this hasn't proven to be a problem because all the examples only specify upper bounds. Also, the optimiser will generally try to minimise activity anyway, because less activity means lower cost, but we shouldn't rely on this.

Fix by setting the upper limit to 100%.

Type of change

  • Bug fix (non-breaking change to fix an issue)
  • New feature (non-breaking change to add functionality)
  • Refactoring (non-breaking, non-functional change to improve maintainability)
  • Optimization (non-breaking change to speed up the code)
  • Breaking change (whatever its nature)
  • Documentation (improve or add documentation)

Key checklist

  • All tests pass: $ cargo test
  • The documentation builds and looks OK: $ cargo doc

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@alexdewar alexdewar added the bug Something isn't working label Oct 21, 2025
@alexdewar alexdewar added this to MUSE Oct 21, 2025
@alexdewar alexdewar moved this to ✅ Done in MUSE Oct 21, 2025
@alexdewar alexdewar moved this from ✅ Done to 👀 In review in MUSE Oct 21, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.86%. Comparing base (9f77d38) to head (e6a9c63).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #955   +/-   ##
=======================================
  Coverage   83.86%   83.86%           
=======================================
  Files          50       50           
  Lines        5540     5541    +1     
  Branches     5540     5541    +1     
=======================================
+ Hits         4646     4647    +1     
  Misses        658      658           
  Partials      236      236           

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

@alexdewar
Copy link
Copy Markdown
Member Author

I am wondering whether a "proportion" type that can only have values >=0 and <=1 might be useful for catching problems like this.

Copy link
Copy Markdown
Collaborator

@tsmbland tsmbland left a comment

Choose a reason for hiding this comment

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

Well spotted!

@tsmbland
Copy link
Copy Markdown
Collaborator

I am wondering whether a "proportion" type that can only have values >=0 and <=1 might be useful for catching problems like this.

Potentially, not sure how often this would crop up though, whether it's worth the effort...

@alexdewar alexdewar merged commit 07f1f53 into main Oct 21, 2025
8 checks passed
@alexdewar alexdewar deleted the fix-availability-lower-bound branch October 21, 2025 15:28
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in MUSE Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants