Internals¶
Details of the implementation that matter when changing it, kept out of the API reference. Development covers the build and the gate.
Rank-1 cut state (r1c.h)¶
R1CResource handles rank-1 cuts with multipliers k/d, d ∈ [2, 8] (#142).
Each cut’s running sum mod d is a field of ⌈log2 d⌉ bits, packed in cut order
into Words 64-bit words (BasicR1C*<Words>; R1C* is one word,
State = uint64_t, a 3/2 cut is bit c). 1-bit numerator-1 cuts take an XOR
toggle; dominance is s1 & ~s2 on 1-bit fields plus a packed field-wise >
on 2- and 3-bit ones.
set_cuts takes R1Cut (multipliers, arc memory; d reduced to the smallest
common one) or R1VertexCut (pull-rcspp’s form: (vertex, numerator), d as
given, vertex memory: an arc keeps the sum iff both ends are in memory ∪
coefficient vertices, read from a ProblemView), both normalized into one
private NormCut and built once. Refusals throw R1CError (R1CErrc code,
cut, vertex), a std::invalid_argument (#144).
There are two layouts (#146):
set_cuts(cuts, n_vertices, n_arcs)is global: every cut’s field at every vertex, one table row kept inline.The
ProblemViewoverloads are per-vertex: a cut’s field sits only at the vertices of M’, at the lowest place free at all of them, else at each vertex’s own lowest free place (#150). Which cuts fit is decided by gap-free per-vertex packing, which is also the layout where the shared places would leave a cut out. Each vertex keeps its masks and its fields’ β and d, not a full row.
A state is in the layout of the vertex it is at, so extend_along_arc keeps a
field whose places at the arc’s ends agree by mask and moves the others
tail→head (Forward) or head→tail (Backward), and anything reading a state’s
bits must use field(cut, vertex).
The static fit(cuts, view) (#147) packs as the per-vertex set_cuts does,
without throwing for room, through the same pack_per_vertex:
R1CFit{unplaced, bit_fails}, where an unplaced cut takes no room, so
set_cuts accepts the placed ones, though possibly in other slots. That
packing is not monotone in width: an R1Cut whose d reduces gets a narrower
field and may pack differently from its R1VertexCut twin.
Benchmark tables¶
The README’s benchmark tables come solely from benchmarks/compute_means.py,
which reads the source CSVs (bgspprc.csv, pathwyse.csv,
pull_algo_runtimes.csv, and for the PathWyse 1.1.0 table
pathwyse-1.1.0/{bgspprc,pathwyse}.csv, which a rerun writes and the
repository does not hold) and joins them in memory; there are no
committed comparison_*.csv files. It uses shift = 1 s and TL → 120 s for
every table; --rows dumps the per-row joins (the former comparison CSVs) for
spot-checking. Don’t reintroduce a materialized join CSV: it goes stale against
bgspprc.csv (the README numbers used to drift this way).
bgspprc.csv encodes rcspp as set ∈ {ng8, ng16, ng24} (one per ng
directory). Canonicalize to a single rcspp bucket before grouping by set
(compute_means.py does this via SET_DISPLAY). The PathWyse table excludes
rcspp rows (INCLUDED_SETS = {spprclib, roberti}) because the ng metric
differs between bgspprc and PathWyse on .graph instances; rcspp is compared
against the paper (pull_algo_runtimes.csv) instead.