Retrospective: M9b (count_local_patterns, Python, the CLI, the docs and the triad_count freeze)#
Status: done on the branch m9b-local-patterns (ready for the pull request; the author merges it with a merge commit). M9b is the second half of PLAN 11.3’s
M9 row (the author’s decision D2 of 2026-10-15): experimental::count_local_patterns<op_t> over
M9a’s wedge engine with its packaging and the Op tutorial; Python (dyng.triad_count,
dyng.update over hypergraphs), the CLI, result_io and the wheels; the docs and examples; and
the triad_count API review and freeze. It runs in three steps, and each step adds its section
here. Release 0.3.0 = M8a + M8b + M9a + M9b (PLAN Appendix F).
The author’s decisions in force (2026-10-15; GOVERNANCE.md). D1: the Nsight Systems peak of
live allocations gated (M9a). D2: the M9a / M9b split. D3: incremental host engines. D5: the
1.25 MB test-data budget. Taken on the plan’s defaults, pending the author’s confirmation at the
0.3.0 release: D4 (triad_count, dyng.triad_count and dyng triad_count frozen at the end of
M9b and stable; count_local_patterns stays experimental: installed, tracked, never frozen),
D9 (the new public names, listed in the ADRs and the API-review ADR), D10 (the “paper vs fixed
code” wording).
Step 1: count_local_patterns and its packaging (local-patterns-experimental)#
Done (M9b acceptance criteria 1-4). experimental::count_local_patterns<op_t> is the public,
nvcc-only extension point over the driver and the engine of triad_count: one driver
(triad_count’s problem generalized over a pattern’s table and the Op’s value) and one engine (M9a’s
kernels and host work, moved unchanged into installed headers). The four patterns of
triad_count are built-in Ops of it, and their five counting kernels are SASS- and
resource-identical to M9a’s build, so no M9a gate needs a re-read. ADR 0058 records the design and
the new public names (D9, for the author).
What was built#
Commit |
What |
|---|---|
|
the engine moved into |
|
|
|
|
|
packaging: |
|
the tutorial page, |
(the records commit) |
|
Deviations from the plan and the step’s text (each with the same intent)#
The branch
m9b-local-patternswas created by the orchestrator fromm9a-triad-countat6716eec(the accepted M9a; PR #16 open):origin/main(9cde147, M8b) did not contain M9a then. The author merged #16 as4cc5c3f(2026-10-21, with the review fix511f8ff), andorigin/mainwas merged into this branch at the M9b review (12afe75).The shape of the API (within the PLAN name):
count_local_patterns<op_t>is a class template with staticcompute(res, h[, op])andupdate(res, h, batch, result); the Op value is fixed atcompute()and kept by the result (op()), asoptions::kindis, soupdate()takes no Op (an Op’s parameters cannot change between updates, which keeps “update == recompute” true). The result is the templatelocal_patterns_result<op_t>(a nested class could not carry a deducibleupdate_traitsspecialization).The host engine changed its plumbing, not its loops: M9a’s per-shape items moved into the installed
host_source<op_t>unchanged, andcount_ownednow runsmax_pattern_binsbins per thread with one type-erased call per source (the source’s own handle bounds the bins to the Op’snum_bins, as M9a’shost_count_bins<num_bins>did). The host backends have no performance gate (D3); their parity was taken again (parity/results/M9b.md1.2-1.3).The device phases keep a bin stride of max(num_bins, 30), M9a’s layout, so the built-ins’ memsets and read-backs are the same bytes; a user’s Op of more than 30 bins gets its own stride.
The keys shape skips the empty row of a dead id for an Op of a user (in the full count the sources are every id below the bound):
key()is called once per live hyperedge, so an Op that counts hyperedges is right. The built-in type 1 keeps M9a’s behaviour (C(0, 3) = 0 for them).The bins of a user’s Op are bounded and carry-checked on every backend; a bin outside
[0, num_bins)is aninvalid_argument_error(on cuda through the error word’s internal bit, named for a user’s Op). M9a’s built-in handle (sign only, unchecked unit adds) is kept for the built-ins throughlocal_patterns::builtin_op.The Op concept’s callbacks are detected with the Op’s real host bins handle, not a probe type: nvcc warned (error #177 under
-Werror) about a callback instantiated for a type no code calls it with, in an Op of an unnamed namespace, as a user’s would be. A device-only or host-only callback cannot be told by astatic_assert; nvcc reports it at the call (ADR 0058 section 3). The overloadcompute(res, h)without an Op is separate fromcompute(res, h, op)(a default argumentop_t{}was evaluated before the concept’s messages for an Op without a default constructor).“The drift check fails when a quoted line moves” is
ci/tutorial_quotes.py: every quote of a tutorial page (marked ranges,start-at/end-at, line ranges) carries a% quote:pin with the digest of the quoted text, andci/docs.shfails when the text changes, also when the markers stay; the two existing tutorials are pinned too (16 pins, no prose change).“The tutorial code is a test … in hosted CPU CI where the header allows”: the extension header needs nvcc, so the engine’s runs of the tutorial (
tutorial_test.cu) build in CUDA builds only (gpu_local; the hosted cuda-build compiles them); the host half (tutorial_host_test.cpp: the Ops’ callbacks driven by hand onaccess_rows(), against the brute force and triad_count) runs in the CPU jobs.Doxygen:
MACRO_EXPANSIONwithEXPAND_ONLY_PREDEFand the CUDA qualifiers and__CUDACC__predefined, so the.cuhheaders are read as plain C++; the listing of every other header is unchanged (the API baseline differs only by the experimental sections and the header comment).Stage names: the experimental flavor’s stages are
count_local_patterns.*; triad_count’s staytriad_count.*(the benchmark suites use them).The compile-failure tests through nvcc carry the label
gpu(they need nvcc, no device), soctest -L gpuinci/gpu_local.shruns them; the host-compiler cases arecpu.DYNG_HDis defined by the installed header too (identically to the privateoperators/execution.hpp, a benign redefinition), withDYNG_HD_INLINEfor the inlined set helpers (the built-ins’__host__ __device__ __forceinline__).
Measurements and checks#
(parity/results/M9b.md section 1.)
The built-in kernels: the five counting kernels of the parity-cuda
counters.cu.oare identical to M9a’s merge build (6716eec) byparity/triad_sass.py compare(normalized SASS digest, instruction counts, every loop, registers 14 / 39 / 40 / 37 / 22, no stack, no local memory, the same shared memory); the-res-usagelines equal. No M9a gate is read again.count_local_patterns == triad_count, bit for bit:
compare.py triad_count --counter local_patterns --mode both: sequential 120/120 (make-test and the syn100k grid), openmp at 8 threads 120/120, cuda 120/120, every batch’s counts, deltas, removed / added and frontiers equal to triad_count’s and the counts equal to A’s goldens.CUDA parity unchanged:
--counter algorithm --mode bothon make-test, the syn1m s1 grid and coauth_b50k_s1: 84/84.Tests:
ctest -L 'triad_count|operators|testing'334 / 334 (the triad mutations detected on both engines),ctest -L experimental57 / 57;ci/gpu_local.shstepstriad,experimentalandgpu(GPU 1);ci/check.sh(after the harness fix); Clang 18 syntax 419 files; the fortified cpu-only build; the frozen headers against65a62c9: empty.
Machine time#
The replays: 26 minutes (sequential 17, openmp 5, cuda 1, the cuda algorithm replays 3), then
again from the final tree (30 minutes, under the CPU gate’s load); ci/check.sh about 45 minutes;
the gpu_local steps triad (37 minutes, the racecheck replays) and experimental (1 minute); the
SASS builds a few seconds each. Everything on GPU 1 under the shared lock; no timed reading.
Notes for step 2 (Python, the CLI, the wheels, the docs)#
count_local_patternshas no Python counterpart by design (python_gaps.md);dyng.update()over hypergraphs needstriad_countresults only.The hosted cuda-build compiles four more CUDA sources (
local_patterns_test.cu,tutorial_test.cu,triad_replay_local_patterns.cu, the two self-containment units) and the nvcc compile-failure cases are not compiled by it (they are tests). Record the ci-cuda13 compile time with them (criterion 7).The wheels do not install the
.cuhheaders (no C++ headers in the wheels); nothing to do.
Step 2: Python, the command line, the triad bins and the wheels (python-cli-wheels)#
Done (M9b acceptance criteria 5-7). dyng.triad_count and dyng.update() over hypergraphs in
Python, the triad bins as JSON (C++ and Python), dyng.testing.triad_reference, dyng triad_count compute|update with --format json|escher, and the three wheels. ADR 0059 records the design and
the new public names (D9, for the author). No library code of the algorithm, the engine or the
operators changed (only the manifest’s python key), so the built-in kernels are those of step 1
and no M9a gate needs a reading.
What was built#
Commit |
What |
|---|---|
|
|
|
|
|
|
|
ADR 0059, GOVERNANCE, CHANGELOG, |
|
the two bins tests that need triad_count moved from |
Deviations from the plan and the step’s text (each with the same intent)#
The container parameter is named
hypergraphindyng.triad_count.computeandupdate(PLAN 5.4’s table writesgraph): the uniform-contract test reads the expected name from the registry’scontainer.dyng.update(graph, batch, *results)keeps its frozen parameter name and takes either container.Patternis anenum.StrEnum, the first public enumeration class of the typed layer (PLAN 5.5’skind=str|enum); every function still takes the names (PLAN 5.4 rule 5), and a member is its name.PatternName(theLiteral) andMAX_BINSare new names beside it.Result.countsis a read-only NumPy copy (the step’s text), not adyng.Arrayas the other results’ arrays;Stats.deltahas the result’snum_binsvalues (C++: 30). Both inpython_gaps.md.--format escherprints the whole of A’s output for a file input, not only the count lines: theHypergraph:line and theBatchlines are reproduced too, so the diff against A’s stdout is of every line but the five its generator prints for a generated input (the test removes that block). The[GPU]prefix is A’s text on every backend.The read flags and two flags that are not fields. The
.hgread flags are generated fromdyng.io.read_hypergraph’s keywords; itsoptions=is--read-options(a flag--optionswould read as the algorithm’s options), and--min-initial-payload NbuildsCapacityPolicy.escher_gpu(N)(A’s--payload-capacity, needed for A’s ids). The flag generator now unwrapsX | Nonefirst and gives a union with oneLiteralits choices; no existing flag changed (none had such a hint; the CLI tests and the documented-flags test pass).A
.dgbrecording’s expected ids are checked bydyng triad_count update(a mismatch exits with status 1): without it a hypergraph built with other properties than the recording’s would delete other hyperedges silently.The triad bins are a C++ writer and reader (tracked,
result_io.hpp) with a JSON parser of their own (no third-party code) and, as PLAN 5.7 asks of every reader, a libFuzzer target; the ninth target lowers the fuzz workflow’s dispatch limit from 750 s to 660 s per target.dyng.testing.triad_referencebinds ADR 0049’s oracle, so the Python tests check against it and against a pure-Python brute force (which classifies triads by the documented table of canonical Venn ids, independent of both).The diff against A’s stdout needs the golden set (367 MB,
$DYNG_SCRATCH): the test skips without it; hosted CI runs the fixture variant (the four synthetic groups regenerated, recorded as.hg/.dgbfiles and replayed through the CLI against the committed counts).The wheels were written to
$DYNG_SCRATCH/wheels/m9b-step2-plugins(DYNG_PLUGIN_OUT), so M8b’s records in0.3.0.dev0-pluginsstay as they were for the growth comparison.The first install test found a test bug:
test_results_on_cudabuilt its “host” hypergraph without resources, which under a plugin module are the cuda defaults; it now namesResources.sequential(). The wheels were not rebuilt (the bug was inpython/tests, which the install tests read from the tree);DYNG_PLUGIN_TEST_ONLY=1reran every install test.The first
ci/check.shfailedformatandscaffold: four new C++ files were not clang-formatted (the formatter of the environment, 22.1.8, differs from what was typed), and the scaffold check builds the library without triad_count (DYNG_ALGORITHMS), where two tests indyng_io_tests(the pattern names againsttriad_count::to_string(), a result’s round trip) did not link: they are indyng_triad_count_bins_testsnow, built with the algorithm. The io module itself never depended on triad_count (its own list of names, checked by that test). The second run passed every step.
Measurements and checks#
(parity/results/M9b.md section 2.)
--format escher== A’s unpatched stdout: all 60 stdout files of make-test (15 groups x 4 executables), empty diff; the expected ids of every.dgbrecord matched.Python == A: the committed make-test counts on sequential, openmp and cuda (both plugins); both oracles after every batch; Hypothesis “update chain == compute”.
Wheels:
dyng2.10 MB (+5.6 % since M8b),dyng-cu128.67 MB (+4.8 %),dyng-cu138.58 MB (+4.8 %), all far below 90 MB;pytest -m gpu69 passed with each plugin and Python; the smoke test runs triad_count compute and a two-result update on GPU 1.ci-cuda13: 216 s wall, 94.2 CPU-minutes (+1.6 against M9a’s merge measured the same way); the hosted job took 10.5-12.7 minutes at M9a’s head, against its 120-minute timeout.
Tests:
ci/check.shall steps (the second run; cpu-only 1,273, dev 1,306, python 715 passed); the CPU wheel in a fresh venvpytest -k triad78 passed;ci/gpu_local.shstepplugin; Clang 18 syntax 445 files; the fortified build; the frozen headers against65a62c9andorigin/main: empty;ci/api_check.shgreen.
Machine time#
The wheels 4.5 minutes (the core wheel and both plugins, up to the first install test’s failure),
then the install tests of both plugins on both Pythons again after the test fix (5 minutes);
the two ci-cuda13 builds 4 minutes each; the portability builds 10 minutes (twice); ci/check.sh
30 minutes (twice); ci/python.sh 1 minute; the golden diff 35 s. Everything under the shared lock, the GPU work on GPU 1; no timed
reading.
Notes for step 3 (the docs, the examples, the API review and the freeze)#
The API review covers
dyng.triad_countas built here (ADR 0059 section 5 lists its names) anddyng triad_count’s flags; freezing them means: the manifest’s maturitystable(withorigin), the API snapshot section oftriad_count.hppfrozen, griffe’s baseline the reviewed names, anddocs/api/cli.md’s table the frozen flags.examples/python/triad_count.pycan followtest_plan_examples.py::test_triad_count_example; the tutorial “Hypergraph triads” can quotedyng.triad_count’s docstring example and the CLI’s--format escher(the make-test fixture’s groups give real output without the golden set).The triad-bins JSON is tracked (io); whether its format version 1 is stable from 0.3.0 belongs with the
.hg/.dgbline of the Open decisions.
Step 3: the docs, the freeze and the release checks (docs-freeze-release)#
Done (M9b acceptance criteria 8-10, and the final check of all ten). The algorithm page with
every PLAN 9.5 section, the tutorial “Hypergraph triads” in C++ and Python, the two examples, the
ESCHER-GPU history page, and the triad_count API review and freeze (ADR 0060). The review found
one library defect (host allocation failures of compute(), update() and clone() left the
library as std::bad_alloc) and fixed it in b732aa9; with that, and with steps 1 and 2, the
library was no longer the one M9a’s gates measured, so every M9a timing and memory gate was
read again on M9b’s library with M9a step 5’s protocol: both suites passed, the replays are
exact on the whole coverage table, and the dry 0.3 certificate passes over the new records.
What was built#
Commit |
What |
|---|---|
|
the header’s documentation amendments (the stats of types 1-3, |
|
the manifest’s maturity |
|
|
|
|
|
|
|
ADR 0060, the freeze tests of both API checks, the Python docstrings, the sketch frozen |
|
CHANGELOG, GOVERNANCE, plan.md, the roadmap; ADR 0060’s demonstrations |
|
|
Deviations from the plan and the step’s text (each with the same intent)#
The gates were read again, not carried over. The step allowed the carry-over only if the measured library scope was otherwise unchanged (certify’s library-scope diff); it was not (step 1’s driver and engine move, step 2’s triad-bins reader, this step’s fix), and
certify.pyrefuses M9a’s records at this tree (“measured commit 2eda830 does not have the release’s code”; the replays likewise). Every gate of both suites was read onb732aa9from a clean clone with M9a step 5’s protocol (parity/results/M9b.md3.1-3.3): 45 / 45 and 11 / 11.A first timing execution was stopped after its first case when the review found the allocation defect (a library change); its partial records were moved aside, unused.
The review changed the library (
b732aa9, finding 7), where ADRs 0035 and 0047 changed only documentation: the header promisedout_of_memory_error, the code letstd::bad_allocout. No signature changed; the counting kernels are SASS-identical; the gates and replays were read on this library.A container defect is reported, not fixed (ADR 0060 finding 8, D13): a host allocation failure inside
cpp/src/hypergraph’s OpenMP regions ends the process. A fix is M8b’s code, outside this step and behind an ADR 0024 reading; the allocation test leavesupdate()out with the reason in its source.The Python half of the freeze has no baseline file:
ci/api_check.shcompares with the base branch, sodyng.triad_countis checked by griffe from its merge intomain; until thenci/tests/test_api_check.pypins three breaking changes, and the demonstration used the freeze commit155f4efas the base. A renamed keyword-only parameter ofcompute()is not a breaking change for griffe (absorbed by**kwargs), so the test renamesupdate()’s positional parameter.The examples share their output: both print the same eight lines, so one expected file (
examples/data/triad_count_update.expected.txt, equal to a brute force) checks the C++ program in the tree and against the installed package and the Python program in pytest. The example data live inexamples/data/(notcpp/tests/data, whose sets are fixtures of an original infixtures.toml; 1.1 KB).“Built and run against the installed package in CI”: the in-tree examples link the build’s
dyng::dynglike the others;ci/cmake_consumer.sh(theconsumerstep ofci/check.sh, and ofci/gpu_local.shon cuda) buildstriad_count_update.cppwithfind_package(dyng)againstcmake --installand compares its output on every backend of the build.The 30-bin table is tested from the page:
TriadCountDocs.*parses the page’s table and checks it against the engine’s Venn table and the oracle’s representatives (the “generated from or tested against” of the step: tested).The “Paper vs fixed code” quotes ESCHER-GPU’s
CHANGES.md(E-C1, E-C3, E-C7 are recorded there; the README states the closed-triad scope, quoted in section 1 of the page). Marked for the author’s review (D10).compare_output.cmaketakes its arguments with|: a;inside a-Dargument ofadd_testsplits it.
Measurements and checks#
(parity/results/M9b.md section 3; the checks in section 4 there.)
Gates on
b732aa9: timing 45 / 45 (update per batch 0.861-1.031, full count 0.999-1.003, end to end 0.920-0.991); memory 11 / 11 (store 1.0000 at every gated point, the Nsight Systems peak 1.0015-1.0021); no audit flag; 8 rounds repeated by the monitor (foreign load).Replays on
b732aa9, both modes: cuda 300/300, sequential 120/120, openmp 142/142 at 8 and 1 threads. The dry 0.3 certificate PASSED over them.SASS of the five counting kernels: identical to M9a’s merge build.
ci/gpu_local.sh: all 21 steps passed (ctest -L gpu861 / 861, the sanitizers, the triad and count_local_patterns steps, the cu13 plugin wheel, clang-tidy); the three wheels:dyng2.10 MB,dyng-cu128.67 MB,dyng-cu138.58 MB (+5.7 / +4.8 / +4.8 % since M8b), their install tests on both Pythons (pytest -m gpu69 passed,DYNG_CPU_ONLY=1719 passed).ci/check.sh: all checks passed (cpu-only 1,279, dev 1,312, harness 349, python 719 passed);ci/docs.sh-W, the link, snippet and quote checks;ci/api_check.shno breaking change againstorigin/main; Clang 18 syntax 429 files, 0 failures; a fresh clone: cpu-only with-D_FORTIFY_SOURCE=3and no nvcc, no warning, 1,279 / 1,279; parity-cuda,ctest -L 'triad_count|experimental|examples'397 / 397 on GPU 1, and the consumers (the triad example on sequential, openmp and cuda; the user Op by nvcc).
Machine time#
What |
Time |
|---|---|
the parity-cuda build of the measurement clone (twice: |
15 min, 2 min |
the timing suite (stopped once after its first case, then in full) and the memory suite |
06:42-07:23 and 07:32-07:39 CDT (exclusive lock on GPU 0; the memory readings on GPU 1) |
the replays (cuda 3 jobs, sequential 6, openmp 8 threads 3, 1 thread 10; concurrent, the shared lock) |
41, 15, 12 and 31 min |
|
about 40 min; 4 h 0 min (07:44-11:44 CDT) |
the fresh clone (cpu-only fortified; parity-cuda and its tests) |
10 and 15 min |
the three wheels and their install tests ( |
9 min |
The M9b review (2026-10-21)#
Independent reviewers checked a71954c through three lenses (an outside Op author, the truth of
the Python, CLI and docs claims, the freeze and release readiness), and a skeptic confirmed each
finding. Every confirmed finding was fixed in this milestone except D13’s library fix, which is
the author’s decision (below). Records: parity/results/M9b.md section 5.
The findings and their fixes#
# |
Finding (severity) |
Fix (commit) |
|---|---|---|
1 |
The branch lacked main’s M9a review fix |
|
2 |
A |
|
3 |
The ids of a call are unordered, so an Op that assumes |
stated in the concept’s Doxygen ( |
4 |
The tutorial test never ran core_triads or hub_pairs through update(); no insert_first, insertion-only, deletion-only or empty batch (medium) |
every Op updated (a second |
5 |
nvcc printed the concept messages’ backticks as |
single quotes; the compile-failure tests match the quotes literally under both compilers ( |
6 |
No limit on the Op’s size: an Op over ~32 KB failed in the engine with a mangled-name error (low) |
|
7 |
No portable way to give an Op data of the user’s own (low) |
documented: a pointer into the memory of the result’s backend, valid for the result’s lifetime ( |
8 |
The tutorial’s CI claims, section 8’s cpu-only commands, section 5’s untested CMake block (low) |
the claims name |
9 |
“the 9 of bin 29” (8) (medium) |
|
10 |
The algorithm page credited M9b’s reading with M9a’s recorded figures; D12 understated (medium) |
the page and the D12 row quote M9b’s latest reading, the review’s ( |
11 |
The README status table said triad_count “planned (0.3, M9)” (medium; two reviewers) |
a working row and an experimental row ( |
12 |
Two gate-table cells differed from M9a’s record (low) |
0.868-1.002 and 152-161 ms ( |
13 |
The CHANGELOG’s Added entries said experimental and tracked while Changed said stable (low; two reviewers) |
“stable from 0.3.0, pending the author’s confirmation” ( |
14 |
|
a message naming the hypergraph result, a test that matches it; both python_gaps rows ( |
15 |
Untested tutorial claims: the brute force, the Python example on cuda, the CLI output (low) |
a brute-force rebuild of the expected output, the cuda parametrization (marker gpu), the console blocks of both pages run and compared ( |
16 |
ESCHER-GPU’s figures attributed to its README, not |
|
17 |
The documented |
a CHANGELOG “Known issues” entry and notes on the triad_count and hypergraph pages ( |
18 |
GOVERNANCE listed D4 twice and the triad-bins format in the wrong row (low) |
one D4 row; the format with the .hg / .dgb row ( |
19 |
The records called M9a’s merge pending (low) |
plan, roadmap and this retrospective ( |
20 |
The ci-cuda13 margin was extrapolated from warm-ccache hosted runs (low) |
measured again (94.7 CPU-minutes) with a cold-cache estimate of about 24 minutes, a margin of about 90-95 minutes ( |
21 |
The SASS identity records carried no provenance (low) |
|
Deviations and what the review found beyond the findings#
The gates were read again, not carried over. The fixes of findings 2, 3, 5, 6 and 7 are in
cpp/include/dyng/experimental/, insidecertify.py’s library scope, so step 3’s readings atb732aa9no longer certified the head. No code compiled into libdyng or the measured tools changed, and the five counting kernels stayed identical to M9a’s merge build (SASS, registers, memory:M9b-sass-review.json), but the plan’s rule is mechanical and certify.py has no exception for documentation orstatic_assertchanges (its METADATA_PATHS cover the generated algorithm metadata only); widening it would change the certification policy, which is not a fix of this round. So every M9a timing and memory gate and the replays of every backend were read again onc83cebfwith M9a’s protocol: 45 / 45 (0.862-1.033) and 11 / 11 (1.000-1.002), 300 / 120 / 142 / 142 exact, the dry 0.3 certificate passed. About 2 hours of machine time.D13 is wider than recorded. The review recorded the terminate for
threads > 1and more than 1,024 rows; a test of an exception that leaves#pragma omp parallel for ... if (false)under GCC 12 shows that the region is still a region and the process ends (terminate called after throwing ...), so every build with OpenMP is affected on the sequential backend too, with any thread count, and also the line graph’s build (flat_adjacency.cpp) at construction. The CHANGELOG, the pages and the D13 row say so. The fix (catch inside each region, rethrow after it) is still the author’s: 0.3.0 or 0.3.x.The wheels were not all rebuilt. The review changed no native code that goes into a wheel (the experimental headers’ checks are instantiated only by a user’s Op; the Python change is pure Python), so the sizes of section 2.3 and step 3 stand;
ci/gpu_local.shrebuilt thedyng-cu13plugin and ran its tests on GPU 1 (8,581,398 B, 2 bytes from step 3’s;pytest -m gpu70 passed;parity/results/M9b.md5.8).tutorial_test.cugrew (both reuse orders, six batches, the second update chain, the counter-example), which the ci-cuda13 reading includes (+0.5 CPU-minutes).
The milestone#
The acceptance criteria of M9b, checked at the end#
# |
Criterion |
Where |
State |
|---|---|---|---|
1 |
the experimental header (banner, group, |
step 1; ADR 0058; results 1 |
met |
2 |
packaging: the |
step 1; results 1.4; ADR 0060 (the experimental change reported, not failed) |
met |
3 |
the four built-in kernels SASS- and resource-identical to M9a’s merge build (step 1 and the final build); the built-in Ops equal triad_count bit for bit on make-test and syn100k on every backend; CUDA parity on make-test, syn1m s1 and coauth_b50k_s1 unchanged. M9a’s records could not be carried over (the library scope changed), so every M9a gate was read again: passed |
results 1.1-1.3, 3.1-3.3 |
met |
4 |
the Op tutorial: a pattern not in the enum, the 1-bin triangles Op against |
step 1 |
met |
5 |
Python: |
step 2; results 2.2; the plugin step of |
met |
6 |
the CLI with flags from the fields, triad bins as JSON in a round trip, |
step 2; results 2.1 |
met |
7 |
the wheels <= 90 MB with their growth, the plugin smoke test with triad_count on GPU, the ci-cuda13 compile time with its margin |
step 2; results 2.3, 4 |
met |
8 |
the docs: the algorithm page with every PLAN 9.5 section (the tested 30-bin table, requirements per pattern, the template mapping, the paper differences, “Paper vs fixed code”, the mapping, the gate table), the tutorial “Hypergraph triads” in C++ and Python, tested, the two examples (<= 60 lines, built and run against the installed package), the README catalogue, the CHANGELOG, |
step 3 |
met |
9 |
the API review ADR (0060) with every new public name; the maturity |
step 3; ADR 0060 |
met |
10 |
|
step 3; results 3-4 |
met |
After the M9b review, criteria 3 (the kernels identical, the gates and the replays read again on
c83cebf), 4 (every Op under updates), 7 (the ci-cuda13 margin, cold) and 10 (ci/check.sh,
ci/gpu_local.sh, fresh clones, the dry certificate) were checked again: all met
(parity/results/M9b.md section 5).
Deviations of M9b from the plan (the milestone)#
PLAN 6.4.6 / 11.3:
count_local_patternsships in 0.3 (the plan’s 0.5 for the extension point), as experimental, on triad_count’s own driver and engine (ADR 0058); triad_count is frozen at M9b’s end, not at M9a’s (D2, D4).PLAN 5.5:
kind=takes a string or aPatternStrEnum(the typed layer’s first public enumeration class);Result.countsis a NumPy copy; the container parameter ishypergraph(ADR 0059).PLAN 8.6 / criterion 3: the gates were read again rather than carried over (the library scope changed), with the same verdicts as M9a’s.
The review’s library fix and the container defect it exposed (ADR 0060, findings 7 and 8).
Effort#
M9b’s three steps ran on 2026-10-21 (CDT), one day of wall-clock time, most of it machine time (the replays twice in step 1, the wheels in step 2, the gate readings, the replays and the full GPU gate in step 3).
Open items#
Hosted CI has not run on this branch (nothing is pushed); the pull request is the orchestrator’s.
D13 (above), and the names and maturity pending at 0.3.0.
Ready-to-paste pull request summary#
## M9b: count_local_patterns, triad_count in Python and on the command line, the docs and the freeze (0.3)
Follows M9a (#16, merged as `4cc5c3f`; `main` is merged into this branch). Completes M9 (PLAN 11.3; the author's decision D2): with M8a, M8b and M9a it
is the content of 0.3.0.
**`experimental::count_local_patterns<op_t>`** (`<dyng/experimental/local_patterns.cuh>`, nvcc
only; EXPERIMENTAL PUBLIC, may change in any minor release; ADR 0058): count a hypergraph pattern
of your own, an Op over the triangles, pairs or hyperedges of the line graph, with triad_count's
wedge engine, exact under hyperedge batches on cuda, sequential and openmp. The four patterns of
triad_count are built-in Ops of the same engine; their counting kernels are SASS- and
resource-identical to M9a's. Tutorial: "Count a new hypergraph pattern (an Op)".
**Python and the command line** (ADR 0059): `dyng.triad_count` (compute, update, Options, Result,
Stats; `kind` as a string or `Pattern`), `dyng.update()` over hypergraphs (several results, one
commit), `dyng.io` triad bins as JSON, `dyng.testing.triad_reference`; `dyng triad_count
compute|update` with `--format escher`, byte for byte against ESCHER-GPU's unpatched output on all
60 make-test cases. Wheels: dyng 2.1 MB, dyng-cu12 8.7 MB, dyng-cu13 8.6 MB.
**The freeze** (ADR 0060, the API review): `<dyng/triad_count.hpp>`, `dyng.triad_count` and `dyng
triad_count` frozen, maturity `stable` from 0.3.0 (the plan's default D4, pending the author's
confirmation at the release). **api-change**: the header moves from tracked to frozen; no
signature changed. The review fixed one defect (host allocation failures of compute, update and
clone are `out_of_memory_error`, as documented) and reports one in the container (D13).
**The review** (21 confirmed findings, all fixed; `parity/results/M9b.md` section 5): `main`
merged in (M9a's OpenMP=OFF test fix); `DYNG_EXPERIMENTAL_CHECK_HOST_CALLBACKS` (nvcc does not
report a `__device__`-only callback, which would end a host backend's run with exit 1); the Op
size limit `max_op_size`; nvcc-readable concept messages; the Op contract states that a call's
ids are unordered, with a tested counter-example; the tutorial updates every Op under both
id_reuse orders; docs, CHANGELOG, README, GOVERNANCE and records corrected; a "Known issues" entry
for D13.
**Docs**: `docs/algorithms/triad_count.md` (the 30-bin table tested against the code, requirements
per pattern, differences from the paper, "Paper vs fixed code" for the author's review: D10, the
gate record), the tutorial "Hypergraph triads" (C++ and Python), `examples/cpp/triad_count_update.cpp`
and `examples/python/triad_count.py` (run in CI, the C++ one against the installed package),
`docs/history/escher_gpu.md`.
**Gates, read again on M9b's final library** (`c83cebf`, after the review; the library scope
changed since M9a's readings; ESCHER-GPU re-measured in the same session, GPU 0, base clock lock,
M9a's protocol):
| | coauth-DBLP 50K s1-s3 (11 rounds) | syn1M / syn2M 50K s1-s3 (21 rounds) | bar |
|---|---|---|---|
| update, each of 3 batches | 0.951-0.971 | 0.862-1.033 | 1.05 |
| full count | 0.999 | 1.002-1.003 | 1.05 |
| end to end | 0.940-0.942 | 0.959-0.992 | 1.10 |
| store accounting (every gated point) | 1.0000 | 1.0000 | 1.05 |
| Nsight Systems peak of live allocations (D1) | 1.0015 | 1.0021 / 1.0016 | 1.05 |
Parity (exact, by key and by content, on M9b's library): cuda 300/300, sequential 120/120, openmp
142/142 at 1 and 8 threads; the dry 0.3 certificate of triad_count passes
(`parity/results/M9b-gates/`).
**Checks** (at the review's head): `ci/check.sh` all passed; `ci/gpu_local.sh` all 21 steps passed on GPU 1 (`ctest -L gpu` 866 / 866; memcheck, synccheck, racecheck and initcheck clean, the triad and count_local_patterns steps included); a fresh clone
(CPU-only fortified without nvcc: 1,280 / 1,280; parity-cuda: the triad, experimental and example
tests 403 / 403, the installed-package consumers on every backend); Clang 18 syntax; `ci/docs.sh`
-W; the API checks and their deliberate-change demonstrations; frozen headers unchanged
(`git diff 65a62c9 -- cpp/include/dyng/{hypergraph,update.hpp,core,graph}` empty, also against
`main`).
**For the author** (GOVERNANCE.md, open decisions; the list in
`docs/developer/retrospectives/M9b.md`): D4 (triad_count stable), D9 (the new public names, ADR
0060), D10 (the paper-vs-fixed wording), the hypergraph and file-format stability of M8b, D6-D8,
D11, D12, and the new D13. ADRs 0058-0060. Records: `parity/results/M9b.md`. Merge with a merge
commit.
🤖 Generated with [Claude Code](https://claude.com/claude-code)