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
Type: architectural-change / performance Difficulty: Hard Recommendation: Adapt
A six-PR series in the upstream repo (spanning 2026-05-16 to 2026-05-18) completely restructured the Rust state_store module and fn-memo engine subsystem. The structural PRs (#1981–#1983) isolated all LMDB-specific code under state_store/, split Store → AppStore + Storage, and hid TxnBatcher as an implementation detail. The behavioral PRs (#1987, #1990, #1991) then made all public state_store methods async fn, introduced a per-component FnMemoAccessor handle, and replaced on-demand per-fn DB reads with an eager-prefetch FnMemoCache that batches all writes in a single flush — dramatically reducing I/O per build.
Maps to recoco: crates/recoco-core/src/ (engine + state_store equivalent)
Recoco Considerations
Module restructure: Recoco's state store (currently organized differently) should adopt the Storage / AppStore split so LMDB-specific code is isolated behind a clean boundary — this will simplify a future swap to a different storage backend.
Async I/O: Upstream made every public state_store method async fn (currently synchronous LMDB calls returning immediately-resolved futures). Recoco should evaluate whether the same API-shape change is worth the cascade through engine call sites. The SDK's AppBuilder::build_blocking / App::open_blocking sync wrappers introduced here are a good pattern to adopt for #[test] entry points.
FnMemoCache performance: The eager-prefetch + single-flush cache is a pure performance improvement (O(1) prefix scan instead of O(N) per-fn point reads). This is high-value for recoco given its performance focus.
No PyO3 impact: Recoco has no Python bindings, so the rust/py/src/app.rs / rust/py/src/environment.rs cascade changes are irrelevant. The py.detach(|| get_runtime().block_on(...)) bridge pattern used in #1987 is not needed.
No blake3 opportunity in this specific series, but the LMDB key encoding under state_store/ should be verified against recoco's existing hashing choices.
Integration Notes
These PRs should be adopted in order (#1981 → #1982 → #1983 → #1987 → #1990 → #1991) since each builds on the previous. The structural rename from Store → AppStore propagates through many engine files — do a bulk rename pass first, then layer in the async and caching changes. The FnMemoCache prefetch strategy (one prefix scan at build start, one flush at commit) is directly adoptable and is the highest-value change in the series.
Upstream Change Summary
Type: architectural-change / performance
Difficulty: Hard
Recommendation: Adapt
A six-PR series in the upstream repo (spanning 2026-05-16 to 2026-05-18) completely restructured the Rust
state_storemodule and fn-memo engine subsystem. The structural PRs (#1981–#1983) isolated all LMDB-specific code understate_store/, splitStore→AppStore+Storage, and hidTxnBatcheras an implementation detail. The behavioral PRs (#1987, #1990, #1991) then made all publicstate_storemethodsasync fn, introduced a per-componentFnMemoAccessorhandle, and replaced on-demand per-fn DB reads with an eager-prefetchFnMemoCachethat batches all writes in a single flush — dramatically reducing I/O per build.Upstream References
FnMemoAccessorhandleFnMemoCachewith prefetch + flushRelevant Upstream Files / Areas
rust/core/src/state_store/(all files — new module split)rust/core/src/engine/app.rs,component.rs,context.rs,execution.rs,function.rsrust/core/src/engine/environment.rs,live_component.rsrust/core/src/inspect/db_inspect.rsMaps to recoco:
crates/recoco-core/src/(engine + state_store equivalent)Recoco Considerations
Storage/AppStoresplit so LMDB-specific code is isolated behind a clean boundary — this will simplify a future swap to a different storage backend.async fn(currently synchronous LMDB calls returning immediately-resolved futures). Recoco should evaluate whether the same API-shape change is worth the cascade through engine call sites. The SDK'sAppBuilder::build_blocking/App::open_blockingsync wrappers introduced here are a good pattern to adopt for#[test]entry points.rust/py/src/app.rs/rust/py/src/environment.rscascade changes are irrelevant. Thepy.detach(|| get_runtime().block_on(...))bridge pattern used in #1987 is not needed.state_store/should be verified against recoco's existing hashing choices.Integration Notes
These PRs should be adopted in order (#1981 → #1982 → #1983 → #1987 → #1990 → #1991) since each builds on the previous. The structural rename from
Store→AppStorepropagates through many engine files — do a bulk rename pass first, then layer in the async and caching changes. TheFnMemoCacheprefetch strategy (one prefix scan at build start, one flush at commit) is directly adoptable and is the highest-value change in the series.