Repository navigation
Conversation
The pipeline state validation part left PSInfo.SampleFrequency at 0. DXC sets it when a pixel input is interpolated per sample (modes 6 and 7, which our lowering gives to PERSP_SAMPLE and LINEAR_SAMPLE barycentrics) or is SV_SampleIndex, and the validator compares the whole runtime info with what it derives from the module. The flag is now set for such pixel shaders.
exp mrtz's channel y is lowered to an SV_StencilRef output, but the module's shader flags never had StencilRef (bit 11) and SFI0 never had D3D_SHADER_FEATURE_STENCIL_REF (0x200). DXC sets both for a pixel shader whose output signature has the stencil reference, and the validator checks the flags against the module. Both are now set when a pixel shader outputs SV_StencilRef.
They went through a 32-bit conversion, so an f16 past the i16 range (32768 up to 65504) wrapped, and infinities and NaN were undefined. The value is now clamped in f32 to the 16-bit range first (every f16 is exact there) and NaN gives 0, as the hardware's conversions do.
Alt or F10 sends WM_SYSCOMMAND SC_KEYMENU, and the default handling runs a modal menu loop on the thread that owns the window, which is the title's. The title stops drawing and reading input until a key ends the loop, with nothing on screen to say so, and Grand Theft Auto VI aborts itself about half a minute later (the deliberate write to 0 at +0x23cf683). The window procedure now drops SC_KEYMENU, next to its SC_CLOSE handling. The mouse can still open the window menu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…TOO_SMALL XGameSaveReadBlobDataResult lists E_GS_PROVIDED_BUFFER_TOO_SMALL among its errors, and the synchronous read already returns it; the result passed on XAsyncGetResult's E_NOT_SUFFICIENT_BUFFER instead.
An update that fit the user's 256 MB quota but not the host disk failed with E_GS_QUOTA_EXCEEDED, which tells the player to delete saves. The documentation keeps the two apart: E_GS_OUT_OF_LOCAL_STORAGE is the device out of room and can come before the quota is reached. The disk check also no longer credits the blobs an update replaces, since the new version is written before the old one is removed.
Compute programs read SGPRs the hardware does not initialize when two branches make the paths look like they allow a read before a write, even though the branch that skips the write does not reach the read. That stops translation with 'a hardware SGPR input is not supported' and drops the program's dispatches. ComputeIo::initialized_sgprs() counts the user SGPRs, the enabled system ones and the scratch wave offset. A read of a general SGPR (0..=105) at or above that count holds whatever the previous wave left, so no program can depend on its value: read it as zero, as unset VGPRs already are. Reserved registers (VCC, trap temporaries, M0, EXEC) keep their current handling.
`cargo test` now and then never finishes: the seven emit::valu_tests that run on the hardware adapter and on WARP start together on the test threads, none of their dispatches completes, and the test binary keeps one core busy until it is killed (the waits spin on the fence). Any other GPU test running at that moment is stuck with them. On an RTX 5070 with a Radeon iGPU, `valu_tests` alone in a loop on main d2a4bae: 3 of 30 runs hang. With `run_cases` behind a process-wide lock: 0 of 60, and the seven tests take under 7 s. The lock is poison-tolerant, so one failing test does not fail the rest. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The resource tally in `victory translate` matched every `Source` variant by hand, so the new `Select`, `Fetched` and `Lanes` kinds left it non-exhaustive and `cargo check -p victory` failed. A fetched descriptor is counted with the loaded ones; selections and per-lane choices are never leaves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
v_max_f32, v_min_f32, their three-operand and f16 forms and the packed v_pk_max_f16/v_pk_min_f16 were lowered to DXIL's FMax and FMin. DXIL specifies those as a compare and select, so with a -0 and a +0 either zero can come out, depending on the operand order and the host; RDNA2 orders -0 below +0, so max(-0, +0) is +0 and min(-0, +0) is -0 in either order. A -0 that should have been +0 then turns, say, a following reciprocal square root's +inf into -inf. A new helper keeps FMax/FMin for everything but two zeros, which it resolves by their sign bits.
A host that refuses the title's slots plus 2^18 dynamic ones (NVIDIA's 1,000,000-view cap) now gets 2^16 dynamic slots, as before, instead of losing mirrored title slots to the larger range: at the cap, 2^18 left 737,856 title slots against 934,464, and titles were seen to index slots up to 917,140. The cap itself is unchanged. Hosts that take the larger heap (RX 9070 XT) keep 2^18.
…a waterfall loop A descriptor read with v_readfirstlane_b32 was traced to each lane's own dwords wherever it was, so a first-lane read outside a loop, or one without the v_cmp_eq that hands every lane its turn, sampled for lanes the program skipped (reported on the PR with the back edge of the fetched waterfall test replaced by s_nop). Now: - a compare counts only when it and the v_readfirstlane it reads are in one loop (each block reaches the other); - every descriptor read from the first lane needs each of its dwords compared that way, or translation stops with "a descriptor read from the first lane outside a waterfall loop". Two tests cover the missing back edge and the missing compare. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
A waterfall loop whose descriptor dwords are VGPR phis stopped with "a descriptor read from the first lane of a phi" (294 programs of the title on JMAN730#307, all at if/else joins of two s_load_dwordx4 descriptors copied into VGPRs). An EXEC if/else leaves two phis per dword: the flow block's joins an arm's dwords with what lanes that skipped the arm held before (inputs, unrelated loads and arithmetic in the title), the join after the other arm picks per path. Only lanes that never read the descriptor bring those other values, so tracing every edge fails. Tracing (resource::track now takes the program's per-lane form): - per-lane phis of one block are traced on each edge into it that the lanes accessing the descriptor can take, from structure's lane conditions (new Structured::reach, the exits' conditions, and Bools::meet, a read-only satisfiability check); the trace starts from what holds in the access's block. Edges no such lane takes are None in the new Source::LanePhi { block, args }; - every per-lane write it follows (v_mov_b32 copies, v_cndmask_b32, global_load_dword*) must run in all those lanes: a guarded one fails with "a per-lane descriptor written where some lanes may keep the old one". On JMAN730#307 an else arm without its s_cbranch_execz traced as the second descriptor for every lane; - a loop header's phi fails with "a descriptor read from the first lane of a phi at a loop header", words defined after the join with "a descriptor partly joined by control flow"; without the per-lane form (structurisation failed) the join is refused. Lowering computes each traced edge's heap index at its predecessor's end (through lane_heap_index, so loads, per-lane loads, choices and nested joins work), joins them with a phi (0 on untaken edges) and makes the handle non-uniform. The waterfall compares need no change. Tests: the if/else of two loaded image descriptors, a join of a per-lane load and a v_cndmask choice, nested arms choosing a buffer descriptor with lanes that skip both and do not load (pruned only by the access's condition), a loop header phi, and an unskipped else arm. On JMAN730#307's head the three join programs fail with "...of a phi" and the unskipped arm is traced as one descriptor for all lanes. On an RTX 5070 and WARP, each lane reads its own arm's texture or buffer; the shaders pass dxil.dll 1.8.2502.11. Reversing the phi's inputs fails validation, flipping the heap index fails the GPU check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pixel programs that write SV_DepthLessEqual or SV_DepthGreaterEqual failed validation: "Interpolation mode for PS input position must be linear_noperspective_centroid or linear_noperspective_sample when outputting oDepthGE or oDepthLE". The position is now declared linear_noperspective_centroid in those programs, as DXC declares it; without multisampling the value is the same. translate --validate on shaders.rpf: vertex/pixel 12172 -> 12186 validated; the error is gone from the list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
'victory config' displays game_dir, cache_dir, and test_titles, but omitted data_dir (where saves, persistent local storage, and crashes.log are stored). It also omitted data_dir from the runtime asset-policy check loop in show_config(). Include data_dir in the output and policy check, and add a unit test in victory-core asserting that a data_dir inside the repository is refused.
(cherry picked from commit 4b2ea70)
fill_phis treats a phi no one read directly as dead and fills a value with no DXIL form (an unsupported s_memtime result, say) with zero. When that value reaches a read through two joins, the first phi is only read by the second, so it was never marked read: the read lowered with a zero where the same value read directly is refused with "a scalar memory read as data". Mark the incoming phis of every read phi as read, transitively, before the phis are filled. The reproducer from JMAN730#604 now agrees for the direct and the joined read, and the dead control (the timestamp replaced by a group id) still lowers.
image_sample_o was refused by name. Its offset dword (x in bits 0-5, y in 8-13, z in 16-21, signed) becomes sample's immediate offsets when it is a constant within DXIL's -8..7; a computed or wider offset is still refused, now saying so. Module::int_value reads an integer constant. translate --validate on shaders.rpf: vertex/pixel 12172 -> 12176 validated (all four). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n review The previous commit proves that a loop's compares select the lanes of the access and that its retry keeps exactly the lanes still waiting. Every failure of that proof was reported with one reason. They now say which part failed: - the access is in no single-block loop ending in s_cbranch_execnz; - the loop is nested in another or split over blocks; - the compares do not select the access's lanes; - the retry does not keep the lanes still waiting. Without the per-lane form the proof cannot run. Nothing is emitted then, and that failure is the one reported, as before. Tests, all hand-assembled: - the case ifBars reported on upstream PR JMAN730#566 (the compares never narrow EXEC), an access under a further mask, a retry that keeps other lanes than those waiting, a wave64 retry of one half: refused, each with its reason; - the waterfall LLVM writes for GFX10 and later (a v_cmpx_eq chain, the retry as todo & !EXEC, also folded into s_andn2_wrexec) is accepted in wave32 and wave64, and each lane samples its own texture on the GPU; - one loop per operand, the sampler's inside the resource's, is refused by name. The console gives each lane its own pair there; following the outer loop's reads into the inner block is left for later. Other per-lane work in a waterfall loop is still taken to run once for each lane; marked as a shortcut. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
describe looked only for a host texture, so every UAV over a buffer printed 'uav None' in device-removed reports and drop traces, though the view is made. It now prints the buffer's title range, as a buffer shader view does.
Queue the list-owned D3D12 staging upload as a host fill so Wine does not skip it based on the title-memory VirtualQuery check.
Its only callers (stub_pipeline_is_created, constant_color_validates) are #[cfg(windows)], so on macOS/Linux the helper is dead code and cargo check --all-targets warns 'function constant_color is never used'. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
`ir::build` hands the emitter one value per register dword and a block graph, and the emitter relies on two things it never checked: that a value is written once, and that the block a read is in is dominated by the block that writes it (a phi's argument by its predecessor). A program that broke either would lower a read to a value that does not exist yet, or to the wrong one. The test builds programs at random from every instruction word the decoder accepts (every opcode of every encoding), and checks those invariants against a dominator set computed by the naive iterative algorithm, so the check does not share code with what it checks. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> (cherry picked from commit c60710a)
The disassembly text showed operands that some instructions lack, and dropped VOP3P negation that applies to one half only: - s_memtime, s_memrealtime and s_get_waveid_in_workgroup printed the unused SMEM base and offset. - A global or scratch access with no SGPR base printed `null`, not `off`. - A MUBUF load with lds printed the unused vdata as a destination. - VOP1 SDWA printed src1_sel, though VOP1 has no second source. - VOP3P ops other than v_fma_mix with only neg_lo or only neg_hi set on a source printed as if the source were not negated. These now get LLVM's neg_lo:[..] and neg_hi:[..] suffixes; a source negated in both halves keeps `-src`. Expected operands come from llvm-mc -mcpu=gfx1030 (gfx1010 for s_get_waveid_in_workgroup). Only the text changes; translation reads Fields and is unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 6325df7) (cherry picked from commit c88bc0c)
…ive flips On a loaded machine (the full workspace test run) the flip wait oversleeps the 5 ms interval and the next flip lands a few ticks later, so the test failed 30 of 30 runs under CPU load. It now checks that each flip ends on a new tick, no earlier than the tick due when the wait was called, and no later than the ticks that passed during the call. (cherry picked from commit d31567c) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> (cherry picked from commit b5863c8)
waits_end_on_ticks_and_count_frames failed intermittently under CPU load (15 of 20 runs failed on main, exit 101; 20 of 20 pass after this change). Two assertions depended on the OS scheduler, not on the frame clock: - The wall-clock bound on the second wait was 50 ms. A 2 ms tick can take longer than that when the scheduler is busy. It is now 500 ms, still well below the 1 s time-out, so a wait that stalls for the full time-out is still caught. - The flip ticks had to be exactly consecutive. A late wake can skip ticks (the next tick comes from the clock), so the check is now strictly rising: it still rejects a tick that repeats or goes backwards. No production code changed. Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com> (cherry picked from commit e1c3557) (cherry picked from commit d6bc254)
…ows 10 On Windows 10 10.0.19045, fresh test threads often start with Rsp - TEB.StackLimit in 0x260..0x6c0, causing RtlWalkFrameChain inside RtlCaptureStackBackTrace to hit the stack PAGE_GUARD mid-walk and abort returning 0 frames. Touching one stack page in ensure_stack_headroom() before the walk keeps the full system-walk parity assertion intact without skipping it on Windows 10. (ported from DrTardis1963/VIctory commit 559756c, upstream Marvisak#742: crash::tests::unwinds_like_the_system_walk failed in about half the runs on Windows 10) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> (cherry picked from commit 4012fe9)
ir::build assigns SSA values in reverse-postorder; a register with no reaching definition could leak NONE (Value(u32::MAX)) into the emitter as 'a value defined after its use'. Leonida keeps all registers in zero- initialized Function arrays, so an unwritten register reads zero. When a read has no reaching definition, mint a zero-valued entry input for it. Same semantics VIctory already uses for program inputs (lower.rs:917,924), applied at the source so all IR consumers see a real Value. (cherry picked from commit 8d81177) (cherry picked from commit d11c249)
view_format reads the host copy, which only Windows has; its only callers and test are Windows-only already, so the crate's portable tests (50) failed to compile off Windows. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> (cherry picked from commit 46a825e)
…d past a 128-entry table; found by the SSA fuzz test) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…OUBLES (cherry picked from commit 61e5f79ac6e0a10508071f0ffd9a65acb6bb0b4c)
No PC GPU renders to R9G9B9E5, so CreateRenderTargetView on such a target removes the device. Add it to the existing stand-in table, next to the 16-bit colour formats. (cherry picked from commit 7dc19f2)
(cherry picked from commit 9ba864a)
(cherry picked from commit 7545c97978d66c1d04e5ffbeb820ac115a666593)
…nly after a lost card; CI parses try.ps1 on Windows PowerShell Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
A host root signature costs at most 64 dwords. Every stage's user data
is root constants (one dword each) beside its root views (two each), so
a pipeline whose vertex and pixel shaders read a lot of user data was
refused ("host root signature refused") and every draw with it dropped.
Over 64 dwords, the largest user data block now becomes a root CBV of
the list's upload memory (two dwords) until the signature fits; the
shader reads b0 the same either way. Nothing changes under the limit.
Idea from upstream Marvisak#644 (6fa53a5); its second phase (merging root
views across stages) is not needed for our one-table root SRVs.
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
(cherry picked from commit 4d3c4e6)
A title's DEPTH_STENCIL1 subobject lost its depth bounds test (the host pipeline took the plain description) and OMSetDepthBounds was ignored, so lights and fog volumes that rely on the test to skip pixels outside their depth range shaded the sky and everything behind them (upstream's README lists the missing test under "GPU: world"). Now a vertex or mesh pipeline whose stream enables the test is made as a stream with DEPTH_STENCIL1 (vertex pipelines keep the plain description otherwise, so their library entries stay valid; the name of one with the test says so; the rectangle geometry stage is kept), and OMSetDepthBounds reaches the host list, clamped to 0..=1 and in order, and is kept in the draw state so a host list continuing the title's after a cut has it too. A derived pipeline's plain depth part leaves the test off, as before. A host without the test says so once and draws as before. Hand-ported from 9afaf12 (this fork's first base) onto victory-gta6's pipeline code. Ideas from upstream Marvisak#849 (Xvania7 c47632f, Raxstreams 520d629). Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…_non_drop) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…after_test_module) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…its (71 pipelines in 9 minutes on an i5-12400F; VICTORY_PIPELINE_BOOST=0 for the old priorities) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
… tried again (25 compute pipelines held workers 10-40 s each on an RTX 4060; a driver change forgets them) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ader cache before a run; Try 3.4 runs it once after each new build (P again) A rebuilt VIctory keys its translations afresh, so the first world visit after each update translated ~900 shaders while the title waited (draws dropped: see-through objects; translations fell to 1-8 a minute as the title took the cores), and the advice was to restart the game again and again. prepare translates them with the game closed, on half the cores, through the same cache, host wave width and view-heap limit a run uses. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…; victory prepare compiles them all with the game closed (Try 3.5 after every run) The world log on an RTX 4060 + i5-12400F ended with 1,675 pipelines still waiting after 9 minutes and 4,600-6,000 draws a frame dropped for them (the see-through world): the title's threads left the workers a few compiles a minute, and each launch got only as far as the one before had compiled. Now the first request of a title pipeline appends its recipe (stage and BLAKE3 of each container, the graphics state field by field) to pipelines/recipes.bin, its containers once to recipe-shaders.bin, from a background thread. victory prepare reads them and makes every host pipeline through HostPipeline::new, the same code and names as a run, on all cores but two (heavy programs 3 at a time, 64 MB stacks), into the pipeline library, keeping the early list. Requested keys are already on the early list, so the next launch loads them all at its start. VICTORY_RECIPES=0 keeps none. Tests: GraphicsState round trip, recipe records with a cut-short tail. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…TORY_WIDE_BACK=1); off again by itself after a run that lost the card The world frame's ~200 ms of copying back was the compare of declared ranges on the submitting thread alone (one core's memory speed). The relay already runs on stage 3 of the late waits, the same flights F mode uses with VICTORY_WIDE_BACK; the wide compare reads the same bytes. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft, opened so the Windows CI (
.github/workflows/ci.yml: clippy + tests on windows-latest) compiles this branch. The gpu crate can't be built in the agent sandbox.This branch now stands on fxceless/victory-gta6 (merge
54ba028, its history kept). Added on top:VIctory-report-20261124-232758.zip
VIctory-report-20261124-231948.zip
VICTORY_DUMP_FAILED;Do not merge yet.