Conversation
Isolate nested goal invocation so comparator and maplist user predicates cannot leak registers or choice points into the caller. Rewrite unmatched call/execute of known builtins to :builtin-call and add a loud unknown-builtin diagnostic behind UW_WAM_WARN_UNKNOWN. Co-authored-by: johns243a <johns243a@gmail.com>
Encode and decode deb versions, alternatives groups, 3/4-ary provides, catalog/10, and the extended blocked shapes. Scale catalogs keep provides; bench_scale reports index-build vs query instruction census. Co-authored-by: johns243a <johns243a@gmail.com>
The generated core now includes catalog/10, index_catalog, and predsort/maplist builtin-calls against the updated runtime. Co-authored-by: johns243a <johns243a@gmail.com>
Covers maplist/2-3, predsort with compare/3 and a user comparator, string_codes empty edge, and UW_WAM_WARN_UNKNOWN=1. Co-authored-by: johns243a <johns243a@gmail.com>
functor_arity_string now takes the trailing /<digits> segment so put_structure ///2 (from `(N-1)//2` in build_tree) is a real instruction instead of :raw. wam_int_token accepts number/string/atom so last-goal execute predsort/3 compiles on SWI 9. Execute of a direct builtin stays :execute (rewriting it to :builtin-call made advance walk into the next predicate). Lowered emit classifies maplist/2-4 and predsort/3 and warns on a missing call/execute label. nbb's unbound *err* is rewritten to js/console.error so UW_WAM_WARN_UNKNOWN reaches the process stderr pipe. Co-authored-by: johns243a <johns243a@gmail.com>
invoke-at-pc-isolated now clears env-stack, unify/build stacks, and cut-bars so maplist/predsort user goals cannot leak Y-slots or stale choice points into the caller (D61, persistent-map restatement). Last-goal :execute of maplist/predsort succeed-states after the builtin; unmatched execute is no longer rewritten to :builtin-call at resolve time. Co-authored-by: johns243a <johns243a@gmail.com>
Generated core now emits put_structure ///2; runtime carries the isolated meta-call path and console.error warn sink. The maplist probe also asserts `NL is (3-1)//2` and that UW_WAM_WARN_UNKNOWN prints on an unresolved goal. Co-authored-by: johns243a <johns243a@gmail.com>
///2)
Corpus 51/51, differential 2600/0, B3 17.6s with index-build vs query instruction split. CLI residual vs frozen expected.json is live-SWI-identical. A3 execute path now covers maplist/predsort. Co-authored-by: johns243a <johns243a@gmail.com>
s243a
marked this pull request as ready for review
September 5, 2026 16:57
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.
Port uw-resolve P3 onto the Clojure WAM / nbb lane (mirrors D61 Go).
Builtin inventory (this resolver build)
maplist/2:builtin-call)maplist/3,4predsort/3string_codes/2''↔[]probed)functor/3,arg/3,=../2arg/3had 1 unresolved:callin an earlier emit; builtin already existed)memberchk/2UW_WAM_WARN_UNKNOWNlanded (off by default). nbb sink isjs/console.errorbecause*err*is unbound.Runtime / register-CP hygiene
Clojure WAM state is an immutable map.
invoke-at-pc-isolatedclears:regs,:stack,:env-stack, unify/build stacks,:choice-points,:cut-bar,:cut-bars. Copy-back is only bindings/trail/heap/intern/next-var-id/instr-count. Last-goal:executeof maplist/predsortsucceed-states soadvancecannot walk into the next predicate (D61 lesson).Compiler bug beyond builtins
index_catalogfailed.functor_arity_stringsplit on/and required exactly two parts.///2fromNL is (N-1)//2became:raw→ backtrack./<digits>segment (wam_clojure_target.pl+ lowered pred-key parse).gdivintests/core/test_clojurescript_wam_maplist_predsort.pl.Gates
expected.json; 66/66 cljs==js. The 11 misses areinstall-planon teaching/frozen_base — live SWIresolve_layeredalso fails those catalogs.cli/is frozen.tests/core/test_clojurescript_*.plgreentest_wam_clojure_lowered_*green; generator lmdb.h + benchmark Cargo.toml + runtime_smoke timeout are the known env failuresCONFORMANCE_TARGETS=javascript, cli_args cljs 17/17 + 25/25, wamjs corpus 51/51B3 index verdict
5k catalog, seed
0xc0ffee01,resolve_layered p30:B3 census
Base:
claude/peerhailer-exploratory-docs-aodas5To show artifacts inline, enable in settings.