Documentation

CslibFrontier.Algorithms.WordRAM.ThreeSum.Frontend.Program

Initialized-input native distinct-position frontend #

The ABI has 128 registers. Radix uses 0–15; frontend locals use 16–63; the existing parameter program uses 64–87. Registers 88–90 return descriptor base, descriptor count and heap end. Each descriptor has six words (length, pointer) for its three compact injective arrays. Each array has capacity n+1, including the singleton zeros required when n=0.

Main definitions #

@[reducible, inline]

Original input length and label-bit budget.

@[reducible, inline]

Original input length and label-bit budget.

@[reducible, inline]

Number of split triples, total triple count and total array count.

@[reducible, inline]

Number of split triples, total triple count and total array count.

@[reducible, inline]

Number of split triples, total triple count and total array count.

@[reducible, inline]

Capacity per compact array.

@[reducible, inline]

Next payload address.

@[reducible, inline]

Descriptor table base.

@[reducible, inline]

Current array index, current triple and slot.

@[reducible, inline]

Current array index, current triple and slot.

@[reducible, inline]

Current array index, current triple and slot.

@[reducible, inline]

Arithmetic temporary and final heap endpoint.

@[reducible, inline]

Arithmetic temporary and final heap endpoint.

Write the singleton-zero array, including on empty input.

Compute the exact array selection mode for the two multiplicity triples.

Decode β, then β', then [false,true], and scan the indicated one of three arrays.

Native choice between the split prefix and the two multiplicity triples.

Write a compact array's two descriptor words and advance the allocation cursor.

Initialize every constant, layout and cursor, then enumerate every array, including empties.

Embed the 24-register parameter program above both native kernels.

Embed the 16-register radix program in the low registers.

Embed the 48-register frontend program between radix and parameters.

@[reducible, inline]

Final descriptor base, descriptor count and one-past-end payload address.

@[reducible, inline]

Final descriptor base, descriptor count and one-past-end payload address.

@[reducible, inline]

Final descriptor base, descriptor count and one-past-end payload address.

Setup for the lower-level sorter with the magnitude-derived bit bound, never physical width.

Transfer actual parameters and radix outputs into the concrete frontend ABI.

Return metadata while preserving parameter outputs and full radix key/count arrays.

Native frontend after the existing complete parameter program.

One finite native program for each fixed polynomial magnitude exponent.