GPU: three opt-in switches (VICTORY_SPLIT_SUBMIT, VICTORY_RELAY_COPY_RUNS, VICTORY_WAVE_ZERO_MASK) and no 4 KiB placement probe that cannot fit #3069
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3069"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Adriwin06 on 2026-11-29T19:52:52Z.
What it changes
4 small changes of the same kind, one commit each, so each can be reviewed, reverted or left out on its own:
GPU: VICTORY_SPLIT_SUBMIT=N sends a submission as one ExecuteCommandLists per N runs
Off by default. With N > 0 a submission goes to the queue as one
ExecuteCommandLists call per N of its runs (each run with its prelude)
instead of one call for all of them, on both the in-order and the
send-ahead paths, still followed by one signal. The aim, as in foxhound,
is that the card starts on the first runs while the later ones are
still being handed over; not measured on its own here.
Ported from readmet3xt-lab/foxhound@6c67166 (foxhound PR #30, Ingenioeren),
GPL-3.0-or-later.
Relay: VICTORY_RELAY_COPY_RUNS=1 joins adjacent read-back copies into one CopyBufferRegion
Off by default. With VICTORY_RELAY_COPY_RUNS=1 the read-back pieces of
one shadow whose source and destination ranges follow each other are
recorded as one CopyBufferRegion instead of one per piece; pieces with
a hole between them, from another shadow or out of order stay apart.
Test: host::joined_readback_preserves_bytes_order_holes_and_distinct_...
Ported from stellarr-studio/kelvaroq patch 0032, GPL-3.0-or-later.
Pool: no 4 KiB small-placement probe for a texture that cannot fit in 64 KiB
With small placement on, every placed texture was first described with
D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT and asked for its allocation
info, and fell back to the default alignment when the driver refused.
small_alignment_might_fit rules out, before asking, the descriptions
that can never use 4 KiB alignment: buffers, multisampled, non-UNKNOWN
layouts, render targets, depth-stencil, and textures whose one slice is
already larger than 64 KiB (an array or volume is judged by one slice).
The driver still decides every other case, tile rounding included. A
description that was not probed is not compared with the info's
alignment.
Ported from DoubleGhosty/cool_fox@0289d1f (cool_fox PR #158, Xyzstk),
GPL-3.0-or-later.
Shaders: VICTORY_WAVE_ZERO_MASK=1 lowers an identically empty lane mask without a half-wave exchange
Off by default. With VICTORY_WAVE_ZERO_MASK=1 a scalar lane-mask
operation on a mask that is provably false (Bool::FALSE in both halves)
is lowered without the cross-half-wave exchange a wave64 program on a
32-lane host otherwise needs: no lane contributes a bit, so either
dword is zero even when the other half skips the instruction. The
switch changes translations, so it is part of the shader cache's key.
Tests: wave64_tests::only_a_provably_empty_mask_needs_no_exchange_in_a_lane_branch,
shader_cache::tests::every_switch_of_the_translator_is_in_the_key.
Ported from stellarr-studio/kelvaroq patch 0033, GPL-3.0-or-later.
How it was tested
cargo testpassed for the crates it touches:cargo test -p victory-gpu --lib -- host::: 212 passedcargo test -p victory-gpu --lib -- host::: 213 passedcargo test -p victory-gpu --lib -- pool::: 28 passedcargo test -p victory-shader --lib -- wave64_tests::only_a_provably: 1 passedcargo clippy --workspace --all-targets --locked: no finding that main does not already have (main has 34 of its own, which is why the Clippy step of CI is red on main itself).cargo xtask policy: no new finding (main fails it on crates/victory-loader/src/heap_sites/frame_users.rs).cargo clippyalso with--all-featuresadds no finding, andcargo test --workspace --lockedfails only tests main also fails on this machine: the five shader tests that fail on main here too (WARP's SM 6.2 and the validator) (barycentric_tests::first_half_values_render_on_hardware_and_warp, hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity, intersect_tests::flat_global_stores_and_atomics_fence_uavs_at_group_barriers_across_waves, rect::tests::rectangles_are_drawn_whole, rect::tests::the_rectangle_stage_is_a_geometry_shader) and xtask's repository_passes_policy (frame_users.rs). 2208 passed, including five that fail on main (three BCPack oracle tests, the menu save race, the shader key test).Checked for overlap
pc.is_none() && small_placement() && small_alignment_might_fit(&d)).🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Copilot on 2026-11-29T19:57:24Z.
Code review location:
crates/victory-gpu/src/host.rs; line 9236When
VICTORY_SUBMIT_SPLIT=1activates the sender thread,submitreturns before reaching the new split logic, andsend_publishedstill builds cuts only fromh.parts(host.rs:8582). As a result, four published runs withVICTORY_SPLIT_SUBMIT=2and no part boundaries still use oneExecuteCommandListscall. Apply the N-run boundaries insend_publishedtoo, keeping each prelude with its run and preserving the single final signal.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-29T19:57:24Z.
Review: COMMENTED
🟡 Changes recommended
The sender-thread path bypasses the new N-run split logic, so published runs without part boundaries still execute in one call rather than honoring VICTORY_SPLIT_SUBMIT.
1 open issue
What changed in this PR
This PR adds optional GPU submission, read-back, and shader optimizations, and avoids unnecessary small-texture placement queries.
Changes:
crates/victory-shader/src/emit/wave64_tests.rscrates/victory-shader/src/emit/lower.rscrates/victory-gpu/src/shader_cache.rscrates/victory-gpu/src/pool.rscrates/victory-gpu/src/host.rsReview effort: Balanced
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T20:47:01Z.
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch
janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with--profile diag --features diagnostics, and the CPU tests of the touched crates pass. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by madvillain91 on 2026-11-29T23:39:10Z.
System Information:
Config Used:
VICTORY_SPLIT_SUBMIT=1
VICTORY_RELAY_COPY_RUNS=1
VICTORY_WAVE_ZERO_MASK=1
Summary of Test Session:
Technical Log Evidence:
Conclusion:
Attachment:
victory-nvidia-play-20261129-232440-15564.log
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Adriwin06 on 2026-11-30T00:54:40Z.
Code review location:
crates/victory-gpu/src/host.rs; line 9236Good catch, fixed in
339a923c: the cuts are now made in one place,send_cuts, whichsubmit's send-ahead and in-order paths andsend_published(theVICTORY_SUBMIT_SPLIT=1sender thread) all use. It cuts at each part's first run and every N-th run, keeps each prelude with its run, puts what follows the last run in the last call, and keeps the single final signal. With the switch off the cuts are the parts' alone, as before. Regression tests:host::send_cuts_tests(four runs by two with no parts give two calls).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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.