primitives.pol_map#
Polynomial mapping data structures.
This module provides faithful Python translations of the C++ mapping structures from pil2-stark/src/starkpil/stark_info.hpp.
These structures describe how polynomials are organized in memory and how they map to different stages of the STARK proof system.
Classes#
Identifies a polynomial in verification context. |
|
Field element type for type-safe field discrimination. |
|
Maps a polynomial to its location in the proof system. |
|
Maps an evaluation point to its polynomial source. |
|
Maps a challenge to its derivation stage. |
|
Custom commitment configuration. |
|
Constraint boundary specification. |
Module Contents#
- class primitives.pol_map.PolynomialId[source]#
Bases:
NamedTupleIdentifies a polynomial in verification context.
Used as dict key for buffer-free polynomial access in the verifier. The verifier parses proof data into dict[PolynomialId, FF3] where values are vectorized across all query points.
- Attributes:
type: ‘cm’ (committed), ‘const’ (constant), ‘custom’ (custom commit) name: Polynomial name from starkinfo (e.g., ‘a’, ‘gsum’) index: Array index for multi-instance polynomials (0 for scalars) stage: Stage number (1+ for committed, 0 for constants)
- class primitives.pol_map.FieldType(*args, **kwds)[source]#
Bases:
enum.EnumField element type for type-safe field discrimination.
- class primitives.pol_map.EvMap[source]#
Maps an evaluation point to its polynomial source.
Corresponds to C++ class EvMap in stark_info.hpp (lines 108-135).
- Attributes:
type: Source type (cm=committed, const_=constant, custom=custom commit) id: Polynomial ID within source type row_offset: Row offset for evaluation (-1, 0, or 1). C++ name: “prime” commit_id: Commitment ID (only for custom type) opening_pos: Position in opening points array
- class Type(*args, **kwds)[source]#
Bases:
enum.EnumEvaluation source type.
Corresponds to C++ enum eType in EvMap (lines 111-116).
- type: EvMap.Type[source]#
- class primitives.pol_map.CustomCommits[source]#
Custom commitment configuration.
Corresponds to C++ class CustomCommits in stark_info.hpp (lines 52-58).
- Attributes:
name: Custom commit name stage_widths: Number of columns at each stage public_values: Indices of public values used
- class primitives.pol_map.Boundary[source]#
Constraint boundary specification.
Corresponds to C++ class Boundary in stark_info.hpp (lines 60-66).
- Attributes:
name: Boundary name (e.g., “everyRow”, “everyFrame”) offset_min: Minimum row offset (only for “everyFrame”) offset_max: Maximum row offset (only for “everyFrame”)