Cut large title-memory allocations into sections of 64 MB #3
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/ReTerryDavis--ReVIctory!3
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3"
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?
@FeelsGoodMan2 on GitHub · 2026-11-30 00:23 UTC · original
FeelsGoodMan2:section-split→main· +168 −35 · 1 files · 1 commits · merged 2026-12-04 01:54 UTCWhat this changes
Large allocations of title pages become several sections of 64 MB instead of one section of any size. Only
crates/victory-hle/src/modules/xmem.rschanges.VICTORY_SECTION_MBsets the size (default 64;0: one section per allocation, as before).arrange).Why
The title's pool of about 6.1 GB is one section today, and its pages are mapped as single 64 KB views (the source puts them at about 100,000; I have not counted them).
The host keeps the views of a section in one list under one lock. I recorded a CPU and context-switch trace of a sibling fork with the same mapping code. A system thread rebuilding large pages (
MiRebuildLargePages->MiTradePage->MiTrimSharedPage->MiTrimSection->MiViewMayContainPage) goes through the views of a section. The title's thread incopy_page_mappings->map_aliases->MapViewOfFile3/UnmapViewOfFile2waits for that thread, 1-4 ms per page, one page at a time (VICTORY_MAP_THREADS=1inplay.ps1).All three gaps over 60 ms in the submit thread (24 s of switch data) are almost all that wait (89-93 %):
Tests
On this branch, Windows 11 build 26300, i5-13600KF, 32 GB RAM, RX 7800 XT:
cargo test --workspace --locked --no-fail-fast -- --test-threads=1: 1443 passed, 7 failed, 63 ignored. Failing:warm_bad_fingerprint_override_again_and_help,first_half_values_render_on_hardware_and_warp,a_geometry_program_is_a_geometry_shader,rectangles_are_drawn_whole,the_rectangle_stage_is_a_geometry_shader,repository_passes_policy,documented_switches_are_read. I have not compared them with an untouchedmain.cargo test -p victory-hle --locked: all passed (the main target 234 passed, 5 ignored).cargo clippy -p victory-hle --lib --tests --no-deps -- -D warnings: clean. The workspace clippy stops on errors invictory-shaderandvictory-loader, which this branch does not change.Two new tests: the lengths of the sections (and that 185 MB stay in one), and mapping, aliasing, reading and writing pages across a cut. The second fails with
VICTORY_SECTION_MB=0(4,099 pages in one section) and passes by default.AI disclosure
Written with an AI coding tool (Claude Code).
🤖 Generated with Claude Code
@RiceShower0721 on GitHub · 2026-11-30 09:14 UTC · original
just asking if u don't mind is there a way 7000 series apply forced fsr4.1 instead of fsr3?
@cloph-dsp on GitHub · 2026-12-01 21:00 UTC · original
Verification (independent, AI-assisted: Hy4 flash). Windows, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC, commit-scoped worktree, dedicated
CARGO_TARGET_DIR.Base
30f351de58f5922bde62506d169b1ce16e09886e, head054bf1e925469ffb9ad49ad8939471d48de76676.git diff --numstat→crates/victory-hle/src/modules/xmem.rs168/35.Both test names are new on the base:
→ no match, exit 1 for each.
git diff --check "30f351de..054bf1e9"→ no output, exit 0.Result, each:
running 1 test,test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 238 filtered out(0.01s and 0.02s).What they pin, with no device and no title files: the first checks
section_lengths(n, one_heap, most)for 5/4/2/1 pages with a 2-page cap — 5 pages split[2, 2, 1], 4 →[2, 2], 2 →[2], 1 →[1]— plus both ways of asking for one section (one_heap, andmost = 0), and then that the 32-bit heap's 185 MB allocation still lands in a single section and frees as one call. The second allocatesONE_SECTION + page_count_most() + 3pages and asserts the page numbers still follow on byFRAMES, that every page'sindex < section.pages, no section holds more thanpage_count_most()pages, and that mapping across section boundaries works.Caveats worth naming: both touch global xmem state, so they only mean anything run alone (
--test-threads=1) — a parallel run against other xmem tests allocates into the same page table; and the second test's cross-section mapping arm is what proves the split is usable, while the first only proves the arithmetic of the split.No game data.