Skip to content

causal-edge: exact truth codes for deduction, induction, abduction (D-NALP-4 harvest) - #1548

Merged
AdaWorldAPI merged 4 commits into
mainfrom
ccr-9f3b8075-74u47l-truth-exact
Oct 14, 2026
Merged

AdaWorldAPI merged 4 commits into
mainfrom
ccr-9f3b8075-74u47l-truth-exact

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

This makes deduction, induction and abduction exact in causal_edge::isa::truth, the one place NARS truth already lives. It is the harvest of draft #1544: its oracle and probe move into causal-edge, and the lane terminal it planned is not built.

Problem

A CE64 register holds f and c as u8 codes (x / 255). execute (and so forward and the named register methods) and syllogize decoded them to f32, applied the law with rounding at every step, and packed with (v · 255).round(). That is one confidence code off on 2,413 of 2³² inputs for deduction and 4,352 each for induction and abduction.

Change

  • isa::truth::code::{deduction, induction, abduction}: u8 codes in and out, computed in integers and rounded once, half up.
  • Opcode::truth_code: routes those three rules there. Revision and synthesis keep the f32 path, unchanged.
  • execute and syllogize: pack truth_code's result.
  • truth::pack: the one place (v.clamp(0, 1) · 255).round() is spelled.
  • The f32 functions stay for real-valued callers.

Evidence

  • Exhaustive probe (cargo run --release -p causal-edge --example truth_exact_probe), all 2³² inputs per rule:

    rule truth::code ≠ oracle old f32 path ≠ oracle
    deduction 0 2,413
    induction 0 4,352
    abduction 0 4,352

    The oracle (tests/common/truth_law.rs) is written independently of the crate.

  • tests/ce64_truth_exact.rs, 8 tests:

    • hand-computed codes;
    • two half-up ties, the second of which rejects ties-to-even;
    • the induction/abduction mirror;
    • zero evidence;
    • OpenNARS nal1.1 at 4d1bdb0;
    • codes equal to the oracle on the every-5th grid;
    • execute and syllogize packing the oracle's codes on exactly the inputs where the f32 path was off: 12 deduction rows of the grid, and 17 induction and 17 abduction rows from an exhaustive scan of the three codes their confidence depends on. The grid holds none for those two.
  • Disable runs, each red: truth_code back to f32; syllogize deduction back to f32; round down; ties-to-even.

  • Unchanged: the legacy golden capture (126 words) and all other causal-edge tests, in both layouts.

  • Dependents green:

    • planner lib (457 passed, 3 ignored), plus chain_confidence, d_rpf_table_1, moore_tenant_isa_equivalence and moore_nars16_probe;
    • cognitive-shader-driver lib (131 passed);
    • lance-graph-osint p5_syllogize (4 passed).

Board

  • Entry: 2026-10-14-isa-truth-exact-codes.md.
  • STATUS_BOARD: D-NALP-4 → partial, in PR.
  • Plan: a MEASURED note in nal-polyfill-v1.md §4 C.

Not in this PR

  • Exact revision and synthesis. Revision first needs a ruling on two operands at confidence 255, which today pack (0, 0) and are pinned as a known defect.
  • Whether D-NALP-4/5 still need a lane terminal. This is the rescope of plan §4 B/C and stays open.
  • Clippy. cargo clippy -D warnings on causal-edge already fails on six lints in code this PR does not touch; CI runs only cargo test for this crate. The additions here are clippy-clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh


Generated by Claude Code

A register holds f and c as u8 codes. execute (forward and the named
register methods) and syllogize decoded them to f32, applied the law with
rounding at every step, and packed with (v * 255).round(). That is off by
one code on 2,413 of 2^32 inputs for deduction and 4,352 each for
induction and abduction.

isa::truth::code computes each law in integers and rounds once, half up;
Opcode::truth_code routes the three rules there (revision and synthesis
keep the f32 path, unchanged). The f32 functions stay for real-valued
callers.

The oracle and the probe are harvested from #1544 (D-NALP-4): an
independent integer oracle in tests/common/truth_law.rs, hand-computed
codes, two half-up ties, the OpenNARS nal1.1 outputs, and register tests
on exactly the inputs where the f32 path was off. The exhaustive probe
(examples/truth_exact_probe.rs) finds 0 differences from the oracle over
2^32 inputs per law. The legacy golden capture is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Entry 2026-10-14-isa-truth-exact-codes.md with the exhaustive measurement
and the open items (revision/synthesis not exact; whether a lane terminal
is still needed). STATUS_BOARD D-NALP-4 -> partial, in PR. Plan 4 C gets
a MEASURED note; the rescope of 4 B/C stays open.

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

coderabbitai Bot commented Oct 14, 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: 8000def8-273d-4728-9a0e-e3073ba3a885
  • 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 14, 2026 05:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 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:58:01.906742Z b0b3fb7 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.

DECISION (approved, points 1-4): the Gadamer gate's invariants are
frozen, each cited to the test that pins it; the revision layers (gate,
CE64 register, folded evidence, Rubikon phases) are kept apart; goal
revision runs only in Planning and Evaluation, agreement on a goal is a
HorizonFusion with the other party's statement as the new root, and a
goal is never revised by counting. Tests for R1-R4 are open.

Also records the differential against main for the exact truth codes:
5 of 16,000,000 register results differ, only in the confidence field,
by one code; bits 50..52 and 59..63 never change.

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 14, 2026

Copy link
Copy Markdown

Add Carrot credits or activate Agent usage billing to use Autofix

@AdaWorldAPI
AdaWorldAPI merged commit e7c5f79 into main Oct 14, 2026
13 checks passed
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