Experiment with adaptive CPU read-ahead on UMA faults #397
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!397
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-397"
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?
@lucalocastro on GitHub · 2026-12-04 00:04 UTC · original
lucalocastro:codex/uma-adaptive-read-ahead→main· +203 −1 · 5 files · 1 commits · openA first CPU touch currently opens up to 15 neighboring 64 KiB pages. This experiment starts with the requested page and grows the window on consecutive faults. Each thread tracks four streams. The existing 16-page window stays the default.
Windows microbenchmark
Median of 30 measured sequences per setting and workload across ten paired launches. Each sequence used 512 reads with real Windows faults on a synthetic 512 MiB section. Timings came from the integration checkout based on
eb51227. Both modes also passed the fixture on this PR commit,72750c6. P99 is per access.The sparse sequence saved 3.48 ms over 512 reads. It opened 8,192 pages with the fixed window and 512 with the adaptive window. With eight interleaved streams, faults increased from 32 to 512 and total time roughly doubled even though per-access P99 fell.
One A/B comparison requested
On this commit, run A with
VICTORY_ADAPTIVE_READ_AHEAD=0and B withVICTORY_ADAPTIVE_READ_AHEAD=1. Restart between arms, restore the same save and use A/B/B/A. Both arms use the upstream migration lock. This experiment is independent of #392.Please cover a city traversal with camera turns, a steady interior and a streaming transition. Include RT off/on, CPU-limited and GPU-limited settings, the normal title budget and a verified 512 MiB cap where available. Separate cold loads from warm repeats. Record CPU, GPU/VRAM, driver, Wine/Proton, resolution and actual title budget. Keep input, shader cache state, frame cap and frame generation settings matched. For steady play, warm up one minute and record the next three.
Please attach per-run median and P99 frame time, FPS, frames over 50/100 ms, and raw frame times if possible. Report regressions, neutral results and visual issues. The eight-stream regression is why this remains opt-in pending game data.
The isolated Windows test is
windows_fault_read_aheadin thevictory-gpulibrary. Run it once per switch value with--ignored --nocapture --test-threads=1.@Luxuride on GitHub · 2026-12-04 11:28 UTC · original
Rebase first, please: the branch predates
f374dbf("count the views an aliased open actually cleared"), so the diff against main deletes thatopen_givencounter atcrates/victory-gpu/src/watch.rs:2514-2530. A rebase removes it; merging the tree as-is would undo a merged fix.Then the comment is one step off: "Cover 1, 2, 4, ... pages" at
watch.rs:1604does not match the code — the stored window starts at 0,window <= 1takes the one-page branch (:1605-1609), and only then does it store(window * 2).clamp(1, 16)(:1612), so the sequence is 1, 1, 2, 4, 8, 16. That also explains your own numbers (sequential slightly worse, 0.575 -> 0.587 ms) better than the comment does.Docs:
docs/SETTINGS.md:59puts the row in "Ray tracing, memory and paging", where every other row has arun.conf.defaultline; either add one or move it to the runtime-only table (:144).The install-time read (
watch.rs:3113) and theconst { Cell::new(..) }initialiser (:1593-1594, no lazy-init lock inside a vectored handler) are both the right call.72750c66c7to56ce551c10@lucalocastro on GitHub · 2026-12-04 12:05 UTC · original · edited 2026-12-04 12:09 UTC
@Luxuride I’ve rebased the patch locally onto
0fd7614and verified that the fullopen_givenfunction matches upstream main, including the actual-open count fromf374dbf. The comment now gives the requested windows as 1, 1, 2, 4, 8, then up to 16 pages. I also addedVICTORY_ADAPTIVE_READ_AHEADtorun.conf.default, unset by default, to match the menu table. The changes are now on this PR in56ce551c10. I verified the exported patch against main; I haven’t run the Windows tests on this revision.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.