GPU: verify exact dirty-page masks on D3D12 #1681
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!1681
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1681"
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?
@avt0m4t48 on GitHub · 2026-11-24 20:43 UTC · original
avt0m4t48:tests/dirty-page-gpu-compare→main· +621 −0 · 3 files · 1 commits · openFirst verification slice for
GPU-SNAPSHOT-COSTin #1633. Add an original compute kernel and a source-built D3D12 fixture. The host can use this contract to test a GPU comparison path before changing when production snapshots or copy-back run.The kernel compares immutable before/after raw buffers over a declared byte range. Each changed 64 KiB title page gets a bounded record with its clipped range, one bit per changed byte, and values for changed DWORDs. Capacity overflow is explicit so a caller can retain the existing comparison as a fallback. The fixture compares the exact GPU output with a bytewise Rust oracle, including poisoned unused output and input changes outside the declared byte range. No title files or dumps are used.
Verification
cargo test --locked -p victory-gpu --features diagnostics dirty_pages_test:: -- --nocapture --test-threads=1: all 11 synthetic cases passed on Windows D3D12 WARP. The runner had no compatible physical adapter and explicitly skipped that complementary check.0x07where the isolated change requires0x02. Windows candidate and negative controldxvand SPIR-V validation passed. The kernel also matched a CPU oracle on llvmpipe for 35 cases, including 24 seeded random input ranges. A separate comparison passed on llvmpipe using the exact 11 Rust fixture inputs. Vulkan experiment and capture-point notesblake3feature passed with warnings denied. Asset policy passed.The production snapshot and submission paths are unchanged. The next integration tests need to prove the baseline capture point and preservation of adjacent CPU writes during reconciliation. Adapter timings and title performance remain open.
AI-assisted using Codex.
@aycow on GitHub · 2026-11-24 21:51 UTC · original
@avt0m4t48 The shared CPU reconciliation contract is ready for comparison with
9c447fb. It covers exact bytes including unchanged neighbours, writes after the GPU sample, real aliases, partial mappings, guard transitions, overflow and ordered replay. Fence ownership and repeated recording are complementary integration cases. On the #387 harness, the guarded bulk writer passed all 20 copy-ordering controls per adapter on AMD and WARP with full GPU-based validation. The extra preflight roughly doubled the 131,072-run case, so use it as a correctness control rather than a write backend for each fragment. Would you be interested in sharing the replay inputs and expected bytes while timing your GPU compare and CPU replay separately?AI-assisted using Codex.
@DeerSilver on GitHub · 2026-11-24 23:06 UTC · original
Setup: one laptop with an NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell,
10de:2d59, driver 621.24) and an Intel UHD Graphics (Raptor Lake Xe-LP,8086:a788, driver 32.0.101.7088), Windows 11 26300, Rust 1.98.1. The PR was merged ontomain70564ae.cargo test --workspace --all-features --locked --no-fail-fast -- --test-threads=1with the D3D12 debug layer on (VICTORY_D3D12_DEBUG=1, and a local, uncommitted change that also turns the debug layer on in victory-shader's testHost): 477 passed, 5 failed, 7 ignored. The 5 failures are the onesmain70564aehas by itself on NVIDIA (the view-heap cap and the structured-view stride, already reported in #1744); this PR adds none.cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features: cleanhardware_dirty_pagesran on the RTX (D3D12 dirty-page adapter (hardware): NVIDIA GeForce RTX 5060 Laptop GPU (0x10de:0x2d59, flags 0x0)) andwarp_dirty_pageson WARP (Microsoft Basic Render Driver (0x1414:0x008c, flags 0x2)); both pass every case.The debug layer gives 22 more lines than
main, all of one warning:It comes from the buffers the new test creates with
D3D12_RESOURCE_STATE_COPY_DEST. It's harmless; creating them inD3D12_RESOURCE_STATE_COMMONwould silence it.No game data used. AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 03:33 UTC · original
Automated triage for the maintainers.
Needs work. This adds a dirty-page compare kernel (
crates/victory-gpu/src/dirty_pages.hlsl) and a WARP/hardware test that checks it against a bytewise Rust oracle (dirty_pages_test.rs). The kernel and test read correctly, but nothing inshadow.rsor the copy-back path uses the kernel ("production snapshot and submission paths are unchanged"), somainwould carry an unused shader whose only caller is its own test. Please send it together with its first use inshadow.rs(writing/copy_back), or stack that PR on this one, so the kernel arrives with a user and a measurement. Minor: a tester's debug-layer run reportsCREATERESOURCE_STATE_IGNOREDfor the buffers created inCOPY_DEST; creating them inCOMMONsilences it. CI: no check runs on this head.Generated by Claude Code
@MrEjecutor on GitHub · 2026-11-25 20:38 UTC · original
A physical-adapter data point for this, since the description says the runner had none: on an RTX 5060 Ti 16 GB (Blackwell, driver 621.24, Windows 11 26200),
9c447fbmerged cleanly onto currentmain(13f91ca, plus a few open NVIDIA PRs and #2705), andcargo test --locked -p victory-gpu --lib -- dirty_pages_test --test-threads=1 --nocapturepasses bothhardware_dirty_pagesandwarp_dirty_pages, with no "SKIP ... no compatible physical adapter" line, so the hardware case ran on the card.If it helps the next slice: in a world run of that stack the CPU side this would replace costs about 39 ms and ~300 MB of snapshots a frame here ("snapshots ... MB in ... ms" on the copystat line), and with #2705's card copies on, the declared writes the comparison would read already live in video memory.
Not tested: rustc 1.98.1 (stable 1.100 here); the diagnostics feature; anything beyond the two tests.
AI use: Claude Code (Claude Opus 5.5) ran and wrote this; checked by mrejecutor.
@pokces on GitHub · 2026-11-26 07:02 UTC · original · edited 2026-11-26 07:07 UTC
On a physical RX 9070 XT (
1002:7550, Windows 11 build 26300, driver 32.0.32029.2010), the unmodified9c447fbpassed all 11 oracle cases on both the card and WARP. I also measured the cost of discovering the readback size, following the RTX 3080 comparison above. Opt-in test and benchmark sourceEach input was 32 MiB in a DEFAULT heap (512 pages). One seeded byte changed per selected page. The same DIRECT queue ran both the existing kernel and the full-buffer control. The table gives the range of two run medians, seven samples per run after one warm-up, with method order rotated.
When the CPU needs the count first, the harness reads the 16-byte GPU header, waits, and submits the payload copy. With 5 dirty pages the two GPU intervals summed to 0.253–0.254 ms, but the helper took 1.856–1.936 ms wall-clock, compared with 1.605–1.656 ms for a full readback. With 512 dirty pages the header selected the full-buffer fallback. Capacity was 512 throughout. The pre-sized column assumes the size is known before submission.
Wall time includes list/allocator and fence creation, CPU waits, and timestamp resolution/mapping in the debug Rust test harness. Input and output initialization, baseline capture, and CPU reconciliation are outside the measurements. Hardware timestamps exclude the CPU wait between submissions. Desktop capture remained active. This suggests testing whether the count read can overlap other work at the proposed production capture point.
To reproduce, check out the linked commit, then run:
The added benchmark harness and this report were generated by GPT 6.2 Astra. The dirty-page kernel under test is from the original PR; the timings were measured on the RX 9070 XT.
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.