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!2804
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2804"
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?
@0xkn0wh3r3 on GitHub · 2026-11-25 21:00 UTC · original
0xkn0wh3r3:bench/write-marks→main· +696 −0 · 3 files · 4 commits · openFive open PRs change how translated programs mark the title-memory pages they write:
This PR measures each approach on hardware, so they can be compared. It is tests only: nothing outside tests changes.
What it adds
crates/victory-gpu/src/marks_bench.rshas HLSL compute shaders that do what translated stores to title memory do:crate::memory;There is one shader for each way of marking:
maintest-first(#2167's approach)wave(#2755's approach)wave+test-firstnoneEach runs with the bitmap in system memory (the custom L0 write-back heap of
Host::shared_buffer, as on main) and in video memory. Each runs over four ways of writing: all in one page, linear, a page per lane (32 pages per bitmap word), and scattered.Times are GPU timestamps around one dispatch on a queue of the benchmark's own: 2,048 groups of 64 threads, 16 dword stores each. Each figure is the median of five runs, once with the bitmap cleared before each run ("first touch") and once with it already set.
Results (RTX 5070 Ti, driver 621.24), ms per dispatch, first touch / already set
main, system bitmaptest-first, systemwave, systemwave+test-first, systemmain, video bitmaptest-first, videononeWhat the results show:
A second benchmark times what a video-memory bitmap adds at a list's end: copying 256.5 KiB into read-back memory, then clearing it from zeros. That takes 12.2 µs per list (median of 20).
Recommendation: a video-memory bitmap (#2175 for page-table marks, #2465 for view marks) gives the full gain on its own. #2167's check-the-bit-first still helps wherever the bitmap stays in system memory, for example when the card has no room, but adds nothing on top of video memory.
Tests
every_variant_marks_the_pages_main_marks: every variant, with the bitmap in either place, sets exactly the bitsmainsets, over every pattern. Those bits are what copy-back copies.#[ignore]d:dxcompiler.dll(found under the Windows Kitsbinfolder) throughIDxcCompiler3; no process is spawned.D3DCompilecan't be used because the wave variant needs shader model 6. Without the SDK, or without a GPU, the tests do nothing.cargo clippy -p victory-gpu --all-targets -- -D warningsis clean, with and without--features diagnostics.cargo test -p victory-gpu --libfails onlydynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views. These fail the same way on main on NVIDIA (the 1,000,000-descriptor cap, fixed by #2121).Limits
A version of #2175's approach rebased on current main, with the bitmaps pooled, is on branch
0xkn0wh3r3:gpu/marks-in-video-memory(dd65e98) for anyone who wants to try it while #2175 conflicts.@fuzeofficlal on GitHub · 2026-11-25 21:24 UTC · original
Reviewed and benchmarked
ec830b56on Windows 11 + NVIDIA GeForce RTX 5090 (Blackwell) (+ WARP) againstmain(13f91ca).Review & correctness
D3D12_QUERY_TYPE_TIMESTAMParound single dispatches (1 warmup + median of 5 / 20), identical page-table lookup anddata.Storeacrossnoneand all marking variants,Dropcloses event handles (system_bitmaprelies on D3D12 release-time unmap; an explicitUnmapinDropwould be a minor polish).every_variant_marks_the_pages_main_markspassed on both RTX 5090 and WARP;cargo clippy --locked -p victory-gpu --all-targets(default &diagnostics): 0 warnings;cargo xtask policy: 185 files ok.RTX 5090
--releaseresults (marks_bench --ignored --nocapture)bitmap_copy_out_bench(262,656 bytes):6.5 µsmedian.clear / set):one pagelinearpage per lanescatteredmainsystemmainvideotest-firstsystemtest-firstvideowavesystemwavevideowave+test-firstsystemwave+test-firstvideononesystemEven on RTX 5090, putting the bitmap in
videomemory matches thenonefloor even withmain's unconditional atomics (401×–449× onone page/linear, 19× onpage per lane, 60×–63× onscattered) for6.5 µsof copy-out/clear overhead.@Marvisak on GitHub · 2026-11-25 23:24 UTC · original · edited 2026-11-26 02:18 UTC
Automated triage for the maintainers.
This adds a test-only,
#[ignore]d benchmark module,crates/victory-gpu/src/marks_bench.rs, that compares ways of marking written title pages (the approaches in #2167, #2175, #2465 and #2755). The measurements in the description and the thread are useful for choosing between those PRs whatever happens to the module.Update for
02912f9: thanks, the benchmark no longer spawnsdxc.exe. It now finds the newest Windows SDK underProgramFiles(x86)\Windows Kits\10\bin, loadsdxil.dllanddxcompiler.dllfrom there withLoadLibraryWand compiles throughDxcCreateInstance/IDxcCompiler3, andcrates/victory-gpu/Cargo.tomlgains awindowsdev-dependency entry with theWin32_Graphics_Direct3D_Dxcfeature. Loading an external compiler DLL into the test process and the Cargo.toml change are still things this triage leaves to the maintainer, so this stays needs work: needs the maintainer's decision, not a code defect. Checked-in DXIL would be generated code in the repo, so I would not switch to that without the maintainer either. CI (check) passes.Generated by Claude Code
@0xkn0wh3r3 on GitHub · 2026-11-26 00:00 UTC · original
Understood. On compiling in-process: the shaders target
cs_6_6, and the wave variants useWaveActiveBitOr,WaveActiveAllEqualandWaveIsFirstLane, which need SM 6.0 or later.D3DCompilestops at SM 5.1, so they can't be built with it. If running the SDK'sdxc.exefrom a test isn't acceptable, the alternative is to check in the compiled DXIL for the handful of benchmark shaders. That's small, but it's generated code in the repo, so it's your call which you prefer. The measurements in the description stand for choosing between #2167, #2175, #2465 and #2755 whatever happens to the module.@0xkn0wh3r3 on GitHub · 2026-11-26 00:01 UTC · original
Update to my reply above: at
02912f97the benchmark no longer spawns anything. It compiles its SM 6.6 shaders in-process through the SDK'sdxcompiler.dll(IDxcCompiler3), so the process question no longer applies. The Cargo.toml change only adds a feature to an existing dependency. #2806, which shares the harness, does the same at5dfeaf69.@Anzymanz on GitHub · 2026-11-26 00:17 UTC · original
From a tester working with Claude (AI-assisted, Claude Code): the same comparison in the title on an AMD card under Linux, for the two kernels that cost the most GPU time in our world runs.
Setup: RX 9070 XT (RDNA4), RADV / Mesa 26.3.1 through vkd3d-proton (GE-Proton 11-14), resizable BAR on. Diagnostics builds of one base (
13f91ca+ #1997 + #454 + #2644), each arm = base + one change, warm shader cache, opening cutscene, 30 s in the world,VICTORY_GPU_TIMING=1(per-command timestamps), one run per arm.The two kernels are
XboxBvhBuilder.dllcompute programs that read and write title memory (memoryandmemory_writesset):caa78b8ca62bc3d6(~90-150 dispatches a frame) and28918b7150a7aad5(~40-70). In the base they are 108 of 249 ms of timed commands per frame. Their DXIL has 156 and 74atomicBinOps, of which 108 and 74 are ORs into the page bitmap.GPU ms per dispatch (stable across arms, unlike per-frame totals, which follow the scene):
caa78b8ca62bc3d628918b7150a7aad5So on this card, for these two kernels, moving the bitmap to video memory changes nothing, and merging a wave's marks takes about a quarter off one of them. That doesn't match the 5070 Ti numbers above, where the system-memory bitmap is the whole cost. My guess, not measured yet: here the cost is their stores and atomics into the host copies of title buffers, which are in system memory too. I'm running #2870's chain next (same binary,
VICTORY_GPU_UPLOAD=0against the default) and will post it.No game data: hashes, counts and timings only.
@liandraraiane on GitHub · 2026-11-26 02:48 UTC · original
NVIDIA numbers for this bench: RTX 3060 12 GB, driver 610.88, Windows 11 26200, dxc 10.0.26100.0, on
ec830b5(before the in-process compile commit). Median of 7 runs (each the bench's own median of 5), ms per dispatch, clear bitmap:On this GPU, system-memory atomics on the bitmap cost about 1000x the video-memory ones (
main: ~3 s per dispatch).wavestays within ~3x of the floor with the bitmap clear and at the floor once it is set. With the bitmap in video memory every variant is at the floor.bitmap_copy_out_bench: 45.2 µs (45.1–45.6).every_variant_marks_the_pages_main_markspasses.AI use: Claude Code ran the benchmarks on this machine and drafted this comment.
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.