Issue #2550: Prove the copy-and-patch patcher and the stencil table (relocations fit, the right variant is chosen)

Open and answer this issue on GitHub.

emitter, blocked, future · opened 2026-11-21 · updated 2026-11-21 · 0 comments

Part of #1593 After #1593 Needs #1235

What it is

Obligations 4 and 5 of #1593. The patcher copies bytes and writes values into holes of each relocation kind (absolute 64-bit, relative 32-bit, …): every value fits its field (a rel32 jump reaches only so far), every offset stays inside the buffer; a few hundred lines, written in Nikaia and proved by Nikaia’s own prover. The table “construct and operand shape → stencil variant” chooses a variant only where it applies; it is small and checked in full. For use as a JIT, write-xor-execute memory and, on Arm, flushing the instruction cache belong to the patcher’s obligations. It waits for the backend (#1235).

To build

  1. The patcher in Nikaia with its claims proved (obligation 4), tests for each relocation kind including a value that does not fit.
  2. The stencil table checked in full (obligation 5).

Done when

The patcher is written in Nikaia and Nikaia’s prover accepts its claims, a value that does not fit its relocation field is refused in a test, and every entry of the stencil table is checked to apply only where its construct and operand shape allow; the report gives a Found: line per finding.

Files

New: the patcher and the table check as tools/*.nika, their tests. No new Rust.

Split from #1593 by Claude Code

Back to Open Issues