Skip to content

validation: replace bias-SE sample-count staircase with measured exact-proof budget #491

Description

@seonghobae

Problem

Production validation_core::bias_standard_error remains deliberately bounded to n=4..=16. GAP-111 through GAP-125 show translated floating moments / sqrt can differ by one ULP from the correctly rounded represented-input result. The cutoff is an implementation/resource boundary, not a scientific boundary, and must not be widened by sample-count staircase alone.

Canonical arithmetic and exact rounding

For exact integer coordinates c_i on a common dyadic unit,

P = Σ(i<j)(c_i-c_j)² = nΣc_i²-(Σc_i)².

The branch retains dependency-free Wide256, signed-dyadic-exponent comparison, exact candidate/adjacent-midpoint ordering, and tie-to-even. Existing characterization shows narrow u128 O(n) can refuse on cancellation-product width while exact P still fits; Wide256 recovers that case. Pairwise-f64 exactness is also stricter than represented-input admission: [0,1,2^-54,2], [0,1,2,-2^53], and [1,2^-54,2,3] establish exact neutral/anchor admissions that pairwise represented subtraction can reject.

Production resource repair on #488

Predecessor #488 head 103768fc3f2fa2f05e8c6e7314b325ceeaf804d4 paid O(n²) before any linear proof. Source-level RED e0b324864e48a503e2aba0d2a487a0b95f5276ed added a production-order contract requiring:

neutral_zero_linear -> conditioned_observed_anchor -> pairwise_reference.

Repair 2b62bd46eb0c391327d2285c2244a76f5a1e0449 implements that route in crates/validation_core/src/bias_se.rs.

exact_neutral_zero_linear_pair_square_sum uses two residual scans: determine the common dyadic exponent, then accumulate signed coefficient sums and Σc_i²; n*Σc_i²-(Σc_i)² uses exact Wide256 products/subtraction. The kernel is O(n) time with O(1) proof storage after the residual vector and allocates no pair records. If its bounded integer coordinate representation refuses, exact_anchor_linear_pair_square_sum searches exact observed anchors as a conditioned O(n²) dynamic-range fallback. exact_pairwise_pair_square_sum runs last as O(n²) comparison/fail-closed reference.

The repair adds a common-domain neutral-zero/pairwise equality unit and preserves the three anchor-only fixtures above. Production admission remains n=4..=16.

The RED commit was superseded before hosted failure evidence completed: non-Rust runs were cancelled and its Rust run had not produced a failing result. Treat it as source-level TDD evidence only.

Remaining scientific/resource evidence

The current equality unit is necessary but insufficient for promotion. Before budget changes, broaden deterministic represented-input neutral-zero/pairwise equality wherever both admit, preserve forward/reversed/permuted bit identity, and either demonstrate a conditioned observed-anchor recovery where the zero-origin bounded representation refuses or remove that O(n²) fallback as unjustified complexity. Preserve exact denominator reduction, candidate stepping, adjacent-midpoint comparison, tie-to-even, overflow refusal, and generic fail-closed behavior.

The checked-in bias_se_exact_proof_budget example is characterization tooling. It records narrow/wide/pair behavior but does not prove which production route executed. Route evidence must distinguish neutral_zero_linear, conditioned_observed_anchor, pairwise_reference, and generic_fallback; identical numeric output is not route evidence.

Code-current doctoring

Current #488 lineage now includes research d57bf6cecc43ac2309dad0dde9a486d30fb9b68b, CHANGELOG 763eba8ff72c5469ef77511c993f9fdd8724e922, TEST_STRATEGY 6ec2d31c963d3494380ab10ae8cf56950cc39a18, and OPERABILITY/current head 5a27c64dcac6d37bb1e576351c52144922bc1f4d.

Canonical docs/TRACEABILITY.md is still the 2026-08-24 cross-cutting matrix without a direct #491 neutral-zero/Wide256 route row. docs/product-technical-gap-baseline.md is also stale on #435. These two are not complete and PR/issue prose is not a substitute.

Foundation prerequisite

#492 remains at 794ba9e6dda9f043aa499920fdf609b81b075d7e, Ready for Review and mergeable. Rust Foundation, Documentation Quality, Security Scan, and Semgrep are exact-head GREEN. CodeQL fails before scan execution at canonical .github machine-principal authorization: live actor/sender opencode-agent[bot], owner allowlist github-actions[bot]. Fresh reviews are COMMENTED only; no qualifying APPROVED exists. TEPP must not alter the owner allowlist, impersonate an allowed actor, self-approve, restore repository-local scheduling, or bypass that gate.

Current delivery evidence

Exact #488 head is 5a27c64dcac6d37bb1e576351c52144922bc1f4d, Draft and mergeable on protected main@a243f18da4a4ca8a8d068c39922537f1f8ed6ad0. At the latest sweep, Security Scan 34023672009, Documentation Quality 34023671960, Semgrep 34023672086, CodeQL 34023671932, and Rust Foundation 34023671881 were queued. No exact-head GREEN or qualifying independent approval is claimed.

Acceptance before any production budget change

  • Same-head Rust 1.98.0 fmt/clippy/nextest/rustdoc and owned-production 100% line/branch/security/documentation GREEN.
  • Broad pairwise-vs-neutral-zero represented-input equality plus explicit anchor-only admissions and permutation/reversal identity.
  • Evidence that justifies the conditioned-anchor fallback, or removal/consolidation if it provides no admission value.
  • Truthful production route observability for neutral-zero, conditioned anchor, pairwise reference, and generic fallback.
  • Rust 1.98.0 --release raw timing, allocator/RSS and applicable buyer-path evidence on recorded hardware/build flags, without shrinking samples or omitting proof work.
  • Normal protected-main landing of fix(actions): align central hourly admission contracts #492 and qualifying independent review; no self-approval or bypass.
  • Code-current canonical TRACEABILITY and docs/product-technical-gap-baseline.md in addition to the already-current research/CHANGELOG/TEST_STRATEGY/OPERABILITY.
  • No force push, destructive rebase, required-gate weakening, mutable sibling dependency, or fabricated benchmark/CI evidence.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions