GPU: constant buffer views of at most 64 KiB #24
No reviewers
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!24
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-24"
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?
@NuraadGit on GitHub · 2026-11-24 20:22 UTC · original
NuraadGit:gpu/constant-view-64k→main· +40 −2 · 1 files · 1 commits · openThe fix I described in #5, as a PR on
1684989. The same change is Marvisak/VIctory#1640 (the code is the same there).A constant buffer view of more than 65,536 bytes removes the host device (
0x887A0001). The size from the title's descriptor went toCreateConstantBufferViewas it was. The heap keeps old contents in slots the title doesn't use, and a view is made for each. In two runs on an RTX 2080 that ended that way, the last 64 views (yourthe host device went while buffer views of the heap were madelist) included constant buffer views of 969,472 and 896,256 bytes. This caps them at 64 KiB, which is all a shader can index.Test.
an_oversized_constant_buffer_view_leaves_the_device_alivemakes both sizes throughmakeand one throughconstant_at, and checks the device after each. Without the cap it fails at the first ("a view of 969472 bytes"); with it, it passes.cargo test -p victory-gpu --libon an RTX 2080: 111 passed, 1 ignored.cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean.Not shown: I haven't run the title with this yet, and a third run with the same removal had no oversized view in its list, so it may not be the only cause. A probe on the same card shows that a view not on a 256-byte address, or of a size that isn't a multiple of 256, also removes the device;
makealready guards against both.AI-assisted (Claude Code); counts and log lines only, nothing from the game attached.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 20:22 UTC · original · edited 2026-11-24 20:24 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
1d2f476ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@rafaconvaitis on GitHub · 2026-11-24 20:45 UTC · original
Independent Windows 11 result on an RTX 4070 (driver 32.0.16.1664), Series X mode, pinned
578d459with local adapter selection and test input. One run reached the lit prologue and later reportedDXGI_ERROR_INVALID_CALL(0x887A0001) during the buffer-view mirror pass. The last 64 sampled views included an aligned CBV of 1,228,032 bytes. At removal, 105,231 submissions had started and finished, with no submission in flight. The sample does not identify which creation call triggered removal.In a synthetic D3D12 WARP probe with the debug layer, the same aligned, 1,228,032-byte backing allocation left the device at
S_OKwith a 65,536-byte view. Asking for a 1,228,032-byte view produced message 650 and0x887A0001before any GPU submission. That corroborates the API failure at the observed size. A separate 30m56s run without this PR reached controllable gameplay and had neither device removal nor message 650. I have not tested the cap from this PR in the title. The in-title trigger remains unconfirmed.AI-assisted capture and log analysis. No title data attached.
@NuraadGit on GitHub · 2026-11-24 20:50 UTC · original
In-title result for this, on an RTX 2080 (
7b0f736+ this change + a diagnostics-only present log, no loop limit, Series X profile).0x7fe8ba580000. The line is logged once per run, so later ones would not show.0x887A0001about 5 to 6.5 minutes after launch, two of them with a view like this among the 64 made last. The probe (in Marvisak/VIctory#1640) shows that making one removes the device.It is one session, so it shows that such a view does turn up in the title and that the device stays, not how often the old build would have ended.
AI-assisted (Claude Code); counts and log lines only, nothing from the game attached.
@adriaespii on GitHub · 2026-11-24 21:04 UTC · original
Independent test run on commit
1d2f476(AMD RDNA4):x86_64-pc-windows-msvc)cargo clippy --workspace --all-targets -- -D warnings: 0 warningscargo test --workspace: 497 passed, 0 failed, 7 ignored (victory-gpu: 111 passed, 0 failed, 1 ignored;victory-shader: 210 passed, 0 failed, 2 ignored)AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.
@arminkhaleghirod on GitHub · 2026-11-24 21:18 UTC · original
Ran the game with this (
1d2f476) on an RTX 4080, Windows 11, Series X profile, default settings. 5.5 min from boot into the opening cutscene. No device loss, no0x887A0001. 0.7–1.8 fps in the cutscene.@Aminou973 on GitHub · 2026-11-24 22:20 UTC · original
Confirmed on an RTX 3080 10 GB (Windows 11, driver 621.14). Without this change the device is removed with
INVALID_CALLat frames 2,498 and 3,387 (debug layer:CreateConstantBufferView: Size of 2785536 exceeds maximum constant buffer view size). With the same clamp there is no removal over 3,400–4,400 frames and the prologue renders (details in #72). AI-assisted.@ericomeehan on GitHub · 2026-11-24 23:28 UTC · original
The evidence in this thread is unusually strong: four cards with before/after runs, and the debug layer naming the oversized view, so the cause looks settled.
One small test thing: in
an_oversized_constant_buffer_view_leaves_the_device_alive, the threeconstant_bytesasserts come after thelet Some(host) = host() else { return; }early return, so on a machine without a GPU (CI runners, for one) the test passes without checking the rounding at all. A separate CPU-only test forconstant_bytes(480 → 512, 64 KiB → 64 KiB,u32::MAX→ 64 KiB) would get those checked everywhere. The same applies to the port in Marvisak/VIctory#1640.Written with an AI assistant (Claude).
@tippythetaidum on GitHub · 2026-11-25 11:52 UTC · original
Test report on current
main(f85101b), RTX 5080 16 GB, driver 621.14, Windows 11, Series X profile, diagnostics build, default settings (so the relay is on).Without this change,
f85101bloses the device at world entry here: 2 runs of 2.f85101b0x887A0001) 2 min 1 s after launch, as the opening cutscene starts; "the host device went while buffer views of the heap were made"f85101b,VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1RemoveDeviceis the one belowf85101b+ this PR's commit cherry-picked (applies clean)Run B, the two lines in order:
Note for anyone reading run A's kind of log: the list of the last 64 views in the "buffer views of the heap were made" error did not contain the oversized view (its largest
Constantwas 480 bytes), so that list alone can miss the cause; the debug layer names it.an_oversized_constant_buffer_view_leaves_the_device_alivepasses on this card with the commit onf85101b.Not shown: runs A and C each ran once at default settings. All three trees also carried a local diagnostics-only counter of mine (it reads the lists' copy steps and does not touch descriptor views). Frame rate in run C's last five minutes: median 4.6 fps in 5-second readings (diagnostics build).
AI-assisted (Claude Code): runs, log reading and this text. Counts and log lines only, nothing from the game attached.
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.