Skip to content

Conversation

@MEO265
Copy link
Owner

@MEO265 MEO265 commented Dec 28, 2025

Motivation

  • Provide a safe R-side S4 wrapper for the CUDD Cudd manager so R code can construct and manage a manager instance without leaking C++ memory.
  • Expose a simple, idiomatic R constructor and avoid the previously exported helper name new_cudd_manager.
  • Ensure proper lifetime management by creating the manager in C++ and registering an R finalizer that deletes the Cudd instance.
  • Address inline review comments to avoid importing the entire methods namespace and to follow R naming conventions for constructors.

Description

  • Added src/cudd_manager.cpp which implements c_cudd_new() that allocates a Cudd object, returns an external pointer, and registers a finalizer that deletes the Cudd instance.
  • Declared c_cudd_new() in src/rcudd.h and registered it in src/register.cpp (added the c_cudd_new entry to R_registerRoutines).
  • Added R/cudd_manager.R that defines the S4 class CuddManager, the constructor CuddManager() which calls .Call("c_cudd_new"), and a show method, and qualified S4 operations with methods:: instead of importing the namespace.
  • Updated package metadata and exports by adding Imports: methods to DESCRIPTION, exporting CuddManager in NAMESPACE, and refreshing generated man files (man/CuddManager-class.Rd and man/CuddManager.Rd).

Testing

  • Ran roxygen2::roxygenise() to refresh documentation after the API/name changes, which was executed after installing roxygen2.
  • Built the package with R CMD build . which produced Rcudd_0.0.0.9999.tar.gz.
  • Executed R CMD check --no-manual Rcudd_0.0.0.9999.tar.gz and the check completed successfully with Status: OK.

Codex Task

@codecov
Copy link

codecov bot commented Dec 28, 2025

Codecov Report

❌ Patch coverage is 87.78409% with 129 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.24%. Comparing base (5ee1eee) to head (0c44e54).

Files with missing lines Patch % Lines
src/cudd_manager.cpp 86.86% 109 Missing ⚠️
R/cudd_manager.R 91.38% 10 Missing ⚠️
R/cudd_bdd.R 90.00% 4 Missing ⚠️
R/cudd_add.R 89.66% 3 Missing ⚠️
R/cudd_zdd.R 88.89% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master       #3      +/-   ##
==========================================
- Coverage   93.06%   89.24%   -3.82%     
==========================================
  Files           8       15       +7     
  Lines         403     1458    +1055     
==========================================
+ Hits          375     1301     +926     
- Misses         28      157     +129     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

* Expose Cudd ADD constructors to R

* Add ZDD bindings and operators

* Refine diagram APIs and tests

* Expose EPD minterm output wrappers

* Expose diagram print helpers

* Add snapshot tests for diagram output

* Add BDD debug output helper

* Add BDD DOT dump helper

* Add manager controls for cache and verbosity

* Expand Cudd manager test coverage

* Track manager ownership for CUDD objects

* Silence lintr object length warnings

* Resolve native symbols before calling

* Use native symbols directly in .Call

* Bind native symbols without onLoad

* Force symbol usage in registration
@MEO265 MEO265 removed the codex label Dec 30, 2025
* Add BDD truth table helper

* Remove native symbol delayed assignments
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