Put the cross-type counterexample into the LibHashNoAlloc NatSpec - #114
Merged
Merged
Conversation
#113 cut the README's copy of the abi.encode argument and, with it, the one concrete thing in that copy: abi.encode of uint8(1), uint256(1), true and address(1) is the same 32 bytes in every case. The claim it illustrates, that abi.encode is not injective across types, survived in the LibHashNoAlloc title block without it, where the claim reads as an assertion rather than a demonstration. The four encodings are re-verified with cast abi-encode at foundry 1.7.2: each is 0x00...01, one word. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
|
Warning Review limit reachedNext included review available in 11 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
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. Comment |
thedavidmeister
pushed a commit
that referenced
this pull request
Sep 16, 2026
#114 landed on main after the record was written. It changes only /// lines in LibHashNoAlloc, so no mutated line moved, but "src/ and test/ are byte-identical to the scanned commit" is no longer literally true and the note now says what is. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#113 cut the README's copy of the
abi.encodeargument on the ruling that theLibHashNoAlloctitle block is the single statement of it. Its own descriptionflagged one item that went with the prose and was not carried across: the
concrete illustration that
abi.encodeofuint8(1),uint256(1),trueandaddress(1)all produce the same 32 bytes. The claim it illustrates, thatabi.encodeis not injective across types, survived in the NatSpec; the workedexample did not. This puts the example back, beside the claim.
The edit
src/lib/LibHashNoAlloc.soltitle block only. The sentence that carried theclaim as a subordinate clause becomes a claim plus its demonstration:
The two surviving predicates are unchanged in force: the cross-type restriction
is still stated as the one the composition below carries, and the efficiency
claim still hands off to the three bullets under it, which all open "Abi
encoding".
itin the old tail bound toabi.encode; with a sentence boundarynow in front of it the referent is named rather than pronominalised.
Nothing else in the block moves, nothing is added to the README, and the
cross-type collision list under "Across types nothing is unambiguous" in the
README is untouched: it enumerates what THIS pattern collides on, not what
abi.encodedoes, so it is not a second copy of this example.Verification
Not taken from the removed prose. Re-derived with
cast abi-encodeatfoundry 1.7.2-nightly (
43923a4), the version in the repo's own dev shell:uint8(1)0x0000000000000000000000000000000000000000000000000000000000000001uint256(1)0x0000000000000000000000000000000000000000000000000000000000000001true0x0000000000000000000000000000000000000000000000000000000000000001address(1)0x0000000000000000000000000000000000000000000000000000000000000001Four identical words. The claim the NatSpec makes above them is exactly what
this shows.
QA
///lines in one title block.NatSpec is not compiled into behaviour, so no observable value can differ
between base and branch, and
git diff --name-only mainis exactlysrc/lib/LibHashNoAlloc.sol. Inertness shown rather than asserted: the suiteis 77 passed / 0 failed / 0 skipped across 9 suites on
mainand identicalhere.
mutate. The mutation-equivalent for added prose is whether the addition can be
false: it is a statement about four specific
abi.encodeoutputs, and it waschecked against the encoder rather than against the text it was recovered
from. Had the removed prose been wrong, the table above would have caught it.
cast abi-encodefor the four values, andsrc/lib/LibHashNoAlloc.solread as a whole for placement, rather than [RLH-10] Cut the README's copy of the abi.encode argument #113's summary of what it says.
(b) beside the claim it illustrates rather than appended to the block, (c) the
four values verified with
cast abi-encoderather than trusted from theremoved prose, (d) no
///line referencing the README, no trailing-underscoreidentifiers, comments carrying only what code and git cannot show. Covered:
(a) src L23-27; (b) it lands as the demonstration clause of the sentence that
makes the claim, with the sentence's other two predicates intact; (c) the
table above; (d) no README reference added, no identifier changed at all, and
the addition earns its place because the claim above it is abstract without
it.
Suite: 77 passed / 0 failed / 0 skipped across 9 suites.
forge buildclean,forge lint -D warningsclean,forge fmt --checkclean,pre-commit run --all-filespasses and rewrites nothing.🤖 Generated with Claude Code
https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN