Skip to content

VIctory on the victory-gta6 base: world-rendering fixes + Try 3.x (draft, CI) - #2

Draft
MfDev0 wants to merge 368 commits into
mainfrom
arena/59fabb00-victory
Draft

MfDev0 wants to merge 368 commits into
mainfrom
arena/59fabb00-victory

Conversation

@MfDev0

@MfDev0 MfDev0 commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Marvisak and others added 30 commits November 24, 2026 09:21
…ivate-links

Docs: rustdoc builds the loader, GPU and shader crates without warnings
…load-128

GPU: use the host upload path for texture staging copies
…ll-unbind

GPU: unbind vertex buffer slots for null view arrays
…g-windows

Shaders: gate the constant_color test helper to Windows
…-link

Docs: drop the private intra-doc link to MICRO in texture.rs
Shaders: v_cmp_lg is ordered on AMD hosts too (olt | ogt, not fcmp one)
Audio, watch: no overflow on huge title sizes (XMA read advance, fread)
BCPack: find a slot's bucket from a window table
A Windows job on the pinned toolchain: clippy with -D warnings on the
default and the --all-features (diagnostics) build, then cargo test
--workspace, which includes the asset-policy test.

main did not build its tests: scalar_bit_tests_lower called lowers()
without the rsrc2 argument a parallel change added (0, no input
registers). Also drops a double parenthesis clippy flagged in an xasync
test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main now has CI (clippy with -D warnings, then the workspace's tests) and
three new tests that call `resource::track`, which this branch gives a
fourth argument. No textual conflict, but the test target did not build:
those three calls (emit/lower.rs, twice in emit/mod.rs) now structure the
program first and pass it, as this branch's other callers do. Both of
CI's clippy commands are clean on the result.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e VALU tests

The four tests of emit/waterfall_tests.rs each dispatch on the hardware
adapter and on WARP. Run in parallel, the test process sometimes died of
an access violation (7 of 24 runs of these four tests on an integration
branch; an image test beside a VALU test does the same on WARP). They now
take the VALU tests' lock, which moves out of `run_cases` to be shared.
With it: 340 workspace tests pass with VICTORY_WARP=1, as on a CI runner,
and the shader tests pass on the RTX 5070.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Shaders: per-lane descriptors chosen by control flow (stacked on JMAN730#307)
The console compiler loops over a per-lane descriptor by reading the
first active lane's table offset (v_readfirstlane_b32), narrowing EXEC
to the lanes with the same one (v_cmpx_eq_u32), loading that entry
(s_load_dwordx8) and dropping those lanes (s_andn2_wrexec). Such a load
now goes through the waterfall proof; when it holds, each lane loads its
own entry through a non-uniform handle. Unproven, the offset stays the
first lane's, as before.

Translation census over the title's 26,096 programs: none lost, 108 get
past these loops to a later refusal. The 249 programs behind JMAN730#736 also
need per-lane size queries in loops without an access.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: GPT 6.2 Sol <noreply@openai.com>
(cherry picked from commit 64b80c3)
`Bits::signed(0)` shifted by 32 (a panic in debug builds) and
`Bits::signed(n)` / `Bits::read(n)` for n > 32 underflowed `32 - n`.
Zero bits now read as 0; past 32 bits the low 32 are the value and all
n bits are consumed, for both. Widths 1 to 32 read as before.

No caller reaches these widths today (the decoder clamps to two channels,
so the widest read is 16 bits and `signed` is only called with 6); this
keeps a later caller or a damaged stream from panicking the decoder.
The new test panics on the old code and passes now.

Closes Marvisak#907.

(cherry picked from commit 87f7cb8)
The title makes buffer views with NumElements 0 for buffers it has not
sized yet. CreateShaderResourceView and CreateUnorderedAccessView with no
elements are invalid calls on the host, and the device is removed for
them (seen on an NVIDIA GPU in the world, and in the new test
on the real device before this change).

buffer_srv and buffer_uav now return None for such views, so the caller
makes the null view it already makes for views that cannot be made.

Test: buffer_views_of_no_elements_are_left_null registers a title buffer,
asks for a zero-element SRV and UAV of it, and checks both are refused
and the device is still alive. Without the guards the device is removed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TydV9AGmPCiUTkG8rHubBQ
(cherry picked from commit 4407092)

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…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 ad22f1f)

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The title's threads wait up to 500 ms per frame for pipelines being made
before draws are dropped. VICTORY_PIPELINE_WAIT_MS changes that budget
(0: never wait; pipelines then appear a few frames later and one-off
passes may be lost). The default is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 0496398)
victory_shader::emit::debug_ps(n) is a DXIL pixel shader of our own: it
reads SV_Position only, colours each pixel by its surface's slope (from
the screen-space derivatives of depth) and writes n colour targets. It
needs nothing of the title's, so a draw's geometry shows whether or not
its pixel shader translates.

- VICTORY_DEBUG_PS=1 (diagnostics view): pipelines that draw depth-tested
  geometry use it instead of the title's pixel shader; flat layers
  (interface, full-screen passes) keep theirs, so menus stay usable.
- Fallback: a geometry pipeline whose pixel shader does not translate, or
  that the host refuses, is made with the debug shader instead of having
  its draws dropped; in the debug view, one the host refuses with ours is
  made with the title's. VICTORY_PS_FALLBACK=0 turns the fallback off.

With the debug view on, the world drew 3,600-4,100 draws per frame
instead of about 1,700. A test makes a pipeline from the debug shader and
a stand-in vertex shader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 45e24f9)

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
makeDouble from the register pair, then fptrunc; declares double
precision (ShaderFlags bit 2, SFI0 0x1). Inline constants read as a
64-bit operand are doubles (floats) or sign-extended integers, and abs
and neg act on the high half's sign bit.

From upstream PR Marvisak#978 (c8c117a), hand-ported: image_sample_d_cl was in
already (JMAN730#694); the double-precision flag is bit 2, not bit 0
(DisableOptimizations), and inline float constants are encoded as
doubles.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
In pixel shaders a cube's level query takes the face coordinates turned
into a direction, as a sample does.

From upstream PR Marvisak#1004 (cbc8c33), hand-ported.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Table-bound structured buffers carry StructureByteStride on the host
descriptor. Flat byte-offset scalar loads and non-idxen buffer loads,
stores and atomics went through a raw handle, whose offsets NVIDIA checks
against the stride: elements past the first read zeros (upstream traced a
4.9 s DEVICE_HUNG in a hit-detection compute pass to it). Use a structured
handle and split each byte address into (address / stride, address %
stride), one dword at a time. Root views stay raw.

From upstream PR Marvisak#984 (5011645), hand-ported.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
A structured buffer SRV placed inside a larger title buffer can start
off an element of its host copy (offset % stride != 0); FirstElement
cannot address it, so the view was left null and read zeros (upstream
traced a 4.8 s DEVICE_HUNG to it). Such a view's table goes to fresh
dynamic slots, its elements are copied at submission into upload scratch
memory aligned to the element, and the slot views that.

shortcut: copied from title memory, so GPU writes earlier in the same
submission are not seen.

From upstream PR Marvisak#986 (d8d7c2c), hand-ported.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ueries

smem() splits scalar loads of a structured table SRV into record and
offset (Marvisak#984 port), but descriptor_data() made the size query's handle
for the same slot a raw view: two kinds for one descriptor, and word 2
reported bytes where the record count was read. Use the structured
stride there too.

Idea from upstream PR Marvisak#995 (89b6c67, Jeremy Goldberg); its PSV
declaration check is not ported (our structured choice follows the
table binding as in Marvisak#984).

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Resolve the path before checking the asset policy and opening the cache. The title can change the host working directory after startup, so later cache reads and writes must keep using the original directory.

A synthetic child-process test changes its working directory between opening the cache and converting bytes. It fails on upstream ffe310e and passes with this change.
CitizenCinema and others added 30 commits November 25, 2026 14:53
On 32-lane NVIDIA cards the wave64 form "without skips, scalars
followed" is wrong for the 14 CS_ShadowRenderTiled* programs: the
prison cell's ceiling is missing and the room is dark. Keeping only
those out gave an almost normal cell on an RTX 4080; keeping all 22
programs of that form out left it much darker (fxceless/victory-fork#62).

The form is now chosen per program by the hash the log names a shader
by: VICTORY_WAVE_DEEP_SKIPS_NOT=<hash>,... (default: the 14; 'none'
keeps none out), VICTORY_WAVE_DEEP_SKIPS_ONLY, and
VICTORY_WAVE_DEEP_SKIPS=0 as before. The switches are in the
translator's fingerprint like its others.

After Xeltax/VIcky 05ee4e9 (GPL-3.0).

Co-authored-by: Xeltax <85458421+Xeltax@users.noreply.github.com>

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
- VICTORY_SHADER_OPT=0 by default (O switches): the clean-up passes
  left walls, roof and floor out on an RTX 4080 and an RX 7800 XT
  (Xeltax/VIcky same-save A/B).
- The shadow fix is on by default (W switches: VICTORY_WAVE_DEEP_SKIPS_NOT=none).
- The run summary no longer calls draws dropped with no pipeline being
  made "waiting for pipelines".

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…spatch

In its Series S mode the title presents two planes (the game image at
1920x1080, its interface at 3840x2160 with alpha 0 where empty) and
makes the game image with the console's FidelityFX upscaler from a
1280x720 render. Only the first plane was shown and the upscaler's
passes do not translate, so the window stayed black after loading.

- over.rs: the second plane is drawn over the first after the copy,
  stretched to the back buffer and blended by its alpha.
- ffx.rs, run.rs, list.rs: the title's import of ffxDispatch is bound
  to ours; an upscale dispatch becomes a compute pass writing the output
  from bilinear samples of the colour input, then the list's state is
  replayed; anything else goes to the title's own DLL.
- host.rs: Try's present passes (render scale, frames in between) are
  left out when there is a second plane, which only the plain copy draws.

Ported from fxceless/victory-fork#188 (2f81ff8, against 8dd30ab).

Co-authored-by: Filip722 <37023444+Filip722@users.noreply.github.com>

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
- The menu shows every key with what it is, whether it is on now and
  what it does. Switches flip at once and show the list again; Enter
  runs the game. V shows the version.
- Series S leaves out the 75% render size and frames in between (the
  game renders at 1280x720 and upscales by itself).

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…pies

A title's own buffer-to-buffer copy (CopyBufferRegion, CopyResource
between two buffers) ran on the CPU at submission. With flights in the
air, one that touched memory a flight's shaders may write settled every
flight first: two settles a frame, 157 ms of a 485 ms frame in the
2026-11-25 report ("title memory read by a buffer copy").

Where both ranges have a host copy, the copy is now one CopyBufferRegion
in the list on the buffers shaders use: the source's host copy is
refreshed, the destination's too and then declared GPU-written, so it is
copied back like a shader write. A barrier on all unordered access goes
before and after it; overlapping ranges of one buffer stay on the CPU.
VICTORY_GPU_COPIES=0 keeps every copy on the CPU. The frame-rate line
counts the copies that ran on the card.

Port of pablogonz12/Scarlight JMAN730#86 (the destination's refresh, the
barriers and the overlap check are additions here).

Co-authored-by: CitizenCInema <fredericlaura.fl@pm.me>

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…e (Y), release notices on Discord

AvatarManz's VIctory (avatarmanz/VIctory-7900XTX at 0a43566, GPL-3.0+),
which PortWatch verified at about 16 fps with a picture close to the
console, is downloaded and built exactly as it is in folders of its own
and run with the settings of its scripts/play.ps1 (-Safe with Y). On
NVIDIA cards Try's shader loop limit and its two skipped programs stay.
If it does not build, this fork's VIctory runs. This fork's engine takes
VICTORY_INDIRECT_WINDOW=1 and VICTORY_JOIN_COPIES=1 from those settings.

A workflow posts scripts/try/RELEASE.md's first lines to Discord when the
version there changes (repository secret DISCORD_WEBHOOK).

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The user asked for AvatarManz's fixes ported into this fork, not its
build run in place of it: Try runs this fork's VIctory again (4.7's flow),
keeping two of AvatarManz's run settings this fork has
(VICTORY_INDIRECT_WINDOW=1, VICTORY_JOIN_COPIES=1).

A probe workflow translates the shaders the user's reports name as
failing, as on a 32-lane host, with each wave switch.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ines' console shaders kept

The frame line said 166 to 2,546 draws a frame were dropped without a
host pipeline in the user's runs; only a diagnostics build (Try builds
release) said which programs and why. The reasons are counted in every
build now and the 12 commonest logged with the frame lines, and a draw
whose pipeline is there but could not be bound says so.

VICTORY_DUMP_FAILED also keeps the console containers of the shaders of
a pipeline the host refused (six compute pipelines, E_INVALIDARG on the
RTX 4060), so they can be translated again offline.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…them every time)

From avatarmanz/VIctory-7900XTX ca1d519 (after ZJOU acf478b8): the views
themselves (resource, host texture, description) are compared, not the
handles a title may write other views behind. A call with the same ones
saves a host view per target and the driver's call.

Co-authored-by: avatarmanz <avatarmanz@users.noreply.github.com>

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…hey are looked up

From avatarmanz/VIctory-7900XTX e77a7d9 (DexNom/VIctory 921d8d3):
several threads map and write, some 5,000 ranges a frame, the same
textures' over and over, and each was looked up.

Co-authored-by: avatarmanz <avatarmanz@users.noreply.github.com>

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ts take DXIL's base-2 logarithm, vertex programs' unordered views declared

From avatarmanz/VIctory-7900XTX 9a6c829 (its parts this fork can take):
- VIctory da82e44: the host's division was a step off for some codes of
  normalized buffer formats, and a material index a title cut from one
  was the code below (wrong materials). Codes of 16 bits or fewer now
  give the nearest float exactly, in integers.
- DexNom/VIctory 921d8d3 (its cube part): the level of a cube sample with
  gradients was taken from a natural logarithm DXIL does not have, 1.44
  times too high (blurry reflections and skies); the instruction's least
  level was lost.
- VIctory a1a2077: unordered views of vertex, geometry and mesh programs
  are declared in the shader's feature flags, as DXC does.
(Its d16 part needs a table of view formats this fork does not have.)
Every shader is translated anew.

Co-authored-by: avatarmanz <avatarmanz@users.noreply.github.com>

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…d for it (VICTORY_KEEP_SHOWN=1; 0: black, then grey)

From avatarmanz/VIctory-7900XTX d1c412c: a slot that showed a texture and
is written with a view of another of the same kind elsewhere or in
another size (a texture streamed in with more levels, or moved) keeps
showing the old one until the new one is made and uploaded, instead of
reading as black and then grey for a frame or two (textures that pop).
2 keeps any view of the same dimension. (Its pop counter is left out.)

Co-authored-by: avatarmanz <avatarmanz@users.noreply.github.com>

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…Try turns it on)

From avatarmanz/VIctory-7900XTX 5f86fa3 and 040aa27: one group of 64
threads counts on a compute queue while the title submits, so the card is
never idle between submissions and its clocks stay up. In the 4.8 logs the
card stood idle 180 ms a frame behind the submitting thread. Nothing is
sent once no submission has gone out for a quarter of a second.

Co-authored-by: avatarmanz <avatarmanz@users.noreply.github.com>

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…port lists why draws were not drawn

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…der shader writes

In the 2026-11-25 report every frame waited 400 ms for its fifteen flights
for "title memory changed under shader writes", while what was put in was
3 pages and no bytes: the card and the CPU took turns instead of working
together. Two of the reasons to settle are gone:
- a page whose changed runs were more than the 512 a submission sent up
  (pages of the title's constants; avatarmanz/VIctory-7900XTX 007fe55
  saw the same): now 16384 (VICTORY_MERGE_RUNS);
- memory no write journal could answer for: its pages in the declared
  ranges are compared whole with what the copy held when the range went to
  the shaders, up to 64 MB a submission (VICTORY_MERGE_UNWATCHED_MB; 0: as
  before).
The frame line says what still settles.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ll levels get memory (VICTORY_SQUEEZE_TILES=4)

In the 2026-11-25 report the RTX 4060's 8 GB stood at the line for the
whole run (6.5 GB used of a 6.8 GB budget) and 17,000 slots of textures
waited for room, drawn black or grey: objects without their colours.
Below a hard line of 97 % of the budget a new host copy of a texture is
now made level by level (a reserved texture, as levels on demand makes
them) and only its levels of 4 tiles (256 KiB) or fewer get memory; the
views show from the first of them. The large levels wait for room as
before and come in when it is there. Texture streaming in PC games drops
the largest levels under a memory budget the same way.
0 turns it off.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…nds wait

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…over frames

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…card every frame, textures on a full card; release notice posts to the owner's webhook

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…s too (exact: each thread knows its console lane)

All that stopped the per-half-wave form of 64-lane compute programs on a
32-lane card was a select on a constant lane mask (f133e35efed2a48a at
0x9a84), refused although the bit a thread picks is its own console
lane's, which the relabelled thread index gives. v_writelane the same:
the lane named is compared with the thread's own. Programs that ended
asking for 64-lane waves (refused by the RTX 4060: 6 in every run) and
the ones stopped where not every lane runs can now take that form.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
… lanes still looping read as the ballot of its block

ceb5eb68cd99cb07 reads dword 2 of a buffer descriptor it otherwise only
takes the address of (s_cmp_eq_u32 s2, 0 at 0x34: an empty view skips
the program): now the host view's size (0 for a view that is not there).
7f05ddab771799a9 stops at 0x89ec on s_andn2 rest, rest, exec after an
s_and_saveexec: the lanes still looping, all of which reach the block,
so the ballot there is exact (VICTORY_MASK_ELSEWHERE=0 refuses, as
before). A texture the title fills after its upload is information.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ts it

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ded settings by default (D resets them)

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…s even around LDS the halves cannot meet for

A console wave64 compute program whose LDS accesses sit in lane branches
(where a group barrier would hang the group) or that has an indirect
exit kept WaveSize(64) through every form, and a 32-lane host refuses
that pipeline outright (E_INVALIDARG; 02384a60fda6f2d0, 2cc4c197ee29e291,
2da4beb386509b77, 369cbe906ea72764, 5dc3b25986622949, 6f225b641c5b0708
in every run on an RTX 4060: their dispatches dropped). The last resort
(each host wave on its own, every mask and lane read per host wave) now
splits those too, the halves meeting where every lane runs as before and
not inside such branches: the split-wave approach of the open VIctory
PRs (Marvisak#1890 split waves, JMAN730#233), taken further where they refuse. Also per
host wave there: wave-wide branches, ds_bpermute (this wave's lane of
that number), 16-bit wave sums and masks with lanes elsewhere.
VICTORY_WAVE_FORCE_SPLIT=0 keeps them refused.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
… 32-lane halves

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.