Skip to content

[#68] Document Murmur3 64-bit seed semantics and C++ interoperability - #120

Merged
peter-lawrey-admin merged 5 commits into
developfrom
docs/Zero-Allocation-Hashing-68-javadoc-note-c-parity-is-for-uint3
Sep 13, 2026
Merged

peter-lawrey-admin merged 5 commits into
developfrom
docs/Zero-Allocation-Hashing-68-javadoc-note-c-parity-is-for-uint3

Conversation

@peter-lawrey

@peter-lawrey peter-lawrey commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Document and test the existing full-width long seed contract for both Murmur3 APIs. C++ MurmurHash3_x64_128 takes a uint32_t; Java callers use Integer.toUnsignedLong(seed) when they want that zero-extended contract. Negative Java int arguments continue to widen with sign extension, preserving established outputs.

The compatibility test calls both factories directly with int seed = -1, so adding an overload that changes source binding after recompilation will fail the regression. The wider negative-long and unsigned boundary cases remain. The two C++ vectors are reproducible with the checked-in generator and its commands, pinned to Austin Appleby's smhasher revision 07bb4de10a63e8cc2e1724865454eba635742383.

This PR now contains only the two API Javadocs and compatibility-test resources. Workflow, JDK-note and coverage repairs are separate in #125.

Validation on 12 September 2026 at dfdfc9a2fb17a21fb73552526127fd06c0e1db5f, Linux x86-64, Maven 3.9.11, isolated cached dependencies:

  • Java 8: mvn -o clean verify passes 14,905 unit cases, 12 skips, plus the automatic-module-name integration test.
  • Java 21: the same command passes two 14,905-case string-layout executions, with 5 and 8 skips, plus the integration test.
  • All executions have zero failures/errors/retries; Javadocs, Checkstyle and licence checks pass.
  • The additional -Pquality verify profile stops before tests because chronicle-quality-rules:1.27.0-SNAPSHOT is absent from the isolated cache. That profile configuration is unchanged from develop; normal verification passes as above.
  • Compiled the pinned C++ reference with the checked-in generator; both boundary vectors match exactly. git diff --check passes.

The shared workflow on develop remains defective until #125 lands. Current-head Actions now fails before tests because develop still uses deprecated actions/cache@v1; that inherited configuration is repaired in #125. In the previously reviewed Actions run, tests passed and the terminal error was Sonar authentication/project access. #125 also restores actual JaCoCo collection and gives verification and analysis separate visible results. These CI concerns do not change the seed contract; current-head CI and repository review requirements remain outstanding.

Fixes #68

The C++ reference accepts uint32_t while the established Java API uses all 64 bits of its long seed. Changing that behaviour would alter existing hash values.

Document both public facades and add independent boundary vectors without changing production behaviour.
@peter-lawrey
peter-lawrey force-pushed the docs/Zero-Allocation-Hashing-68-javadoc-note-c-parity-is-for-uint3 branch from aa8e611 to 9a4536e Compare August 21, 2026 14:11
@peter-lawrey peter-lawrey changed the title [#68] Murmur3 is incompatible with C++ reference implementation for negative seed values [#68] Document Murmur3 64-bit seed semantics and C++ interoperability Aug 21, 2026
@peter-lawrey peter-lawrey self-assigned this Aug 21, 2026
@peter-lawrey
peter-lawrey marked this pull request as ready for review August 21, 2026 14:16
@peter-lawrey
peter-lawrey changed the base branch from ea to develop August 21, 2026 14:17
@peter-lawrey
peter-lawrey requested a review from tgd August 21, 2026 14:17
The Build job failed during setup because both cache steps used the retired cache v1 service. The checkout and Java setup actions also used obsolete runtimes, and the SonarCloud scanner engine now requires Java 21.

Upgrade checkout, Java setup and both cache steps to v4, select Zulu JDK 21 explicitly and document the CI runtime. Preserve the Java 8 bytecode target and existing cache keys.

Validate with actionlint 1.7.12 and mvn -B clean verify -Psonar on JDK 11 and 21. Each build runs 14,904 tests twice, with zero failures or errors and 5/8 skips for the respective string configurations.
The repaired run passed setup and the Maven build, but GitHub reported that the v4 actions use deprecated Node 20 runtimes and setup-java v4 no longer receives updates.

Use checkout v7, setup-java v6 and cache v6, whose documented inputs preserve this workflow configuration. Actionlint 1.7.12 and git diff --check pass.
The topic branch lacks commits from its current base.

Merge the fetched base without rewriting history and retain the
PR-specific behaviour alongside upstream fixes.
@peter-lawrey-admin
peter-lawrey-admin merged commit 581a574 into develop Sep 13, 2026
10 of 13 checks passed
@peter-lawrey-admin
peter-lawrey-admin deleted the docs/Zero-Allocation-Hashing-68-javadoc-note-c-parity-is-for-uint3 branch September 13, 2026 11:49
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.

Murmur3 is incompatible with C++ reference implementation for negative seed values

3 participants