Skip to content

Release mechanics: per-build mangle-seed header, Starlark hash ports, leaner archive - #253

Merged
helly25 merged 8 commits into
mainfrom
hash/mangle-seed-regen-and-dumbo-bzl
Jul 12, 2026
Merged

Release mechanics: per-build mangle-seed header, Starlark hash ports, leaner archive#253
helly25 merged 8 commits into
mainfrom
hash/mangle-seed-regen-and-dumbo-bzl

Conversation

@helly25

@helly25 helly25 commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Fixes release structure, handling, and mechanics. Three related pieces:

1. Mangle-seed header: generate per build, stop committing it

Release version-bump PRs failed CI (e.g. #252). The mangle-seed constant is
version-derived, and the checked-in non-Bazel fallback
internal/hash_mangle_seed.h.in baked that constant in, so every version bump
made it stale and broke hash_mangle_seed_default_test.

The root cause was structural: .h.in was a pre-rendered copy of the header
(the real template lived in the .bzl), carried a version-derived value, and had
to be regenerated and re-committed on every bump.

Fix - generate the header per build and never commit it:

  • Removed internal/hash_mangle_seed.h.in and hash_mangle_seed_default_test.
  • hash_mangle.h now includes the generated hash_mangle_seed_gen.h directly; a
    missing one is a hard #error (not a silent fallback). clangd falls back to a
    stable constant under -DIS_CLANGD purely so the editor can parse this
    low-level header.
  • A version bump no longer needs a committed regeneration, and the
    --//mbo/hash:mangle_seed / --//mbo/hash:mangle_seed_buckets flags are
    unaffected (the header is still generated per build).

2. dumbo/fnv1a in Starlark, verified against the C++ prime

  • Switched the version/seed fold from FNV-1a to the in-house dumbo hash
    (SMHasher3-proven; fnv1a is not).
  • Added Starlark ports of dumbo and fnv1a in //mbo/hash:hash.bzl (public
    hash struct), kept byte-for-byte identical to the C++ prime and verified
    against it by hash_bzl_vs_cpp_dumbo_test / hash_bzl_vs_cpp_fnv1a_test.
  • Added //mbo/hash:hash_tool, a minimal <algo> [<data>] hash CLI (plain
    GetHash64, no mangle) that doubles as the C++ reference for that verification.
  • mbo/hash/README.md: added a Starlark column + a Starlark API snippet; the
    overview table is now PASS/FAIL only (exact SMHasher3 scores stay in the
    Results table).

3. Leaner release archive

release_prep.sh now drops dev-only files from the released tarball via
export-ignore, so it carries only what a consumer needs to build the library:

  • Added to EXCLUDES: mbo/hash/measurements (dev/benchmark data, already
    .bazelignored), .trunk (linter orchestration), .gitattributes,
    .gitignore (git metadata, dead in a tarball).
  • Deliberately kept: bazelmod (a useful template for downstream libs),
    .clang-format (mope formats its generated output with it), the other
    lint/format configs, and compile_commands-update.sh (a courtesy for
    consumers).

4. Trimmed and tightened CI (31 -> 19 test jobs, all gating)

  • Made test-clang gating (was continue-on-error), so the hermetic-clang
    coverage actually blocks via the done gate.
  • Removed the informational benchmark job - it never gated, did no baseline
    comparison, and produced noisy shared-runner artifacts nothing consumed;
    reliable numbers now come from the out-of-band mbo/hash/measurements bundles
    (the hash_benchmark binary stays for those and manual runs).
  • Bazel matrix: one version per supported major (7.2.1 / 8.7.0 / 9.1.1,
    dropping the redundant 9.0.2); the 7.x/8.x rungs run on ubuntu only
    (build-system compat is platform-agnostic), macOS keeps the pinned default.
  • Clang LLVM ladder: oldest + pinned-default/newest only (20.1.8, 22.1.8);
    dropped the 21.1.8 middle rung and fastbuild. asan and cpp23 run on the
    newest rung only; the oldest (20.1.8) just proves the minimum LLVM still
    builds (opt).
  • asan consolidated: gcc-14 (early, in test-gcc) + clang-22 on both OSes;
    dropped the redundant clang-20 asan.
  • test-gcc drops gcc-13 (still built at opt later by test-bcr's
    ubuntu+gcc rungs).
  • Fixed a stale reference claiming LLVM 20.1.8 was the default pin (it is 22.1.8).

Verification

  • bazel test //mbo/... (250 targets) and //mbo/hash/... (6 tests) pass.
  • Bumped MODULE.bazel 0.13.1 -> 0.13.3: the generated constant rotates
    (0x9F24EE18B4458070 -> 0x79EC7046370E0C65) and all tests still pass;
    reverting to 0.13.1 restores the constant and tests pass. No committed file
    changed, so the CI failure that motivated this cannot recur.
  • CHANGELOG condensed to the house style (brief, verb-first); the 0.13.0 restyle
    is presentation only - released content unchanged.

helly25 added 2 commits July 12, 2026 17:49
The checked-in mangle-seed fallback carried a version-derived constant, so every
version bump made it stale and broke hash_mangle_seed_default_test (the CI
failure on release PRs, e.g. #252). Generate the header per build and stop
committing it: remove internal/hash_mangle_seed.h.in and the diff test;
hash_mangle.h includes the generated header directly and #errors when it is
missing (clangd falls back to a stable constant under -DIS_CLANGD). A version
bump no longer needs a committed regeneration, and the --//mbo/hash:mangle_seed*
flags are unaffected.

Also switch the version/seed fold from FNV-1a to the in-house dumbo hash
(SMHasher3-proven) and add Starlark ports of dumbo and fnv1a in
//mbo/hash:hash.bzl (public hash struct), kept byte-for-byte identical to the
C++ prime implementation and verified against it by hash_bzl_vs_cpp_dumbo_test
and hash_bzl_vs_cpp_fnv1a_test via the new //mbo/hash:hash_tool CLI. README and
CHANGELOG updated.

Verified: bumping 0.13.1 -> 0.13.3 rotates the generated constant and all hash
tests pass; reverting restores it and all tests pass.

Also condensed the 0.13.0 CHANGELOG entries to the terse, verb-first house style
(presentation only; released content unchanged).
Add .trunk, .gitattributes, .gitignore (and mbo/hash/measurements) to the
release_prep.sh EXCLUDES so the released tarball carries only what a consumer
needs to build the library. Kept bazelmod (useful to copy for other libs),
.clang-format (mope formats generated output with it), the other lint/format
configs, and compile_commands-update.sh (a courtesy for consumers).
@helly25 helly25 changed the title mbo/hash: generate mangle-seed header per build; dumbo/fnv1a in Starlark Release mechanics: per-build mangle-seed header, Starlark hash ports, leaner archive Jul 12, 2026
helly25 added 5 commits July 12, 2026 18:04
It never gated (continue-on-error), ran only on main when mbo/hash changed, did
no baseline comparison, and produced noisy shared-runner artifacts nothing
consumed. Reliable, comparable numbers now come from the out-of-band
mbo/hash/measurements bundles. The hash_benchmark binary stays for those and for
manual runs; only the CI job and its done-gate wiring are removed.
Policy is the last three majors (7, 8, 9). 9.1.1 already covers major 9, so the
extra 9.0.x rung (9.0.2) was redundant; dropping it removes 4 matrix jobs. Kept
7.2.1 (the earliest working 7.x floor) and 8.7.0 (latest 8.x).
- test-clang now gates (continue-on-error: false) via the done job; the
  hermetic-clang coverage was informational-only before.
- Reduced the clang LLVM ladder to oldest+newest (dropped 21.1.8) and dropped
  the fastbuild config.
- Consolidated asan onto the newest clang on both OSes (dropped the redundant
  clang-20 asan); gcc-14 asan stays and runs early in test-gcc.
- test-bcr runs the 7.x/8.x Bazel rungs on ubuntu only (platform-agnostic
  build-system compat); macOS keeps the default 9.1.1 for platform coverage.
- test-gcc drops gcc-13 (still built at opt later by test-bcr's ubuntu+gcc).

Net: 31 -> 21 test jobs, all gating.
The clang-ladder comment claimed 20.1.8 was the default pin; the pin is 22.1.8
(bazelmod/llvm.MODULE.bazel). Also align test-bcr's clang combos to that pinned
default instead of 20.1.8.
22.1.8 is the default pin (not just a forward-looking rung); 21.1.8 matches
macOS 26's native Apple clang 21 (a pairing that tracks Xcode). Also replaces the
em-dashes with hyphens.
@helly25
helly25 requested a review from Fab-Cat July 12, 2026 17:25
C++23 is used on recent compilers, so testing the cpp23 mode on the oldest
clang (20.1.8) is low value; the oldest rung now just proves the minimum
supported LLVM still builds (opt). Matches the asan 'newest-only' rule.
test-clang 10 -> 8.
@helly25
helly25 enabled auto-merge (squash) July 12, 2026 18:07
@helly25
helly25 merged commit 72b1f20 into main Jul 12, 2026
22 checks passed
@helly25
helly25 deleted the hash/mangle-seed-regen-and-dumbo-bzl branch July 12, 2026 18:19
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.

2 participants