Skip to content

D-NALP-3: NAL revision as one grouped cross-moment fold, keyed by evidential base - #1538

Merged
AdaWorldAPI merged 5 commits into
mainfrom
ccr-9f3b8075-74u47l-nal-w3
Oct 13, 2026
Merged

AdaWorldAPI merged 5 commits into
mainfrom
ccr-9f3b8075-74u47l-nal-w3

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

PR A of the ONA assimilation brief: revision, evidence independence, oracle parity. NAL stays in crates/lance-graph-nal. No opcode is added, OGAR is not changed, and the W2 tests are not touched.

What changed

lance-graph-nal

  • Beliefs::seal_evidence(class, &[Evidence { belief, stamp }], version) writes two lanes beside f and c:
    • w: the evidence weight round(2¹⁶ · c / (255 − c)), written once at seal. Confidence code 255 is refused with UnboundedWeight.
    • evidence: a U32 class per row, worked out per statement in sealed order from the stamps:
      • 0 independent
      • 1 exact duplicate (same stamp set and same truth as an earlier independent piece; counted once)
      • 2 overlap (shares a root without being a duplicate, or one stamp carries two different truths)
      • 3 no stamp
  • A stamp that names the same root twice is refused at seal (InvalidStamp). ONA drops such events at input (Memory.c:501).
  • nal::Revision::bind(bound, statement) keeps one mask-risc program: the statement's range plus GroupCrossPowerSumsI32 { key: evidence, x: w, y: f } into a 4-group sink.
  • PreparedRevision::revise commits once:
    • refuses if group 2 is not empty (DependentEvidence) or group 3 is not empty (MissingProvenance);
    • f = round(Σw·f / Σw) and c = round(255·Σw / (Σw + k·2¹⁶)), with k = 1 and c capped at code 252 (ONA's MAX_CONFIDENCE 0.99);
    • answers None when there is no evidence.
  • Beliefs::seal (W2) carries no stamps, so its populations answer the W2 queries but never revise.

lance-graph-r2il

  • FoldDialect::with_cross_sums and fold_cross_power_sums. This is a dialect method like emit_pred, not an R2IL byte; the fold band has no cross-moment call.

Oracles

  • ONA: Truth_Revision transcribed from src/Truth.c at dc4efd0abd520cdb79bf53bfa3c285ebb24f2e8a (horizon 1, max confidence 0.99), folded pairwise. This is an independent re-implementation of the C source, not a run of the ONA binary.
  • OpenNARS: the three printed points of revision_points.nal: (0.87, 0.91), (0.45, 0.77), (0.50, 0.95).

Tests (tests/w3.rs: 10; plus 1 in r2il tests/dialect.rs)

  • Within one code of ONA, and within the printing tolerance plus one code of OpenNARS, on the three points.
  • 60 random statements:
    • Σw and Σw·f equal the integer row sums exactly;
    • truth is within one code of ONA;
    • anti-vacuity: at least 10 statements have three or more pieces, and at least one has none.
  • Confidence cap; an exact duplicate counts once (the 0.951 counterexample from the backup); partial overlap and one stamp with two truths are both refused; the same stamp on two different statements is allowed; missing provenance is refused; ONA reasoningbench feat: integrate ReservoirSample + rename Belichtungsmesser → LightMeter  #9's stamp [10,2,11,2,1] is refused at seal; unbounded weight is refused; no evidence answers None; a revision bound on one population refuses to run on another.

Disable runs

Seven guards, each removed in turn after the commit; each turned its own test red, and the tree was restored after each:

guard removed tests that went red
overlap refusal overlap
overlap classed as independent overlap
duplicate classed as independent duplicate counts once
w scale dropped 4 tests
provenance refusal provenance
repeated-root check repeated root
confidence cap cap

Gates run

  • lance-graph-nal: 8 W2 tests (unchanged) and 10 W3 tests pass; fmt and clippy -D warnings are clean.
  • lance-graph-r2il: tests pass; fmt and clippy are clean.
  • r2il-mask-abi-probe: 40 tests pass.
  • Not run locally: a full crates/lance-graph core build (disk is tight). The r2il change is additive (one field set in new, two new methods), so I expect it to build; CI will confirm.

Decisions for review

# Decision Recommendation Why Caveats Needs from you
1 Group key Evidence class, not statement The statement is already the execution extent, so the class turns independence into a key and the whole check is one pass with K = 4 Revising every statement of a subject or class in one pass needs a statement-ordinal key; not built Agree, or ask for the batch form now
2 On overlapping evidence Refuse The brief says never treat repeated evidence as independent; overlap has no exact revision ONA instead picks the stronger belief (choice); that is not built Refuse, or add ONA's choice as a second mode
3 Exact duplicate (same stamp and truth) Count once It is the same evidence, so counting once is exact, not approximate A duplicate with a different truth is refused as overlap Agree
4 Stored w lane Keep for now (plan §4 B) Revision needs w = c/(1−c); mask-risc has no per-row division It is a second reading of c (zero-copy concern); deltas that carry their own weight (D-HL-7) would remove it Accept as interim
5 Cross-moment fold as a dialect method Method, no byte Same standing as emit_pred; avoids minting an opcode An ogar-r2il fold byte could follow if procedures need it in text Agree

Not measured on the v4 arm yet. Board: D-NALP-3 is set to In PR; the plan has a Status 2026-10-13 section.

🤖 Generated with Claude Code

https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh


Generated by Claude Code

…nce-class key

Beliefs::seal_evidence stores the fixed-point evidence weight (scale 2^16,
written once, c=255 refused) and an evidence class per row, computed per
statement from the stamps: independent, exact duplicate (counted once),
overlapping, no provenance. nal::Revision folds the statement's range with
mask-risc GroupCrossPowerSumsI32 keyed by that class (x = w, y = f) and
commits once: refuses overlap and missing provenance, caps c at ONA's 0.99.

lance-graph-r2il gains FoldDialect::with_cross_sums / fold_cross_power_sums,
a dialect method like emit_pred; no R2IL byte is minted.

Oracles: ONA Truth_Revision transcribed from Truth.c at dc4efd0, and the
three OpenNARS revision_points values. W2 tests unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 95274943-4565-40be-b9fa-48a7a5720771
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 13, 2026 17:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T17:53:01.888984Z 7d0880f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Add Carrot credits or activate Agent usage billing to use Autofix

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d0880fbb8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/lance-graph-nal/src/nal.rs
Codex P2: once ONA's running confidence reaches its 0.99 cap, its pairwise
Truth_Revision turns the capped confidence back into a bounded weight, so
its answer depends on arrival order: ten (255,230) then ten (0,230) give
f = 104, the reverse 151, interleaved 125. The fold sums every weight once
and caps only the result, so it is order-independent and gives the exact
NAL revision (f = 128). Keep that, state it at the commit law, in the plan
and in the ONA program doc, and pin it with a test that also asserts ONA's
own fold disagrees with itself on the fixture (so it cannot stop reaching
saturation unnoticed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
@AdaWorldAPI
AdaWorldAPI merged commit 4ceaab3 into main Oct 13, 2026
15 of 16 checks passed
AdaWorldAPI added a commit that referenced this pull request Oct 13, 2026
…sor-backoff-board

board: record #1538 and #1540; resolve ISS-SUPERVISOR-RESPAWN-BACKOFF-NOT-APPLIED
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