Skip to content

Africadata#72

Merged
SebKrantz merged 5 commits intomasterfrom
africadata
Mar 22, 2026
Merged

Africadata#72
SebKrantz merged 5 commits intomasterfrom
africadata

Conversation

@SebKrantz
Copy link
Copy Markdown
Owner

No description provided.

github-actions Bot and others added 5 commits March 21, 2026 17:49
…s with nthreads > 1

The `everywhere({}, envir)` call was passing an R environment object to
mirai daemons, which is problematic for two reasons:

1. `envir <- environment()` created a self-referential circular reference
   in the local scope (the variable points to the same environment it lives
   in). When mirai/nanonext serializes the `run_assignment_core` closure
   for transmission to daemon workers, this circular reference causes
   serialization failures in newer versions of R/nanonext.

2. `everywhere({}, envir)` did not do what was intended — in mirai 2.x,
   the R environment object was passed as an unnamed `...` argument but
   was silently ignored by the empty `{}` expression. Serializing a full
   R environment for cross-process transmission is inherently fragile.

The `run_assignment_core` closures already capture all required data
(g, cost, from, to, dmat, etc.) from their enclosing scope via normal
R closure semantics. mirai correctly serializes these closures, so the
`everywhere` setup step is unnecessary.

Fixes #69

Co-authored-by: Sebastian Krantz <[email protected]>
@SebKrantz SebKrantz merged commit bd33b73 into master Mar 22, 2026
6 checks passed
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.

1 participant