test: CompressOneBigFileToZip (renamed, input now arch-invariant)#5979
Merged
test: CompressOneBigFileToZip (renamed, input now arch-invariant)#5979
Conversation
makeSphere's output is slightly arch-dependent -- ARM NEON vs x86 SSE/AVX produce a handful of different floating-point vertex coordinates, which shifts the resulting .mrmesh file's bytes just enough that the test's `sphere.zip size` came out ~74 B apart between arm64 and x86_64 CI legs (58844 vs 58918 on run 24887440903). That noise obscures what the test is actually meant to exercise: the zip write path (libzip + deflate). Swap the sphere+MeshSave::toMrmesh pair for LCG-generated deterministic bytes, sized (119808 B) to match what makeSphere(1000 verts)+toMrmesh used to emit so historical size measurements stay comparable. Now every platform starts from bit-identical input to `compressZip`, so any sphere.zip-size drift that remains comes from the deflate engine itself. DRY: the LCG helper that CompressManySmallFilesToZip already carried as a local lambda is lifted to an anonymous-namespace inline function and reused. Drop includes MRMakeSphereMesh.h / MRMesh.h / MRMeshSave.h -- no longer referenced from this file. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Grantim
approved these changes
Apr 24, 2026
Contributor
Grantim
left a comment
There was a problem hiding this comment.
mb make comments a bit shorter?
The test no longer operates on a sphere mesh; rename it and its
artefacts to reflect what it actually does:
- TEST name: CompressSphereToZip -> CompressOneBigFileToZip
- source file: sphere.mrmesh -> big.bin
- output archive: sphere.zip -> big.zip
- vars: meshPath/meshBytes/meshSize -> filePath/fileBytes/fileSize
- log labels: "sphere.mrmesh size" -> "big.bin size"
"sphere.zip size" -> "big.zip size"
"sphere.zip compression time" -> "big.zip compression time"
Also trim comments and drop references to the prior sphere+toMrmesh
implementation. Update cross-reference in CompressManySmallFilesToZip
to point at the new name.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Rework and rename
MRMesh.CompressSphereToZip->MRMesh.CompressOneBigFileToZip:MeshSave::toMrmesh. It writes a fixed-size buffer of deterministic LCG-generated pseudo-random bytes directly..mrmeshbytes (and therefore the resulting.zipsize) differed between arm64 and x86_64 CI legs. On master run 24887440903,sphere.zip sizewas 59427 B on every arm64 job vs 59469 B on every x86_64 / wasm / Windows job.compressZipon bit-identical bytes. PR run 24893573554 (pre-rename) confirmsbig.zip size: 119972 byteson all 19 build-test jobs — zero drift across arm64/x64/wasm, macOS/Linux/Windows/emscripten, Clang 14/18/20, GCC 11/12/13/14, MSVC 2019/2022, Debug/Release, every libc, every vcpkg version, and the iterator-debug triplet.What changed
source/MRTest/MRZipCompressTests.cpp:CompressSphereToZip->CompressOneBigFileToZip.sphere.mrmesh->big.bin; output archive:sphere.zip->big.zip.makeSphere+MeshSave::toMrmeshreplaced with a 119808-byte LCG buffer. The byte count matches the previous serialized-sphere size so the archive's working set is comparable to historical measurements.CompressManySmallFilesToZipis promoted to an anonymous-namespace inline function at file scope and reused by both tests.MRMakeSphereMesh.h,MRMesh.h,MRMeshSave.h— no longer referenced.CompressManySmallFilesToZip's docstring + sanity-envelope comment updated to point at the new name.Deliberate consequence: weaker compressibility
Random bytes are near-incompressible, so
big.zipis ~120 KB vs the old ~59 KB. That's fine — this test is not a compression-ratio benchmark, it's an end-to-end check that the zip write path produces a non-empty archive for one large entry.CompressManySmallFilesToZipstill exercises compressible (JSON) and near-incompressible (binary) payloads across every deflate level 0-9 with round-trip verification.What this fixes (and doesn't)
Scope
One file, two commits (original rewrite + rename/trim). No source code / build / CI changes.
🤖 Generated with Claude Code