zorch.pcs.jagged.region¶
Jagged region packing for the SP1 trace commit.
A region is the committable form of one shard's variable-height chip traces:
every chip column-major-flattened into one dense buffer, end-padded with zeros
to a multiple of the stacking height. row_counts/column_counts follow
SP1's structure-hash convention — per-chip entries first, then a trailing
(max_height, leftover) / (num_added_cols - 1, 1) pair that decodes the
trailing zero pad — and are bound into the commitment hash, so their encoding is
part of the commitment format (it lives with this PCS's commit, not the generic
zorch/commit blocks), not a packing detail.
JaggedRegion
dataclass
¶
One committable region: dense buffer + SMCS row/column counts.
chip_starts (cumulative chip-area offsets, length num_chips + 1)
addresses each chip's raw, unpadded data inside dense; zero-height
chips occupy no dense data but keep their counts entry so chip indexing
matches the shard's chip order.
Source code in zorch/pcs/jagged/region.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
block
property
¶
block: Array
The [K, S] message-domain matrix (row k is stacked column
k of the dense MLE) — a free reshape view of dense. The layout
the commit encodes and the stacked open consumes
(StackedRound.block).
structure_counts ¶
structure_counts(
heights: Sequence[int],
widths: Sequence[int],
*,
log_stacking_height: int,
max_log_row_count: int
) -> tuple[tuple[int, ...], tuple[int, ...], int, int]
SP1's structure-hash (row_counts, column_counts) for a region of the
given chip heights/widths, plus the raw packed area and its
stacking-aligned size: per-chip entries first, then the trailing pad pair
decoding the end pad to the stacking alignment. One definition shared by
the prover's region packing and the jagged-eval verifier dual's column
manifest — the counts and the alignment are part of the commitment
format, so the two sides must derive them identically.
Source code in zorch/pcs/jagged/region.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |