GPU: skip CPU BLAKE3 texture hashing via xmem dirty-generation digests (VICTORY_TEXTURE_DIRTY_GEN=1) #1018
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/fxceless--victory-fork!1018
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1018"
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?
@HailLucifer666 on GitHub · 2026-11-25 16:21 UTC · original
HailLucifer666:perf/texture-dirty-gen-skip-blake3→main· +1181 −35 · 4 files · 6 commits · openStacked on #231 -> #872: merge after #872.
Adds opt-in (VICTORY_TEXTURE_DIRTY_GEN=1, off by default) dirty-generation digest skipping in exture.rs using xmem::va_generation_digest via ictory_gpu::set_page_gen_oracle, plus VICTORY_TEXTURE_HASH_ORACLE=1 to detect any uncounted writes.
Verification
Review of the commit before this one found five things worth fixing. All of them are about the evidence the change rests on, not about the mapping. THE BUG. Three of them are claims the earlier commit message or comments got wrong. The comment on `View::bytes` said two writers through the section's one mapping write "exactly as they did through separate temporary views". They do not. Through separate virtual views two writes to the same bytes were a data race; through one shared base two live `&mut [u8]` over overlapping bytes is undefined behaviour, and the compiler may assume they do not alias. The precondition -- no two writes in flight cover the same page -- is real, is stated in `dstorage` for the buffer branch only, and is not stated at all for the page branch that calls these helpers. The comment now names it as a precondition rather than calling it unchanged behaviour. The comment on `ensure_committed` promised that a host at its commit limit gets "the same crash report". It gets two: the persistent commit fails and reports, then the caller retries on the temporary path and that commit fails and reports again. The comment says so now instead of claiming otherwise. The `end <= self.size` comparison was described as unobserved and was declared alongside the one surviving mutation, which understated it: it is the only thing keeping `committed_all`'s page arithmetic inside `committed`. It was also invisible to all 16 tests, because both "past the section" rows are refused by the host's own `VirtualAlloc` first. A zero-length range past the end is now asserted refused; that row the host cannot supply, so deleting the comparison turns the test red. WHY NOT HYPOTHETICAL. `persistent_page_windows_share_one_mapping` passed with every write on the temporary path. Its only evidence was `persistent_ptr()` returning the base -- but the test itself calls that, and `View::persistent` calls it before the commit can fail, so the `OnceLock` was populated whether or not the persistent path ever ran. Every byte assertion still held, because the temporary view writes the same pages. A test that cannot see the thing it is named for is worse than no test, and this one would have been quoted as proof that the path works. And with the switch on, nothing said whether it was actually in effect: the map half warns per section, the commit half said nothing, and no run could report "these sections are persistent". That is the exact evidence the switch becoming the default is supposed to rest on. THE FIX. `page_bytes`, the helper the pre-existing tests read bytes through, now asks for `Mapping::Temporary` explicitly, so those tests are the persistent path's negative control whatever the environment says. `persistent_page_windows_share_one_mapping` asserts the pages were committed through the section's mapping after the first window, which only the persistent path does. Confirmed by probe: with `View::persistent` made to return `None`, it now fails with "the window fell back to a temporary view" where it previously passed. `ensure_committed_refuses_ranges_outside_the_section` gains the zero-length row, and the surviving-mutation note now names one mutation because only one remains. A `fallback_noted` on `Section` warns once per section when a commit through the persistent view fails, and `View::persistent` says once, at info, that pages are being written through the persistent view. A run with the switch on can now show which it did. SCOPE. xmem.rs only. The whole-section-vs-chunked decision, the fallback behaviour and the default path are unchanged. Two claims in the previous message are corrected here rather than by rewriting it: "the default path is byte-identical to before" is true of writes, not of allocation -- every section now allocates its page bitset either way, a few KiB per GiB; and "the same crash report" is two reports, as above. Verified: cargo test -p victory-hle xmem:: --locked 16 passed; the two clippy commands clean with and without --all-features; cargo test -p xtask 4 passed; cargo test --workspace --locked 500 passed, 0 failed, 7 ignored. Mutation runs 2026-11-25, all restored: `View::persistent` returning `None` outright fails both persistent tests ("fell back to a temporary view", "not mapped whole"); the `end <= self.size` comparison deleted fails the new zero-length row; the earlier probes (bitset not marked, commit removed) still behave as recorded. Co-Authored-By: DeepSeek V4.1 Flash <[email protected]>@MKmajster on GitHub · 2026-11-25 18:47 UTC · original
For anyone who merges this alone: with
VICTORY_TEXTURE_DIRTY_GEN=1onmainca8829f+ #1007 and without #872, the run ended while loading, before the world, with an access violation (a write to 0). As the description says, it needs #872 first. Without the switch the same build ran normally.AI-assisted (Claude Code). No game data attached.
@HailLucifer666 on GitHub · 2026-11-25 20:20 UTC · original
Thanks
@MKmajster— that confirms the dependency documented in the PR description:VICTORY_TEXTURE_DIRTY_GEN=1callsxmem::va_generation_digestand relies on#872's persistent high-VA alias + per-page generation counters, so this PR is stacked on#231->#872and must land after#872(not cherry-picked ontomainalone).d973366023to606d1e68bf@HailLucifer666 on GitHub · 2026-11-26 13:59 UTC · original
Rebased onto the new
#872head (08aa56ad); this head is now606d1e68(--onto, no conflicts). Verified:cargo checkfor victory-gpu, victory-hle and the victory app;victory-gpu texture::3 passed, 0 failed;clippy -D warningson victory-gpu and victory-hle clean. It still needs#872(and#231) to land first, as the description says.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.