RTX 4080: the 14 CS_ShadowRenderTiled* programs look wrong in the deep-skips wave64 form (missing ceiling, dark room); loop limit 32 smears hair #62
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#62
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Xeltax on GitHub · 2026-11-24 21:01 UTC · original
Setup: RTX 4080 16 GB (32-lane waves), driver 621.01, Windows 11 Pro 26200, own copy of 1.0.2.1, Series X, diag build. Tree:
7b0f736plus a heap remap (VIcky'sfx-heapmap; it doesn't change what follows, see the last point). One run per setting, about 7 min each, compared on the same scene (the prison cell after the cutscene).1. Loop limit. With
VICTORY_SHADER_LOOP_LIMIT=32the hair is smeared into strands. Without it the hair is clean. This matches the RTX 2080 note on #5.2. The "without skips, scalars followed" form from
6a2d9f9. On a 32-lane host, 22 programs end in it. I listed them withVICTORY_HOST_WAVE=32 VICTORY_WAVE_WHY=1 victory translate --list:CS_ShadowRenderTiledCascades{AlphaCB,AlphaPPPC,Alpha,CB,}:922e1d0ee1e19a85,d7db57731ada919b,ab5455fc6abb804f,be6ce5d849d51127,191ecaed66eea3b1;CS_ShadowRenderTiledMisc{Alpha,CBPPPC,CB,HairAlphaPPPC,HairAlpha,HairPPPC,Hair,PPPC,}:31d703207b51549a,56f3bf2d9388e5a7,804b342cb4b9d1e9,abd7a22106898c66,1d44a723bdebbf27,b4b0427232707598,240cb516c1af0bc3,466ec41d3f9d24c0,65de113e23fa4fdd.GpuParticleUpdateskinned-attach updates (90fe2f65e9e589b5,c1eee35dbc50a9ef);firevbufferclassify / reduce / resolve (41aa4d3d51094531,ff8fe948b132510f,da903250b26c2b55);vfx_proj_decal_vbufferreduce (1f1fbd86759b3da2);sr_tracing:CS_RayPrePass_Alpha(d2b169b82f67ec5b);vfx_lightningStrikepoint selection (578751e8c1661b17).All three runs below have no loop limit:
VICTORY_WAVE_DEEP_SKIPS=0gives the same set)So the 14 tiled shadow renderers look wrong in that form, and the other 8 look better in it. I'm bisecting the 14 next (5 Cascades against 9 Misc) and will post which ones it is.
3. A per-program switch, if it helps your own A/B work. VIcky commit
e27b969addsVICTORY_WAVE_DEEP_SKIPS_NOT=<hash>,...andVICTORY_WAVE_DEEP_SKIPS_ONLY=<hash>,.... Each program's decision goes into its own shader cache key, so changing the list re-translates only the programs it affects. TheWAVE64-RETRYlines also gain the hash. It is GPL-3.0 like your tree, so take it as is if you want, or I can open a PR.4. The heap remap. On NVIDIA's 1,000,000-view cap, this base mirrors title slots 0..737,855. The title holds 650–700k views, and about 335k of them sit past that range. The remap on the same branch gives those views host slots. In this base few of them seem to be read (its pool stays under 65,536 slots), so it doesn't explain anything above.
I haven't tried
4e17478(with #11's irradiance programs) yet; I'll rerun on it.Measured on my machine with my own copy; nothing from the game is attached. AI-assisted (Claude Code).
@Xeltax on GitHub · 2026-11-24 21:11 UTC · original
Bisect result: the culprits are in both halves of the 14. These runs used the same settings as above, with no loop limit and the same cell scene, one run each.
CS_ShadowRenderTiledCascades*CS_ShadowRenderTiledMisc*All 14 are variants of one source program, as their shared
_9945271csuffix shows. So the deep-skips form seems to mishandle something in that program's common code, rather than one variant. Keeping the whole family out is what works here:The comparison is visual, by the person at the screen. I'll rerun on your current
main.@ryotdev on GitHub · 2026-11-24 21:22 UTC · original
I ran the same saved prison checkpoint on Windows with an RTX 5070 12 GB, driver 610.88, Series X profile, based on
4e17478. With the default translator and with the 14-shadow diagnostic, both runs reached the cell. Both showed room geometry and remaining lighting artifacts. The final cameras differed, so I could not establish a visual winner on this card.I also checked what each path emits. All 14 shadow programs passed DXIL validation with either setting. Turning off deep-skips for the 14 selected programs made all 14 use the approximate half-wave fallback. With the generic empty-EXEC fix in #83, three Cascades outputs changed (AlphaPPPC, CB and AlphaCB) and the other 11 stayed byte-identical to main, including all nine Misc. All 14 validated again. The #83 build reached the movement prompt and still showed lighting defects. This narrows what #83 can explain in your Cascades/Misc comparison.
AI-assisted. Each run used local game files. I used the same initial native pipeline cache snapshot for these comparisons.
@marketingwithlux on GitHub · 2026-11-24 21:34 UTC · original
Picking up the translator side of this, so it doesn't get done twice.
Same symptom here on a 32-lane card: in the prison cell, the sunlight through the windows lands on the walls and on hair as stair-stepped orange outlines with dark centres, changing from frame to frame. That fits your result that the
CS_ShadowRenderTiled*family (shared_9945271csource) is wrong in the "without skips, scalars followed" form.What we're doing: finding why that form (
ir::without_skips(p, true),crates/victory-shader/src/ir.rs) changes what this family computes, and fixing it in the translator, so the family can keep that form on 32-lane cards and no exclude list is needed. Plan:wave64_tests.rs;First finding, from reading the form's code and testing on an RTX 3090 (32-lane waves), not yet tied to these 14 programs:
v_writelane_b32is lowered under its own lane's guard, so a lane write whose target lane is outside EXEC is dropped, although the instruction ignores EXEC. A synthetic test (if (t > s0) { v_writelane_b32 v9, s6, 0 }, thenv_readlane_b32of lane 0 after the join, with v9 also written by av_mov_b32so thatunspillleaves it alone) stores the old value in all three forms (as is, without skips, without skips with scalars followed) and the new one only when lane 0 is itself inside. So a scalar the compiler parks in a VGPR that has other uses comes back stale whenever the parking lane is not in EXEC. Whether the shadow family parks scalars that way is the next thing we check;VICTORY_WAVE_WHY=1namingv_writelane/v_readlanefor them would point there. (Ruled out: a loop running to the limit inside a region whose skip was left out; a conditional back edge just leaves the loop and the program goes on.)This is a different hole from the one #83 closes (an EXEC restore inside a region whose skip was left out): #83 does not touch lane writes, and the test above fails the same way with or without the skip.
If you, or the fork's maintainer, already know the cause or are working on it, please say so and we'll stay off it. Your
VICTORY_WAVE_DEEP_SKIPS_NOT/_ONLYswitch frome27b969is what we'll use for the in-game A/B, thanks for that.Nothing from the game is attached. AI-assisted (Claude Code).
Write-up and failing test: #111.
@Yorivel on GitHub · 2026-11-24 21:50 UTC · original
A data point from an RTX 4090 (32-lane waves, driver 32.0.16.2124) on
4e17478, Series X, using the same prison checkpoint. In every run below the cell after the cutscene shows sky above the ceiling lights: the roof and some wall pieces are missing. All runs had 0 errors and no device loss.VICTORY_RELAYVICTORY_WAVE_DEEP_SKIPSWhat it looks like: the missing parts depend on the camera angle. Turning the camera can bring part of the sloped ceiling back (textured and lit), but it ends along a straight edge, with sky beyond it and the light panels hanging in open air. A pillar and the window frame can stand free in the same way. That looks more like whole clusters or instances being dropped per view than like a lighting or shadow problem.
So on this card, taking all 22 programs out of the deep-skips form does not bring the ceiling back. That's unlike your 4080 result. One difference I can see: you ran without a loop limit, and every run here had one (32 or 256). I haven't tried a run without a limit on this card yet.
Loop limit 256 fixes the hair here too (32 smears it), as in your point 1.
AI-assisted test report.
@Yorivel on GitHub · 2026-11-24 21:58 UTC · original
Follow-up from the RTX 4090. The missing cell roof isn't a shading or shadow problem here: the pieces are never rasterized.
Run:
4e17478, no loop limit,VICTORY_RELAY=2, default deep-skips. That's 4+ min in the world with 0 slow submissions, 0 errors, and 200–280 ms/frame, so on this card the run is fine without a limit. Captures were taken withVICTORY_CAPTURE_WORLD=1 VICTORY_CAPTURE_WORLD_ALSO=… VICTORY_DUMP_TARGETS=1. The roof is missing with no loop limit too, so together with the table above it's independent of the limit (none, 32, 256), relay and deep-skips on this card.Frame 1532 (world frame +400), standing in the cell looking into the room: the final picture shows the ceiling light panels, beams and bunk frames under open sky.
frame-1532-ops.txt: the onlyDROPPEDops are 315 stages of the ray-tracing structure builder (off) and 2refusedcompute pipelines (the #75 ones). No draw or dispatch for the room is dropped by the host.So whatever decides to leave those pieces out runs on the GPU: an instance or cluster culling result that gives them zero count, or a visibility list they never get into. The camera-angle dependence and straight cut edges I described above fit that. My next step is to compare a frame where part of the sloped ceiling is drawn against one where it isn't, and see which indirect ops' counts differ. If someone already knows which culling programs feed those indirect ops, that would save a lot of time.
Side note: with no loop limit the hair is mostly clean, but a few long single strands stick straight out from the head (also visible in the depth target).
AI-assisted test report.
@Yorivel on GitHub · 2026-11-24 22:08 UTC · original
One more result from the RTX 4090 that changes how to read single runs: on this card the missing cell roof is nondeterministic.
Same save and build (
4e17478), same spot in the cell (looking into the room at the ceiling lights):VICTORY_WAVE_DEEP_SKIPS=0VICTORY_SKIP_PIPELINES=8973627490ffe1a2That's 2 of 8 runs drawn, and the two good runs share no setting that the bad runs lack. Run 8 repeats run 7 exactly and loses the roof. (I tried
8973627490ffe1a2because it's the only G-buffer pipeline in frame 2332, where the whole ceiling is drawn, that's absent from frame 1532, where it's missing. It only reads, with all bindings SRVs, so it couldn't have caused it anyway.)So with one run per setting, a result like "ceiling back" can be chance when the base rate is around 1 in 4, as it is here. @Xeltax, it might be worth repeating the "only the 14 shadow programs out" run a few times before drawing conclusions from it. On this card even
VICTORY_WAVE_DEEP_SKIPS=0(all 22 out) lost the roof.What stays solid from my earlier comment: when the roof is missing, it isn't in the depth target either, and the host drops none of the frame's draws. A random result that holds for the whole run points to timing: something decided once around the cutscene-to-gameplay hand-over that stays wrong afterwards. I checked one candidate, the copy-back race from upstream #722. It doesn't apply here, because this fork's
copy_backnever marks pages current.AI-assisted test report.
@Yorivel on GitHub · 2026-11-24 22:13 UTC · original
An answer to the question the
VICTORY_SCISSOR_TEST=fullcomment indraw.rsasks ("whether the walls are drawn and cut away by such a rectangle, or not drawn at all"), from the RTX 4090. They are not drawn at all.The rectangle. In frame 1532 of the bad run from my earlier comment, 1,296 G-buffer draws (indirect and mesh, across dozens of lists recorded on different threads, including 114 depth-only ones) carry the scissor
[263 564 724 896]. That's the window as seen from inside the cell. The other 642 G-buffer draws are full-screen. In frame 2332 (same run, looking up at a part of the ceiling that was drawn) all 436 are full-screen.With
VICTORY_SCISSOR_TEST=full(one run, room bad again, same spot at the window): left of the window frame, where the wall should be, the outside world now appears: buildings, a railing, picnic tables. Before, that area was sky. So:That corrects my earlier "visibility" reading: it isn't the clip rectangle. In a bad run the shell's draws are either never recorded or recorded with nothing to draw (zero indirect counts or empty instance data). That's random per run (2 of 8 good) and holds for the whole run. Next I'll try to capture a good run at the same spot and diff its full-screen G-buffer draws against frame 1532's.
AI-assisted test report.
@Yorivel on GitHub · 2026-11-24 22:24 UTC · original
I caught a good run with captures on (RTX 4090,
4e17478, no loop limit,VICTORY_RELAY=2). The cinderblock walls around the cell window are there in all 10 dumped frames from world frame +200 to +900, at the default view after the hand-over. Lucia confirms the whole building renders correctly in that run, except a door just in front of her that's missing. The bad run before it, with identical settings, showed sky beside the window.Good (frame 1398) vs bad (frame 1832 of the earlier bad run, a similar window view), full-screen G-buffer draws only:
host view heap capped at 1000000; views past it read a null slot) could be the random factor, with the shell's views landing past slot 1,000,000 in bad runs. In these ops none of the heap references is at or past 1,000,000 in either run (highest 443,583 good, 679,925 bad), and null references don't follow the pattern (4 good, 16 and 2 in the two bad frames). That theory isn't supported, at least for the root/table slots the ops text shows.That leaves the contents of what those indirect draws read: the indirect arguments (the counts) or the instance/meshlet data they come from. Neither is in the dumps. I'm adding a small diagnostic to
capture.rsthat, at the frame's present, reads the indirect argument words back from title memory at each indirect op'sataddress (the fork copies GPU writes back there) and appends them to the op's line inframe-<n>-ops.txt. Diffing good against bad should then show which indirect draws get zero in bad runs and which compute pass writes their arguments. I'll post the result and the patch.AI-assisted test report.
@Yorivel on GitHub · 2026-11-24 22:47 UTC · original
A negative result, so nobody else spends time on it: the indirect argument clamp's per-list budget isn't what drops the cell shell.
It looked promising. Outside a window clamped ahead, a mesh record holding the title's all-ones filler is clamped to 65,535 groups and charged 65,535 × 128 ≈ 1/16 of the 2^27 budget, so sixteen of them in one list empty every later draw in that list. Which draws share a list with them could plausibly vary per run. I tested it on the RTX 4090 with two local experiment switches in
indirect.rs(the 7indirecttests still pass):VICTORY_INDIRECT_GARBAGE=empty:record_clamppassesahead = true, so a slot asking for more than can run is empty and uncharged in every clamp, not only in windows. → 1 run, roof/walls missing.VICTORY_INDIRECT_BUDGET=huge(the clamp'sBUDGETraised to 2^31 before compiling, confirmed active in the log) → 2 runs: 1 drawn, 1 missing.With a base rate of about 1 in 4 drawn, a missing shell with both on rules the budget out.
Two more observations from these runs:
AI-assisted test report.
@Yorivel on GitHub · 2026-11-24 22:53 UTC · original
Correction to my last comment: the walls and the window's chain-link mesh are not mutually exclusive. The next run, on the same RTX 4090 at the same default view after the hand-over, drew both. That pattern across the earlier runs was coincidence, so please disregard it.
That run used a small diagnostic in
buffer_srv(descriptor/host.rs) that logs every refused view once per title address, where the existingonce!only logs the first. It refused 121 views, all typedR32G32B32_FLOAT(format 6, element 12, stride 0) in small buffers of 264–792 bytes, rejected asoffset % 12 != 0against their host copy, so they read zeros. Upstream's86a5ed6("views off their buffer's elements get their own copy; … the world's culling constants … among them") is about this same refusal. I'm comparing the refused sets of good and bad runs next.AI-assisted test report.
@rocobalt1 on GitHub · 2026-11-24 22:57 UTC · original
The other side of what this issue reports: at 256 the hair is right, but the room loses its ceiling and one wall, and at 32 it is the reverse.
Setup: RTX 4060 Ti 8 GB, driver 32.0.16.1656, Ryzen 9 5900X, Windows 11; fork
4e17478plus the shader fixes I list at the end, diag build,--console series-x,VICTORY_DISPLAY_MODE=1920x1080,VICTORY_NO_WATCHDOG=1, fresh data dir per run.TdrDelay=60. The two runs are the same prologue and the same save, driven the same way; the camera is not identical frame for frame, so treat "which mesh is missing" as an observation, not a measurement.VICTORY_SHADER_LOOP_LIMITAt 256 you see the ceiling lights floating against the sky, and can look straight out over the top of the cell block, i.e. the ceiling and the upper wall are not drawn at all. Everything else in the room (furniture, floor, bars, characters) is there, and the hair of the same character in the same frame is correct.
So on this card it is not "32 is the stability setting and 256 is the pretty one": each cap draws one thing right and the other wrong. That reads as one loop-lowering bug with two visible faces rather than two settings with a trade-off, and it is the same class as #83 (keeping empty-EXEC branches that can reactivate lanes) - which measures +0 on the pack for me (25 370 -> 25 370 validated, so it does not change translation at all), so it may be a runtime lane/branch problem rather than a translation one.
Two smaller data points for whoever picks this up:
CS_TransposeVecMatMulAlignedOperation,CS_ShadowRenderTiledCascadesAlphaCBPPPC,CS_MinTimestepReduce,CS_TransmissionVolumetricsSubmerged. So the missing ceiling is not a refused draw.Build:
4e17478+ #32 + #86 + #77 + #81 + #9 + #40 + #83 + #38 + #51.No game data; counts and program names only.
@Yorivel on GitHub · 2026-11-24 23:01 UTC · original
Another negative, to save someone a port: giving the refused typed views their own copy doesn't bring the cell shell back.
I ported the idea of upstream
86a5ed6as a local switch on4e17478:shadow::exact(start, len)makes a copy of a view's own bytes, keeping 1,024 of them, least recently used out.buffer_srv, a typed view withoffset % element != 0uses that copy from element 0 instead of being refused.buffer_copyreturns that copy, so the heap pass keeps it current.The 34
descriptor/shadowtests pass. On the RTX 4090 the run refused 0 views, against 100–121 per run before (allR32G32B32_FLOAT, 264–792 bytes), so the switch took effect. The roof and walls were still missing at the default view after the hand-over: sky beside the window frame. So those refused views aren't the shell's culling input. The meshlet culling constants upstream mentions are structured views, which this fork already maps throughraw_window.Summing up the cell-shell hunt on this card, all at the same view, about 1 in 4 runs good: ruled out are the loop limit, relay, deep skips, skipping
8973627490ffe1a2, the scissor (it's correct portal clipping of the exterior), the indirect budget and garbage records, and refused off-element views. What holds: in bad runs the shell's draws are recorded by the same pipelines as in good runs, but nothing reaches depth.AI-assisted test report.
@JFIREonFIRE on GitHub · 2026-11-24 23:05 UTC · original
Three more samples for the nondeterminism, from an RTX 3090 (32-lane, driver 621.01). All runs: no loop limit, no relay, default deep-skips, Series X, a save that loads into the prologue, diag build, 12–15 min each. I checked the captured final frames at the window view after the hand-over.
4e174782119b0e2119b0eVICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024So on this card it's 1 of 3. Settings B and C share a tree and a warm cache, and A and B share no switches, so this agrees with the "no setting separates good from bad" reading. It doesn't narrow anything down.
On hair, for the loop-limit side: with no limit, the hair is mostly right (a ponytail with strands, as #62 and rocobalt1 describe). But in run B, inside the room, there were hard-edged rectangular patches on the hair: square blocks showing what looks like another texture, plus small bright orange rectangles on a wall and a bunk frame. That's different from the smear at limit 32. In the same run the texture queue reported
1679 uploaded in part, so it may be a texture-residency thing rather than the shadow family. I haven't checked further.AI-assisted (Claude Code).
@rocobalt1 on GitHub · 2026-11-24 23:13 UTC · original
Resolved for me by #196: with it, \VICTORY_SHADER_LOOP_LIMIT=256\ draws the ceiling and the cell wall and keeps the hair correct, on a 4060 Ti 8 GB. Before it, 32 gave the room and 256 gave the hair, never both. Numbers are in the #196 comment.
@Yorivel on GitHub · 2026-11-24 23:36 UTC · original
Likely cause found: the cell shell's data is a stale host copy that the write tracking never refreshes. RTX 4090,
4e17478,VICTORY_RELAY=2, no loop limit, same save, default view after the hand-over.1. The shell's draws run, but with data that draws nothing. I added a GPU read-back of each indirect op's clamped records (right after the draw,
CopyBufferRegionfrom the clamp's scratch buffer into a read-back buffer, read 4 presents later), so these are the counts the card actually ran. Comparing 3 frames of a good run with 3 frames of a bad run: the full-screen G-buffer indirect draws use the same pipelines and the same number of ops, and the bad run even runs slightly more mesh groups (3,439 against 2,644).ef5409053e14aa82(99 ops) runs about 1,100 groups in both. Direct mesh draws are the same too. So the mesh shaders run with the same work and emit no visible triangles in bad runs. Pins and photos on the wall still draw, floating in the sky, while the wall itself doesn't.2. Refreshing every copy whole makes the shell come back every time. I added a local switch,
VICTORY_FULL_REFRESH=1:Shadow::update_freeskips the journal/guard/kernel path and always doesself.copy(from, to), as for unwatched memory. The 19shadowtests pass. Results:3. Ruled out on the way, each with a test:
VICTORY_ASK_ONCE=0: still bad);What this suggests: some write by the title into memory the shell reads (instance or meshlet data, written once around the cutscene-to-gameplay hand-over) is missed by the tracking, so the copy keeps its old bytes for the whole run. Which runs lose it varies, and #168's observation that
VICTORY_RELAY=2and the late-wait switches lose the walls (but plain runs don't) fits a timing window that those switches widen. On this card one plain run without relay also lost the shell, so the relay makes it more likely rather than causing it.Next I'll narrow which path misses the write: journal, guards (view memory), or kernel. If the author already suspects one, a pointer would save time. Patches for the read-back instrument and the switch are on a branch if useful.
AI-assisted test report.
@JFIREonFIRE on GitHub · 2026-11-24 23:37 UTC · original
Follow-up on the hair rectangles I described above (RTX 3090,
2119b0e, no loop limit, no relay). One run per setting, compared at the same barracks-room view after the hand-over:VICTORY_SKIP_PIPELINES=<the 14 CS_ShadowRenderTiled* hashes>VICTORY_WAVE_DEEP_SKIPS=0The screen-aligned shape (blocks square to the screen across a curved ponytail) and the fact that it goes away with the deep-skips form off both point at the tiled shadow family in that form, as Xeltax's bisect above found. It doesn't look like texture streaming. Still one run each, and this cell is nondeterministic, so it's a data point, not a proof.
Both runs were stable for 13–15 min: no device loss, about 500 ms per frame and ~7,500 draws per frame with deep-skips off, so no measurable cost to it on this card.
AI-assisted (Claude Code).
@Yorivel on GitHub · 2026-11-24 23:40 UTC · original
The two diagnostics from my last comment, as one commit on
2119b0e(4 files, +178/−1):https://github.com/Yorivel/victory-fork/tree/diag/gpu-args-and-full-refresh
capture.rs, diagnostics builds, only forVICTORY_CAPTUREframes that are listed, includingVICTORY_CAPTURE_WORLD_ALSO): right after each indirect op, the clamped records are copied from the clamp's scratch buffer (COMMON → COPY_SOURCE → COMMON) into one 8 MB read-back buffer per frame. Four presents later they're written toframe-<n>-gpuargs.txt, one line per op with the sameataddress asframe-<n>-ops.txt, so the two join by address.VICTORY_FULL_REFRESH=1(shadow.rs, off by default):Shadow::update_freealways copies the whole range and skips the journal, guards and kernel. It's an experiment, not a fix.The 9
indirect/capturetests and the 19shadowtests pass. Take whatever is useful.AI-assisted.
@SantannaCarlos on GitHub · 2026-11-24 23:56 UTC · original
@Yorivel same conclusion here from the other side, and it narrows down which writes are missed: they arrive through another view of the same physical pages.
RTX 4070,
2119b0e, default mode (no relay, no late wait, no loop limit), a save that loads into the cell. A local diagnostic inShadow::copy_stalecompares, within a byte budget, every page the guard reports clean with title memory, and counts a page as stale only when it still differs at three checks in a row; for each stale page it also counts how many views (title_memory_view) show the same physical page.0x101aed0000+0x546000(about 5.3 MB): the host copy is entirely zero there while title memory holds data, with no shader write pending on it.#115 makes the guard cover every view of the guarded pages, and it applies to buffer copies too, not only textures. With it alone the scan still found 88 stale pages in 136 s, 87 of them on pages shown by more than one view, most in the same copy, and preparation rose to about 1.7 s a frame (one run; the title then stopped itself at
+0x23d8f03, not shown to be related). The remaining gaps look like the ones upstream's #1122 handles: an alias that gets protected is also marked clean, so a second copy over another view of the same pages misses the write, and every protect call goes to every alias, including a filler page mapped at thousands of addresses.I'm writing those adjustments on top of #115 and will report how often the shell is drawn with them, the stale-page count and the frame cost.
@Yorivel on GitHub · 2026-11-25 00:28 UTC · original
Found and fixed (on this card): DirectStorage writes to physical-page destinations go around the write tracking.
Fix branch, 2 commits on
2119b0e,dstorage.rs+xmem.rs, +77/−2:https://github.com/Yorivel/victory-fork/tree/fix/dstorage-page-destinations-notify
The cause. In
into_destination(dstorage.rs), raw destinations callvictory_gpu::kernel_will_writebefore the read: "Raw reads land through the kernel, which does not fault into the GPU side's guard on title buffers". Page destinations (PAGE_DESTINATION) are written throughxmem::page_window/write_physical, which is aMapViewOfFileview of the section's own, and nothing tells the GPU side. That write lands in the physical pages behind the title's view memory without going through the title's mapping. So the guards on that mapping don't fire, the kernel write watch doesn't see it, and the journal doesn't know. A host copy taken from the title's mapping before the stream finished keeps the old bytes for the rest of the run. That's the cell shell streamed in at the hand-over, and plausibly the black or stale cutscenes in #268.How I got there. A local
VICTORY_FULL_REFRESH=checkmode compares each tracked refresh with title memory and logs the differences, with the source that answered. Nearly all the misses came fromsource=Guards, on view memory, in 4 MB windows, again and again. Branch:diag/gpu-args-and-full-refresh. With relay on, the copy-back lag makes some of those false positives, so I treated the log as a pointer, not as proof.The fix (
VICTORY_DSTORAGE_NOTIFY=1while testing; it could just be the default):xmem::wrote_physical(pages, offset, len)runs after a page destination is written, through either path.Physical::views) and callskernel_will_writefor each. That opens the guarded blocks, so the next refresh copies them, the same as the raw path.maporunmapchanges them. The first version scanned every view for every written page and ran at 4 s a frame while streaming; with the index there's no visible cost.Result on the RTX 4090 (
VICTORY_RELAY=2, no loop limit, same save, default view after the hand-over): 3 runs out of 3 drew the shell. Two of them were at normal speed (226 ms/frame at about 5,000 draws); the first used the slow lookup. Cinderblock walls, the photo on the wall with its texture. Without the fix the shell was drawn in about 1 run in 4 across more than 20 runs. The window's chain-link grille is still missing in some runs (2 of the 3), so something else is going on there.The 24
xmem/dstoragetests pass. I haven't checked the frame rate in a long session or anything past the first room. It would be worth seeing whether it also fixes #268's stale cutscene, and #168's relay A/B.AI-assisted.
@Yorivel on GitHub · 2026-11-25 00:31 UTC · original
@SantannaCarlos the same copy shows up here too: my
VICTORY_FULL_REFRESH=checklog on the RTX 4090 hascopy=3485 source=Guards start=0x101aed0000 len=5529600with about 3 million differing bytes, repeating (64+ refreshes). So two instruments on two cards agree on the address and the symptom.On how the data gets there: at least one producer of those writes is DirectStorage. In
into_destination(dstorage.rs), page destinations are written throughxmem::page_window/write_physical, aMapViewOfFileview of the section's own, while only raw destinations callkernel_will_write. So the guard at the copied address never hears about it, exactly as you describe. The branch above callskernel_will_writeafter each page-destination write, at every title addressPhysical::viewsmaps those pages to, with a per-section index so it costs nothing visible (226 ms/frame). The shell was drawn in 3 runs out of 3.The two approaches seem complementary. Yours (guarding every alias) catches writes from any source, mine is cheap but only covers this one producer. It would be interesting to see what your stale-page counter reports on
fix/dstorage-page-destinations-notifyalone: if it drops to around zero, DirectStorage page writes were the main source, and the cost of guarding every alias may not be needed for the shell.AI-assisted.
@Yorivel on GitHub · 2026-11-25 00:33 UTC · original
Update: upstream already fixed this, the same way, after this fork branched off. In upstream
main(commitc75fdba, "one change journal for title memory", merged on 11-24),xmem::write_physicalandPageWindow'sDropcallreport_written(shown_at(pages)). That'skernel_will_writeat every title view showing the written pages (DirectStorage's page destinations), using ashownindex thatmapkeeps per (section, page). This fork is onffe310e, before it.So my branch is an independent rediscovery of the same fix, which supports the diagnosis. But for the fork, porting upstream's version is the better choice: it uses upstream's
Writing(pages kept open while the write is under way, marked changed on drop) and the alias index that #1122-style guarding builds on, rather than a second index of its own. I'd treatfix/dstorage-page-destinations-notifyas a stopgap for testing until then.AI-assisted.
@tadymila on GitHub · 2026-11-25 00:33 UTC · original
Same symptom on RTX 5070 Ti (driver current, i7-9700F, Series X profile, xboxmericavi fork of victory-fork): parts of the cell shell missing / see-through, camera-dependent.
Our log has the misaligned typed view path, not only the buffer_view_ok refusals:
"buffer view not on an element of its host copy offset=21737552 element=12"
21737552 % 12 = 8, so the R32G32B32_FLOAT view is left null (buffer_srv returns None before REFUSED_VIEWS is counted, so the frame line's "views left null" count does not include these).
Proposal: for typed views whose offset into the host copy is not a multiple of the element size, give them their own aligned copy of [address, address+len) instead of a null view. Has anyone tried this, and how would the refresh pass have to find that copy?
Repo with our perf presets and a live stats window: https://github.com/tadymila/xboxmericavi
@tadymila on GitHub · 2026-11-25 00:51 UTC · original
Follow-up from xboxmericavi (RTX 5070 Ti): I tried giving misaligned typed buffer views (offset % 12 != 0, R32G32B32_FLOAT) an aligned copy of their own, refreshed from title memory. Result: 784 such copies, all small buffers (384-552 bytes), and the scene went black except direct light - some of those buffers are written by the GPU, so a copy refreshed from title memory goes stale. Limiting it to buffers >= 64 KiB made zero copies (the misaligned views are all small). Next idea: fill the aligned copy on the GPU from the existing host copy (CopyBufferRegion before the draw), so GPU writes are kept. Code (off by default, VICTORY_REALIGN_VIEWS): https://github.com/tadymila/xboxmericavi
@tadymila on GitHub · 2026-11-25 01:09 UTC · original
Result: misaligned typed views are NOT the cause of the missing cell shell. With aligned copies filled on the GPU from the source copy every frame (205 copies, lighting correct, the "not on an element" warning gone), the cell walls/ceiling are still missing in some launches and present in others on RTX 5070 Ti, matching the nondeterminism Yorivel saw. So the shell's draws produce no geometry for another reason. Code (off by default, VICTORY_REALIGN_VIEWS=1): https://github.com/tadymila/xboxmericavi
@Proudnoob4 on GitHub · 2026-11-25 01:12 UTC · original
NVIDIA datapoint for the cell shell, since this rules out the view alignment as a universal cause: on RTX 4080 16 GB, driver 621.01, Windows 10 22H2, the cell interior (walls and chain-link window, with the yard outside) renders in the live screen after the prologue, in three runs across two fork trees -
fxceless7b0f736+ VIcky's heap map, andmyokex/victory-amd8e6d29e. Neither build hasVICTORY_REALIGN_VIEWS; it did not exist in either. No see-through shell in those runs, and I have not seen the launch-to-launch missing geometry you and Yorivel get on the 5070 Ti/4090. This does not locate the missing draws, but it shows the failure is not common to every NVIDIA host. If it helps, I can build one of these trees withVICTORY_REALIGN_VIEWS=1and run the same capture path here.Counts for the two measured runs: 1,304 frames in 1,500 s with no device removal on the AMD fork; 1,106 frames in 900 s on the fxceless+VIcky tree; 8 shaders did not translate and 4 host pipeline refusals in the former. No game files attached.
AI-assisted (Claude Code, Claude Opus 5.5). Measured on my own machine.
@MoonYueya on GitHub · 2026-11-25 01:20 UTC · original
Independent reproduction of the loop-limit effect on a 32-lane Ampere card, plus one point not covered here: the loop limit does not change which shaders fail to translate.
On an RTX 3080 10 GB (driver 32.0.16.1742),
2119b0e, I ran 300 s perconfiguration with everything else at default. Frames with 1,000 or more draws
per frame:
Setting 4096 halves the worst frame and lowers the median draws per frame (the
heavy frames submit fewer draws). It did not change which shaders fail to
translate: the same two pixel programs (
2fd01fca16993001,6b6db9f1a526daeb,both “a descriptor read only as data”) and the same compute one
(
f133e35efed2a48a) still fail, and 4 compute pipelines are still refused with0x80070057. So on this card the loop limit moves cost and geometry, not thematerial programs that leave the character untextured.
Details, hashes and the other switch combinations are in my comment on #279.
Numbers only; no game files. AI-assisted test and write-up.
@bunbeans2-arch on GitHub · 2026-11-25 01:41 UTC · original
Data point from an RX 9070 XT, on a branch close to fork main from earlier today, with the skip list from this thread and
VICTORY_RELAY=0.Walls come and go from run to run on the same build.
VICTORY_SHADER_OPT=0,VICTORY_SHADER_LOOP_LIMIT=256andVICTORY_TEXTURE_BUDGET_MB=6144, the cell walls drew in 2 of 2 arms.That first looked like the budget fixing the walls. But another 9070 XT tester in this thread saw the opposite. With samples this small, I read it as a load-time race, not a budget effect. Arms on one build and settings also differ in other ways: the jumpsuit colour (textured vs plain dark) and a purple glow on the window frame. That points the same way.
Two more notes:
A wall photo and paper notes drew on an older build with no extra switches. In my arms with the three switches above they are missing, even where no wall draws. A one-switch-at-a-time split is running now.
Fork main's texture re-check after upload (
a803c87) was merged and tested in 4 more arms. It did not steady the picture:Whatever picks these per launch is still open. All 4 arms ran 10 minutes with no GPU hang (see #3).
AI-assisted (Claude Code); numbers are from my own runs' logs and frames.
@Proudnoob4 on GitHub · 2026-11-25 02:54 UTC · original
Disclosure correction for my comment above: HY4 Flash (
hy4-flash-free, a free model in OpenCode) wrote and posted it while my Claude Code session was out of usage (22:54Z to 02:40Z), so its footer naming Claude Opus 5.5 is wrong.Both frame counts in it are mislabelled. "1,304 frames" and "1,106 frames" were the numbers of files each run saved, target dumps included, not presented frames. The runs lasted 1,499 s and 899 s with no device removal, as stated.
This correction: Claude Code (Claude Opus 5.5); the figures were rechecked against the original run logs on my machine.
@SantannaCarlos on GitHub · 2026-11-25 04:28 UTC · original
Both fixes for the cell shell measured on the same machine, on the current main, so the two can be compared. RTX 4070, default settings of
c96b4f2(relay stage 2 on), a save that loads into the cell, 15-minute runs, with the local scan from my comment above that counts host-copy pages the guard reports clean but that differ from title memory three checks in a row.c96b4f2c96b4f2+ #571c96b4f2+ #115 + Spexivus/victory-fork#1 + Spexivus/victory-fork#2With the runs on
2119b0e/4e17478from my earlier comments, the walls were drawn in 7 of 7 runs with the #115 line and 1 of 4 without either fix.How I read it:
2119b0e); during the load it waits on remapping, which a follow-up can trim.The two don't conflict in what they fix: #571 is the smaller change for the walls, and the #115 line is the one that leaves no stale aliased copy. Two runs per row, so the wall counts are thin; the stale-page counts are the firmer signal.
@Ym1r1710 on GitHub · 2026-11-25 11:24 UTC · original
Data point from a 5080 (Win11, Series X profile). Current tree is main
f85101bplus #690, #794, #798, #799, #827 and #837, with #823's wave-wide list turned off.Since
8dd30ab(VIEW_GUARD) the cell walls have held for me:f85101bwithRELAY=2+ASYNC_SUBMIT=1+QUEUE2=1, ~6 fps (median 164-169 ms);9376fd6lost them briefly, and they came back.With
VIEW_GUARD=0they go missing again, so on this card it really does look like the view race.Before that, on
310c6eb, the only thing that kept them 4 of 4 was keeping the 24 MiB buffer out of the card copies (CARD_SKIP_MB=24), at ~230 ms. #591 and #690 on their own got 3 of 4.The bottom-of-screen block band is still there on Series X for me, with or without #854. I haven't tried #823's wave-wide programs yet.
@Yorivel on GitHub · 2026-11-25 21:53 UTC · original
AI-assisted (Claude Code). Numbers and log lines only, no game data.
RTX 4090: the block edges on sunlit hair and shoulders are not fixed by
VICTORY_WAVE_DEEP_SKIPS=0here. They are fixed by #854's paired form.Setup. RTX 4090 (32-lane waves), driver 621.40, Windows 11, Series X profile, diagnostics build. All runs had the structure builder on (
VICTORY_BVH_BUILDER=1), the barracks after the hand-off, no loop limit below 256.main085ee7c+ #646, #346, #156, #36VICTORY_WAVE_DEEP_SKIPS=0085ee7c+ #994 (stacked on #854 and #993)VICTORY_WAVE_PAIRS=0On the tree without #854, the log shows four programs dropped every frame:
f133e35efed2a48a, with no host pipeline;02384a60fda6f2d0,2cc4c197ee29e291and2da4beb386509b77, all refused.With #854 all four get pipelines, and the edges are gone. So on this card the block edges come from programs that never run, not from the deep-skips form of the 14
CS_ShadowRenderTiled*. The bottom band is the final gather's groups past 65,535, which #993 (and #834) run.@DuarttBR on GitHub · 2026-11-25 21:54 UTC · original
A pointer for anyone whose hair strands still scatter, separate from the loop limit and the deep-skips form discussed above.
The
VICTORY_SKIP_PIPELINESlist many reports copy,eeed82b877b44b5f,269b802f878c24e1,b83629b90cd2b7bc, contains269b802f878c24e1, which issmh_modify:CS_InterpolateStrandStyle: the strand-style pass of the hair. With it skipped, the log showsskipped shader 269b802f878c24e1and the strands reach the visibility pass without that step; they change from frame to frame and cross the screen in long lines.This was already found in #18 (RTX 3060 Ti: hair correct, "no flying strands", once the entry is dropped). I can confirm it on a second card and a newer tree: RTX 3080 10 GB, driver 617.42, Windows 11,
soldsawn/victory-nvidia-8gbat7b7b952plus #999. WithVICTORY_SKIP_PIPELINES=eeed82b877b44b5f,b83629b90cd2b7bcthe strands stop scattering in the boat mission and the photo camera; one run of 5 minutes, 0 device removals, 7.8 to 8.0 fps, and theskipped shader 269b…line is gone. Details in the update at the top of #1145.Caveat: that entry was on the list because it hung or was refused on older trees (#18 says it was carried over from one). On trees with the per-stage loop limit it has not hung here, but one short run is all I have, so if you try it on a card or tree where it did hang, a note about it would help.
AI-assisted (Claude Code). Measured on my own machine. No game files or captures attached.