GPU: keep the view-stride table once per list, not per draw stage #1825
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!1825
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1825"
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?
@slatefield on GitHub · 2026-11-24 23:03 UTC · original
slatefield:gpu/keep-stride-table-once→main· +18 −1 · 1 files · 1 commits · openthe view-stride table was kept on every stage of every draw: COM QueryInterface, deferred mutex, Vec push, and a Release per entry when the list resets. at the world's draw counts that's thousands of them per list for one heap-owned table that the list only has to hold once.
pipeline + root signature right above it already do the compare-then-keep thing, so the table does it now too: keep it when the pointer changes (State is reset with the host list, so the cache empties when kept does).
typechecked for windows target, plain and diagnostics.
@DesertGamer on GitHub · 2026-11-24 23:06 UTC · original
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
@upipibi on GitHub · 2026-11-24 23:12 UTC · original
NVIDIA run: RTX 3070 8 GB, driver 616.56, Windows 11, debug,
3a3f9a2(onmain70564ae).cargo test -p victory-gpu --locked: 76 passed, 2 failed, 1 ignored. The 2 are the capped-heap failuresmainhas on NVIDIA (#1744:dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views), so there are no new failures.AI-assisted (Claude Code). Synthetic tests only.
@Marvisak on GitHub · 2026-11-25 06:31 UTC · original · edited 2026-11-25 20:20 UTC
Automated triage for the maintainers.
Needs work. This makes
State::bind(crates/victory-gpu/src/draw.rs) calllist.keep(table)for the view-stride table only when the table pointer differs fromState::stride_table.Reply to the author: putting the reset in
host_state_lostis the right place, but the pushed headc65f14bdoes not contain it. Its only changes are the newstride_tablefield and the compare-then-keep inbind.host_state_loststill resets onlyhost_pipeline,host_rootsandhost_heaps, and there is noa_lost_host_state_forgets_the_kept_stride_tabletest on the branch. So the problem from the last review is still there. AfterState::cutstarts a newHostList, the next draw sees the same pointer and skipskeep, and the table can be released while that segment is in flight. Please push the commit that has thehost_state_lostchange and the test. With that, this can be reviewed as a merge candidate.CI: no check runs on the head commit.
Generated by Claude Code
@slatefield on GitHub · 2026-11-25 17:17 UTC · original
Rebased onto current
main(13f91ca) and force-pushed, sincemainmoved under it indraw.rs: the conflict was only thatStategrew afixed: Fixedfield for the list-cut work, so both fields are kept (stride_tablefrom here, thenfixed). No other change.Windows-target clippy
--all-targets --all-featuresand without: clean. The rebased head merges cleanly, so the triage can re-run. The earlier merge-candidate verdict still describes the change itself.@slatefield on GitHub · 2026-11-25 18:29 UTC · original
Right on the cut path, and it is fixed in
c65f14b.host_state_lost()now clearsstride_tableas well, so both thecutpath and the other recorders that call it forget it, and the next draw keeps the table again in the fresh list. I put it there rather than incutbecause that is the one both callers go through, and added a unit test for it (a_lost_host_state_forgets_the_kept_stride_table, no device needed).Windows-target clippy
--all-targets --all-featuresclean. The branch is rebased on13f91ca, one commit, force-pushed.c65f14b93atofdf1ef945b@Melow-code on GitHub · 2026-11-24 23:05 UTC · original · approved these changes
The dedup with a pointer check matches how the pipeline and root signature are already cached in State. One QueryInterface + lock + Vec push per draw is real overhead for titles that set views often. +9/−1, clean.
@catminou4 on GitHub · 2026-11-24 23:47 UTC · original · reviewed
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
View-stride table kept once per list instead of per draw: allocation/cache hygiene in host.rs path. Windows-only.
@mercuryVM on GitHub · 2026-11-25 05:41 UTC · original · approved these changes
Tested 3a3f9a2 on Windows 11, RTX 5070, MSVC: builds, clippy
-D warningsclean with and without--all-features,cargo test --workspace --no-fail-fast730 passed on our fork main; the 9 failures are the ones that fail on that main without this PR (host validator and environment). I didn't measure the frame-time effect.Reset, andResetXthrough it) runshost.reset(), which drops the kept objects, together withstate.reset(), which restoresState::default(). Sostride_tableempties exactly when the list's holds do.list.reset()calls are internal host lists that carry no titleState.keepcan't leave a bound table unheld.Merged into our fork's main.
AI-assisted (Claude Code).
@slatefield on GitHub · 2026-11-26 11:04 UTC · original
You are right and the fault was mine: I amended the commit message without staging the file, so
c65f14bonly carried the original change. The real one is now pushed asfdf1ef9(same message, force-pushed):host_state_lost()clearsstride_table, anda_lost_host_state_forgets_the_kept_stride_tableis in the test module.git showon it now has 18 insertions instead of 9, which is how you can tell it is there.Windows-target clippy
--all-targets --all-featuresclean on that tree. Sorry for the noise.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.