58 Commits

Author SHA1 Message Date
821654fe9a residency: memory pressure from the card's share of the PC's memory (VICTORY_SHARED_PRESSURE=0: off)
Every buffer the CPU maps and the card reads counts against DXGI's
non-local budget, which Windows caps at half the RAM, not against free RAM.
On 16 and 24 GB PCs it ran out with gigabytes free, every such buffer was
refused from then on, down to 256 bytes, and the run ended when a host
command list could not close (0x8007000E; #156, #206).

The once-a-second sweep now reads that budget: pressure from 85 % (off
under 75 %), critical from 95 %, the same levels the RAM sample sets, so
spares, staging and texture prefetch shrink before the cap is reached.

The limit and its ending are VIctory-NVIDIA's issue 1520 (trustno1-coder),
whose fix scaled its own L0 caches down on PCs under 24 GiB.
2026-12-02 15:11:54 +01:00
f867ce7d06 pipeline: static samplers made in one order in every process (VICTORY_SAMPLER_ORDER=0: off)
The driver keeps static samplers in a table in the order a process first
makes them, and a compiled pipeline holds their places in it; its disk
cache finds a pipeline again only where those places match. Pipelines are
made by several threads in the title's order, so the places changed from
run to run and the driver compiled again at every start. Every distinct
sampler is now listed in pipelines/static-samplers.txt and made in that
order when the device is made, and before each pipeline's root signature.

Ported from trustno1-coder/VIctory-NVIDIA (pipeline/samplers.rs), without
its pipeline-library and warm-fingerprint hooks.
2026-12-02 15:05:14 +01:00
e37834ff10 Merge PR #209: Shader: retire inactive wave halves in the fast-profile decal reduction 2026-12-02 14:37:11 +01:00
deb6f675e0 Merge PR #207: Shader: lower divergent wave64 LDS on wave32 hosts by default 2026-12-02 14:37:08 +01:00
09483bf4b2 shader: retire empty wave halves in the skinned decal reduction 2026-12-02 15:39:38 +08:00
3aff512ad8 shader: lower divergent wave64 LDS in lockstep on wave32 hosts 2026-12-02 04:13:32 +08:00
=
3115a291e0 VICTORY_KEYS_UNTIL=<file>: the scripted keys end once the file is there
VICTORY_KEYS presses keys at set seconds, focus or not, but a script that
wants Enter pressed until the world draws cannot know those seconds: the
start screen takes Enter after a time that depends on the cache and the
disk, and a press that comes late lands in the world. With this a script
has Enter pressed every few seconds and makes the file when it sees the
world draw (the window's title has the draws a frame); from then on no
scripted key is pressed. The file is looked for only while a key of the
script is due.

Under Proton on a Wayland desktop this is what lets a measuring run start
with nobody at the keyboard: a key sent from outside reaches the title
only while its window has the focus.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-01 19:03:12 +01:00
504bcbc253 docs/linux: Wine/Proton gotchas and RADV settings measured in #192 2026-12-01 11:07:16 +01:00
3fc5d611f5 nix: dev shell for building the Windows executable on NixOS 2026-11-30 19:15:58 +01:00
0dea51ea6d GameInput: support DualSense controllers over USB and Bluetooth
Read Sony HID reports alongside XInput and map the sticks, triggers and
buttons to GameInput. Discover controllers in the background and keep
their device IDs stable across polls.

Send low- and high-frequency rumble over USB and Bluetooth. Cover both
report formats and rumble packets in tests, with a hardware check for a
connected controller.

(cherry picked from commit 9fded1b254)
2026-11-28 19:57:18 +01:00
c9dce28a69 run: a VICTORY_POKE entry can name the title build it is for
The launchers' 71b6330:1 is Grand Theft Auto VI's watchdog tick in one
build (image hash b99f876b74d4a77f...); in any other title or build that
address is other data and a write twice a second there corrupts it.
An entry `<hash>@<rva>:<byte>` now only writes into the title whose image
hash starts with <hash>; entries without one write as before. The
launchers set b99f876b74d4a77f@71b6330:1. `off` writes nothing.
2026-11-28 19:46:05 +01:00
0a2f688b2b run: VICTORY_POKE in every build; the launchers keep Grand Theft Auto VI's watchdog from ending the run
The title's watchdog thread (title+0x2215a60) checks once a second that the
main loop's tick (title+0x71b6338) moved, and after 30 checks without it
ends the title on purpose: it decodes a message and writes to address 0 at
+0x23cf683 ("write 0x0: nothing mapped there", the crash in #39). While the
first frames wait for their compute pipelines (2a1965f) the loop can stall
past 30 s. The watchdog starts its count over on every pass while bit 0 of
title+0x71b6330 is set.

VICTORY_POKE (run.rs) was only built with `diagnostics`; it is now in every
build (it does nothing unless set), and Play-VIctory*.cmd set
VICTORY_POKE=71b6330:1 unless it is set already.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 10:51:30 -03:00
5e7faabe7b Pipelines: one whose worker ended is made again on a 4 GiB stack, and no caller waits for ever (#39)
Under Wine a stack overflow in vkd3d-proton's DXIL-to-SPIR-V ends the
worker thread without unwinding. The pipeline was then failed at once and
its dispatch dropped: #39 (CS_Prop_BatchNoCull under Proton, PR #71's
build), right before the title's write to 0 at +0x23cf683.

- reap() makes such a pipeline once more on a thread with a 4 GiB stack
  (reserved only; VICTORY_PIPELINE_RESCUE=0: not), and gives it up (failed,
  refused-pipelines.txt) only if that thread ends too.
- make_with() no longer makes a pipeline inside its OnceLock's
  initialisation: a thread that ended there held it for good, and a later
  caller (a dispatch waiting for its compute pipeline, on the title's
  thread) waited for ever. A 'building' flag says one is being made;
  others wait for it to be made or given up.

Test: a maker that ends its thread with ExitThread leaves the pipeline
being made; a second caller waits; the rescue makes it and wakes it, or,
ending its thread too, has reap give it up. Passes under Wine and
vkd3d-proton (RTX A3000); the GPU suite as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 11:05:40 +01:00
c58a198680 Merge upstream/main: steven-seagull27's GPU fixes and upstream's #66 fix
New from others: the pipeline-refusal listing during warm-up (b57a837),
march UAV views kept with each host texture (2511e6f), ordinary bytes
before the reserve for a large buffer (6e434c6), and DoubleGhosty's #66
fix in the lowering (9a4aa8d), which replaces this fork's own
(structure.rs, the per-lane fallback in emit): victory-shader is now
upstream's as a whole. The rest are this fork's own changes as upstream
cherry-picked them; for the Agility SDK files upstream's wording, the
README keeps the Windows 10 test steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 10:20:56 +01:00
6e434c6907 Use free ordinary bytes before charging a large buffer to the reserve
(cherry picked from commit 983de211feb82b24eb1c9bc5f56bd2e19c80aff4)
2026-11-27 09:51:48 +01:00
33b3f16b57 Merge upstream/main into wine-perf
Conflicts: the Wine placeholder fallback (kept wine-perf's block-keyed
RwLock), dstorage workers (upstream's worker_count and priority), pipeline
make (both: refused pipelines and upstream's catch_unwind), the indirect
tests (wine-perf's exact assertions; upstream's WARP skip stays).
Also two clippy fixes from wine-perf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 08:17:58 +01:00
27b76dead3 gpu: the ray-marched in-scatter is held to the light of the room (VICTORY_AMBIENT_MARCH)
Measured in one interior without rays: the 180x102 R16G16B16A16_FLOAT image
the CS_Gather_Classified_* programs write has a mean of 0.24 in a clean run
and 0.67 in a veiled one, and the froxel volume the air clamp bounds holds
about 0.05. Before either CS_ReconstructRaymarchClassified* dispatch the
images it reads at table 1, places 96 and 112, are scaled down to the
multiple of the room's slow mean luminance (hue and alpha kept, NaN to 0).
Off unless set; its pipeline and its heap of views are made only then, and
apart from the stand-in's own passes. It needs the estimate
(VICTORY_AMBIENT a number), not constant:<level>, which has no slow mean.

Not built or run on this tree: written against it by reading.

From Dathinel/victory-4gb 743f9b0.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 06:14:52 +01:00
9f9bc43a24 Docs: record buffer-admission profiling and release measurements 2026-11-27 06:06:06 +01:00
71871a6a64 patches/: the wineserver view-tree patch docs/linux.md describes
Against GE-Proton11-14's wine (ValveSoftware/wine a47c73f with GE's
protonprep wine section applied): a process's views in a tree by base
as well as the list, so map_view's overlap check and unmap_view's
lookup no longer walk all of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 22:23:29 +01:00
8ea1e7bb01 play-proton.sh: say when Wine cannot set thread priorities
Wine maps thread priorities to niceness only with a hard RLIMIT_NICE
above 20; without, the title's threads compete for eight cores with our
pipeline workers and streaming on equal terms. With the limit raised
(prlimit, as the gamemode group gives): 104 and 106 ms a frame in two
runs, p90 113 and 114, against 118-122 and 134-143 without.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 22:10:20 +01:00
f97fdade58 Linux/Proton: from 1.5 s to 0.2 s a frame in the prologue
Under GE-Proton11-14 on an RTX 5060 (8 GB), Series S at 1080p:

- Log to a file (VICTORY_LOG_FILE): Proton passes no stderr through;
  crash reports and panics go there too.
- Pipeline library: ask vkd3d-proton for an empty one with a null
  pointer; it refused a non-null pointer of length 0, so no pipeline
  was ever kept between runs.
- Pipeline workers that end while making a pipeline (a stack overflow
  in vkd3d-proton's DXIL-to-SPIR-V; Wine ends the thread silently) are
  noticed, replaced, and their pipeline is left out from then on
  (refused-pipelines.txt); a full-budget wait names what is stalled.
- Wine's memory lock: placeholders the runtime reserved are known
  without asking (Wine lacks that information class); write watches
  are asked in 8 MiB pieces; VICTORY_COMMITTED_QUERY=1 in the script
  (QueryWorkingSetEx reads /proc/self/pagemap under the lock).
- Texture pool: a freed piece is used again once every submission
  begun before has finished (with retire()'s margin), not only after
  2.5 s; cards under 12 GiB keep a tenth of their budget in empty
  blocks, not 4 GiB. Loading took 2.7 GB of staging and 4.1 GB of
  blocks on the card before.
- Under Wine plan with the card's budget less 1 GiB
  (VICTORY_CARD_BUDGET_MB): Linux moves nothing to the PC's memory.
- play-proton.sh: VICTORY_CONSOLE, vkd3d-proton's cache beside ours,
  and the GE-Proton11-14-victory compat tool when installed (a
  wineserver that keeps a process's views in a tree; the list walk at
  every map and unmap was the largest cost of all).
- docs/linux.md: what was found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 20:23:39 +01:00
a983f4c496 Linux: a Proton launcher and how to build and run on Fedora
scripts/play-proton.sh starts victory.exe under umu-run (Proton) or Wine
with Play-VIctory.cmd's pareto-residency settings. It turns Linux paths
into Wine Z: paths, and keeps the shader cache and saves under XDG folders
outside the prefix. docs/linux.md covers the build with cargo-xwin, the
NVIDIA driver, Steam as an alternative, and what was and was not tested
under Wine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 14:27:29 +01:00
c66c173852 Fit smaller PCs: age out idle host lists, scale list threads, profiling guide
Idle host lists: list.rs keeps up to 512 run host lists for reuse, and a
command allocator keeps its high-water memory over every reset. The docs
attribute 9 GB of the 40-46 GB footprint to lists' allocators. Nothing
trimmed that pool. The once-a-second sweep now lets go of lists, oldest
first, that rested longer than the RAM-scaled idle time, keeping the
newest 64; under memory pressure it drops all but those 64.
VICTORY_LIST_POOL_AGE=0 restores the old behaviour.

VICTORY_THIN started 8 threads whatever the CPU. The default is now a
third of the logical processors, clamped to 2-8: still 8 on the 24-thread
machine it was measured on, 5 on an eight-core/16-thread CPU.
VICTORY_THIN_THREADS still overrides it.

docs/profiling.md: how to measure memory fit, CPU vs card, and our own
GPU passes with the existing tools on a Series X-class PC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 14:11:12 +01:00
4b7244ab52 Docs: separate the two forks in the README and fix stale notes
The README opened with codec_d's instructions, which link a private
release, then told readers to clone avatarmanz/VIctory-7900XTX. Split it
into a section per fork, build the pareto-residency launcher from source,
clone this repository, and credit codec_d.

findings.md still called VICTORY_INDIRECT_REST=0 an experiment, but
f4b48ad made it the default. The bug journal now notes that its local
paths and binary hashes refer to the author's machine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 14:00:54 +01:00
f4b48ad766 Publish the pareto-residency Windows build and portable launcher 2026-11-25 22:33:14 -08:00
ab75ac3e02 Back off refused GPU pool growth and defer uploads under low commit 2026-11-25 16:07:37 -08:00
18bdf7932b Scope bindless refreshes to their heap and bound speculative staging 2026-11-25 15:50:47 -08:00
3b30d6f2cd README, findings and a start script of this fork; fxceless' README kept in docs; the translator's file may be 640 KiB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:13:05 -06:00
35bd011453 Merge local/next into day/shaders; pipeline workers are all woken
Queue: passes over the screen first (local/next), then what draws asked
for, the early ones, and those known to take long by a quarter of the
workers. start() woke one worker, which could be one of the two that take
passes over the screen alone: the pipeline then waited for the next push.
All are woken now. victory warm goes through the pipelines no run drew with
in no order, 40 a process. victory translate: VICTORY_HOST_RDNA=1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 15:32:48 -06:00
091151c6cf Merge day/light 2026-11-25 14:01:37 -06:00
f4cc8d8be4 Structure builder: the wait for sizes is off (VICTORY_BVH_SIZES_WAIT=1 turns it on): it mended nothing and costs some 20 ms a frame (light-15)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:01:14 -06:00
35155bed9a Frame replay: --shaders takes passes of ours too, by their own hash
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 13:32:18 -06:00
01e1f525d7 Merge day/shaders 2026-11-25 13:29:56 -06:00
6912fb1d76 Frame replay: shaders of another translation (--retranslate, --shaders, --shaders-b turn by turn), times per pass as medians
--shaders after local/models 098ec1d4. The capture's 1,266 containers are
collected from the title's files once (beside the capture) and translated by
this build in 15 s; a pipeline that is refused with them keeps the recorded
ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 12:49:12 -06:00
72f7f13242 Ray tracing document: the stand-in, the sizes, what is known
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 12:19:01 -06:00
be085e5385 Merge commit 'f61ecf3b' into night/light
# Conflicts:
#	crates/victory-gpu/src/shadow.rs
2026-11-25 05:50:06 -06:00
3c0721033b docs: ray tracing, the state after the first runs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:48:49 -06:00
5f86fa3025 VICTORY_CARD_AWAKE: the card's clocks kept up between submissions
A captured frame whose lists take 28.6 ms sent in one go takes 37.8 ms with
1.2 ms between its submissions, as the game sends them; with one group of
threads counting on a compute queue it takes 28.6 ms again, and nothing
changes when sent in one go (36.1 against 36.3 ms with its copies).
=turns: 20 s on, 20 s off, to compare in one run. Replay: --awake,
--no-restore makes no copies to restore from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:00:22 -06:00
bd68f5e175 Card memory the CPU maps: windows, sends and scratch (VICTORY_WINDOWS_BAR_MB, VICTORY_SEND_BAR, VICTORY_SCRATCH_BAR); the card's own stamps (VICTORY_CARD_SPANS)
GPU_UPLOAD heaps, all off by default. Replayed yard frame (capture
play-1125-0127): 36.3 ms; windows in the card's memory 31.9, sends 32.7.
Replay: --pace, --breadcrumbs, copies counted by the memory they cross.
VICTORY_GPU_LOAD_MS: what the title's GPU timestamps show.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:35:03 -06:00
751bc32dfc Merge local/lighting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 01:12:28 -06:00
eabb82601c docs(architecture): list BCPack as implemented in victory-formats
(cherry picked from commit aaacc2dcfe09afc10d0893b0259ef20afd326280)
2026-11-25 01:02:59 -06:00
7232f45847 Stores by raw address declare what their dispatch names, not every copy reached so far
Also: victory replay --images writes the bytes of buffers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:20:28 -06:00
bf9ebebf60 Merge local/next 2026-11-25 00:01:05 -06:00
0fdcaa3b1a victory replay --flow, --images, --until; shader-info names the hashes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:00:07 -06:00
c05f949c4b victory replay --pixel: which commands change a pixel, in every target
After each command that can change a texture, the texel under a point of
the picture is copied out; commands that changed one are named with their
pipeline and the values before and after. The listing names textures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:50:34 -06:00
d4254dc02c Merge local/next d4772b3
The check of fetched pieces (VICTORY_FETCH_CHECK) with the landing pool:
pieces are gathered and ordered as there; with the check whole pieces come
down and are hashed by the job that lands them. Off, the fetch is the
landing's own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:36:00 -06:00
017fb0b383 What goes up to card copies: a check, and fetches caught in between put right
VICTORY_FETCH_CHECK=1 (off by default): with VICTORY_RELAY_COPY a piece is
fetched beside later submissions, and one of those that clears it and fills
it again with the same is not flagged by its compare: title memory and the
CPU's side kept what was in between, and the next refresh of the 64 KiB
sent it up over the right bytes. The compare now gives the piece's hash
with its flag; a fetch that is not that is made again by the next flight
that may write the piece. (The test shows 11-12 of 12 wrong without it.)

VICTORY_UPCOPY_CHECK=1 (diagnostics): at each send up, the words that the
title did not change and the card holds another value of; every few seconds
at rest, the words in which a copy's card side is not its CPU side, and
whether they were declared as written and fetched.

victory replay --upcopies: the same question of a captured frame, and which
pieces were written undeclared (replay1 and replay2: compute
82a2ad6d07417d36 through views picked by index, 73-75 pieces a frame).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:17:50 -06:00
037596241a Argument clamps in batches (VICTORY_INDIRECT_BATCH)
One pass clamps the arguments of all indirect executions between two
points where they may change; its jobs are in upload memory that is filled
while the list is recorded. The replayed frame: 2,355 clamps become 980
passes, 86.1 -> 77.7 ms; with VICTORY_INDIRECT_BATCH=2 133 passes,
84.6 -> 75.3 ms.

Replay: --batch-clamps, --only-buffers, --listing; --compare runs turn by
turn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:10:47 -06:00
475409218e Frame replay: the CPU's copies leave what the card wrote; buffers in the card's memory fit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:37:32 -06:00
af481877f3 Frame replay: usage doc, mesh draws and a title's size in its tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:23:46 -06:00