Skip to content

feat: add invalidate_cache() to R interface#2416

Merged
krlmlr merged 6 commits intomainfrom
copilot/add-igraph-invalidate-cache
Oct 26, 2025
Merged

feat: add invalidate_cache() to R interface#2416
krlmlr merged 6 commits intomainfrom
copilot/add-igraph-invalidate-cache

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 26, 2025

Exposes igraph_invalidate_cache() from the C library to R for debugging cache-related bugs. Without this function, determining whether user-reported bugs are cache-related from R was not possible.

Changes

  • Added invalidate_cache() function in R/interface.R wrapping the existing invalidate_cache_impl()
  • Added tests in tests/testthat/test-interface.R covering basic functionality and error cases
  • Generated documentation with roxygen2, exported in NAMESPACE under "low-level operations" family
  • Updated pkgdown configuration in _pkgdown.yml to add new "Low-level operations" subsection under Utilities

Usage

g <- make_ring(10)
is_simple(g)  # TRUE - cache populated

# For debugging: invalidate cache to verify results unchanged
invalidate_cache(g)
is_simple(g)  # TRUE - recalculated

# If results differ after invalidation, indicates a cache bug

The underlying C implementation and R bindings already existed; this PR provides user-facing access with proper documentation and categorization as a low-level utility function for debugging purposes.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add igraph_invalidate_cache() to R</issue_title>
<issue_description>This is necessary for debugging. I think this should be high priority. Without this, we won't be able to determine if a user-reported bug is cache-related from R. Such bugs should be very rare, but when they occur they are painful to debug.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits October 26, 2025 13:11
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Copilot AI changed the title [WIP] Add igraph_invalidate_cache() function to R feat: add invalidate_cache() to R interface Oct 26, 2025
Copilot AI requested a review from krlmlr October 26, 2025 13:17
@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented Oct 26, 2025

@copilot: Agent instructions are updated, adapt. This is not a structural query, rather a low-level utility function. Needs a new family and adaptation to the pkgdown site index.

Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 26, 2025

@copilot: Agent instructions are updated, adapt. This is not a structural query, rather a low-level utility function. Needs a new family and adaptation to the pkgdown site index.

Changed from "structural queries" to "low-level operations" family and added new section in pkgdown configuration. (84ac7d1)

@krlmlr krlmlr marked this pull request as ready for review October 26, 2025 20:31
@krlmlr krlmlr enabled auto-merge (squash) October 26, 2025 20:31
@krlmlr krlmlr removed their assignment Oct 26, 2025
@krlmlr krlmlr merged commit b37cf8e into main Oct 26, 2025
5 checks passed
@krlmlr krlmlr deleted the copilot/add-igraph-invalidate-cache branch October 26, 2025 20:50
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.

Add igraph_invalidate_cache() to R

2 participants