Repository navigation
Rate regulator: release the keep count in keepCountSlices slices of the window (E93) - #118
Merged
Merged
Conversation
…he window (E93) keepCountSlices (option rateReceiverKeepCountSlices, default 4, 1 = the whole count at the window start) in both cap-file regulators: slice floor((now mod window) x S / window) of a window passes floor(K / S) keep-count lines of a held pattern, one more while the slice index is under K mod S, on counter rg_kc_<key>_<slice> registered with the window interval. The count per window stays K; rg_kx_ past the total and the mute-entry path are unchanged. config.yaml adds the key; schema.json carries the modules declaration. tests/regulator: k5-slices and k6-slices-mute send a steady ERROR storm over a full window and the next window's first minute and check the lines kept per minute; paced cases start on a window edge (windows sit on epoch multiples from engine 1.1.152, now the default image); k1, k4 and t1 run the fix with one slice, and d1 expects one slice's share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unter (E93 review) Both cap-file regulators go back to the single counter rg_kc_<key>, which the mute path also counts on, and compare it with floor(K x (i + 1) / S) in slice i, so mute and regulator lines share K per window, unused lines carry forward, and a window never passes more than K whatever the sweep phase. A line the keep test refuses hands its increment back, as the service-total reservation does, so the counter holds lines passed, not lines tried. S goes through TenXMath.parseDouble with a default of 1 and is floored, so a string, a fraction or a value below 1 cannot pass more than K or switch slicing off silently. The keep blocks of the two files are byte-identical. tests/regulator: k5 and k6 expect 12, 13, 12, 13 and 12 a minute; k7 ends the storm pattern's mute entry mid-window (at most 50 for the window); k8 sets 2 slices on the command line (25 per half); d1 expects 8 + 12 to 8 + 50. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Engineering ask E93, as ruled 2026-10-25 (D then B,
keepCountSlices4), revised permarketing/vp/REVIEW_E93_SLICES_2026-10-26.md. Needs log-10x/modules#159 (the declaration) and engine 1.1.152 (log-10x/l1x-inc#238). Not to merge until Tal says.Change (keep blocks byte-identical:
rate-object-cap.js:268-288,rate-object-lookup-cap.js:244-264)rg_kc_<key>, the counter the mute path also counts on (rate-object-lookup-cap.js:173). In slice i = floor((now mod windowMs) x S / windowMs), a line passes while the counter is under the cumulative allowance floor(K x (i + 1) / S): 12, 25, 37, 50 for K = 50, S = 4. Mute and regulator lines share K per window, unused lines carry forward, and a window never passes more than K, whatever the sweep phase.getAndInc(..., 0 - 1, windowMs)), as therg_pas_reservation does. Without it the counter counts lines tried: the review's sketch alone passed 12, 0, 0, 0, 12 on k5.TenXMath.parseDouble(TenXEnv.get("rateReceiverKeepCountSlices", 4), 1), then floored. This is the rate objects' string-to-number idiom (TenXMath.parseDouble(keepRaw),rate-object-cap.js:208). EngineLongUtil.parseDouble(LongUtil.java:209-227) returns a number unchanged, parses a string and returns the default 1 otherwise. A value below 1 acts as 1.rg_kx_and the sample are unchanged. With S = 1, every decision is today's.Gate:
log10x/edge-10x:1.1.152(sha256:ab3345e4)rateReceiverKeepCountSlices 2on the command line)🤖 Generated with Claude Code