Skip to content

Return Identity from integer psubtract of unequal values - #115

Open
imlvts wants to merge 1 commit into
Adam-Vandervorst:masterfrom
imlvts:fix/int-psubtract-identity
Open

imlvts wants to merge 1 commit into
Adam-Vandervorst:masterfrom
imlvts:fix/int-psubtract-identity

Conversation

@imlvts

@imlvts imlvts commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

u64 and u16 psubtract returned Element(*self) when nothing was subtracted. Nodes propagate identity masks, so subtract_into reported Element for an unchanged trie. The Lean model's u64Ops follows.

u64 and u16 psubtract returned Element(*self) when nothing was subtracted.
Nodes propagate identity masks, so subtract_into reported Element for an
unchanged trie. The Lean model's u64Ops follows.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019R2H8fnco29asY2v3TPbtF
@luketpeterson

luketpeterson commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

@imlvts What is there a reason behind this change? If there is an expedient reason to change the behavior then it's fine.

My issue is that the policies implemented in the Lattice trait implementations on primitives are basically nonsense. Or at least unjustified.

The plan is to clean them up with well-behaved policies implemented via ZST policy objects. I have a plan for how to go about that. But any kind of near-term tweak to the policy gives the impression of a well reasoned design, and creates inertia to the current behavior. Encoding anything about the current Lattice impls in the lean model disturbs me greatly.

But again, if you have a pragmatic reason then we can merge this PR, as-is.

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