Repository navigation
gpu: opt in to address-range stripes on the mapping lock (streaming load wait 202 -> 23 ms) - #87
superboynick wants to merge 3 commits into
Conversation
…t-frame-window fix(gpu): average copy statistics over the full reporting interval
|
Independent confirmation, run by hand on the release build of this branch, Series S, same save and warm cache, menu keys to get into the scene, eight window samples an arm:
That is +6.4% on this scene, which is the direction the load-frame numbers predicted but smaller — this arm spends most of its time in ordinary play, not in the streaming pass where the wait actually is. Eight samples an arm is not enough to call a steady-state gain, so I am not claiming one: what it does say is that four stripes does not cost anything in ordinary play on this machine. The load-frame figures in the description (submit wait 202.03 to 22.94 ms, frame 499.12 to 258.31 ms) remain the claim to check, and they need someone with a save that streams hard. Written with an AI assistant. |
0b03591 to
5d3358d
Compare
…t-frame-window fix(gpu): average copy statistics over the full reporting interval
…t-frame-window fix(gpu): average copy statistics over the full reporting interval
Disabled by default, preserving the original refresh path and bytes. Previous Series X measurement: 2.25 to 2.58 fps, median lock wait 974 to 438 ms.
Disabled by default, keeping single-texture refreshes unchanged. Release the guard at the end of each scheduled group, before write boundaries or contended staging locks. Previous Series X run: 3.22 to 4.06 fps, median lock wait 9.5 to 0.0 ms.
Disabled by default; one stripe is the existing global lock, byte for byte. Stripes are 2 MiB address ranges. A mapping call takes only the stripes its range covers, a refresh only the stripes it touches, always in ascending order, and a range that grows releases and reacquires. FIFO ordering keeps a reader from being starved. A writer that arrives while readers hold unrelated stripes no longer blocks, which is the point: the title makes 1,200-1,300 mapping calls a frame during streaming, each taking the lock exclusively for any address. Series X, the 36-item play set, paired windows matched on scene progress, draw counts and mapping rate (draws within 4.66%): | | 1 stripe | 4 stripes | 8 stripes | |---|---:|---:|---:| | steady windows (12 pairs), fps | 5.23 | 5.14 | 5.14 | | steady, submit lock wait median | 0 ms | 0 ms | 0 ms | | streaming load windows (16 pairs), fps | 2.00 | 3.87 | 3.29 | | streaming, frame | 499.12 ms | 258.31 ms | 303.71 ms | | streaming, list | 310.91 ms | 93.57 ms | 74.58 ms | | streaming, submit lock wait median | 202.03 ms | 22.94 ms | 7.55 ms | So this is a load-time change, not a steady-state one: with the refresh batching below landed, the steady-state wait is already zero and the frame is GPU-bound. Four stripes is the better trade than eight - eight lowers the wait further but costs more elsewhere in the load frames. All three counts pass a 4,325,376-byte paging remap comparison and a concurrency test in which a writer on unrelated stripes completes while another writer waits on readers; if the old view grows while waiting, the writer releases and retakes. Builds on the two commits above, which touch the same refresh path.
5d3358d to
960816d
Compare
|
Thanks for this. I'm closing it without merging: it conflicts with #59, merged now, which changed the same texture refresh path in texture.rs and host.rs. If you'd still like the address-range stripes in, please rebase on the current main and open a new pull request. |
What I tested
RTX 5070 Ti Laptop (12 GB, 32-lane waves), Windows 11 26100, release build,
--console series-x, the 36-item play set, frame generation off. This is the striped lock from exotiquee's comment on #59, as a separate change:VICTORY_MAPPING_STRIPES=<n>, unset or1= the single lock, byte for byte.Stripes are 2 MiB address ranges. A mapping call takes only the stripes its range covers, a refresh only the stripes it touches, always ascending; a range that grows releases and reacquires; FIFO ordering keeps a reader from being starved.
Windows paired on scene progress, draw count and mapping rate, draws within 4.66%; steady windows are after 300 frames in the scene, load windows are the first streaming pass.
What happened
Two things worth knowing:
All three counts pass a 4,325,376-byte paging remap comparison and a concurrency test where a writer on unrelated stripes completes while another writer waits on readers; if the old view grows while waiting, the writer releases and retakes. With one stripe, eight startup frames are byte-identical to the build before this.
Validation: GNU release build passes;
cargo test -p victory-hlepasses;cargo test -p victory-gpu415 pass, 2 fail, 35 ignored, and those two failures reproduce ond12eb1b.What would make it mergeable
Note: #38 touches
watch.rs,xmem.rsandtexture.rsin the same area, so whichever lands second will need a rebase.Written with an AI assistant.