Builder on: the 3 s frames are CPU work in memory::ready (1,023 copies, 4.3 GB refreshed and declared written per list); taking the dirty-page mask #284
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#284
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?
@ghost on GitHub · 2026-11-24 23:14 UTC · original
AI-assisted (Claude Code). Numbers and log lines only; no game data. I am taking the fix described at the end unless someone already has it.
Setup: RTX 5080 16 GB (32-lane waves), Windows 11. Fork
main(4e17478base) + #156 atebc2c91, diag build, Series X profile,VICTORY_SHADER_LOOP_LIMIT=256, warm caches, scripted Enter, 300 s runs. Builder runs useVICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1.What I measured
#156 reports that with the builder on "the frame time went from about 0.3 s to about 4 s". Same here: 0.45 s to 3.2-3.4 s per frame, no device loss, no title crash in 300 s. The card is not where the time goes:
(From the
fpsandcopystatlines of each run's last report.)Why
memory::ready(crates/victory-gpu/src/memory.rs) brings every numbered copy up to date on a list's first dispatch of a shader that uses title memory by address, and for a shader that can store declares every numbered copy written, so all of those bytes are compared on the CPU after the submission. The module's own comment calls this a shortcut.A local counter in
ready(one log line per 8 frames, builder on):So in the prologue:
COPIES), holding 4,285 MB. The limit is already reached at the first line logged.title memory by address: no number left for another copy; its pages read zerosis logged in the same run. So besides the cost, some pages the builder or the trace programs ask for have no copy at all and read zero. I have not measured how many accesses that affects, nor whether it has to do with the washed-out picture #156 describes (I see that picture too).What I plan to do
The remedy the module's comment names: a dirty-page mask written by the shader, so that a list refreshes and the host compares only the 64 KiB pages a dispatch touched. As a first step: a bit per directory page set by
Lower::memoryon each store (and, if it measures well, on each load), read back with the faults once the submission has run, withgpu_writeslimited to the pages set.I will build it on top of #156 and keep clear of the per-list watermarks #205 adds to the same function. If either author would rather fold this in themselves, say so and I will send the measurements instead.
Not covered by this: the limit of 1,023 copies itself, the washed-out picture, and the box-bounds crash in #16.
@ghost on GitHub · 2026-11-25 00:31 UTC · original
AI-assisted (Claude Code). Counts only; no game data.
Follow-up on the copy limit: with the builder on, shaders ask for far more than 1,023 copies, and the requests are spread over most of the title's memory. Same card and setup as above (RTX 5080, #156 merged,
VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1, 300 s runs). Measured with a local build in which loads mark their copy as stores do in #346, plus counters inmemory.rs; none of that is in #346.How many copies are used
mapcalls refused for want of a numberSo the limit is not being used up by constants that only look like addresses: about three quarters of the numbered copies are read, and most of the refusals come from shaders' own accesses.
With the builder off, nothing uses this path. Same build, defaults: 0 copies numbered, 0 loads, 0 stores, 0 refusals for the whole run.
Where the requests lie, in copies per GiB of title address space (a GiB holds 256 windows):
That is most of the title's big pool being walked, 9 GB and more in all, for one room and a yard. I would expect a traversal to stay inside the structures its rays cross. This looks to me like a traversal that follows bad links or enters every box, which would fit the unfilled box bounds reported in #16; I have not shown that, and it could also be that the structures are simply laid out across the pool.
If it is the builder's output, raising
COPIESwould mostly make room for reads that should not happen, so I am not proposing that. The picture with the builder on is wrong here as well (quarantined): the cell window is covered by a mesh pattern and the room is missing.What would settle it, if someone has the means before I do: the same counts on a 64-lane card, where the builder's programs run in their native form.
@Speartone on GitHub · 2026-11-25 04:34 UTC · original
Research only, not for merging: an experiment on
2119b0ethat gives numbered copies back when nothing uses them. Synthetic data only; actual GTA VI gameplay has not been tested.AI-assisted: design, code, tests and text by Claude Code (Claude Opus 5.5). No game data.