Skip to content

apply_decay_factor: change decay application to incremental instead of cumulative#816

Merged
mergify[bot] merged 2 commits intoflux-framework:masterfrom
cmoussa1:check.job.decays
Feb 13, 2026
Merged

apply_decay_factor: change decay application to incremental instead of cumulative#816
mergify[bot] merged 2 commits intoflux-framework:masterfrom
cmoussa1:check.job.decays

Conversation

@cmoussa1
Copy link
Member

Problem

As mentioned in #815, the apply_decay_factor() function applies cumulative decay factors (0.5^1, 0.5^2, 0.5^3, etc.) to each usage period every time the function runs. However, each period already contains values that have
been decayed in previous cycles. This causes compound decay - for example, a value that should have been decayed by 0.5^3 total was actually being decayed by much more (0.5^5 or higher).


This PR changes the decay application from cumulative to incremental, i.e. just multiplies each value by 0.5 once (representing one half-life period) rather than raising 0.5 to increasing powers.

As a result, some of the expected job usage values in t1006_job_archive.py are changed with the new decay application. I've also added some new tests to simulate multiple half-life periods and checks to make sure that all job usage period values are updated properly.

Fixes #815

@cmoussa1 cmoussa1 added the bug-fix a proposal for something that isn't working label Feb 13, 2026
Problem: The apply_decay_factor() function applies cumulative decay
factors (0.5^1, 0.5^2, 0.5^3, etc.) to each usage period every time the
function runs. However, each period already contains values that have
been decayed in previous cycles. This causes compound decay - for
example, a value that should have been decayed by 0.5^3 total was
actually being decayed by much more (0.5^5 or higher).

Change the decay application from cumulative to incremental, i.e. just
multiply each value by 0.5 once (representing one half-life period)
rather than raising 0.5 to increasing powers.

Change the expected job usage values in t1006_job_archive.py with the
change in how decay factors are applied to previous job usage period
values.
Problem: There are no tests that simulate a half-life period and then
checks *all* job usage period values to make sure that half-life decays
are happening properly.

Add some tests.
Copy link
Member

@jameshcorbett jameshcorbett left a comment

Choose a reason for hiding this comment

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

Nice!

@cmoussa1
Copy link
Member Author

Thanks @jameshcorbett! Setting MWP here

@mergify mergify bot added the queued label Feb 13, 2026
@mergify mergify bot merged commit f076fc9 into flux-framework:master Feb 13, 2026
24 of 26 checks passed
@mergify
Copy link
Contributor

mergify bot commented Feb 13, 2026

Merge Queue Status

Rule: default


  • Entered queue2026-02-13 18:01 UTC
  • Checks passed · in-place
  • Merged2026-02-13 18:01 UTC · at fa1983154110c9500d6066a5b746f082941ae43a

This pull request spent 6 seconds in the queue, with no time running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = coverage
    • check-neutral = coverage
    • check-skipped = coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = el8 - distcheck
    • check-neutral = el8 - distcheck
    • check-skipped = el8 - distcheck
  • any of [🛡 GitHub branch protection]:
    • check-success = el8 - py3.6
    • check-neutral = el8 - py3.6
    • check-skipped = el8 - py3.6
  • any of [🛡 GitHub branch protection]:
    • check-success = jammy - py3.6
    • check-neutral = jammy - py3.6
    • check-skipped = jammy - py3.6
  • any of [🛡 GitHub branch protection]:
    • check-success = spelling
    • check-neutral = spelling
    • check-skipped = spelling
  • any of [🛡 GitHub branch protection]:
    • check-success = python format
    • check-neutral = python format
    • check-skipped = python format
  • any of [🛡 GitHub branch protection]:
    • check-success = python lint
    • check-neutral = python lint
    • check-skipped = python lint
  • any of [🛡 GitHub branch protection]:
    • check-success = validate commits
    • check-neutral = validate commits
    • check-skipped = validate commits

@mergify mergify bot removed the queued label Feb 13, 2026
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.93%. Comparing base (be0faa5) to head (fa19831).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #816   +/-   ##
=======================================
  Coverage   82.93%   82.93%           
=======================================
  Files          27       27           
  Lines        2479     2479           
=======================================
  Hits         2056     2056           
  Misses        423      423           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix a proposal for something that isn't working merge-when-passing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

apply_decay_factor(): decay is cumulative instead of incremental

2 participants