WIP: perf(host): filter translated store marks by GPU backing range on Linux #1558
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1558
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:perf/parked-gpu-store-filter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: perf · Risk: high · Tested on: CachyOS Linux, Ryzen 9 7900X, RTX 3090 · Needs: controlled repeat on Linux
TL;DR
Parked experiment. Skipping dirty-page bookkeeping for memory outside GPU mappings improved one scripted Market run, but the next desktop playtest was slower and had more long frames. The switch stays off by default. Please leave this PR WIP.
Breakdown
Why
The main thread often waits for worker jobs in Market. CPU write bookkeeping occurs in those jobs. A related store-mark experiment on another machine motivated checking the cost here. Related experiment
What changed
Linux builds support HOS_GPU_DIRTY_FILTER=1. The generated store helper checks endpoint groups. NVN and nvdrv enroll the guest backing of physical and alias mappings, with a process-wide barrier before the first mapping becomes visible. A system without the required Linux membarrier support keeps ordinary tracking.
Measurements
The tested change was 055c6460 on the #1553 series. This PR carries the isolated change on main at
b268d901. Each row compares like routes within its own mode.The queue detected an outside build during the filtered desktop run. Manual movement varied. These results leave the desktop benefit unproven.
Testing
Tested locally with the exclusive timing and profile queue. The scripted and desktop runs reached Market and exited cleanly. The mapping regression passes on the isolated PR commit and covers endpoint stores, first mapping, alias and remap, and failed enrollment and retry. The guest libc hook check passed in the experiment workspace.
Must be tested
Repeat the same route with an uninstrumented binary and the same candidate binary with its switch disabled and enabled. Check scene-entry tails, low-memory hardware and first-mapping capture volume. Full suite and in-game verification of the isolated main-based tip are outstanding.
Risk and rollback
Leaving the switch unset keeps ordinary dirty marking. Reverting this commit also removes the eligibility probe from the Linux binary. The first enrollment marks sixteen pages, which can increase capture traffic.
Checklist
Tested in game: Tested the filter on the #1553 renderer in scripted and headed Market on Linux, RTX 3090. Isolated commit
b268d901passes the mapping regression. Parked after the headed comparison.I recommend keeping the filter opt-in. I ran the same #1558 binary (
b268d90152) twice on Linux with a Ryzen 9 7900X, an RTX 3090 and NVIDIA 620.70.06. The filter ran first enabled and then disabled. Each pass started from a private copy of the same game and driver caches. Both indexed 32,459 pipeline notes, and the host confirmed filter activation in the enabled run. A single high-priority exclusive queue job covered both passes and recorded zero outside builds.Each pass used a fresh child save and the same inputs in Market. The player went forward for 10 seconds and circled while looking around for 15 seconds. Position samples confirmed movement in Market throughout.
With populated notes, enabling the filter lowered average FPS by 10.7% and nearly doubled p99. The disabled run still had the longest individual pause, including about one second of renderer wait. In an earlier pass where the tour set the graphics notes aside, this PR with the filter enabled reached 62.23 FPS versus 55.91 on its direct main base. The sign changed across experiments. One pass per configuration leaves the effect of run order and scene variation unresolved.
The implementation is currently Linux-only and uses membarrier when memory first becomes GPU-visible. Windows also tracks CPU writes in software, so the idea could apply there. A Windows port would need an equivalent, verified first-mapping handoff and independent measurements. I would want interleaved repeats in Market and Field and a second GPU with less VRAM before proposing a default change.
Results from a Steam Deck OLED.
Setup: SteamOS, RADV (Mesa 26.2.0-devel), the built-in 1280×800 display, Minimum preset with a fixed 50% render, frame generation off, 15 W and main's clock policy.
What was compared: the SAME
b268d901build (on itsd1a307cbbase) withHOS_GPU_DIRTY_FILTERunset vs=1, two reverse-order rounds (U F / F U).Kokiri standing:
Hyrule Field: no admitted comparison pair. One filtered measured window passed and neither control window did. The refusals flag background work and program-census activity, not an identified translation or filter failure.
Safety: the covered safety windows in both switch states had zero flash-detector flags, and the sampled views showed no obvious new artifact. No GPU fault or reset in this block.
These are descriptive two-pair measurements, not a settled estimate of general benefit, and not evidence of equivalence. They don't justify turning the filter on by default, and they don't replace a comparison against unmodified main.
Follow-up on the Field admission refusals: the recurring “1 jobs queued” pattern aligns with the renderer’s scheduled glibc heap check/trim (
mallinfo2/malloc_trim), which also exists on544229a2; window alignment explains why it was sampled in some runs and not others. It is not evidence of a newly translated Field shader. Our original admission decisions and exclusions are unchanged; separate program-census refusals remain, so there is still no admitted Field comparison pair.Instrumentation caveat for the Steam Deck numbers: recurring long frames have nearly the same cadence as our /proc memory sampler. We are investigating an observer effect; no sampler-off control has established its size or whether it changes the arm contrasts. The Deck p95/p99, long-frame counts and FPS comparisons in our comment above include that instrumentation and must not yet be treated as unsampled player experience. The raw results and exclusions are unchanged.
Follow-up to the instrumentation caveat above: a sampler-cadence control on the same Deck moved the recurring long frames with the memory sampler's period (5.8 → 17.8 → 5.8 s), with every Kokiri interval over 100 ms intersecting its
smaps_rollupread. That strengthens the observer-effect caveat for our Deck tail numbers; it doesn't estimate unsampled FPS or show that the arm contrasts cancel. Details: #1477 (comment)View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.