Skip to content

research: Prolog frontend on Prologos post-elaboration IR - #56

Draft
kumavis wants to merge 1 commit into
mainfrom
claude/prolog-ast-propagator-research-oVsBN
Draft

research: Prolog frontend on Prologos post-elaboration IR#56
kumavis wants to merge 1 commit into
mainfrom
claude/prolog-ast-propagator-research-oVsBN

Conversation

@kumavis

@kumavis kumavis commented May 4, 2026

Copy link
Copy Markdown
Contributor

Stage 1 research note categorizing standard Prolog features into
compatible-as-is vs small/medium/large additional work to land them
on Prologos's existing relational IR (expr-defr / expr-clause /
goal-desc) and BSP-LE propagator runtime.

Headline finding: ~95% of Datalog-fragment Prolog and ~70% of ISO-7
Prolog map directly onto existing IR; the residual gap is concentrated
in dynamic features (assert/retract, attributed vars, CHR) which are
paradigm-level mismatches against CALM-monotone propagator semantics
and naturally co-evolve with the PReduce series.

Includes architectural caveats (tabling default, fork-not-stack,
closed goal-kind set), four-stage staging proposal, and open
questions on cut semantics, side-effect ordering, and marketing.

Stage 1 research note categorizing standard Prolog features into
compatible-as-is vs small/medium/large additional work to land them
on Prologos's existing relational IR (expr-defr / expr-clause /
goal-desc) and BSP-LE propagator runtime.

Headline finding: ~95% of Datalog-fragment Prolog and ~70% of ISO-7
Prolog map directly onto existing IR; the residual gap is concentrated
in dynamic features (assert/retract, attributed vars, CHR) which are
paradigm-level mismatches against CALM-monotone propagator semantics
and naturally co-evolve with the PReduce series.

Includes architectural caveats (tabling default, fork-not-stack,
closed goal-kind set), four-stage staging proposal, and open
questions on cut semantics, side-effect ordering, and marketing.
@kumavis
kumavis marked this pull request as draft May 7, 2026 06:10
kumavis pushed a commit that referenced this pull request Aug 1, 2026
#55 and #56 are the two decoder traps that between them produced a
handoff which fetched correctly, received a well-formed fulfill, and then
did nothing at all -- no error, no log, no failed assertion.

#55: a ONE-argument Syrup record's payload is the value itself, not a
one-element list, so `record-args-of` reports zero arguments for
`<desc:import-object 0>`. It hides because every multi-field record in
the port reads fine through the same helper, and because "no reference in
this message" is a protocol condition that can legitimately happen.

#56: a wire nat arrives as `syrup-nat` OR a non-negative `syrup-int`, and
matching only the first silently misses the other half. The codec already
owns the conversion (`wire-nat`); re-deriving it is the bug. The rule
generalises -- when the codec ships a predicate for a wire-level notion,
a local match on one constructor is waiting for the other spelling.

The third note is bookkeeping with teeth: the seven Node-spawning interop
tests fail on an UNCHANGED tree at e65e0f8, a commit that was CI-green
three days earlier, and the CI variant of the same family first failed on
a documentation-only commit. Both look like regressions and neither is
one. Also records that an `import('@endo/ocapn')` without `@endo/init`
fails by design, so that error is not evidence of a broken dependency --
it looked like one for a few minutes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YM6gc3cMNH2Ymor4jdZY8u
kumavis pushed a commit that referenced this pull request Aug 1, 2026
…built on that

The doc-truth review found the premise the whole CI investigation rested
on, and it was wrong. Both workflows trigger `on: pull_request` with a
bare `actions/checkout@v4`, so GitHub builds refs/pull/N/merge -- the
branch merged into main. Main's LET series landed 2026-07-31, between the
last green run (07-29) and the first red one (08-01). THE CODE UNDER TEST
CHANGED WHILE MY DIFF DID NOT. Every "a docs-only commit failed, so the
diff cannot have caused it" argument was reasoning about the wrong tree.

So #57's four sections (~250 lines) are replaced by ONE resolved entry
rather than appended to, because a wrong investigation left readable as
current fact is the exact failure the entry is now about. It records the
rule (on pull_request the tested tree is branch + base; check what moved
on the base before calling a failure unattributable), the corollary that
cost as much (when a failure resists local repro, MERGE THE BASE FIRST --
doing so turned this into a 6-second deterministic local failure), and
the four wrong conclusions it produced.

Other false claims corrected, all mine:

 #52's cause statement was FALSE. A forward `defn` reference does not
 silently fail: under `process-file` residuation RESOLVES it (0 errors);
 under `process-string` it RAISES. That asymmetry is the real lesson and
 is precisely what produced the false all-clear the entry warns about --
 a process-file probe resolves what the server's process-string path
 rejects. The verified narrow claim (a stuck term is well-typed) is
 re-anchored to the shape that actually produces one, a `def` value whose
 referent never grounds. The "nine of thirty-five" count is unverifiable
 (the broken state was never committed) and is now stated as such.

 #53's quoted diagnostic no longer exists at HEAD -- marked stale.
 #54's "cannot read .prologos" overstated; it is content-dependent, and
 the transcript quoted did not reproduce. #56's "coin flip" was wrong:
 the spelling is determined by provenance, not chance.
 #51 FAMILY's retraction lived 245 lines away; now corrected in place.

 Gaps doc §1.7 M8's "there is one Syrup parser on a frame again" is
 literally false -- run-ocapn-test-server.rkt:1140 still parses every
 frame as a discard-result validation check. Only one implementation
 ACTS, which is the substantive fix; the parser count was overstated.
 The § Status section contradicted itself (line 27 promised a "Still
 open" section that line 111 says does not exist) plus a dangling
 pointer; both corrected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YM6gc3cMNH2Ymor4jdZY8u
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