|
Download source/docs/V1_ARCHITECTURES.md from PureOne/Qyxo-Zhaenivoth-Guard: direct link, hf CLI and curl.
- Browser
- Download file 29 kB
-
https://huggingface.co/datasets/PureOne/Qyxo-Zhaenivoth-Guard/resolve/main/source/docs/V1_ARCHITECTURES.md
- Command line
-
hf download hf://datasets/PureOne/Qyxo-Zhaenivoth-Guard/source/docs/V1_ARCHITECTURES.md
-
curl -L -o V1_ARCHITECTURES.md https://huggingface.co/datasets/PureOne/Qyxo-Zhaenivoth-Guard/resolve/main/source/docs/V1_ARCHITECTURES.md
29 kB
| # Qyxo-Zhaenivoth v1 architecture search and fixed-total theorem | |
| This is an independent second-pass design record. The target is a **major practical improvement on an explicitly delimited workload**, not an assertion that every algorithm is a mathematical breakthrough. Nothing in this record is measured performance. The name is a semantic reset; truth and the prior-art boundary do not depend on it. | |
| ## Problem and scope | |
| Maintain a large, static bank of signed interval values `l[i,j] <= v[i,j] <= h[i,j]` while a small number of nonnegative mass intervals `L[i] <= w[i] <= U[i]` change between policy queries. Compute **exact inclusive robust threshold decisions** and, optionally, exact sharp mean bounds. The denominator is shared with the numerator. Queries and patches should not rescan every unchanged row. Values are finite binary64 inputs converted exactly; exact arithmetic concerns those converted inputs. | |
| For one coordinate with selected value endpoint `x_i`, put `delta_i=U_i-L_i`, `A=N0+sum(L_i*x_i)` and `B=D0+sum(L_i)>0`. Then | |
| \[ | |
| F_+(t)=A-Bt+\sum_i\delta_i(x_i-t)_+, | |
| \qquad | |
| F_-(t)=A-Bt-\sum_i\delta_i(t-x_i)_+. | |
| \] | |
| The upper mean endpoint is the unique zero of `F_+`; the lower endpoint is the unique zero of `F_-`. A threshold decision is a sign check of the corresponding support. Hinge algebra and this fractional reduction are inherited mathematics. | |
| ## Nine structurally different mechanisms | |
| Let `n` be rows, `p` coordinates, `k` patched rows, `q` thresholds in a batch, `r` changed rows retained since an epoch, `b` blocks, and `d` threshold rank movement. Arithmetic-operation bounds below omit arbitrary-precision bit costs; multiplication and addition must be charged at actual operand widths in performance measurements. | |
| ### 1. Exact sorted hinge index — selected core | |
| 1. Primitive: dynamic prefix/suffix moments of a piecewise-affine support function. | |
| 2. State: sorted static lower/upper endpoints, original-row rank maps, exact baseline numerator/denominator, Fenwick arrays of `delta` and `delta*x`, current mass intervals. | |
| 3. Update: for a mass patch, update the baseline by `change(L)*(x,1)` and update two moment trees by `change(delta)*(x,1)` at that row's rank. | |
| 4. Objective: sharp exact predicates under changing mass boxes without a full rescan. | |
| 5. Time: build `O(p*n*log n)` including sorting, linear tree construction after sorting; sparse patch `O(k*p*log n)`, arbitrary threshold `O(p*log n)`, sharp endpoints `O(p*log n)` by direct tree lifting. | |
| 6. Memory: `O(p*n)` exact cells and rank maps; operand widths matter. | |
| 7. Advantage: online sparse updates and arbitrarily changing thresholds, including cancellation and exact ties; no training or numerical-filter assumptions. | |
| 8. Failure: dense patches, mutable values, large `p`, large exact operand widths, short lifetimes, and materialized witnesses. A witness still costs `Omega(n)` to write. | |
| 9. Nearest techniques: Fenwick trees, dynamic prefix sums/order-statistic trees, Karnik–Mendel switching-point type reduction, linear-fractional box optimization, hinge-loss moments. | |
| 10. Non-equivalence: unlike a full support scan or cached stale endpoints, the retained state exposes exact sparse updates and arbitrary threshold/root queries with logarithmic arithmetic work. That is a real capability difference from QZ v0.2.1. The combination is a specialization of known machinery; no original data-structure theorem is established. | |
| ### 2. Fixed-policy exact watch counters — strongest restricted baseline | |
| 1. Primitive: incrementally maintain a finite set of already chosen support evaluations. | |
| 2. State: exact `F_+(t_a)`/`F_-(t_a)` for `a=1..q`, old masses, static values. | |
| 3. Update: subtract each patched row's old support and add its new support for every watched threshold. | |
| 4. Objective: constant-time decisions for a small fixed collection of policy thresholds. | |
| 5. Time: build `O(n*p*q)`, patch `O(k*p*q)`, decision `O(p)`. | |
| 6. Memory: `O(n*p+p*q)`; no sorted trees required. | |
| 7. Advantage: for one fixed threshold, `O(k*p)` updates beat the selected index's logarithmic factor. | |
| 8. Failure: newly requested thresholds require an initial full scan; many thresholds make every patch expensive; no cheap arbitrary sharp-bound query. | |
| 9. Nearest: materialized views, incremental aggregation, delta maintenance. | |
| 10. Non-equivalence: state is policy-specific rather than a representation of the complete support curve. **Retain as mandatory baseline, not a weak comparator to suppress.** | |
| ### 3. Epoch baseline plus sparse compensator | |
| 1. Primitive: exact decomposition into a static baseline plus explicit changed-row support differences. | |
| 2. State: static sorted prefix arrays for an epoch and a dictionary of rows differing from that epoch. | |
| 3. Update: add/replace a dictionary entry; periodically rebuild the epoch. | |
| 4. Objective: avoid both full rescans and tree update overhead when only a few distinct rows ever change. | |
| 5. Time: build `O(p*n*log n)`, patch `O(k*p)`, threshold `O(p*(log n+r))`; rebuilding costs `O(p*n)` after the value order is available. | |
| 6. Memory: `O(n*p+r*p)`. | |
| 7. Advantage: one or two recurring changed rows; cheap writes and compact exact deltas. | |
| 8. Failure: changing-row set grows; endpoint finding can multiply residual work; rebuild scheduling is workload-dependent. | |
| 9. Nearest: log-structured merge designs, static/dynamic decomposition, incremental materialized views. | |
| 10. Non-equivalence: queries evaluate explicit sparse corrections to static arrays rather than updating a complete dynamic index. **Serious adversarial peer; may be superior for tiny persistent delta sets.** | |
| ### 4. Common latent-coordinate quotient | |
| 1. Primitive: prove that all coordinates share an exact one-dimensional ordered latent value. | |
| 2. State: `x_ij=a_j*z_i+b_j`, one ordered scalar mass index, and coordinate coefficients. | |
| 3. Update: update the scalar index once for each mass patch; map extrema by the sign of `a_j`. | |
| 4. Objective: eliminate the multiplicative coordinate factor when exact affine dependence exists. | |
| 5. Time: verify a supplied factorization `O(n*p)`, scalar preprocessing `O(n*log n)`, patch `O(k*log n)`, query `O(log n+p)`. | |
| 6. Memory: `O(n+p)` after exact verification, or `O(n*p)` if originals are retained. | |
| 7. Advantage: correlated engineering signals, affine-derived metrics, very large coordinate counts. | |
| 8. Failure: approximate low rank does not commute with hinges and cannot preserve exact guarantees without a separately derived residual envelope. Generic value intervals need compatible endpoint factorizations. | |
| 9. Nearest: sufficient statistics, exact matrix rank/factorization, affine dimension reduction. | |
| 10. Non-equivalence: a proved quotient removes redundant coordinates instead of merely indexing each separately. **Eliminate from the default release: useful special case, insufficiently general.** | |
| ### 5. Unsorted hierarchical sign partition | |
| 1. Primitive: recursively aggregate a block if all its values lie on one side of the query threshold. | |
| 2. State: a row tree with value min/max, exact mass/value moments, and per-node uncertainty capacity. | |
| 3. Update: change moments and extrema along a path; mutable values are permitted if leaf identity stays fixed. | |
| 4. Objective: query only blocks whose value hull crosses the threshold. | |
| 5. Time: build `O(n*p)`, patch `O(k*p*log n)`, query `O(p*b)` visited nodes, worst `O(n*p)`. | |
| 6. Memory: `O(n*p)`. | |
| 7. Advantage: clustered local values, row locality, mutable value banks, and large pure-sign blocks. | |
| 8. Failure: alternating/random values make every block straddle thresholds; tree traversal loses to scans; exact endpoint finding can visit many blocks repeatedly. | |
| 9. Nearest: segment trees, branch and bound, interval trees, hierarchical aggregation. | |
| 10. Non-equivalence: geometry/locality permits value changes without preserving a global sort, at the cost of losing logarithmic worst-case queries. **Eliminate as default because sorted static banks are the chosen workload.** | |
| ### 6. Coarse capacity envelopes with exact challenger | |
| 1. Primitive: replace a block's `delta_i` distribution by total capacity and its value hull, then refine only an ambiguous sign. | |
| 2. State: `b` fixed buckets with baseline exact moments, uncertainty capacities, lower/upper value extrema; original rows for refinement. | |
| 3. Update: adjust a bucket's aggregate and update its extrema if needed. | |
| 4. Objective: cheap one-sided certified decisions with exact fallback near boundaries. | |
| 5. Time: build `O(n*p)`, typical patch `O(k*p)` for fixed values, approximate certificate `O(b*p)`, worst fallback `O(n*p)`. | |
| 6. Memory: `O(n*p+b*p)`. | |
| 7. Advantage: separated policy signs and narrow within-block value variation, small summaries, streaming portability. | |
| 8. Failure: bounding capacity and values independently creates artificial states; adversarial cancellation and wide value buckets force fallback; batch sizes may conceal extra work. | |
| 9. Nearest: histogram bounds, hierarchical uncertainty envelopes, adaptive exact predicates. | |
| 10. Non-equivalence: deliberately coarsens the support curve and certifies only separated decisions rather than maintaining it sharply. **Eliminate: v0.2.1 already owns a competitive separated-sign niche, while the selected exact index removes the boundary collapse.** | |
| ### 7. Offline/monotone threshold event sweep | |
| 1. Primitive: cross sorted breakpoints once and update the support's slope/intercept by events. | |
| 2. State: current threshold rank, current exact support segment, sorted event list, mass changes, possibly a queue of known future queries. | |
| 3. Update: apply sparse mass corrections in the current partition; move to each threshold by crossing only intervening events. | |
| 4. Objective: near-linear total cost for monotone or sorted threshold batches. | |
| 5. Time: static batch `O(n*p+q*p)` after sorting thresholds; an online step `O(p*(k+d))`; random jumps can cost `O(n*p)` unless a prefix index is added. | |
| 6. Memory: `O(n*p+q*p)` offline, `O(n*p)` streaming. | |
| 7. Advantage: sweeping an entire risk curve; huge sorted batches; no logarithmic factor per nearby query. | |
| 8. Failure: arbitrary threshold order, mass updates spanning many coordinates, unpredictable threshold streams. | |
| 9. Nearest: sweep-line algorithms, kinetic data structures, sorted multipoint evaluation. | |
| 10. Non-equivalence: exploits query order rather than dynamic range queries. **Retain for batched future APIs and as a favorable-control baseline.** | |
| ### 8. Reused local affine certificate with breakpoint continuation | |
| 1. Primitive: retain one exact active support segment and certify that the next root/query remains inside it. | |
| 2. State: a previous switching rank, local affine coefficients, neighboring values, and an index or explicit move list when continuation fails. | |
| 3. Update: sparse changes adjust the local coefficients according to the retained partition. If the new root ratio stays within neighboring breakpoints, accept immediately; otherwise move the partition or invoke a global index. | |
| 4. Objective: remove search work for temporally stable mass/threshold streams. | |
| 5. Time: stable patch/query `O(k*p+p)`, unstable local repair `O(p*d)` plus a fallback `O(p*log n)`. | |
| 6. Memory: `O(n*p)` with a complete fallback index, `O(p)` extra continuation state. | |
| 7. Advantage: a stable switching rank can persist over many updates even when exact support signs are tiny. | |
| 8. Failure: adversarial root motion and equality ties; a stale rank without a rigorous segment check is unsound; adds mutable cache invariants. | |
| 9. Nearest: active-set warm starts, Newton/Karnik–Mendel switching-point iterations, kinetic certificates. | |
| 10. Non-equivalence: an exact affine-segment membership test skips global search on successful continuation; it does not replace the index. **Eliminate from first v1 unless profiling proves contribution; correctness complexity is unnecessary before the core wins.** | |
| ### 9. Fixed-total capacity selection — selected narrow extension | |
| 1. Primitive: exact capacity allocation under the coupling constraint `sum(w_i)=W`. | |
| 2. State: the same sorted `delta` and `delta*x` moment trees as architecture 1 plus baseline moments and total lower/upper mass. | |
| 3. Update: identical sparse mass patch. A query verifies feasibility, selects a prefix capacity by Fenwick lifting, and allocates one partial boundary amount. | |
| 4. Objective: sharp guarantees for a known total mass, avoiding the independent box's fictitious population/reweighting states. | |
| 5. Time: build and patch as architecture 1; bounds and policies `O(p*log n)`. | |
| 6. Memory: no extra asymptotic storage beyond the selected index. | |
| 7. Advantage: known population totals, fixed retained-record counts, fixed-budget resource weights, calibrated rebalancing. If converted capacities and total are integers, the extremal allocation is integral. | |
| 8. Failure: arbitrary further correlations, per-group total constraints not separately indexed, nonlinear weight restrictions, and overinterpreting coordinate-specific witnesses as simultaneous vector extremes. | |
| 9. Nearest: fractional knapsack, continuous bounded resource allocation, dynamic weighted quantile selection, box-plus-hyperplane linear programming. | |
| 10. Non-equivalence: the feasible set differs substantively from v0.2.1's independent boxes, and exact total-mass selection shares the existing dynamic state. **This is an added application capability, not invention of greedy LP or weighted order statistics.** | |
| ## Direct endpoint search: remove a logarithmic factor | |
| The naive composition “binary search sorted breakpoints, making a Fenwick support query at every midpoint” costs `O(log² n)`. That unnecessary composition can be removed. | |
| For sorted `x_1 <= ... <= x_n`, let `C_j=sum_{i<=j} delta_i*x_i`, `E_j=sum_{i<=j} delta_i`, and let `C_n,E_n` be totals. At a breakpoint, | |
| \[ | |
| F_+(x_j)=A+C_n-C_j-(B+E_n-E_j)x_j, | |
| \qquad | |
| F_-(x_j)=A+C_j-(B+E_j)x_j. | |
| \] | |
| Both support functions are strictly decreasing since `B>0`. Therefore the predicate `F(x_j)>=0` is monotone in rank. Fenwick binary lifting builds the candidate prefix moments from one tree node per bit and evaluates that predicate in constant arithmetic work per bit. It locates the largest admissible `j` in `O(log n)` arithmetic operations, even though the moment `C_j` itself need not be monotone because values can be signed. The monotonic object is **the support evaluated at its ordered breakpoints**, not the signed moment sum. | |
| The exact roots then are | |
| \[ | |
| y_+=\frac{A+C_n-C_j}{B+E_n-E_j}, | |
| \qquad | |
| y_-=\frac{A+C_j}{B+E_j}. | |
| \] | |
| Use `j=0` when every breakpoint predicate is false and `j=n` when all are true. Roots outside the value hull are valid when a nonzero base numerator/denominator contributes an external value. Duplicate keys and equality are harmless: zero hinge terms allow either side of a tied breakpoint; selecting the last true rank is deterministic. | |
| This is a derived specialization of standard tree descent/binary lifting. It is not a claimed new general lower bound or a new search data structure. | |
| ## Standalone fixed-total theorem | |
| **Theorem (sharp box-plus-total normalized bounds, exact real arithmetic).** Let all selected value endpoints `x_i` be finite reals, `0<=L_i<=U_i`, `D0>=0`, and `N0` finite. Define `delta_i=U_i-L_i`, `Ltot=sum L_i`, `E=sum delta_i`. Suppose | |
| \[ | |
| L_{tot}\le W\le L_{tot}+E,\qquad D_0+W>0. | |
| \] | |
| Put `R=W-Ltot`. Sort `x_i` increasingly, retaining the matching capacities. Let | |
| \[ | |
| P_j=\sum_{i\le j}\delta_i,\quad M_j=\sum_{i\le j}\delta_i x_i, | |
| \quad j(R)=\max\{j\in\{0,\ldots,n\}:P_j\le R\}. | |
| \] | |
| Define | |
| \[ | |
| H_x(R)= | |
| \begin{cases} | |
| M_n,&j(R)=n,\\ | |
| M_{j(R)}+[R-P_{j(R)}]x_{j(R)+1},&j(R)<n. | |
| \end{cases} | |
| \] | |
| Then the least and greatest residual weighted moments among `0<=z_i<=delta_i`, `sum z_i=R` are exactly `H_x(R)` and `M_n-H_x(E-R)`. Consequently, for interval values, | |
| \[ | |
| y_{min}(W)=\frac{N_0+\sum_iL_i l_i+H_l(R)}{D_0+W}, | |
| \qquad | |
| y_{max}(W)=\frac{N_0+\sum_iL_i h_i+M_{h,n}-H_h(E-R)}{D_0+W}. | |
| \] | |
| For a vector, apply the formula coordinatewise with separately sorted lower and upper endpoints. The extrema are attained. The sharp universal `<=t` predicate is `y_max(W)<=t`; the sharp universal `>=t` predicate is `y_min(W)>=t`. | |
| **Proof.** Write `w_i=L_i+z_i`. All feasible denominators are the same positive number `D0+W`, so extremizing the quotient is equivalent to extremizing its numerator. Positive masses let each coordinate choose its corresponding value endpoint. For minimization, if `x_a<x_b`, `z_a<delta_a`, and `z_b>0`, moving `epsilon=min(delta_a-z_a,z_b)` from `b` to `a` preserves capacity bounds and total mass while decreasing the moment by `epsilon*(x_b-x_a)`. Repeating this exchange yields a prefix filled to capacity, at most one partially filled boundary, then zeros. This is exactly `H_x(R)`; tied values do not change the objective. For maximization, apply the same minimum formula to omitted capacity `delta_i-z_i`, whose total is `E-R`. The omitted moment is least when its capacity is assigned to low values, so the retained residual moment is `M_n-H_x(E-R)`. Feasibility follows from `0<=R<=E`. This proves attainment, sharpness, and both predicates. | |
| **Integrality corollary.** If the converted `L_i,U_i,W` are integers, all prefix sums and the partial amount are integers, so the greedy extremal masses are integers. The theorem therefore remains sharp with integer mass restrictions. The word “converted” matters: converting an arbitrary integer above binary64's exact integer range can alter the intended model before the algorithm begins. | |
| **Complexity corollary.** A Fenwick array of nonnegative capacities supports selection of the largest prefix `P_j<=R` by ordinary binary lifting, and a parallel signed moment array produces `M_j` during the same traversal. This requires `O(log n)` arithmetic operations and `O(n)` cells. A zero-capacity run is skipped by the non-strict comparison. A patch changes `O(log n)` cells. Independent mass totals and exact bit widths must be maintained rather than silently rescaling every stored node. | |
| **Implementation domain note.** The coupled theorem permits `D0+sum L_i=0` provided `D0+W>0`. If a public constructor retains the stricter independent-box requirement, the implementation covers a proper subset of this theorem. Either allow coupled-only construction and reject undefined independent queries, or state the narrower constructor domain explicitly. | |
| ## Smallest decisive demonstration and hostile controls | |
| ### Derived future extension: a total-mass interval | |
| This extension is **not implemented or empirically tested in v1**. If the | |
| additional coupling is `W_a<=sum w_i<=W_b`, restrict it to the feasible mass | |
| range first. Put `R_a=W_a-sum L`, `R_b=W_b-sum L`. For an upper policy support | |
| at `t`, let `R_pos=sum_{h_i>t}delta_i`. The optimal residual total is | |
| `R_star=clamp(R_pos,R_a,R_b)`, and its contribution is obtained by selecting | |
| the highest `R_star` capacity and subtracting `t*R_star`. For lower support, | |
| let `R_neg=sum_{l_i<t}delta_i`, clamp it to the same range, and select the | |
| lowest capacity. This follows because the high-value fill moment is concave | |
| in selected capacity and its derivative is the current value minus `t`; | |
| the low-value fill is convex. Zero coefficients create an objective plateau | |
| and do not affect validity. Prefix capacity and capacity selection therefore | |
| still require only `O(log n)` arithmetic operations. This is a useful mapping | |
| to an additional known retained-count **range**, but remains inherited | |
| resource-allocation mathematics and should not enlarge v1 release claims. | |
| The decisive workload is a long static bank (`n=8,192` through `131,072`, `p=1` and `4`), one/four randomly chosen mass patches per query, changing thresholds, and exact endpoint/boundary decisions. Charge preprocessing, sorting, validation, complete patch cost, query cost, fallback, and exact result construction. Report both steady-state and total-cost break-even lifetime. A reduction in rows visited is insufficient without wall-time advantage. | |
| Compare at least: (a) v0.2.1 full public prepared/filter path with actual changed arrays, (b) exact GMP support scan, (c) independent prepared sorted-order exact scan, (d) fixed-policy delta counters on the fixed-threshold control, (e) static prefix arrays plus sparse epoch corrections, and (f) cached exact endpoints on unchanged-box controls. An independently implemented dynamic Fenwick peer would likely tie architecture 1 and would sharply narrow any novelty claim. Do not omit that fact. | |
| For the fixed-total extension, compare exact greedy sort-and-scan and exact prepared-order linear capacity selection. A floating SciPy LP solver may be an independent well-separated integer-fixture oracle, but an LP tolerance is not an exact threshold certificate. Show a fixture where the independent mass box cannot guarantee a policy while a known-total coupled model can, and verify both by complete small vertex enumeration. | |
| Suggested preregistered practical target: at least `5x` lower complete steady-state cost against the strongest comparable measured rescan peer in most large/sparse cells, plus at least one cell whose complete lifetime including build reaches `2x` advantage at a published finite query count. These are **success thresholds, not observations**. No speed target should be claimed against the strongest possible equivalent dynamic index before it is tested. | |
| Mandatory attacks: | |
| - Dense patches `k=n` and `k` ranging to the break-even density. Use a linear bulk rebuild rather than `n` point tree updates where appropriate, and charge it. | |
| - `n=1,16,64,256`; the tree should lose somewhere. Publish the loss. | |
| - A fixed threshold with one recurring changed row: incremental counters should remain superior. | |
| - No mass changes and many thresholds: cached exact endpoints should remain superior. | |
| - Uniformly random versus monotone threshold streams, large root movement, exact ties, repeated keys, zero capacities, negative values, and roots outside the static value hull due to base terms. | |
| - `p=1,4,64,1,024`; publish actual integer-cell memory, not only big-O. | |
| - Changing values: global reordering is excluded from the static-bank advantage and must be charged if supported. | |
| - Subnormal and widely separated exponents. No hidden whole-index rescale may be counted as an `O(log n)` patch. | |
| - Invalid mass patch midway through a transaction; state and revision must remain unchanged. | |
| - Materialized witness requests. Their unavoidable linear output cost is separate from a logarithmic scalar decision. | |
| - For fixed total: infeasible totals, zero residual capacity, all capacity used, all lower masses zero with positive total, repeated values, zero-capacity gaps, integer integrality, and nonintegral dyadic boundary allocations. | |
| ## Prior-art boundary and checked primary sources | |
| ### Dual geometric interpretation | |
| For point values `l_i=h_i=x_i`, the feasible `(numerator, denominator)` pairs form | |
| the translated two-dimensional zonotope | |
| \[ | |
| Z=(A,B)+\sum_i[0,\delta_i](x_i,1). | |
| \] | |
| For interval values this is **not** the complete feasible `(N,D)` set: one | |
| row contributes the trapezoid `L_i<=w_i<=U_i`, `l_i*w_i<=n_i<=h_i*w_i`, | |
| and the full set is its translated Minkowski sum, generally not a zonotope. | |
| The upper selected endpoints `x_i=h_i` and lower selected endpoints `x_i=l_i` | |
| give two separate fixed-value zonotopes whose appropriate support boundaries | |
| are exactly the extrema relevant here, since masses are nonnegative. | |
| For the upper selected-endpoint zonotope, policy support is its support function in direction `(1,-t)`; | |
| the sharp upper normalized endpoint is its largest slope `N/D` with `D>0`. | |
| Ordering generator slopes `x_i` orders the directions in which support | |
| vertices switch. A mass patch changes generator lengths and the translation, | |
| while preserving that slope order. Fixed-total coupling takes the vertical | |
| section `D=D0+W`, whose maximum and minimum heights are the capacity-selection | |
| formulas above. This explains why one static order serves both policy support | |
| and known-total optimization. Zonotope support, convex slices and tangent | |
| slopes are known convex geometry; the interpretation provides an invariant, | |
| not a new novelty claim. | |
| Fenwick's original paper explicitly supplies dynamic cumulative-frequency updates and logarithmic operation costs. Primary source: P. M. Fenwick, *A new data structure for cumulative frequency tables*, Software: Practice and Experience 24(3), 327–336 (1994), DOI https://doi.org/10.1002/spe.4380240306 . The author's follow-up technical report is https://www.cs.auckland.ac.nz/~peter-f/FTPfiles/TechRep110.pdf . | |
| The existing project already documents interval weighted-average/Karnik–Mendel prior art and the exact switching-point formulation in `docs/PRIOR_ART.md`. This search found no defensible basis to claim that dynamic weighted prefix sums, affine support curves, binary lifting, greedy capacity allocation, or order-statistic selection are new. Failure to find an exact matching library is not proof of mathematical novelty. | |
| **Selected formulation:** sparse patches update an exact support curve, and policies/endpoints query that curve rather than rebuilding it. Fixed-total coupling reuses the same capacity moments to solve a sharper constrained feasible set. This is the narrowest useful v1 mechanism supported by derivation. Its major-breakthrough status must depend on completed comparative evidence and adoption scope; it is not supplied by the version number or the project name. | |
| ## Late-pass derived improvement: recover global precision after fine inputs disappear | |
| **Status: derived proposal, not yet accepted implementation or measured evidence.** | |
| The parent's local-dyadic candidate canonically normalizes each Fenwick block | |
| while a shared global query exponent only becomes finer. That representation | |
| keeps untouched blocks coarse but allows one historical tiny input to leave | |
| global scalars and future query temporaries padded after it is removed. | |
| This history effect can be removed with bounded exponent metadata. Decode all | |
| nonzero converted mass endpoints to odd-mantissa dyads. Maintain a frequency | |
| table for their exponents and an active-exponent bitmask. The binary64 domain | |
| is finite: canonical nonzero exponents range from `-1074` to `1023`. Updating | |
| the two endpoints of each patched row changes only constant-many frequencies. | |
| The lowest active bit supplies the minimum current endpoint exponent without | |
| an `n`-row scan. Zero endpoints do not contribute frequencies. | |
| Let `e_rows` be the minimum current nonzero mass endpoint exponent, or positive infinity when none exists. With a fixed static integer-value exponent `E_v`, define the fixed cap | |
| \[ | |
| \begin{aligned} | |
| e_{cap}&=\min\left(0,e_D\text{ if }D\ne0, | |
| \{e_{N_c}-E_v:N_c\ne0\}\right),\\ | |
| e_{new}&=\min(e_{cap},e_{rows}). | |
| \end{aligned} | |
| \] | |
| The cap ensures every unchanged denominator and numerator base remains | |
| exactly representable when the global exponent becomes coarser. If there are | |
| no nonzero row masses, use `e_cap`; the constructor's positive denominator | |
| then comes from a nonzero base denominator. | |
| If `e_new<e_old`, refine the `O(p)` global scalars before applying the new fine | |
| deltas, exactly as in the current candidate. If `e_new>e_old`, first apply the | |
| removal/ordinary deltas at the old fine scale and normalize only their touched | |
| nodes, then right-shift the `O(p)` final global scalars. Those right shifts are | |
| exact because every final mass and base is representable at `e_new`. Do not | |
| right-shift old globals before removing the old fine contribution. | |
| **Node invariant.** Every final capacity is a difference of endpoints with | |
| exponents at least `e_new`, so every block capacity and its fixed-integer-value | |
| moment are divisible by the required power of two. A joint canonical block | |
| pair therefore has local exponent at least `e_new`; canonical zero exponent | |
| zero is safe because `e_new<=0`. Untouched nodes already represent their | |
| unchanged physical sums canonically, so they satisfy the same inequality | |
| without mutation. Hence coarsening the global query unit requires no node | |
| rewrite or row scan. | |
| **Transaction boundary.** Compute frequency deltas, the pending active mask, | |
| the final minimum exponent and the final positive denominator in temporaries. | |
| Only commit them after ordinary patch validation. A rejected patch must not | |
| mutate the exponent registry or any live numeric state. The fixed-width mask | |
| and bounded-domain table add no dependence on `n`; bigint operations still | |
| have operand-width costs. | |
| This is a derived composition of current-input exponent bookkeeping, lazy | |
| alignment and canonical dyadic arithmetic. It is not a claim to invent any of | |
| those components. Decisive tests would alternate a minimum-subnormal arrival | |
| and removal, verify exact physical supports/capacities at every step, prove | |
| off-path storage unchanged, and show the shared exponent and query width | |
| recover to the fresh-bank representation. Fine fixed base numerators and | |
| originally fine static values remain real precision requirements. | |