Specialize buffered descriptor comparisons by record width #39

Open
github-bot wants to merge 1 commit from github-bot/gh-39 into main AGit
Owner

@⁠avt0m4t48 on GitHub · 2026-12-03 05:09 UTC · original
avt0m4t48:perf-specialize-buffered-descriptor-records → main · +29 −0 · 1 files · 1 commits · draft

Buffered descriptor mirroring compares groups of 16 before revisiting changed records. For the view and sampler strides of 32 and 16 bytes, express both comparisons with fixed-width arrays. This lets the compiler generate fixed-width compares and stores. Keep the generic path for other strides, and preserve the complete-record boundary, updated mirror bytes and order of changed slot numbers.

Local verification

The extracted production Copied::changes path matched an independent bytewise model across 31,500 calls per build. Tests include unaligned input, clipped ranges, partial records, and pre-existing entries in the output vector.

Median elapsed times for 12 paired runs at each target, scanning 400,000 synthetic records on a Linux i7-7700HQ with Rust 1.98.1:

Changes Generic x86-64 x86-64-v3
None 1.139 → 1.139 ms 1.196 → 1.209 ms
Sparse, 3,979 records 1.325 → 1.215 ms 1.372 → 1.248 ms
Mixed, 28,823 records 1.956 → 1.593 ms 1.986 → 1.557 ms
Dense, 279,396 records 3.304 → 2.532 ms 3.317 → 2.503 ms

A separate benchmark with two 400,000-record packs and 40,000 changes found 1.16–1.28× speedups. When the compiler could already see both stride and slice length as constants, most of the gain disappeared. The tiny unchanged 24-byte generic fallback was 22–23% slower on v3 in that fixture. Buffered sync uses 16 and 32. The isolated MSVC object grew by about 1 KiB of .text on each target.

These results cover local CPU comparison and copy work. Page acquisition, native Windows timings, GPU behavior and gameplay FPS were outside the measurement.

The standalone GPU test targets and combined workspace test targets type-checked for Windows x86-64 MSVC with pure-Rust BLAKE3 and a metadata-only allocator declaration. The combined check covered both diagnostics settings. The staged asset policy passed.

**@⁠avt0m4t48** on GitHub · 2026-12-03 05:09 UTC · [original](https://github.com/linkoovosh/LinkoArts-build/pull/39) `avt0m4t48:perf-specialize-buffered-descriptor-records` → `main` · +29 −0 · 1 files · 1 commits · draft Buffered descriptor mirroring compares groups of 16 before revisiting changed records. For the view and sampler strides of 32 and 16 bytes, express both comparisons with fixed-width arrays. This lets the compiler generate fixed-width compares and stores. Keep the generic path for other strides, and preserve the complete-record boundary, updated mirror bytes and order of changed slot numbers. ### Local verification The extracted production `Copied::changes` path matched an independent bytewise model across 31,500 calls per build. Tests include unaligned input, clipped ranges, partial records, and pre-existing entries in the output vector. Median elapsed times for 12 paired runs at each target, scanning 400,000 synthetic records on a Linux i7-7700HQ with Rust 1.98.1: | Changes | Generic x86-64 | x86-64-v3 | |---|---:|---:| | None | 1.139 → 1.139 ms | 1.196 → 1.209 ms | | Sparse, 3,979 records | 1.325 → 1.215 ms | 1.372 → 1.248 ms | | Mixed, 28,823 records | 1.956 → 1.593 ms | 1.986 → 1.557 ms | | Dense, 279,396 records | 3.304 → 2.532 ms | 3.317 → 2.503 ms | A separate benchmark with two 400,000-record packs and 40,000 changes found 1.16–1.28× speedups. When the compiler could already see both stride and slice length as constants, most of the gain disappeared. The tiny unchanged 24-byte generic fallback was 22–23% slower on v3 in that fixture. Buffered sync uses 16 and 32. The isolated MSVC object grew by about 1 KiB of `.text` on each target. These results cover local CPU comparison and copy work. Page acquisition, native Windows timings, GPU behavior and gameplay FPS were outside the measurement. The standalone GPU test targets and combined workspace test targets type-checked for Windows x86-64 MSVC with pure-Rust BLAKE3 and a metadata-only allocator declaration. The combined check covered both diagnostics settings. The staged asset policy passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 05:22:46 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/39/head:github-bot/gh-39'
git switch 'github-bot/gh-39'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-39'
git switch 'github-bot/gh-39'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-39'
git switch 'github-bot/gh-39'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-39'
git switch 'main'
git merge --squash 'github-bot/gh-39'
git switch 'main'
git merge --ff-only 'github-bot/gh-39'
git switch 'main'
git merge 'github-bot/gh-39'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.