State the destination contract

The output check passes even though the function never writes two of the four answers. In this original CPU example, the harness starts those positions at zero, which happens to be the required value. Changing only the initial destination contents exposes the skipped writes.[3][4]

The contract is explicit: for input [3, 0, -2, 0], the final destination must be [6, 0, -4, 0], independently of its initial contents. The expected answer comes from doubling each input value before any candidate runs. If an API requires zero-initialized output, that is a different contract and its precondition belongs in the benchmark record.[3][4]

We authored four small functions: overwrite every output, skip writes where the input is zero, add each answer to the old destination, and leave the destination unchanged. Each function gets a fresh buffer for each of three initializers: all zeros; [101, -103, 107, -109]; and the expected answer itself. All twelve calls were fixed before execution and retained.[3][4]

Change the initial contents

The skip-zero function writes 6 at index 0 and -4 at index 2. With zero initialization, the two untouched positions already contain the expected zeros. The final vector is correct for that call. With sentinel initialization, the same function returns [6, -103, -4, -109]. Positions 1 and 3 remain wrong. The comparison still checks every coordinate; the favorable initial state hid the fault.[3][4]

The accumulating control shows a different dependence on old contents. Zero initialization gives the expected [6, 0, -4, 0]. Sentinels produce [107, -103, 103, -109]. Starting from the expected answer gives [12, 0, -8, 0]. A harness that always clears the output can miss an implementation that adds when the contract requires replacement.[3][4]

  • Change the initial state: Skip-zero passes from zeros, then leaves -103 and -109 in the sentinel case.

Final-value comparisons for all 12 authored calls. Only overwrite passes all three initializers in this finite example.

Authored functionZerosSentinelsExpected values
OverwritePassPassPass
Skip zero inputsPassFailPass
AccumulatePassFailFail
UnchangedFailFailPass
  • Sentinel initialization is [101, -103, 107, -109]; expected output is [6, 0, -4, 0].
  • The contract requires final values independent of prior contents, not a specific count of physical stores.

Retain every outcome

The unchanged control performs no buffer reads or writes. It fails the zero and sentinel cases, but passes when the destination starts as [6, 0, -4, 0]. That pass is a correct observation about one final vector. It is insufficient evidence that the function computes the answer from arbitrary prior contents.[3][4]

All four functions remain in the table, including the failures. The complete saved result contains 12 calls, 48 coordinate comparisons and all 42 explicit buffer-method events: 12 reads and 30 writes. Eleven selected fixture checks passed. The ledger is trusted Python teaching instrumentation. It does not measure hardware stores, native memory access or adversarial write coverage.[3][4]

  • Keep the contract explicit: An API that requires zero initialization must be evaluated against that stated precondition.

Preserve scope and credit

The API distinction matters when translating this method to kernels. Triton documents that a false store mask suppresses the corresponding store. PyTorch documents that empty allocation normally leaves data uninitialized, with deterministic fill behavior when both deterministic algorithms and fill_uninitialized_memory are enabled. These official sources supply context; this demonstration executes neither library and establishes no defect in either.[1][2][3]

The program ran once on CPython 3.9.6 on 2026-11-24 UTC. Source, fixture and full result are included in the MIT package. The public protocol changes only local invocation and output path strings for portability; its scientific fields and the original protocol hash are retained.[3][4]

For a candidate-reward check, record the destination initialization contract alongside the input and expected answer. Use deliberately different valid initial states when the contract allows them, retain each outcome, and keep value correctness separate from claims about store coverage. These three initializers distinguish the selected controls; they do not prove correctness for all inputs, shapes, aliasing or prior states.[3][5]

  • Retain the input, initial destination, expected answer and final output for every correctness attempt.

Sources

  1. triton.language.store — Triton documentation — Triton contributors triton-lang.org
  2. torch.empty — PyTorch 2.15 documentation — PyTorch contributors docs.pytorch.org
  3. MIT proof and complete saved output data.nodus-compute.ai
  4. Saved result JSON data.nodus-compute.ai
  5. Source and saved-result provenance data.nodus-compute.ai
  6. Vector figure data.nodus-compute.ai