Skip to content

feat(wam_rust): P3 port — Debian resolver on the Rust WAM lane - #4222

Draft
s243a wants to merge 1 commit into
claude/peerhailer-exploratory-docs-aodas5from
grok/pkg-resolver-rust-p3
Draft

s243a wants to merge 1 commit into
claude/peerhailer-exploratory-docs-aodas5from
grok/pkg-resolver-rust-p3

Conversation

@s243a

@s243a s243a commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Bring the Rust WAM uw-resolve lane to the same P3 bar as wamjs / Go / ClojureScript (corpus 51/51, differential 2600/0), mirroring the D61 Go playbook against the current resolver (includes D69 H4/H1).

What changed

Owned files only: examples/pkg_resolver/rust/ (shim + rebuilt uw_resolve_wam/), src/unifyweaver/targets/wam_rust_target.pl, additive tests/test_wam_rust_maplist_predsort.pl. resolver.pl and every other lane frozen.

Shim

Round-trips the full P3 JSON both directions:

  • {"deb":[Epoch,[[order,num],…],[…]]}deb/3 + s(Codes,N) segments
  • depends third arg {"alternatives":[{dep,constraint},…]}alternatives([dep/2|_])
  • provides 3-ary / 4-ary; catalog/10 when provides are present
  • blocked providers([...]) / alternatives([alt(N,Reason)|…])
  • constraints lte / gt

Runtime

  • predsort/3 (A3 captured before the comparator; A/X regs saved around each less-func; leftover CPs truncated)
  • maplist/2-5 accepts the atom [] via deref_list_arg
  • Call/Execute already fall back to the whole builtin table (functor/3, arg/3, =../2, memberchk already classified). UW_WAM_WARN_UNKNOWN unchanged.

Runtime bug beyond the P3 gap

A nested run() from the predsort comparator (cmp_verversion_lt) Deallocated the caller’s Env frame. sort_versions_desc then failed after a successful predsort: reverse/2 ran, clause Deallocate found no Env. The v/3 world never hit this (sort/2). call_goal_once now restores a stack snapshot. Probe mp06.

Gates

gate result
run_corpus_rust.sh 51/51, B1 42 ms
run_differential_rust.sh pending
rust probe suites + known-base-failure identity pending
shared-lane JS / cli_args / wamjs corpus pending
B1–B3 (D51 protocol) + G1 index reading pending

docs/WAM_RUST_STATUS.md and the rust README will be updated with the remaining numbers.

Open in Web Open in Cursor 

Bring examples/pkg_resolver/rust/ to the P3 resolver. The shim now
round-trips deb/3 versions, alternatives groups, provides 3/4-ary,
catalog/10, and the providers/alternatives blocked shapes.

Runtime: predsort/3 (A3 captured before the comparator; regs saved
around each less-func) and maplist/2-5 accept the atom [] via
deref_list_arg. Call/Execute already fall back to the whole builtin
table and UW_WAM_WARN_UNKNOWN is unchanged.

Real bug: a nested run() from the predsort comparator Deallocated
the caller's Env frame, so sort_versions_desc failed after a
successful predsort (reverse ran, clause Deallocate found no Env).
v/3 never hit this because it uses sort/2. call_goal_once now
restores the stack snapshot; probe mp06.

Rebuilt uw_resolve_wam from current resolver.pl. Corpus 51/51 vs SWI
(B1 42 ms). Differential and the rest of the gate list follow.

Co-authored-by: johns243a <johns243a@gmail.com>
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