Graph unit tests — the CSR and the PageRank kernel, built and run by CI
- Dominant language
- C++
- Stars
- 2.1k
- Forks
- 125
- Avg merge
- 5h 42m
- Merged PRs (30d)
- 136
Description
## What is missing
`CONTRIBUTING.md` §2 rejects a change automatically when "the CSR property test fails" — but no gate
and no CI job builds the CSR or PageRank test targets. They sit behind `-DRIPWIRE_TESTS=ON`, which
CI never sets, and nothing runs `ctest`. A rejection criterion that nothing measures is not a
criterion. The job is unit tests for the CSR call graph, for the PageRank kernel and its wrappers,
and the gate that makes CI build and run them.
## The evidence
Because nothing builds them, `test/verify_pagerank.cpp` had not compiled since `2bbd134d`
(2026-08-17), the commit that changed `pageRankDouble` to return `PageRankRun`; line 65 still
assigned the result to a `const unsigned`. That one line is fixed in the pull request that adds this
kit, so the targets build today:
```
cmake -S . -B -DRIPWIRE_TESTS=ON
cmake --build --target ripwire_test_pagerank ripwire_test_csr -j 4
ripwire_test_pagerank -> 1 test case, 16 assertions, SUCCESS
ripwire_test_csr -> 2 test cases, 23 assertions, SUCCESS
```
The kit itself carries:
- **A coverage inventory**, with file:line, for every branch in the CSR build and the kernel —
including the single `DEGRADED_PATH_ALERT`, the silent fallback in `biasPrior`, and the conditions
that are unreachable or untestable at unit scale.
- **43 specified tests**, plus one optional environment-ceiling arm: C1–C6 (CSR structure and
`verifyCsr`), G0–G10 (the graph `buildGraph` produces), K0–K17 (the kernel), B1–B3 and R1–R5 (the
wrappers). Every expected value is an exact CSR array, a closed form or a tolerance band, and each
was checked three ways — an exact rational solve, the plain-Python reference included in the kit,
and a scratch run of the real kernel.
- **The tolerance arithmetic.** The shipped damping is `double( 0.85f )`. A band of 1e-5 is provably
safe at τ = 1e-6, and 1e-12 at τ = 1e-13. At the shipped settings 90 iterations is the worst case
and a fixture reaches it, so the ceiling of 100 is never hit.
- **The CI wiring**: a `test/csrpagerankcheck.sh` gate modelled on `test/strkerncheck.sh`, with a
presence arm, a G1 sanitizer arm, an NDEBUG arm and a mutation arm that must go red, plus
registration in `test/regression.sh` and `test/binoverridecheck.sh`, the generated gate count, and
which CI legs run it.
## Size
**Medium.** The expected values are already derived and cross-checked, so the work is writing the
tests, the gate and its mutation arm, and the CI registration — not the numerics.
## Where to start
`prompts/help-wanted/graph-unit-tests.md` is a self-contained prompt for a coding agent. Like every
prompt in `prompts/`, **it ends by writing a plan and stopping** — the first deliverable is the plan
(which tests to add, extend or drop, and the gate's arms and mutations), and a maintainer agrees it
before any code is written.
Related kits: `prompts/help-wanted/correctness-fuzzers.md` covers random-input oracles and its
criterion 7 asks for the same gate; `prompts/help-wanted/certified-ranking-order.md` expects to add
a residual to `PageRankRun`.
Comment here to claim it.
Contributor guide
Research direction
Read prompts/help-wanted/graph-unit-tests.md first, then compare the proposed test/csrpagerankcheck.sh gate with test/strkerncheck.sh and inspect test/regression.sh and test/binoverridecheck.sh. The first deliverable is a maintainer-reviewed plan covering the CSR, PageRank, wrapper tests, gate arms and mutations. Done means the tests build and run through the registered CI gate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, shell
- Domain
- build-system, ci-cd, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100