Skip to content

New C++ api docs#8737

Merged
myrrc merged 3 commits into
developfrom
myrrc/cxx-new-docs
Jul 13, 2026
Merged

New C++ api docs#8737
myrrc merged 3 commits into
developfrom
myrrc/cxx-new-docs

Conversation

@myrrc

@myrrc myrrc commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@myrrc myrrc added the changelog/skip Do not list PR in the changelog label Jul 13, 2026
@myrrc myrrc requested a review from 0ax1 July 13, 2026 13:16
@myrrc myrrc force-pushed the myrrc/cxx-new-docs branch from 9144e12 to 6aa3880 Compare July 13, 2026 13:20
@myrrc myrrc enabled auto-merge (squash) July 13, 2026 13:20
@codspeed-hq

codspeed-hq Bot commented Jul 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚡ 6 improved benchmarks
❌ 4 regressed benchmarks
✅ 1654 untouched benchmarks
⏩ 42 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation encode_varbin[(1000, 8)] 138.9 µs 155.6 µs -10.79%
Simulation encode_varbin[(1000, 4)] 138.7 µs 154.6 µs -10.3%
Simulation encode_varbin[(1000, 32)] 143.9 µs 160.4 µs -10.29%
Simulation encode_varbin[(1000, 2)] 138.3 µs 154 µs -10.24%
Simulation bitwise_not_vortex_buffer_mut[128] 244.4 ns 186.1 ns +31.34%
Simulation bitwise_not_vortex_buffer_mut[1024] 304.7 ns 246.4 ns +23.68%
Simulation chunked_varbinview_opt_canonical_into[(1000, 10)] 205.7 µs 168.8 µs +21.88%
Simulation chunked_varbinview_into_canonical[(1000, 10)] 205.9 µs 169.5 µs +21.49%
Simulation bitwise_not_vortex_buffer_mut[2048] 398.6 ns 340.3 ns +17.14%
Simulation eq_i64_constant 298.5 µs 267.8 µs +11.46%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing myrrc/cxx-new-docs (9add296) with develop (1d7951a)

Open in CodSpeed

Footnotes

  1. 42 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@myrrc myrrc force-pushed the myrrc/cxx-new-docs branch from 6aa3880 to 27171ed Compare July 13, 2026 13:26

@0ax1 0ax1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great to write down proper docs. couple of thoughts

Comment thread docs/api/cpp/index.rst Outdated
Comment thread docs/api/cpp/index.rst
Comment thread docs/api/cpp/index.rst Outdated
Comment thread docs/api/cpp/index.rst Outdated
Comment thread docs/api/cpp/index.rst Outdated
Comment thread docs/api/cpp/index.rst Outdated
Comment thread docs/api/cpp/index.rst Outdated
Comment thread docs/api/cpp/index.rst Outdated
Comment thread docs/api/cpp/index.rst Outdated
Comment thread docs/api/cpp/index.rst
@myrrc myrrc requested a review from 0ax1 July 13, 2026 14:31
Signed-off-by: Mikhail Kot <mikhail@spiraldb.com>
@myrrc myrrc force-pushed the myrrc/cxx-new-docs branch from 2e6b836 to 222c409 Compare July 13, 2026 14:31
Signed-off-by: Mikhail Kot <mikhail@spiraldb.com>
@myrrc myrrc force-pushed the myrrc/cxx-new-docs branch from 222c409 to d944f96 Compare July 13, 2026 14:37
Comment thread docs/api/cpp/index.rst Outdated
@0ax1 0ax1 disabled auto-merge July 13, 2026 15:15
Signed-off-by: Mikhail Kot <mikhail@spiraldb.com>
@myrrc myrrc enabled auto-merge (squash) July 13, 2026 15:27
@myrrc myrrc merged commit 443b79b into develop Jul 13, 2026
70 of 71 checks passed
@myrrc myrrc deleted the myrrc/cxx-new-docs branch July 13, 2026 15:35
connortsui20 pushed a commit that referenced this pull request Jul 13, 2026
encode_varbin[(1000, *)] flipped between ~138us and ~155-160us on about a
dozen recently merged PRs (including docs-only #8737 and uv.lock-only #8732),
encode_varbinview[(10000, 2)] on several more, and encode_varbinview
[(10000, 4)] flipped -10.1% on an earlier revision of this very PR - which
does not touch dict encoding.

String dict encoding is hash-table growth plus builder-buffer growth, i.e.
allocation-dominated, so the trace inherits glibc malloc's per-runner-image
code differences. Route it through vendored mimalloc, as the never-flagged
alloc-heavy bench suites already do.

Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6PPcdrqcNeUkfi1EGd4oC
connortsui20 pushed a commit that referenced this pull request Jul 13, 2026
eq_i64_constant showed the same ~+11% two-state flip as compare_int_constant,
most conclusively on docs-only #8737. Like compare.rs, the timed region
allocates the output array through glibc malloc while the kernel itself is
compute-bound, so route allocation through vendored mimalloc.

Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6PPcdrqcNeUkfi1EGd4oC
connortsui20 pushed a commit that referenced this pull request Jul 13, 2026
encode_varbin[(1000, *)] flipped between ~138us and ~155-160us on about a
dozen recently merged PRs (including docs-only #8737 and uv.lock-only #8732),
encode_varbinview[(10000, 2)] on several more, and encode_varbinview
[(10000, 4)] flipped -10.1% on an earlier revision of this very PR - which
does not touch dict encoding.

String dict encoding is hash-table growth plus builder-buffer growth, i.e.
allocation-dominated, so the trace inherits glibc malloc's per-runner-image
code differences. Route it through vendored mimalloc, as the never-flagged
alloc-heavy bench suites already do.

Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6PPcdrqcNeUkfi1EGd4oC
connortsui20 pushed a commit that referenced this pull request Jul 13, 2026
eq_i64_constant showed the same ~+11% two-state flip as compare_int_constant,
most conclusively on docs-only #8737. Like compare.rs, the timed region
allocates the output array through glibc malloc while the kernel itself is
compute-bound, so route allocation through vendored mimalloc.

Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6PPcdrqcNeUkfi1EGd4oC
robert3005 pushed a commit that referenced this pull request Jul 14, 2026
A small pool of microbenchmarks flips ±10-35% between two fixed values
on unrelated PRs (including docs-only and lockfile-only changes),
spamming every CodSpeed report. This PR fixes them (and removes only 1
benchmark). No `#[cfg(codspeed)]` gating; CI and local runs stay
identical. One commit per benchmark.

## Changes

- **mimalloc as global allocator** in the 5 flaky `vortex-array` bench
files: `chunk_array_builder`, `dict_compress`, `varbinview_compact`,
`compare`, `binary_ops`
- **`bitwise_not_vortex_buffer_mut`**: drop the 128/1024/2048 sizes
(measured only harness overhead)
- **`slice_empty_vortex`**: rewrite as a 1024-iteration tight loop,
renamed `slice_empty_tight_loop_vortex`
- **`rebuild_naive` (vortex-zstd)**: the one benchmark removed instead
of fixed — its cost is dominated by zstd-internal copies (glibc
`ifunc`-resolved `memcpy`) that no bench-level change can stabilize, its
fixture is degenerate (a 4-string dictionary with all-zero offsets), and
ListView rebuild is already benchmarked across element types and list
shapes in `vortex-array/benches/listview_rebuild.rs`. The crate's
now-unused `divan` dev-dependency goes with it.

<details>
<summary>Which benchmarks were flaky, and the evidence</summary>

Identified by reading the CodSpeed comments on the ~47 PRs merged since
June 25 (post-#8490). The tell: the same benchmark flipping between the
same two values, in both directions, on PRs that can't have affected it
— including deny.toml-only (#8712, #8716), uv.lock-only (#8732),
docs-only (#8737, #8728, #8685), and CI-YAML-only (#8660, #8683)
changes.

| Benchmark | Evidence |
|---|---|
| `bitwise_not_vortex_buffer_mut[128/1024/2048]` | ~half of all PRs —
worst offender |
| `chunked_varbinview_*` ×4 | ~20 PRs, both directions |
| `chunked_bool_canonical_into[(1000,10)]` | ~2× flips (16µs ↔ 35µs) on
4 PRs |
| `encode_varbin`, `encode_varbinview` | ~12 PRs;
`encode_varbinview[(10000,4)]` also flipped on an earlier revision of
this PR |
| `compact`, `compact_sliced` (90%-utilization args) | ~8 PRs |
| `compare_int_constant` | ±11.1% verbatim on ≥9 PRs |
| `eq_i64_constant` | same ±11% signature incl. docs-only PR |
| `slice_empty_vortex` | -14.66% verbatim on ~13 PRs |
| `rebuild_naive` (vortex-zstd) | ~10 PRs, both directions |

Watch list (left alone, below the ≥3-independent-sightings bar):
`copy_nullable`/`copy_non_nullable[65536]` in `cast_decimal.rs`,
`true_count_vortex_buffer[128]`.
</details>

<details>
<summary>Root causes and why each fix matches</summary>

- **Allocation in the timed region** → glibc malloc's code differs
across CodSpeed runner images, so alloc-heavy benchmarks trace
differently for byte-identical Vortex code. Vendored mimalloc removes
glibc malloc from the trace. Empirical support: the only three bench
files already using mimalloc (`single_encoding_throughput`,
`common_encoding_tree_throughput`, `row_encode`) are the most
alloc-heavy suites in the repo and were never flagged once in the 47-PR
window.
- **Sub-microsecond work** → the measurement is fixed harness overhead
plus binary code layout, which shifts with any unrelated change. Fix by
making the operation dominate: the in-place NOT (no alloc, no copy)
keeps only sizes where the loop dominates; the empty slice runs 1024×
per iteration, mirroring the neighboring `slice_tight_loop_vortex`.
- **Environment-bound and low-signal** → `rebuild_naive`, per the
justification above: unfixable at the bench level and redundant with the
vortex-array ListView rebuild suite, so removed.
</details>

<details>
<summary>Validation: A/A reruns and a stacked canary PR</summary>

- **Expected one-time step changes on this PR**: swapping the allocator
changes the trace of every benchmark in the touched files, so this PR's
report shows a few ±10-20% level shifts (including on never-flaky
`encode_primitives`, which just shares a file). These need a one-time
acknowledgment on the CodSpeed dashboard; after merge every PR compares
mimalloc-vs-mimalloc.
- **A/A reruns** (same bench binaries measured three times, on separate
runners and commits): every value reproduced exactly — 211.5µs, 137.1µs,
14.6µs, 26.3µs — with zero new flags across 1656 benchmarks.
- **Canary #8743** (a #8681-style cold-string change stacked on this
branch — the class of change that used to collect five false flags):
**Performance Gate Passed**, `✅ 1660 untouched`, zero changes reported.
</details>

No public API changes; benchmark-only.

https://claude.ai/code/session_01T6PPcdrqcNeUkfi1EGd4oC

---------

Signed-off-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/skip Do not list PR in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants