Gate B Standalone Measurement Contract

Status: frozen and implemented; local observation available; no accepted claim

Decision: ADR-0041

Claim

For the exact BranchMix R1-S8 residual and fixed dynamic input:

median(end_to_end_naux_standalone)
    <=
2 * median(end_to_end_hand_specialized_standalone)

Both rows use the same raw-syscall startup, wire protocol, ELF grammar, fresh-process lifecycle, input frame, output relation, timeout, CPU, schedule, and timing boundary.

Fixed workload

array_elements = 65,536
repetitions    = 64
visits         = 4,194,304

The deterministic generator, raw frame, and expected exact/canonical result must be hashed into the evidence. Generation and encoding occur before each timed series and are compared byte-for-byte across engines.

Fixed measurement policy

schema                         1.0.0
policy                         1.0.0
warmups per engine             5
samples per engine            30
schedule                       alternating paired order
sample dropping                forbidden
timeout                        30,000 ms
primary metric                 end-to-end ns/invocation
primary statistic              median
supporting statistic           p95
maximum population CV          5%
threshold                      NAUX / baseline <= 2.0

The timed interval begins immediately before spawn and ends after exact pipe capture, normal exit, and reap. It includes startup, I/O, input mapping, protection, target execution, unmap, and process teardown. It excludes specialization, verification, executable materialization, semantic decoding, and summary calculation; those costs are reported separately.

Baseline admission

The hand baseline:

  • implements the same BranchMix operation order and strict SSE2 arithmetic;
  • accepts only the canonical BranchMix ABI;
  • uses a separately frozen target byte string and identity;
  • is packaged behind the exact R1-S8 startup and direct ELF grammar;
  • passes all 46 frozen BranchMix semantic cases and the claim input;
  • has no generated-target byte reuse, external call, interpreter, fallback, dynamic loader, libc, assembler, or system linker.

It is benchmark evidence only. It cannot be passed to an R1-S8 writer or verifier as generated residual authority.

Sample admission

Every invocation must:

  • consume the exact input frame and EOF;
  • exit normally with code zero within the timeout;
  • produce exactly 40 stdout bytes and zero stderr bytes;
  • decode to the expected profile and semantic outcome;
  • leave no live descendant or retry;
  • retain its raw total nanoseconds.

Any failure rejects the complete claim bundle.

Statistical admission

The verifier reconstructs median, p95, mean numerator, and exact integer CV comparison from all raw samples. It rejects:

  • fewer or more than 30 samples;
  • zero duration;
  • reorder/duplication or engine substitution;
  • declared statistics that differ from recomputation;
  • either engine with CV above 5%;
  • a ratio above 2.0;
  • overflow in any sum, square, percentile, or ratio calculation.

For the even 30-sample median, evidence retains the exact numerator sorted[14] + sorted[15] with denominator two. Ratio admission compares these numerators directly, so a half-nanosecond median is never truncated.

The first implementation exposes a local-observation emitter and a separate claim-admission token. The local emitter deliberately marks repository state unrecorded and dirty; therefore it can exercise the complete sampler but cannot close Gate B.

Historical policy-1.3 local observation

Encoder policy 1.3.0 produced the following complete unpinned, dirty local observation. It is retained as predecessor evidence:

NAUX median numerator       75,040,133 ns
baseline median numerator   12,783,674 ns
NAUX p95                    39,549,080 ns
baseline p95                 6,472,724 ns
both CV checks              pass
ratio                       about 5.87x
threshold                   fail
claim admission             rejected (local-only metadata)

The numerators are twice the exact even-sample medians. This run is engineering evidence only: it neither satisfies the <= 2.0x threshold nor the clean, pinned claim-host requirements.

Current policy-1.4 local observations

Three complete encoder-policy-1.4.0 release observations are:

run  NAUX median numerator  baseline median numerator  ratio     vs policy 1.3
  1             62,402,943                 12,939,397  4.822709x        -17.84%
  2             62,537,517                 13,038,023  4.796549x        -18.29%
  3             62,297,934                 12,753,051  4.884944x        -16.78%

The numerators are twice the exact even-sample medians, and the three ratios span about 1.85%. This is useful reproducible local engineering evidence for the reachable one-operation superblock increment. The first and third runs failed the baseline CV check and the second failed both CV checks; all retain local-only metadata and miss the <= 2.0x threshold. None can close Gate B.

Claim boundary

A green result closes only the performance half of Gate B on the recorded machine and revision. R1-S8 correctness remains a prerequisite. Gate C and P1 remain open.