Skip to content

Put back the swept content that reached main - #112

Merged
thedavidmeister merged 1 commit into
mainfrom
restore-swept-content
Sep 16, 2026
Merged

thedavidmeister merged 1 commit into
mainfrom
restore-swept-content

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Five comment-sweep commits reached main and took prose with them that was not
a restatement. #102 merged without 845e591, the restoration commit on
hash-68, and 6e24ffd had only its src half put back. This is the full
sweep of main, not just the four known losses.

How the set was found

Every non-merge commit reachable from main since 2026-09-13 was checked for
comment-only deletions, and every deleted // / /// line was grepped against
the current tree. Six sweep commits are on main: 65499d5, 7566d57,
8532c38, 926dc2b, 9e711a8, c380644, plus 6e24ffd's test half. Lines
that came back under different wording (the Foo citation now in
test/lib/LibFooOracle.sol, testCombineHashesGas, the src title block) are
already restored and are not touched here. ccc3720, ea03286, f1f7ded,
8e963c6 and 899aff8 deleted comments as part of substantive rewrites and
are left alone.

Restored

test/src/lib/AbiEncodeGas.t.sol — 6e24ffd cut the title-block claims in
src/lib/LibHashNoAlloc.sol and this file's docstrings in one commit. The src
half is back on main; this half never was, so the file that exists to measure
the cost bullet no longer says which bullet, and the ABI length arithmetic in
each assertEq has nothing naming its terms. The suite docstring, the two test
docstrings and the one naming encodeGas's unnamed tuple returns come back
verbatim; the bullet they quote is on main word for word.

test/lib/LibHashSlow.sol — the title block is the only place "Slow" is
defined as allocation rather than speed, and the only statement that
hashBytesSlow is a value oracle with nothing to measure against, which is why
testHashBytesCostsTheSameAsBuiltin asserts equal gas where its siblings assert
cheaper. Restored with the hashBytesSlow docstring that says why.

test/src/lib/LibHashNoAlloc.t.sol — the suite docstring. Every other test
contract in the repo carries one; 9e711a8 cut this one and #96 did not put it
back. Restored to the suite as it now stands rather than verbatim: the
empty-input HASH_NIL identities it used to list moved to the cross-type suite
with ccc3720.

test/src/lib/HashPattern.t.sol — testBytesTrueLength's docstring, the
hex"01" / hex"0100" collision the test is about, which left it the only
undocumented test in its file. And the // Hash C and D, already in scratch, to produce the final hash E step comment, the last of the README's five steps and
the only one left uncommented.

test/src/lib/MemoryLayout.t.sol — testDeeplyNestedStructIsOnePointerWordPerLevel
in the corrected "2 words at each of the two outer levels" form 7566d57 cut,
not the "each level" form it had replaced, and
testNewFooArrayAllocatesListThenElements, which carries the allocation claim
ea03286 split out of testFooListIsWordList.

test/src/lib/HashPatternFold.t.sol — testFoldPrefixIsStepwiseCombine's
mapping of its locals onto the README's N, A, B, C, D, which nothing in the code
carries, and testFoldSingletonIsNotItem's "Nil hash prefix" citation, the one
its sibling testFoldEmptyIsNilHash kept.

test/src/lib/LibHashNoAlloc.crossType.t.sol — struct TwoBytes, both
pointer-only-struct tests, and the keccak256(s, 0) comment, which is the only
thing saying that a zero-length hash is deliberate.

Left cut

These were restatements and the sweep was right about them:

  • 65499d5's sign-extension comment: the docstring directly above it already
    states the sign-extension claim, and the line below is the lint directive.
  • 926dc2b's take docstring and testLeafNodeCollision docstring: the first
    paraphrases a three-line body, the second restates an assertion that
    hashBytes's NatSpec already states as a property.
  • 9e711a8's per-test one-liners in LibHashNoAlloc.t.sol and the per-function
    abi.encodePacked notes in LibHashSlow, which the restored title block
    covers.
  • 926dc2b's allocation paragraph on testFooListIsWordList: that test no
    longer measures allocation. The claim is restored on
    testNewFooArrayAllocatesListThenElements, which does.

QA

  • Discriminating tests: n/a - comments only. The diff is 55 inserted lines and
    zero deleted, every inserted line a /// or // comment, so there is no
    behaviour for a test to discriminate and nothing that could fail on base.
  • Mutations applied: n/a - a docs-only diff has no executable line to mutate.
    The existing suite is untouched and is the gate this branch stays green
    against.
  • Oracle: the source each restored claim makes a claim about, read as it stands
    today rather than as it stood when the line was cut. The AbiEncodeGas
    docstrings were checked against the cost bullet currently in
    src/lib/LibHashNoAlloc.sol and against each assertEq on encoded.length;
    LibHashSlow's title block against which tests use it as a gas oracle and
    which as a value oracle; testBytesTrueLength against README.md line 368 and
    its own three assertions; the fold letters against README "Handling pointers"
    N-A-B-C-D and the five locals they name; the nested-struct docstring against
    fmp1 - midPtr == 0x40 and fmp2 - outermostPtr == 0x40, which is two outer
    levels and not three; testNewFooArrayAllocatesListThenElements against
    fmpAfter - ptr == 0x20 + n * 0x20 + n * 0x80 and its w2/w3 zero-slot
    reads. Two blocks were deliberately not restored verbatim because the
    verbatim text is now false: the LibHashNoAlloc.t.sol suite docstring, whose
    empty-input identities left that suite in ccc3720, and the nested-struct
    docstring, where 8532c38's "each level" form is the one docs: correct five inaccurate statements in the README and test docs #102 existed to
    correct.
  • Category check: the task names LibHashSlow's title block,
    testBytesTrueLength, the Yul step comment and the nested-struct correction,
    and asks for a full check of 926dc2b and 8532c38 rather than those four
    alone. Covered: all four, the remainder of both named commits, the remainder
    of 7566d57, 9e711a8 and c380644, and 6e24ffd's test half, with
    65499d5 checked and deliberately left cut. The hash-55 / README: state each hash function's preimage as its API #88 Releases
    section is out of scope under the ruling that release-lifecycle documentation
    lives in rainix only, and is untouched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN

Five comment-sweep commits reached main and cut prose that was not a
restatement. 845e591 would have put two of them back but #102 merged without
it.

Restored:

- `test/src/lib/AbiEncodeGas.t.sol`: the suite docstring naming the title-block
  cost bullet this file exists to measure and why the gasleft() window provably
  contains the encoding, the two docstrings giving the ABI length arithmetic
  term by term, and the one naming the helper's unnamed tuple returns. 6e24ffd
  cut these alongside the `src` title block claims; only the `src` half came
  back.
- `LibHashSlow`'s title block, which is the only place "Slow" is defined as
  allocation rather than speed and the only statement that `hashBytesSlow` is a
  value oracle with no saving to measure, plus the `hashBytesSlow` docstring
  that says why.
- `LibHashNoAlloc.t.sol`'s suite docstring. Rewritten to the suite as it now
  stands: the empty-input identities it used to list moved to the cross-type
  suite with ccc3720.
- `testBytesTrueLength`: the `hex"01"` / `hex"0100"` collision the test is
  about. It was the only test in its file left undocumented.
- The `keccak256(0, 0x40)` step comment in the README Yul, the last of five
  steps and the only one uncommented.
- `testDeeplyNestedStructIsOnePointerWordPerLevel`, in the corrected "two outer
  levels" form 7566d57 cut rather than the "each level" form it replaced.
- `testNewFooArrayAllocatesListThenElements`, `testFoldPrefixIsStepwiseCombine`
  (the README's N-A-B-C-D letters over the locals), `testFoldSingletonIsNotItem`
  (the "Nil hash prefix" citation its sibling kept), and the four pointer-only
  struct comments in the cross-type suite.

Left cut as genuine restatements: the sign-extension comment under the lint
directive the docstring above it already states, `take`'s one-line paraphrase
of its body, `testLeafNodeCollision`'s docstring, which `hashBytes`'s NatSpec
already carries, the per-function `abi.encodePacked` notes in `LibHashSlow`
that the restored title block covers, and the per-test one-liners 9e711a8 cut
from `LibHashNoAlloc.t.sol`.

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

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: f2bf1b60-5ce5-4a28-9dcd-fac22fa392b5

📥 Commits

Reviewing files that changed from the base of the PR and between ca72f31 and 1281a90.

📒 Files selected for processing (7)
  • test/lib/LibHashSlow.sol
  • test/src/lib/AbiEncodeGas.t.sol
  • test/src/lib/HashPattern.t.sol
  • test/src/lib/HashPatternFold.t.sol
  • test/src/lib/LibHashNoAlloc.crossType.t.sol
  • test/src/lib/LibHashNoAlloc.t.sol
  • test/src/lib/MemoryLayout.t.sol

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.

@thedavidmeister
thedavidmeister merged commit 809962e into main Sep 16, 2026
4 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.

1 participant