PureOne's picture
Publish Qyxo-Zhaenivoth Guard v1.0.0 research release
25c6e75 verified
|
Raw History Blame Contribute Delete
7.59 kB

Practical adoption guide

Version 1.0.0: start with the update pattern

Choose DynamicBank when value bounds stay fixed and only a few mass intervals change before a new threshold or sharp-range request. Its exact Python runtime needs no optional package. examples/dynamic_policy.py is the runnable starting point; DYNAMIC_API.md defines the contracts and DYNAMIC_RESULTS.md records preparation, request horizons, strong indexed peers and losing regimes.

Choose CompactDynamicBank explicitly when retained state is a concern. Its local node exponents reduce owned payload on the supplied ordinary-mass fixtures, but exact alignment and canonicalization can cost extra latency. Measure both on the actual stream rather than switching automatically.

Use full-array filtering when most weights change. Use exact fixed-threshold deltas when the threshold and relation never change. Use cached sharp endpoints when the weight box never changes. The maintained index is most useful when neither of those stronger restricted shortcuts applies.

The new index removes a full rescan from sparse requests; it does not remove static preparation or input calibration. New value intervals require rebuilding. Keep snapshots and old results separate from live state, synchronize concurrent access externally, and measure complete application costs before deployment.

Historical full-array filter guidance

The following measured advice describes the earlier full-array interface. Its original evidence boundary is preserved; current dynamic comparisons are reported separately.

The recommended workload

Prepare a stable bank of scalar or small-vector value intervals once. For each new policy evaluation, replace only the nonnegative mass bounds and run one inclusive threshold vector. This is the scope supported by the disjoint performance holdout. Rebuilding all value arrays on every call does not consistently pass the same 3x speed gate.

from qzguard import PreparedBank

# Application-provided finite real arrays; their uncertainty validity is yours.
bank = PreparedBank(lower_values, upper_values, backend='filtered')

for lower_weights, upper_weights, threshold in application_updates:
    answer = bank.evaluate(lower_weights, upper_weights, threshold, relation='<=')
    if answer.all_guaranteed:
        accept_policy()
    else:
        # Optional: pay exact arithmetic and witness materialization only here.
        exact = answer.exact(witness=True)
        inspect_counterexamples(exact.witnesses)

The functions and arrays named above are integration placeholders, not shipped executable objects; examples/fast_array_service.py is a complete runnable example. COOKBOOK.md provides installed-package code and installation commands that work outside the release root. A false guard identifies a violating state within the specified independent box. If the box relaxes physical correlations, that state may be infeasible in the original application, so it is evidence for further checking rather than proof of a physical failure.

Choose the backend deliberately

Workload Starting choice Reason
Large stable value bank, fresh mass intervals, one policy PreparedBank(backend='filtered') plus evaluate Disjoint measured scope; ordinary separated signs avoid exact conversion
Tiny arrays or boundary-dominated arithmetic PreparedBank(backend='exact') or NormalizedBox Avoid filter overhead; evaluate exact ties and extreme ranges directly
Many queries on one unchanged box NormalizedBox.enclose() then guard_from_bounds() Cache sharp endpoints; no source scan per decision
Approximate answer sufficient Existing NumPy or KM/EIASC implementation No need to pay for exact-predicate guarantees
Actual scalar records with fixed deletion caps DeletionGuard Exact feasible deletion support and witnesses; speed superiority not claimed

The holdout covered 2,048 and 8,192 rows, one and four coordinates, ten independent seed groups per cell (the same seeds are reused across cells) and five new mass boxes per group. Its fastest-peer comparison includes actual GMP and prepared exact endpoint methods. This is not a hardware-independent crossover rule. Benchmark representative data before making a deployment budget claim.

Exactness and costs

The filter uses a proved allowance, not an application tolerance. Exact equality, unsafe magnitudes and ambiguous signs fall back. Current fallback computes all coordinates when one is ambiguous. Rational margins or witnesses explicitly pay additional exact work; the speed gate covers decision outputs alone.

The numerical contract assumes valid independent envelopes, positive minimum total mass and converted finite binary64 input semantics. Correctly rounded IEEE round-to-nearest operations with gradual underflow and the stated NumPy reduction contract are required for accepted filtered signs. Use the integer backend if those premises are unavailable.

Installation and interpreter/NumPy startup are outside the steady running-process timings. The first preparation cost is recorded and amortized over 1,000 fresh boxes in the primary speed table; consult raw JSON for other query counts. Object-payload estimates are not peak process-memory measurements. No GPU or training is required.

Release qualification

This is a tested research software release with MIT licensing, explicit assumptions and executable reproduction. It is not externally replicated production software. A second-machine benchmark, calibrated real application integration and an independently engineered certified-filter comparator are next steps. Preserve negative controls when publishing results.

v0.2 adoption simplification

The public entry point is now PreparedBank(...).evaluate(...): callers no longer construct placeholder masses or remember with_masses. A static JSON bank plus a JSONL update stream exposes the same pattern to tools without a Python integration. Source launchers work before installation; optional installers use a local environment and bundled wheel. The exact CLI default avoids silently changing an application's arithmetic contract when NumPy is installed. The choice is reported in every successful record.

Arrays returned by filtered public getters are defensive read-only copies. Re-enabling writes on a returned copy cannot corrupt model values or make a cached exact result disagree with later filtered calls. This is ordinary API encapsulation, not a security guarantee against private-attribute modification.

The new wrapper deliberately validates Python numbers, including rejecting booleans and numeric strings. Numeric ndarrays permit dtype checking without a Python loop per element. Use real ndarrays in a performance-sensitive Python service; list/JSON overhead is measured separately and can erase a speed advantage at small dimensions. See PUBLIC_API_RESULTS for the measured public cost instead of assuming that a fast kernel means fast full-file processing.

The final public validation pass specializes builtin float/int checks before NumPy/abstract-number type dispatch. This preserves rejection of booleans, nonfinite conversion, strings and unordered mappings/sets, while avoiding unnecessary repeated type dispatch on ordinary float lists. Its isolated validation savings are not a whole-algorithm speed claim; the complete paired public benchmark determines the release wording. Initial wrapper results are preserved under results_public_api_initial.json for comparison.