You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Its application algorithms extract the native pointer and work directly with the tskit C API.
It currently carries tskit 1.1.2 in-tree, so it owns the ongoing upgrade and security burden.
This validates RcppTskit’s basic design: downstream packages should be able to receive a TreeSequence$xptr, safely access tsk_treeseq_t in compiled code, and avoid implementing their own loader, finalisers, vendoring workflow, and routine wrappers.
Concrete lessons for RcppTskit
The largest missing downstream-oriented capability is tree iteration. gaia keeps a tsk_tree_t next to its tree sequence because its algorithms repeatedly traverse local trees. RcppTskit should eventually offer either:
a safe public C++ example for constructing and iterating tsk_tree_t from TreeSequence$xptr; or
an owned tree-iterator wrapper that preserves its parent tree sequence for its entire lifetime.
The lifetime requirement matters: a child tree or iterator must not outlive the tree sequence it references.
gaia also demonstrates the value of bulk table access. Returning nodes or edges as R data frames is useful for inspection and analysis.
Activity
gregorgorjanc commentedon Aug 20, 2026
gaia implements almost exactly the infrastructure RcppTskit is meant to centralise:
It vendors and compiles its own copy of tskit.
Its S4 treeseq object stores external pointers to both a tsk_treeseq_t and a current tsk_tree_t: treeseq_class.R.
It manually allocates, wraps, finalises, and frees those structures: tsk_treeseq_load.c.
It writes separate C wrappers that copy tskit tables into R data frames: tsk_table_nodes.c, tsk_table_edges.c.
Its application algorithms extract the native pointer and work directly with the tskit C API.
It currently carries tskit 1.1.2 in-tree, so it owns the ongoing upgrade and security burden.
This validates RcppTskit’s basic design: downstream packages should be able to receive a TreeSequence$xptr, safely access tsk_treeseq_t in compiled code, and avoid implementing their own loader, finalisers, vendoring workflow, and routine wrappers.
Concrete lessons for RcppTskit
The largest missing downstream-oriented capability is tree iteration. gaia keeps a tsk_tree_t next to its tree sequence because its algorithms repeatedly traverse local trees. RcppTskit should eventually offer either:
a safe public C++ example for constructing and iterating tsk_tree_t from TreeSequence$xptr; or
an owned tree-iterator wrapper that preserves its parent tree sequence for its entire lifetime.
The lifetime requirement matters: a child tree or iterator must not outlive the tree sequence it references.
gaia also demonstrates the value of bulk table access. Returning nodes or edges as R data frames is useful for inspection and analysis.
gregorgorjanc commentedon Aug 20, 2026
@LynxJinyangii implemented iterator in #132 so that would then cover the suggestions and I logged data.frame export.