ADR 0071: The label_propagation API (provisional until M10b’s freeze)#
Status: The technical parts accepted under delegation (2026-10-29; GOVERNANCE.md, “Delegation of technical ADRs”). The names and semantics are the author’s: AD12 (the new public names of 0.4, with E1’s changes; E2:
update_stats::affectedkeeps its frozen meaning and label_propagation addsstats::initial_frontier= |V_aff|), AD20 (the per-field determinism sentence ofcore/stats.hpp), AD16 (the published setup is the documented default), AD19 (no OpenMP backend in 0.4) and the comparator rules of sheet C8, decided by the author on 2026-10-28 (GOVERNANCE.md, approvals log, the rows “The new public names of 0.4 (AD12, HD8, HD12; sheet E1)”, “API semantics of 0.4 (sheet E2-E10)”, “Licensing, data provenance, budgets and scope of 0.4 (sheet G1-G3, H1-H3)” and “The parity rules of 0.4 (sheet C1-C8)”). The names beyond AD12’s list (section 5) are listed in GOVERNANCE.md’s open-decision sub-blockM10 (AD), pending the author’s acknowledgement. The header istracked, not frozen: M10b freezes it.Decided: the author approved on 2026-11-12 (GOVERNANCE.md, approvals log, the row “M10’s public names beyond AD12’s list”) every name beyond AD12’s list (section 5), as ADR 0109’s section “The new public names” lists them, frozen with the API; the acknowledgement above is closed.
Date: 2026-10-29
Deciders: the AI assistant, on the author’s behalf (M10a, step host-container-sequential-driver)
Builds on: ADR 0023 (the uniform contract), ADR 0052 (the API ADR precedent), ADR 0069 (the slotted rows), ADR 0070 (the backend sentence), the sketch
docs/design/sketches/ label_propagation.md.
Context#
The sketch fixed the shape and left three questions for M10: where on_limit lives, whether
std::optional<float> is acceptable in options, and whether the published setup or the
streaming mode is the documented default. PLAN 5.3’s example applied the initial batch and then
called compute(); the original’s run (runDynLP) starts from an empty device graph and treats the
first batch b0 (the first ground truth and its edges) as an ordinary batch.
Decision#
1. The header cpp/include/dyng/label_propagation.hpp#
Entity |
Form |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
IrLP |
|
DynLP, one batch |
|
|
Instantiated for vertex_t = int32 and edge_t int32 or int64, float weights; other types stop
at a static_assert (DYNG_LABEL_PROPAGATION_TYPES_MESSAGE). std::optional<float> is accepted
in options (sketch question 2: the C++ API is the contract; nanobind binds it).
2. The published setup as data, not a mode#
The published setup (sketch question 3; AD16: the documented default) is data the caller passes:
the graph built by graph::with_capacity(stream.row_capacity) (the full graph’s degrees) and
options::similarity_threshold = stream.similarity_threshold (the original’s
computeAvgEdgeWeight of the full graph). There is no published mode: the streaming mode of
M10b (row_layout::slack, std::nullopt tau from the graph seen so far) uses the same functions
with other data.
3. The parity flow against PLAN 5.3#
The original’s run is reproduced as graph::with_capacity(stream.row_capacity), then
compute() on the empty capacity graph (untimed setup: every label 0.5, no tag consumed), then
update(b0) … update(b(B-1)). PLAN 5.3’s g.apply(stream.initial) + compute() would make b0
part of a static solve, which the original never runs: its b0 is counted, timed and consumes a
propagation tag. Both forms are valid uses of the API; the parity runs, the gates and the docs use
the first.
4. Semantics and requirements#
I4 (no oscillating schedules) applies to
update()’s schedules: there is no plain Jacobi (thedampedrule removes the period-2 oscillation of the original’s defect D-b). IrLP, the published baseline ofcompute(), is exempt (ADR 0072): it is the paper’s comparison, kept unchanged.Requirements:
directed = falseand float weights for both;update()needsrow_layout::slottedwithbatch_semantics::net_effect()(not_supported_errorotherwise, naminggraph::with_capacity());compute()also reads compact float graphs (the same labels for the same edges: it reads the column-sorted snapshot of the live edges).Labels: a seed’s label is exactly its class (after every update, deleted seeds included); a deleted vertex keeps its last label; a vertex that never entered the graph, or arrived and left in one batch, stays at 0.5 under
update(); undercompute()every vertex that is not active is 0.5.Determinism:
dampedis bitwise per backend and build;in_placeis a tolerance (the CUDA backend’s published rule is not reproducible; the sequential backend is, ADR 0072). The inheritedaffected(the vertices whose label bits changed; E2),convergedandfallback_usedare deterministic per backend underdampedand schedule-dependent underin_place: AD20’s sentence incore/stats.hpp(“An algorithm’s stats documentation may state a weaker level … for an inherited field; that statement governs for that algorithm”), written here as the last paragraph of theupdate_statsclass comment, the placement both tracks use.on_limit:
reportkeeps the labels and reportsconverged = false;errorthrowsconvergence_errorafter the commit (the result is poisoned);fallback_recomputerecomputes every label with IrLP (fallback_used = true).compute()reports a cap underreportand throws otherwise (it is the recomputation).Backends: AD19 and ADR 0070’s sentence: the manifest lists sequential (and cuda from M10a step 4); OpenMP resources raise
not_supported_errornamingsequentialandcudaand the fixdyng.Resources("sequential").Seeds of compute(): active vertices of
g, each once, class 0 or 1 (invalid_argument_errorotherwise). The batches’ labels join the result’s seed labels inupdate().Diagnostics: the profiler counter
label_propagation.irlp_iterations(IrLP’s iterations of acompute()), and the stage trace of ADR 0073 (DYNG_DYNLP_TRACE_DIR).
5. The new public names#
AD12’s list (decided by the author on 2026-10-28): label_propagation::schedule, on_limit,
options, stats (with initial_frontier), result, compute, update; the graph’s
with_capacity, num_active_vertices, vertex_status, graph_view::status and row_end,
batch_semantics::net_effect(), edge_batch::insert_vertex and delete_vertex (ADR 0069); the
vertex-arrival generators (generators::legacy::dynlp_vertex_arrival_stream, ADR 0067);
testing::harmonic_solution, union_find, lp_host_model (ADR 0068); the compat tool
dyng-compat-dynlp (ADR 0073).
Beyond AD12’s list, pending the author’s acknowledgement (GOVERNANCE.md, M10 (AD)):
Name |
Where |
Why |
|---|---|---|
|
the enumerators |
the sketch’s |
|
the fields |
the sketch’s |
|
the fields |
the sketch’s |
|
the members |
the sketch’s, and |
|
the dispatch |
the pattern of every algorithm |
the profiler counter |
profiler |
results.csv’s |
|
ADR 0069 |
the container |
|
ADR 0067 |
the generator’s types |
|
ADR 0068 |
the oracles’ types |
|
ADR 0068 |
the host model’s own per-vertex state (added to this list by the M10a review; its order is not |
6. Amendments of the M10a review#
on_limit::fallback_recompute: if IrLP reaches the cap too, its labels are kept andstats::convergedis false (compute()raises convergence_error there).compute(),result::reserve()andresult::clone()report a host allocation failure asout_of_memory_error(function-try-blocks withDYNG_TRANSLATE_ALLOCATION_FAILURE, as every other algorithm’s entries).update()and itsdyng::update()participant make the entry checks that read nothing of the batch (backend, placement, poisoned and stale result, layout, options) before Step 0 (framework::checked_participant; ADR 0070 section 1).The documentation of
result::reserve()andoptions::similarity_thresholdsays what each covers or costs (the graph’s own per-batch storage; the per-update download of the rows on cuda when the threshold is unset).
Consequences#
M10b reviews and freezes the header (with Python and the command line); the names above are then on the stable list for the author’s confirmation at 0.4.0 (AD15).
examples/and the tutorials pass explicit resources (AD19).
Alternatives considered#
on_limitincore/types.hpp: rejected until a second user (rule of two).A
publishedoption or mode: rejected; the setup is data (section 2).affected= |V_aff| for label_propagation: rejected by the author (E2);initial_frontiercarries it.