Skip to content

test: Pin the results that the igraph C core 1.0 changes - #2997

Merged
krlmlr merged 2 commits into
claude/f1-leiden-directed-testsfrom
claude/f3-pin-engine-changes
Oct 18, 2026
Merged

krlmlr merged 2 commits into
claude/f1-leiden-directed-testsfrom
claude/f3-pin-engine-changes

Conversation

@krlmlr

@krlmlr krlmlr commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

This adds tests that pin what main computes today wherever the upcoming igraph C core 1.0 changes the result. Each test passes with the vendored C core 0.10.17 and fails with 1.0.1+, so when the vendoring series is rebuilt from main, the vendor commit that changes a behaviour has to flip its expectation, and every user-visible change shows up in the review diff. It is stacked on #2996.

What it pins

  • hits_scores() on an edgeless graph returns NaN without a warning, and on an undirected graph it does not warn and returns the expected value (test-centrality.R).
  • eigen_centrality() on two disconnected graphs does not warn and returns the expected vectors (test-centrality.R).
  • The cluster_infomap() code length on the karate graph (test-community.R).
  • The edge order of graph_from_adjacency_matrix() for directed input (test-adjacency.R) and of graph_from_biadjacency_matrix() for dense unweighted input (test-incidence.R).
  • The random streams of seeded sample_islands() (test-games.R), layout_with_gem() and layout_with_dh() (test-layout.R).

The ARPACK error wording is already pinned by an existing snapshot, so it needs no new test.

Also included

Commit dcfe7b3 from claude/f-nits (draft #2992) makes the eigen_centrality() stress test in test-centrality.R expect the "eigenvector centralities are nearly zero" warning and muffle only that one. The C core 1.0 emits it for most of the disconnected random graphs in that test, which printed hundreds of warnings on a passing test. The engine on main never emits it, so here the handler never fires and the test is unchanged in effect.

Checks

devtools::document() and air format change nothing. The six touched test files pass against a build of this branch: 241 blocks, 0 failures, 0 warnings, and the one existing skip (pcalg not installed).

LLM use: this PR was prepared with Claude Code (Claude Opus 5.5), at the maintainer's request. The pinning tests come from the subsession https://claude.ai/code/session_016jy2KuQGnR2SqMEUJ3dx35, and the stress-test commit from https://claude.ai/code/session_01L5n6BLiYoPmk3NFiYDSKZZ.

  • By submitting this pull request, I assign the copyright of my contribution to The igraph development team.

Generated by Claude Code

Each test passes with the vendored C core 0.10.17 and fails with 1.0.1+,
so the vendor commit that changes the behaviour has to flip the expectation,
and every user-visible change shows up in the review diff.

Pinned: `hits_scores()` on edgeless and undirected graphs,
`eigen_centrality()` on disconnected graphs,
the `cluster_infomap()` code length,
the edge order of `graph_from_adjacency_matrix()` and `graph_from_biadjacency_matrix()`,
and the random streams of `sample_islands()`, `layout_with_gem()` and `layout_with_dh()`.
The ARPACK error wording is already pinned by an existing snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jy2KuQGnR2SqMEUJ3dx35
…s test

Most random graphs in the stress test are disconnected,
so `eigen_centrality()` warns that some centralities are nearly zero,
which emitted hundreds of warnings on a passing test.
The test now checks that only this warning occurs and muffles it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5n6BLiYoPmk3NFiYDSKZZ
@krlmlr
krlmlr added this pull request to stack #3001 October 18, 2026 13:00
@krlmlr
krlmlr merged commit a1fb209 into main Oct 18, 2026
9 checks passed
@krlmlr
krlmlr deleted the claude/f3-pin-engine-changes branch October 18, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants