commit 170d40c5063c5db119e6a071c7243378677eccc9
parent 3e6fd4bf258c004fe0971069f865d2843b4bbb3c
Author: triesap <tyson@radroots.org>
Date: Thu, 24 Sep 2026 16:21:18 +0000
H092: clamp a non-positive stage cap to zero in the derivation helper
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/hyf_runtime/budget.mojo b/src/hyf_runtime/budget.mojo
@@ -78,8 +78,9 @@ def derived_stage_cap_ms(stage_cap_ms: Int, remaining_budget_ms: Int) -> Int:
D21 connect/read and output caps are derived from the positive remaining
absolute budget; this helper never replaces or extends the total deadline.
+ A non-positive stage cap has no admissible budget and collapses to zero.
"""
- if remaining_budget_ms <= 0:
+ if stage_cap_ms <= 0 or remaining_budget_ms <= 0:
return 0
if remaining_budget_ms < stage_cap_ms:
return remaining_budget_ms