Skip to content

feat(hash): generate the README quality tables from JSON + a measured bundle; measurements as a dev package - #256

Merged
helly25 merged 4 commits into
mainfrom
feat/hash-measurements-quality-test
Jul 13, 2026
Merged

feat(hash): generate the README quality tables from JSON + a measured bundle; measurements as a dev package#256
helly25 merged 4 commits into
mainfrom
feat/hash-measurements-quality-test

Conversation

@helly25

@helly25 helly25 commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Makes both SMHasher3 quality tables in mbo/hash/README.md generated (not hand-edited), with a clean separation of manual vs measured data, and makes the measurement tooling a normal dev package that CI gates without leaking into releases.

Generated quality tables

  • hash_algorithms.json — the manual/editorial SOT: per (algorithm, width) instance, only the non-measured columns (role, available_via, notice, seeded, streaming, starlark, and the smhasher registration name). One entry per width, so both tables separate 64/128 consistently (murmur3 is 128-only — its GetHash64 folds the native 128; xxh3 is native at both).
  • Measured data comes from a bundle, not the JSON: _measured_from_bundle re-parses the bundle's per-algorithm logs with the current parser (the stored smhasher.json predates parser fixes and is score-less). A hardcoded _MISSING_MEASURED stopgap covers FNV-1a-64 / MurmurHash3-128 (their committed logs are the invalid-name stub) until a bundle carries them — warned loudly on every render.
  • quality --bundle <tgz> renders BOTH the "Algorithm overview" (its SMHasher3 PASS/FAIL derived from the measurement, so it cannot disagree with Results) and the SMHasher3 "Results" table (measured score + failing families) between their own <!-- BEGIN/END --> marker regions. quality --check gates them.
  • consistency — all bundles at the same source git SHA must report identical measurements (a verdict is a property of the algorithm, not the machine). The two committed bundles agree.

Dev package + CI

  • Dropped the nested mbo/hash/measurements module and its .bazelignore entry so it's an ordinary dev package; still stripped from release archives (release_prep.sh).
  • //mbo/hash/measurements:quality_sh_test runs quality --check + consistency + a drift/idempotence guard over the committed bundles.
  • The test CI job now fetches the measurement bundles (git lfs pull) — actions/checkout leaves LFS pointers, so the quality gate needs them materialized.
  • no-deps-on-measurements pre-commit guard: nothing outside the release-stripped dir may reference it.

Docs

  • Compact result column; runnable sh example for producing measurements on another machine; intro clarified that all three in-house hashes pass 188/188.

Verification (local, all green)

  • quality --check matches the committed tables; the drift guard fails on a changed table; regeneration is idempotent; consistency passes; quality_sh_test passes under bazel; trunk clean.

Follow-up (separate): the AMD/linux bundle's FNV-1a 64-byte latency is a gcc-15 measurement artifact (chain elided → 0.27 ns); needs a re-measure or a latency-benchmark hardening. Not a quality-table issue.

helly25 added 2 commits July 12, 2026 23:29
…ts table

- Drop the nested mbo/hash/measurements module and its .bazelignore entry so it
  is an ordinary dev package (built/tested in dev + CI). It is still stripped
  from release archives by release_prep.sh, so nothing shipped depends on it.
- Add //mbo/hash/measurements:quality_sh_test, a bashtest that runs
  `hash_benchmark_report.py quality --check` (README Results table in sync with
  the curated data), plus drift-detection and idempotence checks.
- Add a no-deps-on-measurements pre-commit guard: no .bazel/.bzl file outside the
  dir may reference //mbo/hash/measurements, so the release strip cannot leave a
  dangling reference.
- Export //mbo/hash:README.md (public) for the test; refresh measurements/README
  and the hash README Methodology (how to measure on another machine).
The intro credited only mumbo/jumbo with passing and appended "dumbo is the
compact companion", which read as if dumbo did not pass. All three in-house
hashes pass 188/188; dumbo is a compact single-lane companion with a different
profile, not a lower-quality one.
@helly25
helly25 enabled auto-merge (squash) July 12, 2026 23:20
…red bundle

Replace the curated _SMH_RESULTS_ROWS with a clean separation of concerns:
- hash_algorithms.json holds ONLY manual/editorial per-instance columns (role,
  notice, seeded, streaming, starlark, available_via, smhasher name), one entry
  per (algorithm, width) so both tables separate 64/128 consistently (murmur3 is
  128-only - its GetHash64 folds the 128; xxh3 is native at both).
- Measured verdict/score/failures are re-parsed from a data bundle's logs
  (_measured_from_bundle; the stored smhasher.json predates parser fixes) and
  joined by smhasher name; a _MISSING_MEASURED stopgap covers FNV-1a-64/
  MurmurHash3-128 (invalid-name logs) until a bundle carries them, warned loudly.
-  now renders BOTH the Algorithm-overview (SMHasher3 PASS/FAIL
  derived from the measurement) and the Results table (measured score + families)
  between their own marker regions;  gates both.
- New  command: all bundles at the same source SHA must report
  identical measurements (verdicts are machine-independent). Verified: the two
  committed bundles agree.
- quality_sh_test reads the LFS bundles (data dep); the test CI job fetches them
  via git lfs pull (actions/checkout leaves pointers).
@helly25 helly25 changed the title chore(hash): integrate measurements as a dev package + gate the Results table feat(hash): generate the README quality tables from JSON + a measured bundle; measurements as a dev package Jul 12, 2026
@helly25
helly25 merged commit 7ecb2a6 into main Jul 13, 2026
22 checks passed
@helly25
helly25 deleted the feat/hash-measurements-quality-test branch July 13, 2026 17:48
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