Skip to content

uw-resolve P2: store-backed resolution (D43 indexed catalog) - #4214

Open
s243a wants to merge 6 commits into
grok/pkg-resolver-p05from
grok/pkg-resolver-p2
Open

s243a wants to merge 6 commits into
grok/pkg-resolver-p05from
grok/pkg-resolver-p2

Conversation

@s243a

@s243a s243a commented Sep 2, 2026

Copy link
Copy Markdown
Owner

P2: store-backed resolution. Branches from grok/pkg-resolver-p05. Coordinator cut-semantics runtime imported first; P0.5 gates reconfirmed before P2 work.

Environment split

Huge shared catalog (packages / depends / conflicts / reverse-deps) lives in D43 indexed P/2 stores. Machine-local state stays a term:

env(CatId, Base, Installed, Requested, Layers, Excluded, Aliases)

resolver.pl catalog-as-term API is untouched. resolver_store.pl is the adapter.

JSONL + store layout

Rich dump (one object per fact, kind + catalog prefix). Indexed stores (a1 = CatId|Name):

prefix a2
pkg Major.Minor.Patch
dep Ver#Dep#Constraint
conflict Ver#Other
revdep Name#Ver#Constraint (precomputed)

SWI reads the same P/2 JSONL the indexer consumes (load_p2_jsonl/1) — no UWFI reader in SWI; identical keys/cells. WAM seeks indexed(Prefix). lmdb(Dir) is the same P/2 via uw_fact_lmdb.js (opt-in). The gated lmdb arm ran in this env (83 records); missing-package error path ungated.

Gates (measured)

Gate Result
Baseline P0.5 SWI 38/38
Baseline P0.5 wamjs corpus 39/39
Baseline term differential 2400 / 0 / 0 (swi 1.332s, wamjs 5.848s)
Store identity (SWI) 39/39 identical to term-catalog
Store wamjs corpus 39/39 matched SWI
5k catalog 5000 packages, 15000 dep edges
Bound resolve_layered p30 bytes_read=8242 vs store 1 645 394 bytes (0.50%); data_size=489001, n_reads=650; wamjs 92 ms
SWI term vs store (load included) term 0.433s (load 0.425 + resolve 0.008); store 0.301s (load 0.295 + resolve 0.006); match
Store differential 500 / 0 / 0 (swi 0.418s, wamjs 4.934s)
lowered / builtins / fact_sources / cut_semantics / CONFORMANCE=javascript exit 0
cli_args 17/17 + 5067 / 0 / 0

No runtime/emitter fixes. uw_fact_index.js reused as-is (no codec change). examples/pkg_resolver/cli/ not created.

Residuals

Provides/virtual, epoch/tilde, write paths, incremental store updates, CLI.

Open in Web Open in Cursor 

cursoragent and others added 6 commits September 2, 2026 19:21
Pulls the barrier-model runtime, lowered-emitter fixes, cut-semantics
suite, and status/convention docs so pkg_resolver P2 builds against the
post-P0.5 runtime. No resolver changes in this commit.

Co-authored-by: johns243a <johns243a@gmail.com>
Confirms P0.5 gates still hold on the coordinator tip: 38/38 SWI,
39/39 wamjs corpus, 2400/0 term-catalog differential.

Co-authored-by: johns243a <johns243a@gmail.com>
resolver_store.pl keeps the term-catalog API untouched and serves the
same 10 queries from P/2 fact predicates (packages/depends/conflicts/
reverse-deps) plus a tiny env term. SWI identity: 39/39 corpus rows
match term-catalog results.

Co-authored-by: johns243a <johns243a@gmail.com>
Rich JSONL plus four P/2 indexes (pkg/dep/conflict/revdep, reverse-deps
precomputed). wamjs_store binds those stores as javascript_wam_fact_sources.
lmdb stays opt-in; the missing-package error path is ungated.

Co-authored-by: johns243a <johns243a@gmail.com>
Seeded catalog (≥5000 packages, ≥15000 deps) with a bound resolve_layered
bytes-read proof, term-vs-store timings, and 500 SWI-vs-wamjs cases at
0 divergences.

Co-authored-by: johns243a <johns243a@gmail.com>
Co-authored-by: johns243a <johns243a@gmail.com>
@s243a
s243a marked this pull request as ready for review September 2, 2026 19:39
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