Repository navigation
Conversation
The guard protected one view of a texture's physical pages and heard only of faults there, so a write through another view of the same pages, or the runtime's own write into them (write_physical, DirectStorage page destinations), went unseen and the texture kept stale contents until its eighth-frame hash. The guard now protects every view of its pages, and the runtime reports its own writes.
|
Confirmed on AMD: this fixes the boot video stutter on an RX 6600M. Setup: AMD Radeon RX 6600M (8 GB, 32-lane waves), driver 32.0.21045.16010, Windows 11 26200, default TDR. Own 1.0.2.1 copy, Series X profile, What it looked like before: the boot video played visibly jerky, and the present timing did not explain it. With
Without it, the video's three frame buffers cycle: frames 761-770 show the same three images in turn ( Tests: Unrelated, from the same runs, in case it helps someone else: the 1.0-1.5 s freezes on the black screen before the first logo are a title worker making about 54,000 one-page AI-assisted (Claude Code); hashes, counts and log lines only. |
|
Confirmed the boot-video fix on an NVIDIA RTX 5070 (driver 610.88), Ryzen 7 7800X3D, Windows, native D3D12, Series X profile. I compared 4e17478 with #115 (2ef19e0, also cleanly applied to 2119b0e, whose source tree matches 4e17478). Both runs used the same saved setup, separately copied warm caches and identical inputs. I captured three bursts of 18 consecutive frames in the animated startup video, starting at host frames 390, 470 and 555. Both sides showed the moving intro in all three bursts. I hashed the decoded RGB pixels. A return means frame N matches N−3 with at least one different image in between.
I also ran the Windows shared-page regressions against main as negative controls: the write-through-another-view and newly-mapped-alias tests both failed with an empty dirty-page result on main and passed with #115. All 33 focused watch, XMem and DirectStorage tests passed with the change. These captures measure frame content, so I’m reporting the reversal fix separately from frame pacing or gameplay FPS. AI-assisted testing. World checkpoint follow-up. This revision also exited in two runs shortly after entering the prison scene on my RTX 5070. Windows exit code was 0x80000003 in both, without a reported GPU device loss. The last captured frames were 40 and 24 frames past the first 500-draw frame. One used joined rehash runs with descriptor statistics, the other the normal direct-queue play profile. I reran main with the latter profile and the same saved checkpoint and reached +150 frames. Earlier main comparisons reached +500. I haven't isolated which change accounts for the exits. The intro result above stands; I would keep later gameplay stability a separate check. The narrower patch from #63 applied to 4e17478 also gave 18 distinct frames in each of the three intro bursts and zero three-frame returns. With that patch, the same checkpoint reached +500 frames on the standard direct-queue play profile. |
|
A defect in this PR's What is wrong. The fix. The other views are made read-only and noted protected, not clean; Test. Measured on an RTX 5070 (driver 32.0.16.2124, Windows 11, diag build,
So this PR also matters outside textures: without it the copies of the memory the structure builder works in go stale within a second. It does not fix #16: the title still crashes 5-15 s after the builder starts with both changes (2 of 2 runs, Not tested: AMD, Intel, Windows 10, the boot video with the fix on top. AI use: Claude (Anthropic) in OpenCode, on my machine with my own copy of the title; no game data attached. |
|
Measured in the title with joroyt's Spexivus#1 ( RTX 4070,
So with The problem: the title stops itself in 2 of the 4 runs with this PR (one without Why it happens more with this PR: |
…ess#206 reverted) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Same stop as @SantannaCarlos describes, on another setup, and it comes fast with the speed switches. Setup: RTX 5060 Ti 16 GB (driver 621.24), i7-14700KF, Windows 10 22H2 (#22 for the Agility SDK), release build, Series X. Tree
Before both stops the log has With AI-assisted (Claude Code, Claude Opus 5.5); numbers from local logs, no game data attached. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The title shows one physical page at several addresses. A copy taken through one of them was guarded at that address only, so a write through another left the copy as it was for the rest of the run. On one machine the first room's walls and a face's shading came back in two runs out of two; the walls also came back by themselves in some earlier runs, so this is not proof. Code of victory-fork fxceless#115 by Spexivus (the index of the views of each page, the guard over all of them), with joroyt's correction of it (another view is made read-only, not noted clean) and the set of aliased blocks of VIctory fxceless#1122 by tightfall. Added here: a page of more than 64 views is guarded one view at a time, a switch (VICTORY_VIEW_GUARD=0), counts in the diagnostics log, and tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The title shows one physical page at several addresses. A copy taken through one of them was guarded at that address only, so a write through another left the copy as it was for the rest of the run. On one machine the first room's walls and a face's shading came back in two runs out of two; the walls also came back by themselves in some earlier runs, so this is not proof. Code of victory-fork fxceless#115 by Spexivus (the index of the views of each page, the guard over all of them), with joroyt's correction of it (another view is made read-only, not noted clean) and the set of aliased blocks of VIctory fxceless#1122 by tightfall. Added here: a page of more than 64 views is guarded one view at a time, a switch (VICTORY_VIEW_GUARD=0), counts in the diagnostics log, and tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested this PR on its own (merged onto current main 2119b0e, release build, RTX 5070, driver 32.0.16.2124, VICTORY_RELAY=2, same key script, 330 s per run, real title).
Not verified: whether the boot-video glitch this PR targets is fixed (not looked at in these runs), and whether the dstorage failure is caused by the page guard or only exposed by it. |
|
Same stop reproduced on Linux/Wine, with the same log signature, and a clean A/B on the same tree. Counters and offsets only, no game data. Setup: RX 7900 XT (RADV, Mesa 26.3.1), Wine 11.22 with vkd3d-proton (GE
The two stops, both on a title worker thread (
That supports @SantannaCarlos's diagnosis and the hold-open fix (keeping the destination's blocks open until the read is done, for |
The title shows one physical page at several addresses. A copy taken through one of them was guarded at that address only, so a write through another left the copy as it was for the rest of the run. On one machine the first room's walls and a face's shading came back in two runs out of two; the walls also came back by themselves in some earlier runs, so this is not proof. Code of victory-fork fxceless#115 by Spexivus (the index of the views of each page, the guard over all of them), with joroyt's correction of it (another view is made read-only, not noted clean) and the set of aliased blocks of VIctory fxceless#1122 by tightfall. Added here: a page of more than 64 views is guarded one view at a time, a switch (VICTORY_VIEW_GUARD=0), counts in the diagnostics log, and tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit c6dc4d8)
|
The fix for the stops above is Spexivus#2, on top of this branch and joroyt's #1 there: |
|
Tested this PR merged onto current main (c96b4f2) against main alone: release build, RTX 5070 12 GB, driver 32.0.16.2124, VICTORY_RELAY=2, same key script, 240 s per run, 3 runs each. A main run and a PR run were always running at the same time (two sessions), so GPU/host memory pressure is a confound.
So I could not reproduce the earlier report (breakpoint after a dstorage failure, only with this PR): on this main both sides fail, in similar proportions, and the PR does not stand out at n=3. The 0xC0000005 run is one sample and I did not look for its cause. Not verified: whether the boot-video glitch is fixed (not looked at), and whether the failures above also happen with one session at a time. |
Census: report directory traversal failures
|
@UwUCammie @Revens2 thanks, that's the same signature on both platforms ( On the 4070, with it, 3 of 3 runs in the cell went 15 minutes with no |
Support unaligned 12-byte typed views while retaining their backing heaps. Track writes across views of physical pages and keep DirectStorage kernel destinations writable until the read completes. Include the Wave64 lowering, indirect scratch, readback and diagnostic changes from the RTX build used for the apartment and prison captures. Physical-page handling adapted from myokex/victory-amd@c6dc4d8, incorporating Marvisak#1122 and fxceless/victory-fork#115. Other incorporated changes include fxceless/victory-fork#220, Marvisak#253 and Marvisak#260. Verified on RTX 5070 Ti. The apartment capture shows restored clothing and interior surfaces. Prison lighting and gameplay performance remain incomplete.
|
Tested in the game, sequentially and alone on the machine (no other title session at the same time), RTX 5070 12 GB, diagnostics build,
In both crashed runs the title raised the breakpoint within about 150 ms of the failed request, always an unpacked read ( Probable cause (read from the code, not proven by a trace): Candidate fix, tested on top of this PR: in - fill: impl FnOnce(&mut [u8]) -> Result<usize, HRESULT>,
+ mut fill: impl FnMut(&mut [u8]) -> Result<usize, HRESULT>,
...
- victory_gpu::kernel_will_write(request.destination as usize, len);
- let out = unsafe { std::slice::from_raw_parts_mut(request.destination.cast::<u8>(), len) };
- return fill(out).map(drop);
+ const INVALID_USER_BUFFER: i32 = 0x8007_06f8_u32 as i32;
+ let mut tries = 0;
+ loop {
+ victory_gpu::kernel_will_write(request.destination as usize, len);
+ let out = unsafe { std::slice::from_raw_parts_mut(request.destination.cast::<u8>(), len) };
+ match fill(out) {
+ Err(INVALID_USER_BUFFER) if tries < 16 => tries += 1,
+ done => return done.map(drop),
+ }
+ }Not verified: whether the boot video glitch this PR targets is fixed (not looked at in these runs); |
…re seen (intro movie stutter) The texture guard re-hashed a texture only every eighth frame when it saw no write to it, and it saw writes only at the one address it guarded. The intro movie's frames are written through another view of the same pages, so it showed stale frames and jumped back and forth (fxceless/victory-fork#39, #269). Brings in, from SantannaCarlos/victory-fork fx/kernel-write-held: - fxceless/victory-fork#115 by Spexivus (2ef19e0): the guard protects every view of the guarded pages and the runtime reports its own writes into them; - Spexivus/victory-fork#1 by joroyt (0bcc069): another view of pages a copy took is made read-only, not noted clean; - Spexivus/victory-fork#2 by Carlos Sant'Anna (90697f1): memory the kernel writes is held open until it has written (without it DirectStorage requests failed and the title stopped after 2-3 minutes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rites counted; levels on demand (off); warm-up; card memory numbers Memory sync: - The guard over every view of a physical page (code by myokex, victory-amd c6dc4d8, after pull request #115 by Spexivus, its correction by joroyt and a part of VIctory #1122 by tightfall): the title shows one page at several addresses and a copy was guarded at one only. 0.8 to 1.0 million writes through another view in a five-minute run on the test machine. VICTORY_VIEW_GUARD=0 turns it off. - Kernel reads into title memory are read beside and copied in (Joshua Odom, 10ea38e). - Writes of the storage layer into physical pages are counted where the title has the pages mapped and can open the guards there (VICTORY_PAGE_WRITES, off: counted only). Failed page-destination reads are retried. Card memory: - Levels on demand, off unless VICTORY_LEVELS_ON_DEMAND=1: a texture the title fills takes card memory for the levels the title holds; held levels get memory only while the card has room and are asked for again. Its test runs on the software adapter; not run on a card yet. - Refused texture slots are held back so a pass reaches the slots behind them; room can be kept for card copies of title buffers (off). Tools: translate --warm all; the shader cache is keyed on the translator's source; counters for copy-back races, page writes and the copies the texture sweep never lets go; a walls trace. Game runs of these changes on an RTX 4070: five five-minute runs without a device loss or a failed request. This merged tree was built; its test suites were run on the tree the changes come from (gpu 129, hle 97). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The shared-page negative control that @ryotdev reported on Windows also distinguishes the two modes on Linux / GE-Proton11-14, using integrated main
With defaults, all 12 AI disclosure: Hermes Agent built and ran these tests, checked the negative control, and wrote this comment on ArturoWolff’s behalf. |
Census: report directory traversal failures (cherry picked from commit b5ac27f)
|
@SantannaCarlos thanks for the branch and for naming the cause. Tested Tree: origin/main Setup: RTX 5070 12 GB, driver 32.0.16.2124, Windows 11,
So the crash I reported on #115 is gone with this branch in our setup: no failed request, no breakpoint, all three runs alive at the end of 900 s, the world (about 5,000 draws per frame in the cell scene) reached at t=126-142 s. The mechanism you describe (a guard re-closing the destination between One difference I can't explain: median fps is lower (2.5-3.3 against 4.7-5.0). I did not run main on Not verified: whether the boot video is fixed with this branch (not looked at); cause of the lower fps; Wine / AI-assisted (Claude Code); numbers from local run logs. |
|
Update for anyone testing this PR: We have a solo three-run test of SantannaCarlos's |
|
@Revens2 thanks for the runs. On the fps question, the same base on the 4070 (default settings of
So most of the drop you saw is the base: Main has since taken the view guard ( |
|
Follow-up on the remaining case: on current main ( |
|
@SantannaCarlos thanks for the base-vs-branch table and for the follow-up on Tree:
The cell scene draws about 5,000 draws per frame in all three runs (max 7,300-9,600 in transitions). A late capture of run 1 shows the cell and a guard in the doorway, rendered normally. Fps attribution: the 2.5-3.3 we measured on Not verified: the boot video glitch (not looked at); Wine / So on AI-assisted (Claude Code); numbers from local run logs. |
The title shows one physical page at several addresses. A copy taken through one of them was guarded at that address only, so a write through another left the copy as it was for the rest of the run. On one machine the first room's walls and a face's shading came back in two runs out of two; the walls also came back by themselves in some earlier runs, so this is not proof. Code of victory-fork fxceless#115 by Spexivus (the index of the views of each page, the guard over all of them), with joroyt's correction of it (another view is made read-only, not noted clean) and the set of aliased blocks of VIctory fxceless#1122 by tightfall. Added here: a page of more than 64 views is guarded one view at a time, a switch (VICTORY_VIEW_GUARD=0), counts in the diagnostics log, and tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit c6dc4d8)
Before: the texture guard made the 64 KiB blocks of one view read-only and learned of writes only at that address: a fault there,
watch::writing, or a mapping. Physical pages can be mapped at several addresses, though, and a write through another view of the same pages, or the runtime's own write into physical pages (write_physical, DirectStorage page destinations), never faults at the guarded address. The guard then reported the texture unwritten, so it was hashed only on its turn every eighth frame and kept showing stale contents in between.After: a write to the pages is seen whichever way it arrives.
watch.rs: the guard makes every view of the guarded physical pages read-only. A fault at any of them, orwriting, opens and marks all of them written. Newtitle_memory_written(section, offset, len)lets the runtime report its own writes into physical pages, and a view newly mapped over guarded pages makes their guards check again.inplace.rs: an index from (section, 64 KiB offset) to every view showing it, kept bytitle_memory_view/views_gone, withviews_between,pages_ofandviews_of_sectionto look it up.xmem.rs:write_physicalreports each run it writes;PageWindow::written()reports the window.dstorage.rscalls it after filling a page destination.texture.rs: withdiagnostics, a one-time warning when a hash finds a change the guard did not report, naming the texture, so any write path still missed shows up.Unchanged:
HASH_EVERY, and memory that is not written costs the same as before (no faults, no hash). The hash stays as the net under the guard.Tests: three new ones in
watch.rs(a write through another view, a view mapped beside a guarded one, a runtime write into physical pages).cargo test -p victory-gpu --features diagnostics120 passed,victory-hle95 passed, clippy clean with and withoutdiagnostics.