diff 56bc728..f6bf760 k_server_uniform_computation_v2.txt
diff --git a/k_server_uniform_computation_v2.txt b/k_server_uniform_computation_v2.txt
index 4355264..0921493 100644
--- a/k_server_uniform_computation_v2.txt
+++ b/k_server_uniform_computation_v2.txt
@@ -49,7 +49,7 @@ These recurrences use only rational arithmetic and comparisons and never divide
The system is feasible and bounded: by the existence theorem and lazification, a real solution exists with a = C_0 log^2(k+1), obtained from the probability distribution of the source policy. Since all coefficients are rational, the feasible set for a after projecting out the p and f variables is a nonempty half-line [a_*, ∞) with rational endpoint a_*. To compute a_* exactly, replace each equality by a pair of weak inequalities, eliminate all variables except a one at a time by Fourier-Motzkin elimination, and reverse the eliminations by choosing the largest lower bound at each variable. To eliminate a variable z, divide every inequality in which z occurs by the (nonzero) rational coefficient of z, split the resulting affine bounds into lower bounds z ge L_i(y) and upper bounds z le U_j(y), keep all inequalities independent of z, and add every comparison L_i(y) le U_j(y); if either family is empty, add nothing. This is an exact existential projection. Each elimination removes one variable and a finite set of inequalities, so starting from finitely many the procedure terminates after finitely many eliminations. After all eliminations, the feasible a-values are given by finitely many weak rational inequalities in one variable. That set is nonempty because the real solution already exhibited belongs to it, and it includes the constraint a ge 0, so its least value is the maximum of finitely many rational lower bounds. That maximum is rational and belongs to the feasible set. Compute it, then reverse the eliminations one variable at a time. At each reversal, evaluate the already-computed values inside the bounds and choose the largest lower bound if one exists; otherwise choose the smallest upper bound if one exists; otherwise choose zero. The projection inequalities ensure that the chosen value also respects any upper bounds. Repeating this yields a rational solution of the full system. Because both the Fourier-Motzkin step and the back-substitution work with rationals, the coefficient a computed this way is a rational number satisfying 0 le a_* le C_0 log^2(k+1); neither C_0 nor the source policy enters the computation. The elimination and its dual were introduced by Dantzig and Eaves in 1973; Subramani's exposition documents the step-by-step algorithm.
./pdf/subramani-wvu-fourier-motzkin-elimination-notes.pdf
-From the rational solution, define causal conditional rows by q_{w, r, c}(j) = f_{w r, c, j} / p_{w,c} when p_{w,c} > 0, and put all mass on the smallest allowed label when p_{w,c} = 0. Each row is a rational probability distribution supported on the allowed labels J(c,r), including rows at configurations the unrounded policy does not reach. Along a fixed word w, induction using the mass, outflow, and inflow constraints shows that the causal policy generated by these rows has exactly the marginals p and f, and therefore that the flow system's coefficient constraint is the expected-cost bound. Rounding follows. Fix b the least nonnegative integer with 2^b ge k H^2. In each row reserve its smallest allowed label j_0 and set widehatwidehat q_q_{w,r,c}(j) = 2^{-b}lfloor 2^b q_{w,r,c}(j) rfloor for j ne j_0, with the residual mass widehatwidehat q_q_{w,r,c}(j_0) = 1 - sum_{j ne j_0} widehatwidehat q_q_{w,r,c}(j). The new row is supported on J(c,r) and its total variation distance from the original is at most k 2^{-b}. Sampling with b unbiased bits, using the numerators of the row with common denominator 2^b, uses exactly b random bits per decision and requires no rejection loop. Coupling the rounded and unrounded causally generated services until their first differing label choice, on a word of length h le H, gives discrepancy probability at most h k 2^{-b}, since at any agreeing step the conditional discrepancy probability is at most k 2^{-b}. On the complement the two costs are equal; on the discrepancy event the difference is at most h D. Hence the expected movement of the rounded table from u on any word w of length h le H satisfies
+From the rational solution, define causal conditional rows by q_{w, r, c}(j) = f_{w r, c, j} / p_{w,c} when p_{w,c} > 0, and put all mass on the smallest allowed label when p_{w,c} = 0. Each row is a rational probability distribution supported on the allowed labels J(c,r), including rows at configurations the unrounded policy does not reach. Along a fixed word w, induction using the mass, outflow, and inflow constraints shows that the causal policy generated by these rows has exactly the marginals p and f, and therefore that the flow system's coefficient constraint is the expected-cost bound. Rounding follows. Fix b the least nonnegative integer with 2^b ge k H^2. In each row reserve its smallest allowed label j_0 and set widehatwidehat q_q_{w,r,c}(j) = 2^{-b}floor( 2^b q_{w,r,c}(j) ) for j ne j_0, with the residual mass widehatwidehat q_q_{w,r,c}(j_0) = 1 - sum_{j ne j_0} widehatwidehat q_q_{w,r,c}(j). The new row is supported on J(c,r) and its total variation distance from the original is at most k 2^{-b}. Sampling with b unbiased bits, using the numerators of the row with common denominator 2^b, uses exactly b random bits per decision and requires no rejection loop. Coupling the rounded and unrounded causally generated services until their first differing label choice, on a word of length h le H, gives discrepancy probability at most h k 2^{-b}, since at any agreeing step the conditional discrepancy probability is at most k 2^{-b}. On the complement the two costs are equal; on the discrepancy event the difference is at most h D. Hence the expected movement of the rounded table from u on any word w of length h le H satisfies
𝔼[cost_{T_H, u}(w)] le a, OPT_u(w) + k h^2 2^{-b} D le a, OPT_u(w) + D.
A rounded trajectory can reach a configuration whose unrounded marginals were zero. That possibility causes no exception, because the table has already assigned such a configuration a legal row and reaching it can only occur after a discrepancy, whose cost is already absorbed.
For every positive integer H there is a terminating deterministic procedure on rational input that constructs a rational number a and a finite table defining a strongly lazy policy T_H from u such that 0 le a le C_0 log^2(k+1) and
@@ -114,7 +114,7 @@ The bounded-implementation bound reads: given the explicitly written constructor
This is a state count. Let m = L + S + 2. Since H, R, M, b le S, the numeric values H, R, M, b are at most m and n, k le O(m). Use explicit lists, binary counters, and bounded-length strings for the following state: the actual and virtual tuples, each of at most k point indices; the kept word of at most H indices; the filter of at most H live entries, each a tuple of at most k indices plus a move counter of at most M; the current raw block's set of at most k+1 points; a completed-block counter of at most R; fallback marks together with their assigned labels, at most k protected points; a mode flag; and the virtual positive-move counter capped at M+1. For each raw request, scan every live tuple to determine whether it covers the request. If the request is kept, copy the surviving entries and generate at most k children per removed entry; even materializing all kH temporary children uses only O(m^4) bits for the temporary lists, on top of O(m^3) bits for the live list. At a table decision, locate the record by scanning the output and comparing its key (prefix, request, virtual tuple) with the required one. The filter lemma and the table-mode invariant ensure every requested key has prefix length less than H, and the constructor writes a legal row for every reachable key, including keys reachable only after dyadic rounding. Sample with exactly b fresh bits using that row's stored numerators; the sampled label is allowed because disallowed labels have numerator zero. Every access, scan, copy, or cleanup uses polynomially many bounded-length string operations. At the end of the request, discard obsolete lists and temporary strings, carrying only the stated compact state into the next request. No counts of raw epoch length, global epoch number, cumulative movement total, or unfiltered request history are stored. Cleanup is included in the same polynomial bound, and every bound is deterministic and independent of the probability of the current state.
-The online schedule proceeds as follows. At request number t ge 1, set g(t) = lfloor log_2(t+1) rfloor. Simulate P from scratch on the stored canonical input for at most g(t) elementary transitions. If P has not halted, serve the current request with label 1. If P has halted, use its output to serve the current request by the suffix routine. At the first successful simulation, initialize a fresh suffix epoch including this request and set the activation flag. At every later success, retain the suffix state from the preceding request and perform its next step; recomputing the identical table does not reset that state, since only the prescribed epoch boundaries do so. Erase the simulation workspace and table after use, preserving the canonical input, actual tuple, request counter, activation flag, and compact suffix state.
+The online schedule proceeds as follows. At request number t ge 1, set g(t) = floor( log_2(t+1) ). Simulate P from scratch on the stored canonical input for at most g(t) elementary transitions. If P has not halted, serve the current request with label 1. If P has halted, use its output to serve the current request by the suffix routine. At the first successful simulation, initialize a fresh suffix epoch including this request and set the activation flag. At every later success, retain the suffix state from the preceding request and perform its next step; recomputing the identical table does not reset that state, since only the prescribed epoch boundaries do so. Erase the simulation workspace and table after use, preserving the canonical input, actual tuple, request counter, activation flag, and compact suffix state.
The scheduling bound reads: there is one polynomial p, independent of the instance, such that preprocessing uses at most p(L) bit operations and serving request t uses at most p(L + lceil log_2(t+1) rceil) bit operations for every reachable history and internal state. Activation occurs at a finite deterministic time t_* depending only on (n, k, d).