Skip to content

Smooth UnspentCostBucket budget spending#5579

Open
komarevtsev-d wants to merge 1 commit intomainfrom
users/komarevtsev-d/issue-5095/8
Open

Smooth UnspentCostBucket budget spending#5579
komarevtsev-d wants to merge 1 commit intomainfrom
users/komarevtsev-d/issue-5095/8

Conversation

@komarevtsev-d
Copy link
Copy Markdown
Collaborator

#5095
Register() no longer consumes budget in a single fixed way for the gap between the minimum and maximum budget spend. It now picks a desired spend by interpolating between minBudgetSpend and maxBudgetSpend using Smootherstep(CurrentBudget / MaxBudget). Consumption should be higher when the budget is fuller.

For interpolation i chose the smootherstep. It is slightly faster than sigmoid and simpler to use, as it is conveniently positioned relative to the y-axis (unlike sigmoid).

Added a benchmark that compares sigmoid to smoothstep functions. Results are:

----------- Sigmoid_Benchmark ---------------
 samples:       39338
 iterations:    955260195
 iterations hr:    955M
 run time:      5.003712421
 per iteration: 12.32858252 cycles
----------- Smoothstep_Benchmark ---------------
 samples:       99311
 iterations:    6088175031
 iterations hr:    6.09G
 run time:      5.009607195
 per iteration: 1.947897513 cycles
----------- Smootherstep1_Benchmark ---------------
 samples:       96192
 iterations:    5711827521
 iterations hr:    5.71G
 run time:      5.008432135
 per iteration: 2.079131814 cycles
----------- Smootherstep2_Benchmark ---------------
 samples:       93695
 iterations:    5419081671
 iterations hr:    5.42G
 run time:      5.00840317
 per iteration: 2.190996133 cycles
----------- Smootherstep3_Benchmark ---------------
 samples:       79463
 iterations:    3897871071
 iterations hr:    3.9G
 run time:      5.007022594
 per iteration: 3.047205232 cycles

@komarevtsev-d komarevtsev-d force-pushed the users/komarevtsev-d/issue-5095/8 branch from 3e73b7b to b80efe3 Compare March 25, 2026 10:36
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo target: cloud/disk_manager/ (test time: 225s): all tests PASSED for commit b80efe3.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
1091 1091 0 0 0 0 0

🟢 linux-x86_64-relwithdebinfo target: cloud/tasks/,cloud/storage/ (test time: 432s): all tests PASSED for commit b80efe3.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
865 865 0 0 0 0 0

🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 1545s): some tests FAILED for commit b80efe3.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
5961 5959 0 1 0 1 0

🟢 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 44s): all tests PASSED for commit b80efe3.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
39 39 0 0 0 0 0

🟢 linux-x86_64-relwithdebinfo target: cloud/filestore/ (test time: 4793s): all tests PASSED for commit b80efe3.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
3510 3510 0 0 0 0 0

@komarevtsev-d komarevtsev-d requested a review from qkrorlqr March 25, 2026 11:20
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.

1 participant