Skip to content

[harvest — do not merge] nal W4 (D-NALP-4): exact truth-law oracle and measurement, kept as a reminder - #1544

Open
AdaWorldAPI wants to merge 3 commits into
mainfrom
ccr-9f3b8075-74u47l-nal-w4
Open

AdaWorldAPI wants to merge 3 commits into
mainfrom
ccr-9f3b8075-74u47l-nal-w4

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Being harvested for good — do not merge

This PR stays open only as a reminder of a landing zone. Its useful parts are to be harvested into code that fits the existing substrate. The PR is then closed, not merged.

Why not merge. W4 aimed at a lane-producing truth terminal in mask-risc plus nal::Deduction-style types. That would be a second NARS truth substrate beside the one that already exists: CausalEdge64 with its truth codes, causal_edge::isa::truth, syllogize and revision. NARS truth arithmetic has one home, isa::truth. Making that home exact is the conforming fix; a parallel per-row law in lance-graph-nal is not.

What is harvested, and where it goes

part worth keeping because conforming home
tests/common/truth_law.rs: the exact integer law over u8 codes, rounded once, half up, for deduction, analogy, induction and abduction It is the oracle. It states what an exact NAL truth code is. the test oracle for causal_edge::isa::truth
examples/w4_truth_law_probe.rs: an exhaustive sweep over all 2³² inputs per law It finds every row where a shape is off by one code. a probe in causal-edge against isa::truth
Measurement: f64 on integer values is exact on every row of all four laws; the 256² u8 table is off on 419M–775M rows; f32 is off on 512–7,680 rows It decides the arithmetic shape. the isa::truth rework
Tie tests: 127.5 → 128 and 110.5 → 111 (the second one rejects ties-to-even; codex review) They pin the rounding rule. causal-edge unit tests
OpenNARS nal1.1 at 4d1bdb0: %1.00;0.81% and %1.00;0.45% External ground truth. causal-edge tests

What is dropped

  • The mask-risc lane-producing truth terminal.
  • FoldDialect truth methods.
  • nal::Deduction-style types.
  • The W4/W5 rows in nal-polyfill-v1.md §4 B/C that describe them.

All of these would duplicate the CE64 substrate.

Open before the harvest

  • Decide whether isa::truth becomes exact (integer law, f64 on integers, rounded once, half up). Right now it disagrees with the law by one code on some rows (12 rows on the every-5th-code grid for deduction).
  • Rewrite the D-NALP-4 board entry and plan §4 B/C to point at isa::truth.
  • Close this PR once the oracle and probe have landed in causal-edge.

State of the branch (unchanged code)

  • Code: test oracle, 7 tests, the probe, and a causal-edge dev-dependency. No production code.
  • Checks: clippy and fmt are clean. CI is green as of fa6c572; a run on d18a664 is pending.
  • Disable runs:
    • floor rounding turns a_tie_rounds_up and the analogy test red;
    • ties-to-even turns the new tie assertion red.

🤖 Generated with Claude Code

https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh

tests/w4.rs pins the exact integer law (round once, half up) for
deduction, analogy, induction and abduction against hand-computed
codes, OpenNARS nal1.1 and causal_edge::isa::truth (within one code).
examples/w4_truth_law_probe.rs measures four realizations over all
2^32 inputs per law: only integer-valued f64 is exact everywhere.

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: 98110b67-4ab7-4f49-852f-484ed4aa3025
  • 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.

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 13, 2026 22:35
@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-14T05:57:57.425079Z d18a664 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.

@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: fa6c572f46

ℹ️ 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/tests/w4.rs
127.5 rounds to 128 under both half-up and ties-to-even, so the tie test
could not tell them apart (codex review on #1544). Add f1 = 195, where
c = 110.5 codes: 111 half up, 110 ties-to-even.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
@AdaWorldAPI AdaWorldAPI changed the title nal W4 (D-NALP-4): exact per-row truth-law oracle and shape measurement [harvest — do not merge] nal W4 (D-NALP-4): exact truth-law oracle and measurement, kept as a reminder Oct 13, 2026
@AdaWorldAPI
AdaWorldAPI marked this pull request as draft October 14, 2026 05:26
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 14, 2026 05:55

This branch has not been deployed

No deployments
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