Windows compatibility work from TaynanGT/VIctory, merged with main #2758
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!2758
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2758"
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?
@TaynanGT on GitHub · 2026-11-25 19:49 UTC · original
main→main· +60359 −32501 · 117 files · 467 commits · closed without mergingThe Windows compatibility work from TaynanGT/VIctory, merged with VIctory
mainat13f91ca. It reaches the controllable prologue room at about 7 FPS on an RTX 4090 (README, "Local test results"), against about 1 FPS in VIctory's own status.This is one large change (326 commits, 117 files). If you prefer focused PRs, say which parts you want first and I will open them separately against
main, each with its own description and tests, as #2716 already does for XGameSave.What it changes
victory-shader): wave64 compute programs on 32-lane hosts (NVIDIA, Intel) as two host waves that exchange through LDS, including groups of several console waves; the ray-tracing node test (image_bvh_intersect_ray) as inline DXIL, with a CPU model it is checked against; scalarised light loops (own_bits), jump threading for uniform diamonds, spilled user-data tables; lowering fixes with tests inemit/*_tests.rs.victory-gpu): descriptor mirroring for heaps the title writes by address, title memory opened as a host heap (inplace) and direct copies of it, texture upload budgets, indirect-draw clamping, host pipelines built off the render thread, and live switches (VICTORY_LIVE) to compare settings in one session.victory-hle): XGameSave recovery (the same rules as #2716), DirectStorage page lists, XMA looping, memory mapping and async cancel fixes.victory-loader): the console CPU's instructions an Intel host lacks (clzeroloops among them), emulated in the vectored handler.Cargo.toml,rust-toolchain.toml,rustfmt.toml,.github/workflows/ci.yml,xtask,docs/andLICENSEare identical tomain. The README ismain's, with two sections added: the development PC and the local test results.Known differences from
mainThe merge kept the fork's interfaces where both sides changed the same code, so this PR also removes ten files that
mainhas and the fork replaced:victory-gpu/src/{bindless,hold,placement,twin}.rs,victory-shader/src/emit/lower/bvh.rs, and the testsemit/{bvh,memory,semantics,stride,synthetic}_tests.rs. Some ofmain's GPU changes from the last two days (texture placement, list waits on memory values) are therefore not in this branch yet.Tests
cargo clippy --workspace --all-targets --locked -- -D warningsand the same with--all-features: clean.cargo test --workspace --lockedon Windows 11 with an RTX 4090, GPU tests included: 903 passed, 0 failed (atdef99cf).cargo xtask policy: all files pass.🤖 Generated with Claude Code
cargo test --workspace does not compile on main: host.rs declares #[cfg(test)] mod tests twice, once near the top for the warp adapter test and once at the end for the Batch::texture_due tests, so rustc rejects the crate with E0428 before running anything: error[E0428]: the name ests is defined multiple times --> crates\victory-gpu\src\host.rs:1974:1 The second block only touches Batch, so it becomes mod batch and keeps its two tests. cargo test -p victory-gpu --lib goes from "could not compile" to 43 passed, 0 failed, 1 ignored, and cargo test --workspace compiles again. Nothing else changes: one line, no test bodies touched.When the host cannot make an unordered-access view (no host texture, a format the host does not allow, a placed texture not mirrored), null_for() wrote a 2D null UAV whatever the title asked for. A shader that writes a 3D texture through it then has a dimension mismatch: GPU-based validation reports it ("UAV Dimension Expected: TEXTURE3D, UAV Dimension In Descriptor: TEXTURE2D") for the world's wind field (WindNew:CS_CopyWindFieldBeforeUpdateWithSmooth, compute 5bb23d336331db1d, image_load/image_store dim:SQ_RSRC_IMG_3D). Shader views already get a null view of the title's dimension (null_like); unordered views did not. Null texture UAVs now keep the title's dimension: 1D, 1D and 2D arrays, 3D (WSize -1). Multisampled and unnamed dimensions stay 2D. With this, the validation error is gone on an RTX 5070. Tests: the dimension mapping, and a null 3D UAV made on the real device leaves it alive.A descriptor held in VGPRs is used through a waterfall loop: each pass reads the first active lane's dwords with v_readfirstlane_b32, compares them with every lane's own (v_cmp_eq), runs the access with the lanes that match and repeats for the rest. Tracing stopped at the readfirstlane results ("a descriptor neither loaded nor built"). The tracer now follows the read lanes' dwords to where each lane gets its own: global_load_dword* from a table or heap at a per-lane address (an image descriptor's two x4 loads lined up), or a v_cndmask_b32 choice per lane between such sources (e.g. two s_load descriptors). Other sources fail naming them (LDS read, buffer load, phi, input, computed VGPRs). The loop's compares of those reads with their own dwords are recorded. Lowering gives the access each lane's heap index (its load address over the descriptor size, or a per-lane select of indices) with createHandleFromHeap's nonUniformIndex set, lowers the recorded readfirstlanes as the lane's own dword and their compares as true, so the loop runs once with all lanes. Wave32 and wave64 are tested.v_cmp_lg_{f32,f16} ("less or greater") is ordered and not equal: false when either operand is a NaN, on RDNA2 hardware as in the ISA. It was lowered to `fcmp one`, which says the same, but the AMD D3D12 driver runs `fcmp one` as unordered and returns true for a NaN. NVIDIA and WARP get it right. It now lowers as `olt | ogt`, which all three run alike. New GPU test v_cmp_lg_is_false_for_nan covers both widths: NaN on either side, both NaN, a signalling NaN, +0 against -0, inf against inf and against -inf, and junk in the unread high halves for f16.a288258) into shader/per-lane-phi 1511e31a79a48eac3) into shader/per-lane-phi 1b6f0bac217474ad9) 9a68781c7aPSV0 shared one string-table entry between elements with the same semantic name. DXC writes one entry per named arbitrary element, in element order and repeats included. Validators before 1.8 compare the part byte for byte and refused ours ("Container part 'Pipeline State Validation' does not match expected for module"); 1.8 compares by content and took either, which is why the newest SDK never showed it. This is not specific to mesh shaders: vertex and geometry shaders with repeated names failed the same way (the rect tests under 1.7). Fixes #12. (cherry picked from commit 8bac552616ddd89b9215cfff0b79e2538464668f)The modes of interpolated elements came from DXC's defaults by type (float: linear, uint: constant), but the console's compiler may pack a float and a uint element into one signature row, declaring both constant in its PSV0. Mixed modes in one row are rejected by the validator ("interpolation mode that differs from another element packed into the same row"). The modes are now read from the console container's PSV0, keyed by row and column, falling back to the defaults without one. Ported from Marvisak/VIctory#1208 (its interpolation-mode part and its test), adapted to this fork's Psv (`geometry`). (cherry picked from commit b4ee908ee8797a1e166e18168d8253c0f4d92af5)ShallowWaterSim:CS_MinTimestepReduce (ceb5eb68cd99cb07) loads table entry 0 and only tests dword 2, the record count, against zero (s_cmp_eq_u32 s2, 0 then a branch to s_endpgm). descriptor_data's branch for a buffer view whose address alone is taken filled dwords 0 and 1 and left dword 2 missing, so the first read of it stopped the program ("a descriptor's address or format read as data") and its dispatches were dropped, 6.7 a frame on average while the water simulation runs. The table-entry lookup is split out of view_address (buffer_view); in that branch dword 2 now comes from getDimensions on a raw handle, divided by the entry's stride when it is over one (as175c71edoes), and the address is taken only when dword 0 or 1 is read. Test: a wave32 program that loads entry 0, tests dword 2 against 0 and stores it, on the card and on WARP, expects 24 for a buffer of 24 four-byte elements; it fails without the fix with the game log's error. The victory-shader suite passes (243). (cherry picked from commit c9e59ab9eb8aeed59d1cbeab2c3a6a4f9acd3fe4)The victory-gpu tests ended with STATUS_ACCESS_VIOLATION in some runs of `indirect::` with the tests in parallel (2 of 20 reported; 6 of 510 here), never single-threaded and never with one test alone. The fault is WARP's, on a thread of its pool: d3d10warp.dll's shader compiler reading entry 0xFFFFFFFF of a table, or a null pointer (+0xc7bb9, +0xc8c13, +0xc7b6c, +0xc85de, +0xa4cdb; an unhandled-exception filter in an instrumented build). The event log holds another tree's test binary crashed at +0xc7b6c today. D3D12 makes one device per adapter (the devices made on EnumWarpAdapter's adapter and on the Basic Render Driver's are the same object), so every WarpHarness and inplace's warp() share one device, and WARP compiles a pipeline's shader when a queue first runs it. In both crashes caught with a timeline, harnesses' first submissions came within 3 ms of each other (four of them; the two card compare tests, 0.2 ms apart). Experiments, instrumented build, 10 runs each: two queues running new pipelines at the same moment crashed 10/10; one queue running new pipelines while another thread made pipelines 0/10; two threads only making pipelines 0/10; two queues running pipelines that had run before 0/10. Harnesses on 8 threads, 20 each: 18/20 crashed; one device kept alive throughout 19/20 (not device re-creation); bytecode unique to each harness 10/10 (not shared compiled shaders); bytecode blobs never freed 10/10 (not a freed bytecode read); submissions one at a time 0/20. Pairs with --test-threads=2, 60 runs each: 3 crashes in 1,260, each pairing warp_window_executions_read_their_records_with_no_barrier_between with one of warp_a_group_charges_its_records_in_lane_order, warp_budget_saturates_without_wraparound_and_preserves_draw_fields, warp_count_buffer_ignores_garbage_tail_and_preserves_source; the other 18 pairs 0/60. crate::host::warp_turn is a process-wide turn: WarpHarness holds it for its life (its last field, given back after its objects are released), and inplace's warp() returns it with the device. Tests: warp_harnesses_take_turns failed before ("a second harness was made while the first was alive"). warp_window_executions_on_eight_threads (ignored, a reproduction) crashed 10/10 before and passed 5/5 after. warp_turn_is_taken_again_after_a_test_failed_holding_it covers the poisoned turn. Side by side, before / after: `indirect::` 3/300 crashed / 0/300; the pair warp_a_group_charges_its_records_in_lane_order + warp_window_executions_read_their_records_with_no_barrier_between with --test-threads=2, 2/300 crashed / 0/300. Mutations: a fresh mutex per call fails warp_harnesses_take_turns and the reproduction crashed 4/5; lock().unwrap() fails the poison test; the turn given back before the objects are released passed the reproduction 10/10, so that order is a precaution. `indirect::` takes 2.8 s instead of 1.2 s (1 s of it the new test's wait); the crate's tests pass (138, 4 ignored). Clippy as CI runs it is clean but for host.rs's existing useless_vec at the base. Not covered: where the default adapter is the software one (a runner without a card), host() is this same device and tests that submit to the host's queue do not take the turn. (cherry picked from commit 5d9843667abeeeb1c734b2ec7b396236213aa0d4)A console wave64 program that no form carries in 32 lanes was handed over with WaveSize(64), and on an RTX 4090 (waves of 32) CreateComputePipelineState refused it with E_INVALIDARG and no reason, on every run, for 3 to 7 of the prologue's compute shaders. It is now refused at translation with the reason ("a console wave64 program that still needs 64-lane waves"), and gets the constant-edge retry that only refused programs had. Its dispatches are dropped as before. Hosts with 64-lane waves are unaffected. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y64The heap pass looks again at every texture uploaded in part, asking the kernel about each 64 KiB of it, although the runtime's notices already make a slot due when memory is mapped, unmapped or written under it: 4.5 ms a frame on average in a release run (241 slots looked at, peaks of 13-16 ms), with "looks that found no more mapped" growing by ~153 a frame. - The frame line now counts looks that found more of a texture mapped with no notice between ("arrived unannounced"), the cases the looks are for. - VICTORY_TEXTURE_PARK_FRAMES=<n> (off by default) lets a texture uploaded in part and found no further along wait up to n frames before the next look. With it on, dropped notices make the slots waiting on looks due at once. To be tried where the new counter stays about 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WFqqAvbrdcaXe2SvGb2y640601955) d0c99394a3@kotekompotek on GitHub · 2026-11-25 20:08 UTC · original
+59k/-32k across 117 files is a whole-fork diff, not a reviewable change - same shape as #2643. If this carries real fixes, please split them into focused PRs; as-is nobody can verify what it does.
@NovNovikov on GitHub · 2026-11-25 21:00 UTC · original
Sadly ground braking changes like this will not be recognized. You should advertize your own fork instead of trying to improve the upstream
@TaynanGT on GitHub · 2026-11-25 21:16 UTC · original
Thanks for taking a look, @kotekompotek. That's fair. This PR is too broad to review as a single change. The XGameSave fix is available separately in #2716, with its own regression tests.
Thanks for the suggestion, @NovNovikov. I posted a Vice-Tay update with my test setup, the results for each build, and the rendering issues I still see.
@Marvisak on GitHub · 2026-11-25 23:14 UTC · original · edited 2026-11-26 01:14 UTC
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting: 32 files, among themREADME.md,crates/victory-gpu/src/resource.rsandcrates/victory-shader/src/emit/lower.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
Pull request closed