Repository navigation
Add end-to-end test for meshing above 4 GiB; tidy finalizeMesh - #131
Merged
Merged
Conversation
The Apple and non-Apple branches of finalizeMesh were identical apart from an fd assertion, which holds on all platforms. Also widen span.length before shifting in the (currently disabled) kAdviseDump path so spans >= 4 GiB are not truncated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reserves an untouched 4 GiB placeholder so the next two spans start past the 4 GiB mark of the backing file, meshes them, then scavenges. Checks that meshed objects keep their contents and that resetting the meshed span's mapping does not alias the placeholder. Without the off_t fix in finalizeMesh, the meshed object reads back as zeros; without the fix in resetSpanMapping, writes to the reset span appear in the placeholder. It is a separate target (high-offset-mesh-test) because it reserves 4 GiB of arena address space; make test and CI run it alongside unit-tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
emeryberger
force-pushed
the
high-offset-mesh-test
branch
from
October 21, 2026 14:33
da49765 to
8024ae0
Compare
emeryberger
marked this pull request as ready for review
October 21, 2026 14:54
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.
Follow-up to #129 (now merged), rebased onto master.
Summary
End-to-end regression test,
//src:high-offset-mesh-test. Reserves an untouched 4 GiB placeholder so the next two spans start more than 4 GiB into the backing file, meshes them, then scavenges. It checks that:ZZZ…contents);resetSpanMapping, writes to the old span don't show up in the placeholder. This check also fails on its own when onlyresetSpanMappinghas the old 32-bit shift.It's a separate target because of the 4 GiB address-space reservation, which uses almost no real memory.
make testand both Bazel CI jobs run it alongsideunit-tests. The CMake job doesn't run it.Cleanup. Merges the
__APPLE__and Linux branches offinalizeMesh, which were identical apart fromhard_assert(_fd >= 0); that assert now runs on all platforms. Also widensspan.lengthbefore the shift in theMADV_DONTDUMPcall, which is dead code today sincekAdviseDump = false.Testing
s2content check with master'smeshable_arena.{h,cc}; fails at the alias check when onlyresetSpanMappinghas the old shift.Questions for review
kArenaSize> 4 GiB plus the spans after it. That holds for 64 GB on Linux and 32 GB on macOS.scavenge(it zeroes them again afterward)?🤖 Generated with Claude Code