GPU: coalesce identical write declarations within a submission #435
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!435
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-435"
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?
@melon0918 on GitHub · 2026-11-24 03:20 UTC · original
melon0918:perf/avoid-duplicate-gpu-writes→main· +40 −18 · 1 files · 1 commits · openWhat changed
World passes declare the same writable shadow-buffer ranges repeatedly. Each repeat used to flush the accumulated refreshes, even after the first declaration had taken the pre-submit snapshot and marked that exact range pending. Store the first declaration per shadow, address and length in the submission batch. Use that same ordered list for copy-back after the fence, replacing the second pass over the deferred command steps.
Verification
cargo test --locked -p victory-gpu --features diagnostics -- --test-threads=1passed 46 tests with one existing benchmark ignored. The added test covers repeated declarations, overlapping ranges, distinct shadows, and submission boundaries.cargo xtask policypassed. The PR contains only source and a synthetic test. AI-assisted (Codex).@DaviTostes on GitHub · 2026-11-24 03:35 UTC · original
Overlaps with #440: both deduplicate
Step::GpuWriteper submission incrates/victory-gpu/src/host.rs, and they conflict textually —git merge-tree --write-tree pr435 pr440reportsCONFLICT (content)inhost.rs. Worth choosing one.Both were verified separately on Arch Linux x86_64, Windows MSVC release build under Wine 11.22 (
--test-threads=1):657efd8):victory-gpu44 passed, 0 failed, 1 ignored; the newhost::batch::exact_gpu_writes_are_declared_once_per_submissionpasses.0ba3e44): 44 passed, 0 failed, 1 ignored; itsshadow::submission_tests::repeated_gpu_writes_keep_their_first_copy_back_orderalso passes.The difference is where the state lives: this PR dedupes in
Batch::new_gpu_writeand keeps copy-back deferred steps, #440 collectsBatch::copy_backin first-declaration order (and adds the ordering test). Both fix the same repeated-range cost.@Marvisak on GitHub · 2026-11-25 00:17 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-gpu/src/host.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
@jeremygold02 on GitHub · 2026-11-25 02:59 UTC · original · edited 2026-11-25 03:22 UTC
Triage verdict — Narrow the scope and rebase (
657efd8)Evidence
mainat940d32falready deduplicates exact keys for copy-back and combines theirmissedstatus. The remaining opportunity here is reducing repeated preparation before submission. That path still flushes on each unmarked declaration.Checks and limits
0on this head (657efd8) where the expected byte was33.Next step
This verification was AI-assisted.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.