Separate payload and write region

The four output bytes are correct, but the byte immediately before them has changed. In this original CPU example, checking only the output accepts the call. Comparing the neighboring guard bytes reveals a separate contract violation.[3][4]

The task allocates eight bytes: [161, 162, 0, 0, 0, 0, 177, 178]. Only offsets 2 through 5 may be written. The first two and last two bytes are guards. Input [3, 5, 7, 9] must be doubled into the four-byte payload, giving [6, 10, 14, 18]. The input and literal expected answer become immutable tuples before any candidate runs.[3][4]

  • Keep both observations: The payload [6, 10, 14, 18] is correct while a neighboring guard changes from 162 to 0.

Retain the changed guards

We authored six functions and gave each a fresh copy of that arena. The correct function writes the four answers inside the allowed window. The wrong-payload control writes [6, 10, 14, 19] inside the same window. Two other functions write the correct payload, then write zero to either offset 1 or offset 6. Every one of these accesses stays inside the allocated bytearray. The deliberate error is writing outside the task’s permitted payload, not accessing unallocated native memory.[3][4]

The prefix-corruption function ends with [161, 0, 6, 10, 14, 18, 177, 178]. Its output slice exactly matches the reference. Its prefix guard does not: 162 became 0. The suffix-corruption function similarly preserves all four answers while changing the first suffix byte from 177 to 0. Neither case is a skipped output write; both functions write every required answer before the extra write.[3][4]

The full saved record separates three observations: output equality, final guard equality and the locations of recorded write attempts. Five of the six functions pass the output comparison. Three pass output plus final guards. Only the ordinary correct function passes output plus the declared write-window contract in this finite trusted ledger. These counts describe selected authored functions, not a defect rate or evidence of a real reward-system exploit.[3][4]

Keep endpoint and write observations distinct

Unchanged guards are limited evidence. The restore-prefix function writes zero to offset 1, then restores 162. The same-value-suffix function writes 177 over the existing 177 at offset 6. Both finish with correct output and unchanged guards, yet both contain forbidden writes under this task’s rule. A different API could allow such writes; the writable-region contract must be declared before scoring. These two controls retain a familiar endpoint-check limitation rather than establish a new security mechanism.[3][4]

The ledger records explicit calls to the example’s write method, including index, value, prior value, resulting value and window membership. The six main calls contain 29 performed writes, five outside the permitted window. The wrapper refuses invalid allocation indices and invalid byte values before any storage access, and retains those rejected attempts in the separate controls. This trusted instrumentation does not observe arbitrary native stores, detect hidden code or provide a sandbox.[3][4]

Twenty-four selected controls accompany the six literal full-record checks: fourteen malformed-fixture refusals, seven invalid-write refusals and three valid boundary writes. The boundary checks distinguish the first and last permitted payload offsets from the first suffix offset. All outcomes and complete eight-byte before/after snapshots are retained. No actual out-of-allocation write is performed, including in the refusal controls.[3][4]

  • Do not overread the guard: Restored and same-value writes preserve final guards but still violate this declared write-window contract.

All six authored calls. Off-window counts come from trusted explicit write-method events, not native or hardware instrumentation.

Authored functionOutput equalFinal guards equalOff-window writesOutput + write contract
CorrectYesYes0Accept
Wrong payloadNoYes0Reject
Prefix corruptionYesNo1Reject
Suffix corruptionYesNo1Reject
Restore prefixYesYes2Reject
Same-value suffixYesYes1Reject
  • All main functions write four payload positions; every performed write remains inside the eight-byte allocation.
  • Output plus final guards accepts correct, restore-prefix and same-value-suffix. Final-state equality cannot establish the absence of writes.

Credit and scope

Python documents bytearray as mutable binary storage supporting mutable sequence operations. In kernel APIs, addresses are a separate consideration from values: Triton documents that store writes to locations defined by its pointer, with false masks suppressing corresponding stores. Those official sources provide context. This proof executes neither Triton nor a GPU, and reports no defect in either implementation. Nodus authored the functions, fixture, ledger and worked example.[1][2][3]

One original standard-library invocation produced the saved result on CPython 3.9.6. The MIT package contains the exact executed source, fixture, literal expectations, controls and complete result. The practical method is to define the writable region, retain surrounding state where feasible, and report payload correctness separately from observed side effects. Passing finite guard checks does not prove absence of temporary writes, arbitrary out-of-bounds behavior or general memory safety.[3][4]

The original saved CPU execution completed on November 27, 2026 (UTC). This article reuses that exact result and its complete recorded outcomes; no new experiment was run for this release.[3][5]

Python and Triton documentation contributors provide the storage and store-operation context. Nodus authored the bytearray functions, fixture and trusted write ledger; neither Triton nor GPU code was executed.[1][2][3]

  • Declare the writable output region and retain payload, guard-state and observed write-contract verdicts separately.

Sources

  1. Python documentation: Built-in Types, Bytearray Objects — Python Software Foundation docs.python.org
  2. Triton documentation: triton.language.store — Triton contributors triton-lang.org
  3. MIT source and complete saved result data.nodus-compute.ai
  4. Saved result JSON data.nodus-compute.ai
  5. Original execution and saved-result provenance data.nodus-compute.ai
  6. Vector figure data.nodus-compute.ai