Manuscript Offprint
arXiv:2611.06955A Sharp Additive Bound for the Threshold Rule in Repeated Rent-or-Buy
VASCO SCHIAVO
ABSTRACT. Motivated by context management in LLM agents, we study a repeated rent-or-buy model with schedule-independent history growth and a fixed reset price , a discrete form of dynamic TCP acknowledgment: every call pays as rent the history accumulated since the last reset, and a reset clears it. The classical threshold rule is 2-competitive, and no deterministic rule guarantees a smaller ratio. We show that, measured additively, its loss is governed by the changes in the growth: if the growth is constant on runs, the threshold rule, knowing neither the runs nor the horizon, pays at most more than the optimal schedule chosen with hindsight, and the coefficient is sharp. If the growth is only within a factor of runs, the bound holds up to a factor and an extra . The proof is a potential argument built from the relative value functions of the single-rate problems. On two runs no deterministic rule guarantees a loss below . A rule that also resets when the growth decreases guarantees , while the threshold rule can lose arbitrarily close to .
1. INTRODUCTION
A session makes calls . At call , a schedule observes the history and decides whether to reset. The call pays as rent in either case. A reset also costs and clears that history. Each call then appends an increment for the next call. Neither the increments nor the horizon are known in advance. This is a repeated rent-or-buy problem, a finite-horizon discrete variant of dynamic TCP acknowledgment [9,15]. It models an LLM agent, which re-sends its whole history on every call and is billed for it [5, 17, 23], and can summarize the history at a fixed price: when should it summarize? The model assumes that the increments are the same under every schedule, that is fixed, and that a reset clears the modeled history and changes nothing the agent does afterwards. A part re-sent by every call, such as the system prompt, is common to all schedules and left out. The model leaves out the effect of a summary on the information the agent keeps and on a prompt cache, and summaries whose size depends on what they summarize. So the theorems bound the modeled cost only.
What is known. The classical threshold rule accumulates the rent paid on non-reset calls since its last reset. It resets when adding the current rent would bring the accumulator to at least . It pays at most twice the cost of the best schedule chosen with hindsight, and no deterministic rule guarantees a smaller ratio (Section 2), as in the classical TCP problem [8, Theorems 10 and 12]. For standard dynamic TCP acknowledgment, randomized algorithms achieve [15, Theorem 1]. Our model differs in that terminal history need not be cleared. Under constant growth the rule resets with the period that minimizes the cost per call, a
2020 Mathematics Subject Classification. 68W27, 68W40, 90B05.
Key words and phrases. Online algorithms, rent-or-buy, dynamic TCP acknowledgment, additive guarantees, competitive analysis, context management, LLM agents.
VASCO SCHIAVO
discrete form of Harris's economic order quantity [12]. The factor 2 is a worst case over all sessions, attained by a single burst of growth followed by nothing, with the session ending right after the rule resets. It does not say how the loss depends on the session.
Our result. A run is a maximal block of equal consecutive increments, and is the number of runs. We show that the loss of the threshold rule, which does not know the runs, their number or the horizon, is governed by alone, whatever the length of the session or the size of the increments.
Theorem 1 (Main Theorem). Let and .
(1) For every session with runs, of arbitrary nonnegative rates, the threshold rule satisfies
(2) For every there is a session with exactly runs such that
In words, the threshold rule pays one reset price for not knowing the session and two for each change of growth. The first cannot be improved by any rule (Remark 9), and part (2) shows that the second is sharp. When , the bound also improves the ratio to .
The rule is not new: the commit rule of CADOC, which times context replacement, is of this kind [24]. What is new is the guarantee: a sharp additive bound against the unrestricted optimum, with no predictions or stochastic assumptions, and the best deterministic loss on two runs.
The parameter counts exact changes. If every increment is within a factor of a session with runs, the rule pays at most
by Remark 11.
The proof. The runs cannot be analyzed one at a time: neither the rule nor the optimal schedule restarts at a boundary, and both carry rent across it. We compare the schedules using potentials built from the single-rate problems. Within each run, these potentials bound the excess cost by a telescoping sum. At a change of rate, the old and new potential differences lie in the same interval of width , so the change contributes at most . The terminal term contributes at most , giving .
The rule or the problem? On sessions with at most two runs we can say which part of the loss is the rule's fault. No deterministic rule guarantees a loss below (Theorem 16), since none can tell slow growth that goes on from slow growth about to be followed by a burst. The threshold rule loses at most when the change is an increase, but arbitrarily close to at a decrease, where it keeps paying the stale rent of the fast run. All the sharp sessions of Section 4 change by decreases. A rule that also resets at every decrease loses at most per decrease (Theorem 15) and on two runs, the best possible (Theorem 18), though it gives up the factor 2: it is not -competitive for any constant . Table 1 records these results as prices: a rule has prices if every session satisfies , where and count the decreases and the increases between consecutive runs. Prices are coefficients of a guarantee for all sessions, not a split of the loss on one. Whether some rule pays for every change, on any number of runs, is open.
TABLE 1. Prices in units of . Larger triples are prices too. The first two rows fix the least base, , and give the and we prove with it and the known lower bounds. The last row gives limits for every rule. On sessions with two runs, suffices for both rules, and no rule with has a smaller (Theorems 16 and 18).
| base | decrease | increase | |
|---|---|---|---|
| threshold rule | 1 | 2, sharp (Sec. 4) | between 1 and 2 |
| drop-aware rule | 1 | at most 1 (Thm. 15) | between 1 and 2 |
| every rule | at least 1 (Rem. 9) | open | (Thm. 16) |
Related work. Beyond the worst case, guarantees exist for predicted resets [2,6,14,20], for general delay costs [7], for stationary stochastic arrivals up to constant factors [18, Section 3], and against the best of online experts: Harada, Kawase and Sumita [11] give a -competitive randomized rule with expected regret against the best of them, in the tension between ratio and regret studied by Andrew et al. [1]. Closest in spirit is tracking regret, which grows with the number of switches of the comparator [13]. Here, the changes are in the input instead, and the comparator is the unrestricted optimum. Worst-case analyses of lot-sizing heuristics bound ratios to the optimum [3,21], which no heuristic that ignores future demand brings below 2 [4,22]. Vachani refines them by the horizon and for constant or bounded demand. These are ratios, and none of them depends on the number of changes in the demand. For agents, CADOC batches context replacements with a stationary-optimal batch size and a commit rule that is 2-competitive for its waiting-plus-setup cost when the setup cost is a positive constant [24, Propositions 1 and 2]. Other compaction timings are tuned or learned [10,19,25]. Section 2 sets up the model, Sections 3 and 4 prove Theorem 1, and Section 5 compares rules.
Disclosure. A large language model was used to help prepare this paper. The author has read and checked every result and takes full responsibility for the paper, including any errors.
Definition 2 (Session). Let . A session of horizon is a sequence : it has calls, is the increment that call appends to the history, and the sequence of increments is the growth of . A run of is a maximal set of consecutive indices such that for every , and this constant is the rate of the run.
The number of runs of a session of horizon is
From now on, we suppose that , so .
VASCO SCHIAVO
Definition 3 (Schedule and cost). Let be a session of horizon , and let be the price of a reset, fixed throughout. A schedule for is an element , where means reset before call . Its history, the cost of call and the total cost are
We suppress the dependence of on the schedule r.
Since is finite, there is a schedule for , possibly not unique, with for every schedule for . We call such a schedule optimal with hindsight.
At call , the schedule observes and chooses . It pays , clears the history if , and then appends if . The rent includes even on a reset call because the reset reads the history it clears. There is no required reset after the final call and no cost beyond . For example, with increments and the three calls cost 0, and without a reset, and and with a reset before call 2. An increment appended at call and cleared by a reset before call thus pays , and an increment never cleared pays .
In the language of dynamic TCP acknowledgment with the objective of [8, Definition 2], under C every increment waits at least one step: increments arrive just after the integer times and acknowledgments happen at the integers. The other discretization, the cost of Remark 10, is the convention in which an acknowledgment also covers the arrivals of its own step, so a reset call pays the price only. The additive bound of Theorem 1 holds and is sharp under both (Remark 10).
Definition 4 (Rule). A rule is a map , where contains only the empty sequence. On a session of horizon it produces the schedule given by for .
Rules are thus deterministic and do not know the horizon: on a session that extends S by further calls, a rule produces a schedule whose first T entries are the ones it produces on S.
A rule loses against a schedule for , and its loss on is , the most it loses against any schedule. We call c-competitive if for every session , with no additive allowance.
Definition 5 (Threshold rule). On a session S of horizon T, let be the history of the schedule being built and the sum of rents paid on non-reset calls since its last reset. Starting from , for
We call the test value of call . Since and depend only on , this is a rule, the threshold rule, and its schedule on is the threshold schedule .
For a rate we define the two functions
Under constant growth , the function gives the rent of the first calls after a reset, and gives the cost per call of resetting every calls. Define
The minimum exists because is unbounded. Since , a direct computation gives .
Proposition 6. The following hold:
(1) for every session and every schedule for .
(2) For every , .
Proof. Part (1) is the discrete analogue of the factor two of the rule that Dooly, Goldman and Scott call greedy [8, Theorem 10]. We give the proof in this model.
Split the calls into the cycles of the rule: a cycle ends with a call at which the rule resets, or with call . Both costs are sums over calls, so it suffices to show that on each cycle the rule pays at most twice what a schedule pays. Every schedule pays each increment at call , so pays at least the total of the increments first billed in the cycle. The rule's history was empty before the first of them was appended, so its history at each call of the cycle is at most that of if does not reset in the cycle, and is the rule's rent at the last call of the cycle.
If the cycle ends with a reset, let be the rule's accumulator at that call. Then , and the rule pays on the cycle. If resets in the cycle, it pays at least , and . If it does not, it pays at least the rule's rents, , and . If the cycle ends with call and no reset, the rule pays only its rents, which total less than . Then pays at least if it resets in the cycle and at least the rule's rents otherwise.
Part (2) is a discrete counterpart of Harris's economic order quantity [12]. Directly,
Since is strictly increasing and is the first with , this difference is negative for , nonnegative for and positive for .
The factor 2 in part (1) is best possible for deterministic rules, by the adversary of ski rental [16], used for acknowledgment in [8, Theorem 12]. Append a single increment , followed by zeros, and end the session right after the rule's first reset, or sufficiently late if it never resets. If it resets before call 1, end after call 2. The rule then pays at least times the optimum. Applied to the threshold rule itself, this adversary stops at its first reset: the rule then loses exactly , against an optimum below . The ratio 2 thus comes from sessions whose optimum is about . On longer sessions it allows a loss as large as the optimum, while Theorem 1 bounds the loss by .
3. THE UPPER BOUND
In this section we prove point (1) of Theorem 1.
Without loss of generality, we may assume that every increment is positive. Indeed, replace each zero increment of by some smaller than every positive increment of : the runs and the direction of each change stay the same, and the cost of every schedule is affine in . Along the decisions that the threshold rule makes on , its test values are affine
VASCO SCHIAVO
and nondecreasing in , so for small enough a test that holds still holds and one that fails still fails: the rule makes the same decisions. Letting carries the bound back to . The same argument applies to the other upper bounds below and to the drop-aware rule of Section 5.A, whose comparisons between increments do not change.
For , the carry of a schedule before call is the history left after the preceding call's reset decision:
For , the new increment is added to this carry, so . At , the carry is what the schedule leaves after its last call. We write for the threshold rule's carry, and use and for the two carries at a fixed call.
The state of the threshold rule before call is . The carry records retained history. The accumulator records rent already paid on non-reset calls, so the same increment can contribute to it repeatedly. At a call with rate , the rent is . If , the rule also pays and moves to . Otherwise, it moves to . By induction, at every state it visits.
Fix a rate . To compare the schedules, we consider the cost of their next reset if the rate stays , measured relative to the optimal cycle average per call. For a carry and , define
For , is the rent up to a reset at the -th call: those calls pay . Adding the reset price and subtracting gives . Minimizing over gives the benchmark . We also include the artificial candidate to cap at . This is not a reset action in the model. The minimum exists because .
For the threshold rule, the state fixes the next reset under constant rate . Its crossing index is the first with , and its relative cost is . The proof compares this cost with the benchmark at the comparator's carry through . The comparator need not choose a minimizing reset: gives an inequality for either of its actions (Lemma 8). Summing these one-call inequalities within each run cancels the intermediate potentials, leaving only the rate changes and the terminal state to be charged.
Lemma 7. Let and .
(1) For , . In particular for all , for every , and .
(2) , and .
(3) The equality holds. Consequently,
(4) If then .
(5) The map is nondecreasing on .
Proof. (1) For ,
where we used in the third equality the fact that . By Proposition 6 point (2), , so , also for , where . In addition, . Hence
as , and the crossing index of is , since first holds at .
(2) Every term is nonnegative by (1) and the term equals , and .
(3) Expanding the quadratic rents gives
where the third equality uses . Taking the minimum over on the right gives the first inequality, and gives the second since .
(4) The lower bound follows from the definition of . For the upper bound we show for every . Since , the crossing index satisfies . Its minimality also gives .
First let . Since ,
using , and .
Now let . If , use . Otherwise, means , and then
(5) For every the map is nondecreasing, and so is their minimum .
Lemma 8. Let , and let be a call with .
(1) If and are the states of the threshold rule before calls and , then
(2) If o and o' are the carries of a schedule r before calls t and , then
Proof. (1) If the rule does not reset, and the crossing index of the next state is k - 1, since, for every ,
VASCO SCHIAVO
Hence by Lemma 7 point (3), which is . If it resets, equals , and the next potential is by Lemma 7 point (1).
(2) If , then and . If , then and . The two inequalities of Lemma 7 point (3), with by Lemma 7 point (2), are exactly the two cases.
Proof of Theorem 1 point (1). Fix a schedule for . For let be the state of the threshold rule and the carry of before call , and for a rate put
For let be the excess cost of call , and for write for the rate of call .
We first bound the excess cost of one call. For , Lemma 8 points (1) and (2) at call t give
Call 1 costs the rule nothing, as it has no history and does not reset, so . Summing over the calls and shifting the index of the first sum by one gives
We bound the three terms separately.
For the first term, before call 2 we have , so by Lemma 7 points (1) and (2).
For the second term, and by Lemma 7 points (2) and (4), so .
For the third term, if then and the summand is 0. Otherwise a boundary lies between calls and , and since has runs this happens for exactly values of . Fix such a , write , , and . Since , Lemma 7 point (4) gives, for every rate ,
Together with and monotonicity in the carry (Lemma 7 points (2) and (5)), this yields
The carries and are fixed at the boundary, so and lie in the same interval of width . Hence , whatever the direction of the change.
Combining the three bounds gives
Since is arbitrary, this holds in particular for , and together with Proposition 6 point (1) it gives the claim.
Remark 9 (Constant growth). With , Theorem 1 point (1) says that under constant growth the rule loses at most against every schedule. Every rule loses at least . Feed it a constant rate . If it resets, end the session right after its first reset, as the adversary of ski rental does [16], or after call 2 if that reset is before call 1, so that the session has one run. Up to there it has paid the rents of the schedule that never resets, and at least more. If it never resets, its cost grows quadratically in , while resetting every calls costs a linear amount, so its loss exceeds for large.
Remark 10 (The other discretization). If a reset call pays the price only, the cost of a schedule is . The threshold rule makes the same decisions under both costs, since its accumulator counts the rent of non-reset calls only, and the additive bound of Theorem 1 holds for as well: for every schedule . A reset before call clears each increment appended since the previous reset exactly once, so is minus the carry that leaves after call , and likewise for the rule, whose final carry is . The proof above bounds by , so the primed gap is at most
by Lemma 7 points (1) and (2). The family of Section 4 ends with rule carry 0 and a comparator carry that tends to 0, so the coefficient stays sharp. Section 5 uses only.
Remark 11 (Approximate runs). The bound survives small perturbations of the growth. Let be a session with runs and positive increments, let , and let have the same horizon and increments . Then every schedule for satisfies
Write for the threshold schedule on and . For a fixed schedule, histories and accumulators are linear in the increments with nonnegative coefficients. So on , the schedule resets only if its test value is at least , and always if it is at least . Run the proof of point (1) on , with replaced by the largest over the indices with , where is the crossing index. The proof of Lemma 7 point (4) uses only and , so it holds for each such , and the boundary and terminal bounds stand. A call without a reset only removes candidates, so Lemma 8 point (1) becomes an inequality in the right direction. A reset is the index 1, and the fresh state it leaves is now worth the largest over with . This is 0 for , and for the bound gives . Counting the initial state as well,
where is the number of resets of . Finally,
give the claim.
VASCO SCHIAVO
4. SHARPNESS
In this section we prove Theorem 1 point (2): for every we build a session with runs on which the threshold rule loses more than , so the charge of per change in Section 3 is not an artifact of the proof. At each drop, the threshold rule enters with stale carry while the comparator enters with none. The slower growth makes the rule pay almost in repeated rent on that carry before paying for an extra reset. We end the session at a further threshold reset to retain the terminal loss of .
Proof of Theorem 1 point (2). For the argument of Remark 9, applied to the threshold rule, gives a loss of . Let . We take , since multiplying the growth and the price by multiplies both costs by , and we omit the first call: it has rent 0, and neither schedule below resets before it. As in Section 3, call has rate , and run consists of the calls at rate .
We first build the session. Choose an integer and set . For , define successively
With incoming carry and accumulator both calls without new growth give test value . Choosing much larger than makes small enough that the new growth does not cause an earlier reset, as verified below. The choice of also gives , so is the reset period from an empty state. These resets happen at exact ties, which the test counts as resets. Since , all and are integers. Run has rate and calls if calls if , and calls if . As , the session has exactly runs.
Next we fix the comparator, the schedule that resets before the last call of each nonfinal run and never in run . So it enters every run with carry 0, and the -th call of run pays the rent .
We now follow the threshold rule run by run. In run 1 the -th call pays and has test value , which first reaches 1 at : the rule resets there, and the last call of the run pays and does not reset. So the rule leaves run 1 with carry and accumulator both equal to . Suppose that it enters run with carry and accumulator . Until its first reset in the run, the -th call pays , so its test value is . At this is , and at it is , because
So the rule first resets before the -th call of the run. After that reset the calls pay , so the next reset is calls later, before the -th call. In run this is the last call of the session. In a nonfinal run, one call is left. It pays and does not reset, so the rule leaves run with carry and accumulator .
Finally, compare the costs on each run. The reset positions and excess costs are summarized below. Positions are counted within the run, and excess means the rule's cost minus .
| Run | Rule's resets | r's reset | Excess cost |
|---|---|---|---|
| First | last call | ||
| Intermediate | last call | ||
| Final | none |
For the first row, both schedules reset once and pay the same rents except on the last call, when pays more. For an intermediate run, split at the rule's two resets. The rent differences on the first calls, the next calls, and the last call are , and , respectively. The rule also makes one extra reset. Its excess cost is therefore
using and . In the final run the last single call is absent and the rule makes two extra resets, giving the last row. That row exceeds , since . Summing over the runs, and using and ,
which exceeds for large. Since , this proves part (2).
Remark 12 (Size of the instances). The recursion gives and , so the runs grow doubly exponentially in . This sharpness construction uses very long sessions. With a bounded horizon or a minimum positive rate, we do not know the best coefficient.
5. THE RULE OR THE PROBLEM?
Theorem 1 is a statement about one rule. Could a different rule, still knowing neither the runs nor the horizon, pay less for a change of growth? For two runs this section answers the question completely. Its results fill the second and third rows of Table 1.
5.A. Decreases: a rule that reacts to them. As in Section 4, after a fast run the threshold rule keeps paying the stale carry of that run during the slow one, and then pays a reset. A rule that sees the decrease can clear the stale carry at once.
Definition 13 (Drop-aware rule). On a session of horizon , let and be as in Definition 5 for the schedule being built. Starting from , for
where is read as false for .
So the rule is the threshold rule, except that it also resets at the first call of every run slower than the one before. Since both tests use only , this is a rule, and its schedule on is the drop-aware schedule .
VASCO SCHIAVO
The analysis of this rule needs one more property of the potentials, which the proof of Theorem 1 did not use: when the growth decreases, the relative value of every carry can only rise.
Lemma 14. For every , the map is nonincreasing on .
Proof. Let . For each we show , in two cases.
For the first case, , the minimizing property of (Proposition 6 point (2)) gives
It follows that
So for every .
For , Lemma 7 point (1) gives
Hence for every , and taking the minimum over gives .
Theorem 15 (Drop-aware bound). Let , let be a session with runs, and let and be the numbers of decreases and of increases between consecutive runs. For every schedule for , the drop-aware rule satisfies
Proof. In this proof, denotes the drop-aware rule's state. Telescope as in the proof of Theorem 1. Call a reset made because a drop reset. At a call without a drop reset the rule acts as the threshold rule, so Lemma 8 applies, and a boundary at such a call is an increase, charged at most 2K by the jump bound. That bound and the terminal one use Lemma 7 point (4), which needs . The drop-aware rule keeps this invariant, since a drop reset moves it to . At a decrease from rate to rate the rule makes a drop reset: from state it pays and moves to , whose potential is 0 by Lemma 7 point (1). Measure the state before the call with the old rate and the state after it with the new one. Let be this call, and let and be the comparator's carries before and after it. Then , and the excess of the call plus the change of is
The first bracket is at most 0 by Lemma 7 point (1). So is the second, because is nonincreasing in the rate (Lemma 14). The third is at most by Lemma 8 point (2) at the rate , since . So a decrease and the reset it forces add at most , the boundary included. The terminal term contributes at most as before.
Since , taking shows that the drop-aware rule loses at most , as the threshold rule does, and at most if every change is a decrease, as on the family of Section 4, where the threshold rule loses close to .
The drop-aware rule is not a better rule in general. Its additive guarantee is never weaker than that of Theorem 1, but it pays at every decrease, whether or not the decrease leaves stale rent to clear. If the growth alternates between and , with , it resets before every other call from call 3 on, at an average cost of per call, while resetting every calls costs at most per call. On long sessions the ratio of its cost to the optimum therefore tends to at least , which grows like as grows: unlike the threshold rule, it is not -competitive for any constant .
5.B. Increases: one reset price. Increases are different. A rule that loses at most under constant growth, the least possible (Remark 9), must lose about on some session with one increase, because it cannot tell slow growth that goes on from slow growth that is about to be followed by a burst.
Theorem 16 (No rule guarantees a loss below on at most two runs). Let , let be a rule and . There are a session , with one run or with two runs whose change is an increase, and a schedule for such that
Proof. Fix an integer with , put and , and feed the rule constant rate . If it has not reset within calls, end there: it has paid the rent , while resetting once, before call , costs , which is smaller by . Otherwise let be the first call before which it resets, and let the increment appended by that call be the burst . The rule, which has seen only s, behaves identically on the new session up to that reset. There it pays , with , and carries the burst into call . If it resets again before call , end the session there: against the schedule that never resets it has paid two reset prices and saved only the rent . If it does not, append one more increment and end after call : against the schedule that resets only before call it has paid at least as many reset prices, the burst twice instead of once, and saved only the rent , so it loses at least . In both cases the loss is at least . In all three cases the increments are s followed by none, one or two , and , so the session has one run or two runs with an increase.
So a rule that loses at most on every session with one run loses at least on a session with two runs and an increase. In the terms of Table 1, this session forces or , so for every rule. The threshold rule loses at most when the increase is the only change, because the cycle it completes after the increase costs at most its fair price.
VASCO SCHIAVO
Lemma 17. Let and with , and let be the crossing index of at rate . Then
the threshold cycle made of calls at rate and then calls at rate costs at most its fair price. Equivalently, .
Proof. Step 1: locate the crossing indices.
Write , , , and . Since and , the crossing index at rate is . Hence
which gives the equivalence.
Since , we have . Also gives , and gives . Thus
Step 2: expand the potential difference.
Set . Substituting and and expanding the quadratic rents gives
The last two terms are nonnegative. If , then and , so the claim follows. If , then , so the claim also follows whenever .
Step 3: use the crossing condition when .
It remains to treat . Its definition forces , hence . Here the crossing condition gives
Multiply the identity above by and apply this bound to its last term. Since , we obtain
where, for ,
The function is affine with nonnegative slope:
indeed, and because and .
As , we get , and a direct computation gives
To check the sign, recall that and that these indices are integers. Thus , and . The two remaining factors satisfy
where follows from . Every factor in the two products is therefore nonnegative. Since , we have , hence and .
Theorem 18 (Two runs). On a session with at most two runs, the threshold rule loses at most 2K if the change is an increase, and the drop-aware rule loses at most 2K in every case. So 2K is the smallest loss a rule can guarantee on such sessions (Theorem 16). The drop-aware rule guarantees it, while the threshold rule, which for every can lose more than (Theorem 1 point (2)), does not.
Proof. For an increase from to , the rule starts at and each call at rate moves to or, at a reset, to . So at the boundary its state is with . In the proof of Theorem 1 point (1) the jump of at this boundary is then by Lemma 17 and Lemma 7 point (2), so the loss is at most . On such a session the drop-aware rule meets no decrease and makes the same decisions. With one run or a decrease, Theorem 15 gives or .
So on two runs the extra loss of the threshold rule comes only from decreases. Four questions remain open. Does some rule guarantee a loss of at most PK on every session with runs? What is the sharp additive bound for the threshold rule under repeated increases, where Lemma 17 no longer directly applies? Can a rule lose at most 2K on two runs and also be -competitive for some constant ? Is the term in Remark 11 necessary?
REFERENCES
[1] ANDREW, L., BARMAN, S., LIGETT, K., LIN, M., MEYERSON, A., ROYTMAN, A., AND WIERMAN, A. A tale of two metrics: Simultaneous bounds on competitiveness and regret. In Proceedings of the 26th Annual Conference on Learning Theory (COLT 2013) (2013), vol. 30 of PMLR, pp. 741–763.
[2] ANGELOPOULOS, S., DÜRR, C., JIN, S., KAMALI, S., AND RENAULT, M. Online computation with untrusted advice. In 11th Innovations in Theoretical Computer Science Conference (ITCS 2020) (2020), vol. 151 of LIPIcs, pp. 52:1–52:15.
[3] AXSÄTER, S. Worst case performance for lot sizing heuristics. European Journal of Operational Research 9, 4 (1982), 339–343.
[4] AXSÄTER, S. Performance bounds for lot sizing heuristics. Management Science 31, 5 (1985), 634–640.
[5] BAI, L., HUANG, Z., WANG, X., SUN, J., MIHALCEA, R., BRYNJOLFSSON, E., PENTLAND, A., AND PEI, J. How do AI agents spend your money? Analyzing and predicting token consumption in agentic coding tasks, 2026. arXiv:2604.22750.
[6] BAMAS, É., MAGGIORI, A., AND SVENSSON, O. The primal-dual method for learning augmented algorithms. In Advances in Neural Information Processing Systems 33 (NeurIPS) (2020), pp. 20083–20094.
VASCO SCHIAVO
[7] BHORE, S., PAWLOWSKI, M., AND UMBOH, S. W. Online TCP acknowledgment under general delays. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (AP-PROX/RANDOM 2026) (2026), vol. 392 of LIPIcs, pp. 26:1–26:24.
[8] DOOLY, D. R., GOLDMAN, S. A., AND SCOTT, S. D. TCP dynamic acknowledgment delay: Theory and practice. Tech. Rep. WUCS-98-29, Washington University in St. Louis, 1998.
[9] DOOLY, D. R., GOLDMAN, S. A., AND SCOTT, S. D. On-line analysis of the TCP acknowledgment delay problem. Journal of the ACM 48, 2 (2001), 243–273.
[10] HAO, X., MENG, H., YIN, X., ZHU, J., AND CAO, C. Self-GC: Self-governing context for long-horizon LLM agents, 2026. arXiv:2607.00692.
[11] HARADA, T., KAWASE, Y., AND SUMITA, H. Simultaneous competitive and regret guarantees for TCP acknowledgment, 2026. arXiv:2610.13571.
[12] HARRIS, F. W. How many parts to make at once. Factory, The Magazine of Management 10, 2 (1913), 135–136, 152. Reprinted in Operations Research 38(6):947–950, 1990.
[13] HERBSTER, M., AND WARMUTH, M. K. Tracking the best expert. Machine Learning 32, 2 (1998), 151–178.
[14] IM, S., MOSELEY, B., XU, C., AND ZHANG, R. Online dynamic acknowledgement with learned predictions. In IEEE Conference on Computer Communications (INFOCOM 2023) (2023), pp. 1–10.
[15] KARLIN, A. R., KENYON, C., AND RANDALL, D. Dynamic TCP acknowledgment and other stories about . Algorithmica 36, 3 (2003), 209–224.
[16] KARLIN, A. R., MANASSE, M. S., RUDOLPH, L., AND SLEATOR, D. D. Competitive snoopy caching. Algorithmica 3, 1 (1988), 79–119.
[17] LUMER, E., NIZAR, F., JANGITI, A., FRANK, K., GULATI, A., PHADATE, M., AND SUBBIAH, V. K. Don't break the cache: An evaluation of prompt caching for long-horizon agentic tasks, 2026. arXiv:2601.06007.
[18] MARI, M., PAWLOWSKI, M., REN, R., AND SANKOWSKI, P. Online multi-level aggregation with delays and stochastic arrivals. In 35th International Symposium on Algorithms and Computation (ISAAC 2024) (2024), vol. 322 of LIPIcs, Schloss Dagstuhl, pp. 49:1–49:20.
[19] NGUYEN, T., CHO, E., CHEN, B., AND DETTMERS, T. CliffCompaction: Cost-efficient compaction for long-horizon coding agents, 2026. arXiv:2609.26779.
[20] PUROHIT, M., SVITKINA, Z., AND KUMAR, R. Improving online algorithms via ML predictions. In Advances in Neural Information Processing Systems 31 (NeurIPS) (2018), pp. 9661–9670.
[21] VACHANI, R. Performance of heuristics for the uncapacitated lot-size problem. Naval Research Logistics 39, 6 (1992), 801–813.
[22] VAN DEN HEUVEL, W., AND WAGELMANS, A. P. M. Worst-case analysis for a general class of online lot-sizing heuristics. Operations Research 58, 1 (2010), 59–67.
[23] WEINBERGER, S., AND HOZEZ, A. Token reduction is not cost reduction, 2026. arXiv:2607.12161.
[24] YAO, J., ZHOU, Z., AND XU, Z.-Q. J. CADOC: Cache-aware dynamic object context for long-horizon agents, 2026. arXiv:2609.37012.
[25] ZHANG, X., ZHENG, L., DU, C., AN, B., AND DONG, X. AutoCompact: Learning when to compact context in long-horizon coding agents, 2026. arXiv:2610.02163.
Email address: vasco.schiavo@protonmail.com