Jump Stack Table

The Jump Stack Memory contains the underflow from the Jump Stack.

Base Columns

The Jump Stack Table consists of 5 columns:

  1. the cycle counter clk
  2. current instruction ci,
  3. the jump stack pointer jsp,
  4. the last jump's origin jso, and
  5. the last jump's destination jsd.
ClockCurrent InstructionJump Stack PointerJump Stack OriginJump Stack Destination
-----

The rows are sorted by jump stack pointer jsp, then by cycle counter clk. The column jsd contains the destination of stack-extending jump (call) as well as of the no-stack-change jump (recurse); the column jso contains the source of the stack-extending jump (call) or equivalently the destination of the stack-shrinking jump (return).

The AIR for this table guarantees that the return address of a single cell of return address memory can change only if there was a call instruction.

An example program, execution trace, and jump stack table are shown below.

Program:

addressinstruction
0x00foo
0x01bar
0x02call
0x030xA0
0x04buzz
0x05bar
0x06call
0x070xB0
0x08foo
0x09bar
0xA0buzz
0xA1foo
0xA2bar
0xA3return
0xA4foo
0xB0foo
0xB1call
0xB20xC0
0xB3return
0xB4bazz
0xC0buzz
0xC1foo
0xC2bar
0xC3return
0xC4buzz

Execution trace:

clkipciniajspjsojsdjump stack
00x00foobar00x000x00[ ]
10x01barcall00x000x00[ ]
20x02call0xA000x000x00[ ]
30xA0buzzfoo10x040xA0[(0x04, 0xA0)]
40xA1foobar10x040xA0[(0x04, 0xA0)]
50xA2barreturn10x040xA0[(0x04, 0xA0)]
60xA3returnfoo10x040xA0[(0x04, 0xA0)]
70x04buzzbar00x000x00[ ]
80x05barcall00x000x00[ ]
90x06call0xB000x000x00[ ]
100xB0foocall10x080xB0[(0x08, 0xB0)]
110xB1call0xC010x080xB0[(0x08, 0xB0)]
120xC0buzzfoo20xB30xC0[(0x08, 0xB0), (0xB3, 0xC0)]
130xC1foobar20xB30xC0[(0x08, 0xB0), (0xB3, 0xC0)]
140xC2barreturn20xB30xC0[(0x08, 0xB0), (0xB3, 0xC0)]
150xC3returnbuzz20xB30xC0[(0x08, 0xB0), (0xB3, 0xC0)]
160xB3returnbazz10x080xB0[(0x08, 0xB0)]
170x08foobar00x000x00[ ]

Jump Stack Table:

clkcijspjsojsd
0foo00x000x00
1bar00x000x00
2call00x000x00
7buzz00x000x00
8bar00x000x00
9call00x000x00
17foo00x000x00
3buzz10x040xA0
4foo10x040xA0
5bar10x040xA0
6return10x040xA0
10foo10x080xB0
11call10x080xB0
16return10x080xB0
12buzz20xB30xC0
13foo20xB30xC0
14bar20xB30xC0
15return20xB30xC0

Extension Columns

The Jump Stack Table has 2 extension columns, rppa and ClockJumpDifferenceLookupClientLogDerivative.

  1. A Permutation Argument establishes that the rows of the Jump Stack Table match with the rows in the Processor Table. The running product for this argument is contained in the rppa column.
  2. In order to achieve memory consistency, a Lookup Argument shows that all clock jump differences are contained in the clk column of the Processor Table. The logarithmic derivative for this argument is contained in the ClockJumpDifferenceLookupClientLogDerivative column.

Padding

A padding row is a direct copy of the Jump Stack Table's row with the highest value for column clk, called template row, with the exception of the cycle count column clk. In a padding row, the value of column clk is 1 greater than the value of column clk in the template row. The padding row is inserted right below the template row. These steps are repeated until the desired padded height is reached. In total, above steps ensure that the Permutation Argument between the Jump Stack Table and the Processor Table holds up.

Memory-Consistency

Memory-consistency follows from two more primitive properties:

  1. Contiguity of regions of constant memory pointer. Since the memory pointer for the Jump Stack table, jsp can change by at most one per cycle, it is possible to enforce a full sorting using AIR constraints.
  2. Correct inner-sorting within contiguous regions. Specifically, the rows within each contiguous region of constant memory pointer should be sorted for clock cycle. This property is established by the clock jump difference Lookup Argument. In a nutshell, every difference of consecutive clock cycles that occurs within one contiguous block of constant memory pointer is shown itself to be a valid clock cycle through a separate cross-table argument.

Arithmetic Intermediate Representation

Let all household items (🪥, 🛁, etc.) be challenges, concretely evaluation points, supplied by the verifier. Let all fruit & vegetables (🥝, 🥥, etc.) be challenges, concretely weights to compress rows, supplied by the verifier. Both types of challenges are X-field elements, i.e., elements of .

Initial Constraints

  1. Cycle count clk is 0.
  2. Jump Stack Pointer jsp is 0.
  3. Jump Stack Origin jso is 0.
  4. Jump Stack Destination jsd is 0.
  5. The running product for the permutation argument with the Processor Table rppa has absorbed the first row with respect to challenges 🍇, 🍅, 🍌, 🍏, and 🍐 and indeterminate 🧴.
  6. The running product of clock jump differences ClockJumpDifferenceLookupClientLogDerivative is 0.

Initial Constraints as Polynomials

  1. clk
  2. jsp
  3. jso
  4. jsd
  5. rppa - (🧴 - 🍇·clk - 🍅·ci - 🍌·jsp - 🍏·jso - 🍐·jsd)
  6. ClockJumpDifferenceLookupClientLogDerivative

Consistency Constraints

None.

Transition Constraints

  1. The jump stack pointer jsp increases by 1, or
  2. (jsp does not change and jso does not change and jsd does not change and the cycle counter clk increases by 1), or
  3. (jsp does not change and jso does not change and jsd does not change and the current instruction ci is call), or
  4. (jsp does not change and the current instruction ci is return).
  5. The running product for the permutation argument rppa absorbs the next row with respect to challenges 🍇, 🍅, 🍌, 🍏, and 🍐 and indeterminate 🧴.
  6. If the jump stack pointer jsp does not change, then the logarithmic derivative for the clock jump difference lookup ClockJumpDifferenceLookupClientLogDerivative accumulates a factor (clk' - clk) relative to indeterminate 🪞. Otherwise, it remains the same.

Written as Disjunctive Normal Form, the same constraints can be expressed as:

  1. The jump stack pointer jsp increases by 1 or the jump stack pointer jsp does not change
  2. The jump stack pointer jsp increases by 1 or the jump stack origin jso does not change or current instruction ci is return
  3. The jump stack pointer jsp increases by 1 or the jump stack destination jsd does not change or current instruction ci is return
  4. The jump stack pointer jsp increases by 1 or the cycle count clk increases by 1 or current instruction ci is call or current instruction ci is return
  5. rppa' - rppa·(🧴 - 🍇·clk' - 🍅·ci' - 🍌·jsp' - 🍏·jso' - 🍐·jsd')
    • the jsp changes or the logarithmic derivative accumulates a summand, and
    • the jsp does not change or the logarithmic derivative does not change.

Transition Constraints as Polynomials

  1. (jsp' - (jsp + 1))·(jsp' - jsp)
  2. (jsp' - (jsp + 1))·(jso' - jso)·(ci - op_code(return))
  3. (jsp' - (jsp + 1))·(jsd' - jsd)·(ci - op_code(return))
  4. (jsp' - (jsp + 1))·(clk' - (clk + 1))·(ci - op_code(call))·(ci - op_code(return))
  5. clk_di·(jsp' - jsp - 1)·(1 - clk_di·(clk' - clk - one))
  6. (clk' - clk - one)·(jsp' - jsp - 1)·(1 - clk_di·(clk' - clk - one))
  7. rppa' - rppa·(🧴 - 🍇·clk' - 🍅·ci' - 🍌·jsp' - 🍏·jso' - 🍐·jsd')
  8. (jsp' - (jsp + 1))·((ClockJumpDifferenceLookupClientLogDerivative' - ClockJumpDifferenceLookupClientLogDerivative) · (🪞 - clk' + clk) - 1)
    + (jsp' - jsp)·(ClockJumpDifferenceLookupClientLogDerivative' - ClockJumpDifferenceLookupClientLogDerivative)

Terminal Constraints

None.