Skip to content

perf(partitions): a data object's Adler-32 is summed in place with SIMD (B80) - #695

Merged
DrunkOnJava merged 3 commits into
mainfrom
perf/b80-adler
Oct 5, 2026
Merged

DrunkOnJava merged 3 commits into
mainfrom
perf/b80-adler

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

A partition stream holds headers that look like data objects (RE-153): a zero word, then a size whose payload ends in the size again. verified_data_object copied each candidate's payload and summed it before the Adler-32 rejected it. Scratch counters (run 37244006521) on Autodesk's 2025 rme_advanced sample show where the time went. Of one 229 MB stream's 3.96 s scan, 3.75 s rejected 2,554 such headers claiming 8.4 GB between them, against 0.10 s for its 214,923 real objects.

The checksum is now summed over the class word and the payload where they lie, with simd-adler32. miniz_oxide, under flate2, already builds that crate, so the lockfile gains one edge and no crate. The scalar adler32 is gone.

In-process timing (run 37244777714, the same counters on both sides; the head runner ran untouched steps at about x1.25):

2025 rme_advanced before after
rejecting the 2,554 headers 3.03 s 0.29 s
original symbols (fills the cache) 3.21 s 0.38 s
Serial Number (RE-156, also verifies headers) 0.77 s 0.11 s

Both sides find the same 214,923 objects and reject the same 2,554 headers. Measure run 37244753521 against main checks the IFC.


Note

Low Risk
Localized checksum implementation swap with identical inputs; correctness depends on matching the prior Adler-32 domain, with benchmarks reporting unchanged accept/reject counts.

Overview
Partition data-object verification no longer allocates a scratch buffer or uses a local scalar Adler-32 when rejecting bogus headers during partition scans (RE-153 / B80).

verified_data_object now hashes the class word and payload in place with simd-adler32, matching the previous checksum domain (class + payload excluding the trailing size word). The hand-rolled adler32 helper is removed. simd-adler32 is declared in Cargo.toml (already present transitively via flate2 / miniz_oxide).

This targets the hot path where many false-positive headers each claim large payloads and must be checksum-rejected before being discarded.

Reviewed by Cursor Bugbot for commit 358aae1. Configure here.

…MD (B80)

A partition stream holds headers that look like data objects: a zero
word, then a size whose payload ends in the size again. Each was copied and
summed before its Adler-32 rejected it. On Autodesk's 2025 rme_advanced
sample 2,554 such headers claim 8.4 GB between them, and rejecting them
took 3.75 s of the stream's 3.96 s scan, against 0.10 s for its 214,923
real objects (counter run 37244006521). The checksum is now summed over
the class word and the payload where they lie, with simd-adler32, which
miniz_oxide already builds; the scalar adler32 is gone.
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Timed on one runner against main with #699's timing job (run 37245443309; the same job reads main against itself within ±1% on 45 of 50 files): 2016 to 2023 files 0.96 to 1.00, 2024 to 2027 files 0.27 to 0.84 (2025 rme_advanced 13.1 s to 9.6 s, 2027 rme_advanced 6.6 s to 1.9 s, Core Interior 4.9 s to 3.2 s). IFC byte-identical (run 37244753521).

@DrunkOnJava
DrunkOnJava merged commit ff2efc7 into main Oct 5, 2026
32 checks passed
@DrunkOnJava
DrunkOnJava deleted the perf/b80-adler branch October 5, 2026 00:16
DrunkOnJava added a commit that referenced this pull request Oct 5, 2026
…unners the wall times came from (B81) (#699)

Measure's base and head jobs run on different runners. In today's B80
runs, runner speed alone moved an export's time by up to about 1.7x: run
37244582476 read a change that adds no work in the default export as
1.6x slower on every file, the architecture samples included. So the
wall-time table #687 added compares machines as much as code.

- **The cross-runner table** now names each side's CPU (`runner.txt` in
each artifact, left out of the scorer diff) and says what the numbers
are.
- **A new `timing` input** adds a job, `Timing (one runner)`. It builds
`rvt-ifc` at both refs on one runner, exports every model (and every
sample, with `samples`) with each build in turn, and reports the medians
and their ratio in the run summary and the `measure-timing` artifact
(`tools/ci/measure-timing.sh`). That is three rounds per file, the order
alternating each round so a drift in the runner's speed falls on both
alike. A file either build fails to export is reported as failed, not
timed.
- **CONTRIBUTING** says when to use it.

Verified by dispatching this branch's workflow with `timing`: #695
against `main` (run 37245443309), and `main` against itself as a noise
check (run 37245395447). The results follow in a comment.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> CI and contributor docs only; no changes to rvt-ifc or export logic.
> 
> **Overview**
> Cross-runner **rvt-ifc** wall times in the Measure compare summary are
now labeled as coming from **two different runners**, with each artifact
carrying **`runner.txt`** (CPU model from `/proc/cpuinfo`) and copy that
warns runner speed alone can skew times by ~**1.7x**; **`runner.txt`**
is excluded from the scorer diff.
> 
> A new workflow input **`timing`** (when **`base` ≠ `none`**) adds a
**Timing (one runner)** job that checks out head and base, builds
**`rvt-ifc`** at both refs, and runs **`tools/ci/measure-timing.sh`**:
three alternating export rounds per model (and samples when
**`samples=true`**), median ms per ref, **head/base** ratio in the run
summary and **`measure-timing`** artifact.
> 
> **CONTRIBUTING** documents using **`-f timing=true`** for defensible
performance claims instead of the default cross-runner table.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
4f95586. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

1 participant