Repository navigation
Card steps: serve constant fills behind placed copies from destination shadow (VICTORY_PLACED_FILLS) - #740
Conversation
…n shadow (VICTORY_PLACED_FILLS)
Dukestar69
left a comment
There was a problem hiding this comment.
LGTM — verified on Windows (RTX 5090):
cargo test -p victory-gpu --lib card_steps::passed (10/10, includingfills_behind_a_copy_at_its_place_are_shown_its_bytes)cargo test -p victory-gpu --lib host::menu::passed (7/7)- 0 new compiler warnings in touched files
cargo xtask policypassed (294 files ok)
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
|
I tested
The destination-shadow path was exercised: 7 of 29 service reports in the enabled window were nonzero, reaching 0.32 served fills per frame. In the three longer route windows the log reported a wait for an upload-memory fill with the placed-copy dependency reason in 3, 13 and 14 reporting intervals with the option off, and in zero intervals with it on. Some of those longer windows faced different shores, so the FPS comparison above uses only the matched overhead view. This confirms the change in the reported waits on this card. The scene’s median frame time moved by 0.25 ms with a small draw-count difference; it gives me no measurable throughput gain to claim here. |
Reuse upload scratch and filter unchanged graphics copies, reduce descriptor lock contention, and let safe constant-buffer transfers stay on the GPU. Keep the optional direct constant-buffer path behind F1. Stabilize static sampler order for reuse of the driver's shader pipelines. Expose DLSS Ultra Performance for Series X with the same ultrawide output and HUD. Ports selected changes from trustno1-coder#548, trustno1-coder#700, trustno1-coder#814, trustno1-coder#740, trustno1-coder#958 and fxceless/victory-fork@9e90746. The source bundle preserves the individual commits and credit.
|
One run here suggests RTX 3060 12 GB (driver 621.40), Ryzen 7 5700X, 32 GB, Windows 11. Main
(Run 1 and one of the runs 2 also had the water program The log showed AI-assisted (Claude Code): the runs were judged by eye on my PC, and Claude wrote this text. No game files attached. 🤖 Generated with Claude Code |
|
The run with Cutscene with this switch: 40.1 ms a frame ( 🤖 Generated with Claude Code |
|
A smoke test only: the scene barely reaches this path. RTX 3090 24 GB (driver 610.88), i9-14900K, 32 GB, Windows 11. A release build of this PR merged onto main at
So nothing broke where it is idle. A real test needs a scene with many placed copies; I'll add one if I get a save there. Tested with an AI assistant (Claude Code); results are from this PC. |
|
Thanks everyone (@Dukestar69, @Yoshi-233, @grosterr, @nick0451) for testing and verifying across RTX 3060, 3090, 4070 Ti SUPER, and 5090. Summarizing where things stand from the independent runs:
The PR remains cleanly mergeable with no changes needed on this side, and is ready for maintainer CI approval and review. |
Conflicts: - watch.rs: trustno1-coder#933's protect_here/protect_run split kept, upstream's soft views parameter passed through both. - shadow.rs: upstream's has_pending and PageMerge landing loop taken (on trustno1-coder#1298's copied tuple); trustno1-coder#1184's lazy landing applied to upstream's outside_sorted_into parts. - pool.rs: trustno1-coder#814's take_from_with (one empty block made ahead) kept; its base is the same trustno1-coder#661 change upstream merged. - card_steps.rs: upstream's taken whole (VICTORY_PLACED_FILLS, trustno1-coder#740); trustno1-coder#1298's card_steps part dropped. - draw.rs: upstream's trustno1-coder#532 values; trustno1-coder#814's cached slot handle kept inside upstream's rest() timing. - descriptor/host.rs: upstream's TextureQueue ordering taken whole; trustno1-coder#814's VICTORY_DUE_FRESH_FIRST and its play.rs default dropped. A test module both sides added was kept once. - emit/mod.rs, send.rs: both sides kept.
Summary
Adds an opt-in switch
VICTORY_PLACED_FILLS=1(off by default, exposed in the F1 menu asCONSTANTS AFTER PLACED COPIES) incrates/victory-gpu/src/host/card_steps.rsandcrates/victory-gpu/src/host/menu.rs.When enabled, constant-buffer fills (
Step::Fillwith a dedicated descriptor slot) that stand behind a placed buffer copy (Step::Placed) and read only bytes written by that copy are pointed directly at the placed copy's destination host shadow on the GPU instead of refusing the submission or copying bytes through the front-of-submission scratch buffer.With
VICTORY_PLACED_FILLSunset, behaviour is unchanged (includingVICTORY_PLACED_READS=1).Where the bytes are and why this differs from
VICTORY_PLACED_READS=1placed.shadow.bufferbyHostList::place_copy, followed bywait_for_all(crates/victory-gpu/src/host/place.rs).VICTORY_PLACED_FILLS=1adds zero GPU buffer copies:show_placedvalidates 256-byte CBV alignment, buffer bounds, and that the placed copy is not waiting on flights (!matches!(placed.waits(written), Waits::Yes)), then points the fill's dedicated descriptor slot straight atplaced.shadow.buffer.Does::Read, an untakenDoes::Copy/Does::Fill, or a laterDoes::Placedreading fromdst),served_fillsrefuses to serve from that copy so title-memory coherency is preserved.VICTORY_PLACED_READS=1on63b902f: in A/B testing,VICTORY_PLACED_READS=1still refused0.40submissions/frame (waiting for flightsmedian15.8 ms, peaks33-47 ms) witha step other than a fill done on the card reads what a copy at its place writes(PLACED_READER), becauseplaced_read_on_cpuchecks all steps indoes(including steps ahead of the placed copy and fills handled on the card).VICTORY_PLACED_FILLS=1avoids those false refusals and dropsBEHIND_PLACED/PLACED_READERrefusals to0.00/frame.Relation to existing open PRs
Checked existing open PRs before opening this one:
#34(perf(gpu): snapshot placed-copy constants on GPU and enable VICTORY_PLACED_ORDER): copies constants into a per-listDEFAULTbuffer during list recording and enablesVICTORY_PLACED_ORDERby default; predatesVICTORY_PLACED_READS.#295(perf(gpu): plan dependent GPU fills behind placed copies...): currently has merge conflicts againstmain(63b902f), bundles two ports, and does not include in-game A/B numbers.This PR stays strictly opt-in behind
VICTORY_PLACED_FILLS=1, performs no extra GPU copy, applies cleanly on63b902falongsideVICTORY_PLACED_READS=1, and is measured directly againstVICTORY_PLACED_READS=1.Measured results (in-game A/B on
63b902f)Hardware: Windows 11, NVIDIA GeForce RTX 3060 12 GB, Series X profile, 2560x1440, DLSS Performance,
releasebuild, same opening cutscenes through the prison room (up to ~7,150 draws/frame), pipeline cache warmed before both runs.VICTORY_PLACED_READS=1(main63b902f)VICTORY_PLACED_FILLS=1(this PR)waiting for flightsmedian (mean)card_stepssubmissions refused/frame median (max)PLACED_READER/BEHIND_PLACEDrefusalsPLACED_READER)preparingmedian (mean)on the GPUwaitVisual check: no corruption or regressions observed across the full opening stretch.
Verification
cargo clippy -p victory-gpu --all-targets --lockedand--all-features --locked: 0 warnings in modified files (card_steps.rs,menu.rs).cargo test -p victory-gpu --lib --locked: 454 passed, 0 failed, 36 ignored (including new unit testhost::card_steps::tests::fills_behind_a_copy_at_its_place_are_shown_its_bytesand existinga_fill_behind_a_copy_at_its_place_reads_where_the_copy_does).cargo xtask policy:asset policy: 294 files ok.cargo build --release --locked -p victoryand verified in-game againstVICTORY_PLACED_READS=1on the same build.