Conversation
Add a bounded read-through cache (UW_FACT_CACHE, default off, cap 4096) around indexed/lmdb lookups, plus lmdb_ops counters on UW_FACT_IO_STATS. uw_fact_lmdb.js gains build-all for the four resolver stores. Catalogs are read-only: no invalidation; a write path must fact_cache_reset(). Co-authored-by: johns243a <johns243a@gmail.com>
Declaration switch UW_STORE_BACKEND=indexed|lmdb compiles the same store adapter against D43 indexed prefixes or four LMDB envs. Cache on/off is asserted identical on the dump corpus. lmdb stays opt-in via /tmp/uw-lmdb-pkg with a loud missing-package error. Co-authored-by: johns243a <johns243a@gmail.com>
Include js-cache plunit in test_resolver_store/0. Rebuild the store differential binary when wam_runtime.js lacks configure_fact_cache. Co-authored-by: johns243a <johns243a@gmail.com>
s243a
marked this pull request as ready for review
September 3, 2026 17:53
…on tiers Name the JS store cache after Go/F#/Rust lmdb_materialisation (eager|lazy|cached|auto). Default cached; UW_FACT_CACHE=0|1 remains the lazy|cached measurement alias. L2 and cost-model auto are residuals. Co-authored-by: johns243a <johns243a@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LMDB catalog backend for store-backed uw-resolve, plus a fact-source cache that uses the fleet graph-kernel materialisation vocabulary (
docs/WAM_GO_STATUS.md,docs/WAM_FSHARP_STATUS.md, RustLookupSource).Declaration switch
UW_STORE_BACKEND=indexed|lmdb(defaultindexed) compiles the same adapter (store_pkg/2…store_revdep/2) against D43indexed(Prefix)or fourlmdb(Dir)environments (StoreDir/lmdb/{pkg,dep,conflict,revdep}). Same 10 queries, same JSON shim. No silent fallback: missinglmdbnpm is a loud error (D43/tmp/uw-lmdb-pkginstall, no repopackage.json).Materialisation tiers (fleet names)
eagerlazycachedautocore/cost_model.plhookup; falls back tocached(stderr once)UW_LMDB_MATERIALISATION=eager|lazy|cached|auto. Measurement alias unchanged:UW_FACT_CACHE=0→ lazy,=1→ cached.UW_LMDB_L2_CAPACITY/UW_FACT_CACHE_CAP(default 4096) sizes the L1. L2 is a residual (Go L1 = L2/8).Runtime.configure_lmdb_materialisation(mode, cap);configure_fact_cachekept as alias.lazy/cached/eageridentical corpus results (39 cases, both backends).lazyso bytes ∝ query (8242 B / 650reads). Defaultcachedstill seek-on-miss: D43 bytes-read proof is 506 / 992872 / 29 reads.docs/reports/wam_rust_cached_scaling_sweep_2026-06-14.md) when lookups dominate. This resolver is interpreter-bound; cache value is repeated queries (~111× fewer indexed reads).Gates (this revision, this VM)
/tmp/uw-lmdb-pkg)cachedcachedoff_hits=0 on_hits=79 replay_hits=270 eager=eager)materialisation=cachedCONFORMANCE_TARGETS=javascript2×2 + 100× (seed
0xc0ffee01;off=lazy,on=cached)Same 10-package
resolve_layeredin every cell. WAM loop dominates store I/O.This-revision 5k probe (same query, same result): lazy
8242 B / 650; cached7321 B / 578(83 hits); eager742819 B / 67548(full scan — why the scale demo forces lazy).Honest reading: LMDB does not beat indexed here. The cache's value is repeated queries in one process, not first-query wall time.
Residuals
lmdb_l2_capacityas a real L2)auto+core/cost_model.pl(JS warns and usescached)lmdb_materialisation(...)/lmdb_l2_capacity(...)onwrite_wam_javascript_project(wam_javascript_target.plfrozen this round; runtime env + optionalsource.materialisationuntil then)Runtime.fact_cache_reset()), CSR