Repository navigation
Conversation
…for a larger one) The title names constant buffer views of more than 4,096 vectors (one of 1,306,368 bytes, in the world). CreateConstantBufferView with a size over 65,536 bytes is an invalid call; NVIDIA removes the device for it (DXGI_ERROR_INVALID_CALL, 0x887A0001) in the frame the view is made. Both places that make constant views (make, HostHeap::constant_at) now cap the size at 64 KiB, the most a shader can read through one.
|
One boundary case in #104 covers the adjacent staging path: it applies the cap before sizing the scratch allocation and deferred copy, so the unused tail never reaches AI-assisted source review and synthetic helper test. |
|
One follow-up for memory pressure, separate from the invalid D3D12 call this fixes and the staging cap in #104. On I ran the branch's I'd treat that as a separate optimization, not a blocker for the descriptor fix. If narrowing the shadow lookup, check that descriptor creation and any later refresh resolve the same backing, particularly when only the capped prefix fits a registered buffer. The boundary case above would make a small regression fixture. AI disclosure: Hermes Agent traced the lookup and ran the CPU fixture on ArturoWolff's behalf. |
…ceInfo::arena_size - Expose VulkanDeviceInfo::arena_size in runtime/shims/d3d12_com.h and populate state_.info.arena_size = arena.size in Device::create_arena() so callers and merge glue (set_heap_base) can read the actual GPU address arena size. - Clamp CreateConstantBufferView / write_constant_buffer_view() to the D3D12 64 KiB cap (65536 bytes = 4096 * 16), rounded up to a 256-byte multiple, adapted from fxceless/victory-fork#911 (GPL-3.0, author douline). Log once when clamped and pass the clamped byte size to both buffer.num_records and resolve_vsharp_address() so oversized retail CBVs (>1 MiB) neither fault the GPU nor allocate oversized title-VA windows. - Add unit tests in d3d12_vulkan_device_test for 64 KiB CBV clamping (PC and Xbox vector-row paths) and VulkanDeviceInfo::arena_size (0 without BDA and non-zero on standalone BDA). - Update large (>64 KiB) title-window tests in d3d12_xmem_shadow_test to drive 512 KiB / 1 MiB / 2 MiB window installation via TitleVaAliases::table_view while keeping CBV calls within the legal 64 KiB cap.
…pty ones, at most 64 KiB - Table CBVs filled into the list's scratch or own memory (upload fill or GPU copy) zero the bytes from the title's size to the 256-byte end the host view takes, as the console reads zeros past a view's size; before, they read what earlier recordings left there. A CBV copy is reused only where its bytes past the asked length are zeros. - A constant view of no address or no bytes is a null CBV (dynamic slots: HostHeap::null_constant; title slots: `make` declines it, `null_for` makes a null CBV), not a 0-byte view, a null 2D SRV, or a fill from title address 0. create_cbv without a description records View::Constant(0, 0) instead of leaving the slot's old view. - Host CBVs take at most 64 KiB (constant_bytes, capped_constant): larger ones remove the device on NVIDIA (0x887A0001). Title sizes over 64 KiB are logged (counted, with the largest seen), and only 64 KiB is copied. Tests (WARP): draw::tests::table_cbvs_read_zeros_past_their_size, descriptor::tests::a_constant_view_without_a_description_is_a_null_one, descriptor::host::tests::constant_views_are_capped_at_64_kib_and_null_when_empty. Ported from Marvisak/VIctory#1629 (head 111b773) by ESAT586 Ported from Marvisak/VIctory#1640 (head b916a9c) by NuraadGit Ported from fxceless/victory-fork#911 (1087538) by douline
…r runs across the cursor, snapshots flushed before a copy goes, changed runs reused, texture checks side by side, the card-copy census and its write-combining experiment From fxceless/victory-fork's open pull requests: - fxceless#911 (douline): a constant buffer view is at most 64 KiB; the title names larger ones and NVIDIA removes the device for them. - fxceless#932 (avt0m4t48): the search for free dynamic descriptor slots finds a run that lies across its starting point. - fxceless#936 (faycalbaklouti): queued snapshots are taken before a host copy is dropped (a use after free); its test's imports added for this tree. - fxceless#925 (alpz1000): changed-byte runs are found into one buffer reused across pages, the merge gap joined in the same pass. - fxceless#768 (KyleS98): a submission's texture checks run several at a time (`VICTORY_WIDE_TEXTURES=1`, off by default). - fxceless#868 (Chipsraine): a census of the card copies (`VICTORY_CENSUS=1`) and an EXPERIMENT, off by default: `VICTORY_SKIP_WC_COMPARE=1` leaves copies of write-combining title memory out of the compare and the copy-back. Here (RTX 4070, first gameplay scene) it took the median from 213 to 186 ms a frame, best 150 ms; not exact (the title must never read that memory after the card wrote it). With them gameplay went from a median of 233 to 213 ms a frame here. Tried and left off: `VICTORY_CARD_REHASH_RUNS=1` (1,735 passes a frame joined to about 220, no gain). victory-gpu: 174 tests pass (`inplace::...shows_its_bytes_at_its_offset` fails now and then, as before these); victory-hle: 99 pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…APS flush, fxceless#827 skip_frames) + test fixes - PR fxceless#911: clamp HostHeap::constant_at CBV SizeInBytes to <= 64 KiB via constant_view_size() - PR fxceless#936: flush SNAPS via take_snapshots() before dropping Shadow to prevent UAF - PR fxceless#827 (crash-fix part): add opt-in VICTORY_TABLED_SKIP_FRAMES check in HostHeap::tabled_lately (omits copy_or_make VRAM growth and unsafe COPY_FAST) - Align merged unit tests in shadow.rs, host.rs, indirect.rs, indirect/bench.rs, texture.rs and deduplicate record_print_tests
…ear u32::MAX) On top of fork PRs fxceless#911 (constant buffer views at most 64 KiB) and fxceless#868 (card copies census, VICTORY_SKIP_WC_BACK), both merged here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…t, page arrays waited for, views of at most 64 KiB - The card's compare takes 64 threads a 64 KiB piece, and fills of upload memory are kept in their own lists (fxceless#929 by AlexMiu, d07e1eb). - Constant tables read on the card in place (VICTORY_TABLE_CBV_DIRECT=1; off by default here) (fxceless#929). - A DirectStorage request whose page array the title fills late waits up to 100 ms for it (fxceless#929). - A constant buffer view is at most 64 KiB (fxceless#911 by douline). - A shadow that goes takes its queued snapshots first (fxceless#936 by faycalbaklouti). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… PR #911) The title names constant views of more than 4,096 vectors (the PR's author logged one of 1,306,368 bytes in the world); CreateConstantBufferView with such a size is an invalid call, and its author's NVIDIA card removed the device for it, found while buffer views of the heap were made. Logged once when it caps. Read whole (27 lines + a test), applied as it is. Whether the title names such views in OUR runs is not known: the once-line will say. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… PR fxceless#911) The title names constant views of more than 4,096 vectors (the PR's author logged one of 1,306,368 bytes in the world); CreateConstantBufferView with such a size is an invalid call, and its author's NVIDIA card removed the device for it, found while buffer views of the heap were made. Logged once when it caps. Read whole (27 lines + a test), applied as it is. Whether the title names such views in OUR runs is not known: the once-line will say. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit 2ba6e1f)
… PR fxceless#911) The title names constant views of more than 4,096 vectors (the PR's author logged one of 1,306,368 bytes in the world); CreateConstantBufferView with such a size is an invalid call, and its author's NVIDIA card removed the device for it, found while buffer views of the heap were made. Logged once when it caps. Read whole (27 lines + a test), applied as it is. Whether the title names such views in OUR runs is not known: the once-line will say. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit 2ba6e1f)
What
CreateConstantBufferViewis called with sizes over 64 KiB: the title names constant buffer views of more than 4,096 vectors (the one we caught: 1,306,368 bytes, in the world, minutes after entering it). D3D12 takes at mostD3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT× 16 = 65,536 bytes; on NVIDIA the call is invalid and the device is removed on the spot withDXGI_ERROR_INVALID_CALL(0x887A0001).Both places that make constant views (
makeforView::Constant, andHostHeap::constant_at) now cap the size at 64 KiB (constant_view_size). A shader cannot read more than 4,096 vectors through a constant view, so nothing it can read is lost. Logged once when it happens.How it was found
RTX 5070 Ti, release build, world entry with
VICTORY_LATE_WAIT=3: the device was removed every 5-20 minutes, always detected in the heap-views pass ("the host device went while buffer views of the heap were made"), without the debug layer able to catch it (diagnostics builds were too slow to reach it). A local check ofGetDeviceRemovedReasonright before and after each view/resource creation named the call:View::Constant(…, 1306368).Measured
Same machine and settings, after the fix: 30 minutes in the world without a device loss (it could not get past 5-20 before), 2.5 frames a second steady; then 50 minutes in a diagnostics build with the D3D12 debug layer and DRED on: no removal, no debug-layer error.
cargo test -p victory-gpu --lib constant_views: passes (new testconstant_views_are_at_most_64_kib).AI-assisted (Claude).