[pr-performance] Stop scanning once the longest root-view window is found #35

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

@⁠avt0m4t48 on GitHub · 2026-12-03 04:36 UTC · original
avt0m4t48:perf-ordered-window-tail → main · +3 −3 · 1 files · 1 commits · draft

Change

The ordered loose-window map already visits candidates from lowest starting address to highest. A reusable tail must end at the same boundary, so the earliest eligible start is the longest. Return on that first match, preserving the selected key and the caller's fallback and lock.

This reduces CPU work where the NVIDIA launcher enables tails and the 1 MiB grid for detected RAM up to 16.5 GiB.

Verification

Extracted the actual selector and existing tail tests. Across 245,760 comparisons per source and CPU target, the old and patched selectors matched a separate oracle for the selected key, stored entry and new-window fallback.

Repeated pinned Linux runs using the LinkoArts release-style fat LTO configuration, 15 alternating pairs per case:

Fixture Original Patched Median paired change
Dense existing tails 83.67 ns 36.80 ns -55.97%
Early match among shorter windows 138.62 ns 62.40 ns -55.17%
Rotating cells, mixed hits and misses 212.06 ns 157.38 ns -26.02%
Last eligible key 171.66 ns 174.30 ns +1.00%
No eligible key 164.91 ns 169.73 ns +2.72%
One eligible window 27.15 ns 26.88 ns -2.20%

The timings cover the CPU map query. Results for the late match and miss show the cost of still visiting the full range. The fixture excludes the Windows lock, device operations, and gameplay frame timing.

Windows x86-64 MSVC standalone GPU test targets and combined workspace test targets type-checked. The workspace was checked with diagnostics enabled and disabled. The checks used pure-Rust BLAKE3 and a metadata-only allocator declaration. The staged asset policy passed.

**@⁠avt0m4t48** on GitHub · 2026-12-03 04:36 UTC · [original](https://github.com/linkoovosh/LinkoArts-build/pull/35) `avt0m4t48:perf-ordered-window-tail` → `main` · +3 −3 · 1 files · 1 commits · draft ## Change The ordered loose-window map already visits candidates from lowest starting address to highest. A reusable tail must end at the same boundary, so the earliest eligible start is the longest. Return on that first match, preserving the selected key and the caller's fallback and lock. This reduces CPU work where the NVIDIA launcher enables tails and the 1 MiB grid for detected RAM up to 16.5 GiB. ## Verification Extracted the actual selector and existing tail tests. Across 245,760 comparisons per source and CPU target, the old and patched selectors matched a separate oracle for the selected key, stored entry and new-window fallback. Repeated pinned Linux runs using the LinkoArts release-style fat LTO configuration, 15 alternating pairs per case: | Fixture | Original | Patched | Median paired change | | --- | ---: | ---: | ---: | | Dense existing tails | 83.67 ns | 36.80 ns | -55.97% | | Early match among shorter windows | 138.62 ns | 62.40 ns | -55.17% | | Rotating cells, mixed hits and misses | 212.06 ns | 157.38 ns | -26.02% | | Last eligible key | 171.66 ns | 174.30 ns | +1.00% | | No eligible key | 164.91 ns | 169.73 ns | +2.72% | | One eligible window | 27.15 ns | 26.88 ns | -2.20% | The timings cover the CPU map query. Results for the late match and miss show the cost of still visiting the full range. The fixture excludes the Windows lock, device operations, and gameplay frame timing. Windows x86-64 MSVC standalone GPU test targets and combined workspace test targets type-checked. The workspace was checked with diagnostics enabled and disabled. The checks used pure-Rust BLAKE3 and a metadata-only allocator declaration. The staged asset policy passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 05:22:26 +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/35/head:github-bot/gh-35'
git switch 'github-bot/gh-35'

Merge

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