Repository navigation
Conversation
|
Not a request to change how this issue works, just a note for people who want a running build to try pull requests together, and for authors whose PRs may already be in it. VIctory V2 is an integration fork: it merges community pull requests, keeps each author in the history, and runs What would help us:
If you want your PR exercised together with others in a running build, tell us its number. |
bc2f306 to
143370c
Compare
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: merged into main 940d32f, cargo test -p victory-shader --locked on macOS arm64 — 144 passed, 0 failed, 2 ignored (Windows-gated hardware execution tests not run here). Approving the shader side — compute dispatches spread past 65,535 groups. victory-gpu side is Windows-only; static review only there.
|
We were about to add a limit check for direct dispatches and found this PR already covers the main case (x > 65,535 with z == 1). Two notes, from reading the code only; I didn't run anything.
The title was not used in these tests. AI-assisted |
|
@r4tedx Great catches on both points. Addressed in
CI check and xtask policy are clean. |
|
Thanks, re-read
Two small optional suggestions:
This is from reading the code only; I didn't build or run it. The title was not used in these tests. AI-assisted |
|
For comparison, a parallel design: xcl-dev/xcl#1428 folds x > 65,535 into Y (when y == 1) for direct dispatches and AI-assisted (Claude Code). |
|
@r4tedx @upipibi Pushed @upipibi Great comparative analysis with
CI check and unit tests pass cleanly. |
|
Checked
One optional gap: the This is from reading the code only. The title was not used in these tests. AI-assisted |
|
@r4tedx Pushed |
|
Checked My second point, y or z over the limit and x over it with z > 1, was already covered by This is from reading the code only. The title was not used in these tests. AI-assisted |
|
Thanks @r4tedx for the thorough review, catching the loop-header edge case, and helping pin down the unit tests! |
|
Automated triage for the maintainers. Needs work (small). Thanks for the rebase onto Still to fix:
This overlaps #3086 and #3100, which handle the same 65,535 limit for direct dispatches; the maintainer picks one approach. Generated by Claude Code |
|
More data on the pass this fixes, measured on an RTX 5070 Ti (NVIDIA 621.40, Windows 11). One trap for the indirect side, if a count is ever read on the CPU when the list is recorded: the record's memory can still hold a value the title has not written yet. We read 4,294,903,655 once. We treat a count over 2^20 as not a count and clamp it as before. |
|
Pushed 1. Default-Heap Spread Buffer Pooling & Zero Per-Dispatch Allocation Overhead
2. Synthetic GPU Unit Test for Translated Remap & Group Bounding
|
6bfc9c3 to
f06bd91
Compare
|
Rebased cleanly onto
|
d27c93a to
cc17a78
Compare
|
@Xvania7 I saw your latest rebase in On the linked branch, both Branch · Follow-up commit · Full diff AI-assisted with Codex. |
|
@andrewpozdnakov7-jpg thanks for the detailed verification across the group boundaries (65,535 / 65,536 / 65,537) on WARP and validating Looked through your follow-up commit I can cherry-pick |
Carry d5d6673 onto the current Marvisak#2312 head. Cover oversized Y in the GPU argument readback and keep an owned root signature in every spread command-signature cache entry.
|
@Xvania7 I carried the fixes from
The full app-local WARP suite passed 249 tests with one ignored. The synthetic direct and indirect dispatches wrote each expected group once at 65,535, 65,536 and 65,537 groups. The shader unit test also checks the direct Y clamp. If you cherry-pick the follow-up, please retain its Git author. If you fold it into another commit, please keep AI-assisted. Synthetic tests. |
|
Tested in game on Linux, and it fixes the scene where I found this bug. Setup: RTX 5090 (driver 620.73.04), GE-Proton11-14 Wine with its vkd3d-proton. Base: The bug there: Bottom-edge blocks: the share of bright blocky pixels in the bottom 4% of the frame.
Also: the lit yard looks the same as with the clamp simply lifted (a diagnostic that isn't valid D3D12). There was no device removal, Xid or exception in the runs. I also reviewed the merge for the bug classes found in my competing #3100:
Two minor things you may want to look at:
The merge onto that base had a few conflicts with #2699's root-view offset check and the Wine-compilable clamp from #2969; they were mechanical. AI-assisted (Claude); measured on my machine, no game data shared. |
…he preparing thread's work at equal draws); compute dispatches past 65,535 groups spread across z; blank texture slots asked again; BC7 rotation fix; instruments for DirectStorage holds, failed askings and refreshes; pipelines can be denied their build - VICTORY_SETTLE_ROOM=1|alt (off): lists in the air x2, changed runs merged x8. - Dispatch spread (after upstream VIctory pull request Marvisak#2312): a compute program that reads its group id x takes (x + z * row) and leaves past the asked count; direct dispatches and the indirect clamp spread x > 65,535 with z 1; VICTORY_SPREAD=0|alt to compare. Tested on the card and WARP. - VICTORY_REASK_BLANK=1 (diagnostics builds): zero-reading slots asked again. - Upstream VIctory Marvisak#3111: BC7 rotation only in modes 4 and 5. - VICTORY_NEAR_WRITES, VICTORY_SYNC_BESIDE (both measured at no gain, off), VICTORY_DENY_PIPELINES, builder pipelines named, DirectStorage held-read wait line, failed-asking price and refresh counters (diagnostics). - README: newest results.
|
@Xvania7 @neonbyte1 I reproduced the near-UINT_MAX case from the Linux report on the exact PR head 7a1632d. The synthetic WARP test reads the clamp output and never dispatches those arguments.
The earlier follow-up already rejects that x before doing either ceiling division and caps y before the group count check. I also updated the same fork branch at 38b0f59 so the shader regression reports errors from the requested WARP device or pipeline creation. It uses a single WARP run when VICTORY_WARP=1. With inbox WARP (SM 6.2), the previous forced test printed two skips and passed. The updated test fails with the actual shader-model error. With app-local Agility 1.620.2 and WARP 1.0.22, it validates DXIL, dispatches the synthetic shader, and verifies all 65,537 group IDs in its readback. Strict shader Clippy and asset policy passed. Please retain the Git author if cherry-picking or rebasing the fix and test. If folded into another commit, please add the following trailer. Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com |
|
Pulled @andrewpozdnakov7-jpg's follow-up commits
Huge thanks to @neonbyte1 for the in-game validation on RTX 5090 (Proton / Linux) confirming the fix for Local validation clean:
Pushed to branch head |
Upstream Marvisak#2312 spreads dispatches of more than 65,535 groups in x over z (the translated program takes its group as x + z * row), and its indirect half changes the clamp's HLSL. This branch has no clamp HLSL: the clamp is DXIL we write (emit/own.rs), so that half could not merge. The clamp's unused fourth constant now asks for spread records. Then each dispatch goes out as 20 bytes, [row, asked x, gx, gy, gz], packed whatever the title's stride: a record of more than 65,535 groups in x, any in y and one in z as ceil(x / rows) by y by rows (rows = ceil(x / 65535)), others clamped as before with row 0; over 2^20 groups in all, none. A record past the budget gets zero groups in x, as before. indirect::bound takes the flag with Marvisak#2312's signature; nothing passes true yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hes past 65,535 groups in x across z (fixes Marvisak#2256) Conflicts resolved: - indirect.rs: the clamp HLSL the PR changes is DXIL on this branch; the previous commit gives that DXIL the same spread records and bound() the PR's signature, so our side is kept and the PR's test is added. - draw.rs: the direct spread goes after this branch's thread dispatches (DispatchThreads), binding through bind_dispatch. A partial-dispatch program is not spread: its guard reads the group id before the remap. The indirect path keeps the BVH builder hold-back check. - synthetic_tests.rs: both sides' tests kept; the PR's HostShader gets this branch's written_root_uavs field. - placed_uav_tests.rs: hand_out takes the title's bytecode pointers and dispatch its THREADS parameter on this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since Marvisak#2312 every compute program reads two host user-data dwords (DISPATCH_SLOT: the groups of a row, the groups asked in x). The PR taught upstream's test helpers to leave them at zero; this branch's own GPU tests filled them as title data. The cube resinfo test panicked on them ("unexpected user data (Constants, 255)"), and the cross-lane, memory, stride and VALU helpers either asserted every entry is a table or wrote table offsets and test constants there, so the programs ran as if spread (row 32 or 255 * 32) and skipped or remapped their groups. Those helpers now skip the two words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Marvisak#2312 every indirect dispatch of a compute program goes through a command signature that sets two root constants per record, then the dispatch, not only the wide ones. Nothing checked that D3DMetal (or any other host) honours root constants in ExecuteIndirect; where it does not, every such dispatch runs with the bound row and asked count, not the record's. A probe now runs once before the first spread signature is made: a program written as DXIL (emit::constants_probe) through a signature of two constants at offset 1 and a dispatch, on a queue of its own, two records with different constants and group counts. Only where each group wrote its own record's constants are indirect dispatches spread; otherwise, or when the probe fails or takes more than five seconds, they keep the plain signature and the unspread clamp, as before Marvisak#2312. The result is logged once. Direct dispatches set plain root constants and spread regardless. The device-removed report (diagnostics) no longer reads the spread words as title root arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream Marvisak#2256 reports the first room turning much darker with a fork's spreading of wide dispatches, while another fork running every group without spreading saw no change; the cause is not known. With VICTORY_NO_SPREAD=1 dispatches of more than 65,535 groups in x, direct and indirect, are cut to 65,535 groups per dimension as before Marvisak#2312, so the two can be compared on the same build. Unset, nothing changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
INTEGRATION.md listed Marvisak#2312 as deferred for a DXIL follow-up. It now says how it was taken (the DXIL clamp's spread records, the merge, the test helpers, the indirect root-constants probe, VICTORY_NO_SPREAD), the conflicts resolved, what to check on the Mac, and the test round. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This reverts commit 7256b04: a track branch does not edit INTEGRATION.md; this round's documentation commit covers Marvisak#2312. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in draw.rs execute_indirect: Marvisak#1817 passes the argument span in and drops the local len; Marvisak#2312's port keeps the host pipeline from the let-else. Both kept. placed_uav_tests (Marvisak#2312, diagnostics) passes the 12-byte span Marvisak#1817's signature now takes.
…words alone Since Marvisak#2312 every compute program reads two host user-data dwords (DISPATCH_SLOT) past the title's. Tests merged in the PR refresh were written without them: Marvisak#2037's indexed CBV test panicked on the unexpected (Constants, 255) entry, Marvisak#2152's ds_permute test wrote the mask's high half into them (the program would run as if spread), Marvisak#3038's test counted them as spilled user data at index 16 and up, and Marvisak#171's GPU test set five of seven root constants. They now leave the two words at zero or skip them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
's root signature Marvisak#2336's test seeds the pipeline library under the name HostPipeline::new gives the incoming compute shader, built from an empty root signature. Since Marvisak#2312 every translated compute program reads two user-data words, so HostPipeline::new makes a root signature with those constants: the seed failed (E_INVALIDARG, the shader reads constants the empty signature lacks) and the names would not have matched anyway. The test now builds the same constants parameter HostPipeline::new does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
INTEGRATION.md did not list this round. It now has a dated section with the 96 community PRs and their authors, our own commits, what was dropped and why (Marvisak#2445, our publish fix superseded by Marvisak#2797, the track's own INTEGRATION.md commit), the conflicts resolved and a list of checks for the Mac; a section on Marvisak#2312 taken on our DXIL clamp and one on writes Rosetta reports as reads; and the test round against c0034e8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since Marvisak#2312 every translated compute program starts with the spread guard: groups past the asked count return before the console code. In a program with s_barrier that puts the barrier in a conditional arm, and WARP's compiler crashes on it: glc_heap_uav_loads_stores_and_atomics_execute_on_gpu ended the Windows test run with an access violation (fork CI at 7f326a9, the Marvisak#2312 port alone; the refresh alone passes). The partial-dispatch guard already refuses barrier programs for the same reason. Such programs get no spread words now, so the host does not spread them and cuts them at 65,535 groups per dimension, as before Marvisak#2312. Programs without a barrier are spread as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
INTEGRATION.md did not say that compute programs with a group barrier are left unspread, or how the round did on Windows CI. It now covers the barrier rule in the Marvisak#2312 section, in our commits and in the Mac checks, and records the CI history: WARP crashed at 00842b5 (the Marvisak#2312 port alone did the same, the refresh alone passed), then the run at 5af7950 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Fixes #2256 (indirect clamp and direct Dispatch cutting compute dispatches with more than 65,535 groups in x).
victory-shader):DISPATCH_SLOTuser-data constants (ow, �sked_x) and a compute prologue (cs_spread_prologue) emitted after self.inputs() (so entry-block inputs dominate the body block).
ow != 0, remaps GroupId(0) to x + z * row, GroupId(2) to , and returns early before the shader body if eff_x >= asked_x (covering side-effect-only shaders that do not read TGID).
victory-gpu):Dispatch: spreads x > 65,535 && z == 1 into ceil(x / rows) x y x rows (ows = ceil(x / 65,535)) and passes [row, asked_x] via DISPATCH_SLOT user data.
ExecuteIndirect(DISPATCH):indirect::bound_spreadwrites 20-byte [row, asked_x, gx, gy, gz] records into a list-kept UAV buffer (zeroing g_out when over budget), anddraw::execute_indirectruns them through a cached root-constant + dispatch command signature (host_spread_signature).Tests
indirect::tests::spread_records_split_large_x_and_keep_small_unspread(verified on RTX 5060: 115,200 x 1 x 1 -> [57600, 115200, 57600, 1, 2], 65,537 x 1 x 1 -> [32769, 65537, 32769, 1, 2], 100 x 2 x 1 -> [0, 100, 100, 2, 1]).cargo test -p victory-shader --lib emit::lower::tests::— 21 passed, 0 failedcargo test -p victory-gpu --lib -- --test-threads=1 indirect::tests::— 6 passed, 0 failedcargo test -p victory-gpu --lib -- --test-threads=1 list::tests::— 4 passed, 0 failedcargo clippy -p victory-gpu -p victory-shader --all-targets -- -D warnings— 0 warningscargo xtask policy— 182 files ok