Commit Graph
269 Commits
Author SHA1 Message Date
localandClaude Opus 5.5 048201b13c victory replay, larger tests of it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 20:09:57 -06:00
localandClaude Opus 5.5 59a556e4b0 Record and replay a frame's D3D12 work (diagnostics builds)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 20:00:23 -06:00
localandClaude Opus 5.5 eca1d231e3 Merge PR 220
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 18:57:48 -06:00
localandClaude Opus 5.5 1f951910e4 Merge fork main a803c87
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 18:57:47 -06:00
localandClaude Opus 5.5 dd3307943c Streaming, copy queue, texture pools and a shader cache that survives rebuilds
Textures and staging cut from 64 MB blocks; a kept view per page section and
page lists read again until the title has filled them in; the GPU side told
when streamed bytes land; results fetched over the copy queue
(VICTORY_RELAY_COPY=1); the write-watch journal behind a reader-writer lock;
the shader cache keyed by the translator's sources and `victory shaders`;
helper lanes as in upstream 1733 (VICTORY_HELPER_OWN).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 18:55:40 -06:00
fxcelessandClaude Fable 5.2 8f80e08663 Textures picked by index are looked at again after their upload (characters' skin and hair without colour in most launches)
A texture a shader picks by index was uploaded once, when the title wrote
its view, and again only if the view was rewritten or the runtime told of
a remap. The title often fills the texture's memory only afterwards (its
streaming reads land later), so the host copy kept what the memory held at
the first look for the rest of the run: zeros. Which textures lost that
race changed from launch to launch; the main character's face came out
black and her hair pale in about three launches of four.

Now a texture uploaded whole is looked at again after 4, 12, 40, 120 and
400 frames (a fingerprint of 48 KiB of its memory); a changed one is
uploaded again and the looks start over. One test launch re-uploaded more
than 6,000 textures this way. VICTORY_HEAP_RECHECK=0 turns it off.

Known gap: the fingerprint samples the start, middle and end of the
memory, so a texture whose other parts arrive later is still missed.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 19:29:47 -05:00
fxcelessandClaude Fable 5.2 2f4b35f5b1 Take the fix/amd-view-heap-clamp branch of triippywhale's fork (as one commit)
Every host view heap ends at a null slot that view indices past the heap
read (a host that takes large heaps gets 2^21 views; one that caps them
keeps the capped heap), the cache key includes that limit, and
v_permlane16/x16 are lowered.

Both forks lower v_cvt_f32_f64. The IEEE form with its test is the one in
use; this branch's flush-to-zero form is kept beside it, unused, and its
test is ignored until the console's float mode for the instruction is
checked.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 19:00:31 -05:00
fxcelessandClaude Fable 5.2 a56ad16e30 Take the test/fx-prs branch of asdaasdsaddf's fork (as one commit)
Double-precision shader instructions (v_cvt_f32_f64, v_add_f64 sums, the
makeDouble overload name and flag), a first half of a paired interpolation
read as data, sooner eviction of idle textures and caches under memory
pressure, a retried DirectStorage destination write, the texture catch-up
budget, VICTORY_FIRSTLANE_OWN, and zlib-rs in place of miniz_oxide.

Left out: the fork's personal launcher scripts and its readme.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 19:00:31 -05:00
Vyacheslav VenglovskyandClaude Opus 5.5 a78124a866 GPU: the indirect clamp's groups past a count touch the budget not at all
An execution may ask for thousands of records with a count buffer that
counts a few: the clamp runs a group per 64 asked. Before the charge per
group, the threads past the count returned at once; with it, the first
thread of every group read the budget word, and for mesh records added
the group's notes to it, records or none. In memory the CPU maps that is
up to three atomics across the bus per empty group (on an RTX 5070 an
in-game A/B of 32c6229 ran slower, #220). Now a group without records
makes no atomic; the group's barriers stay in uniform control flow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:54:13 +01:00
Vyacheslav VenglovskyandClaude Opus 5.5 3911ebf4fe GPU: the indirect budget lives in the card's memory
The clamp charges the list's budget with atomics: at least an atomic
read and a compare-and-swap in a row for every clamp, so for every
indirect execution clamped on its own. The budget was in memory the CPU
maps (zeroed on the CPU at submission), so on a card of its own each of
those crosses the bus.

Now the words live in a device-local buffer of the list. The list zeroes
it before its first clamp (WriteBufferImmediate, as a copy), the clamps
charge it as before, and when the list closes the clamp's notes on mesh
records are copied to the mapped words, where the next submission reads
them for the frame line as before. VICTORY_INDIRECT_CARD_BUDGET=0 keeps
the old place, for an A/B; lists without ID3D12GraphicsCommandList2 keep
it too.

Test: a recording whose clamps spend the whole budget, then one with a
small record after the reset, which runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:35:20 +01:00
Vyacheslav VenglovskyandClaude Opus 5.5 3bcfe0d777 GPU tests: the benchmark also runs with the budget in the card's memory
Two more cases, one record at a time and windows of 32, with this
tree's clamp and the budget words in a device-local buffer instead of
CPU-mapped memory: whether the clamp's atomics crossing the bus are
what a draw clamped alone still costs on a card.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:12:47 +01:00
Vyacheslav VenglovskyandClaude Opus 5.5 6e903827d1 GPU: the clamp walks only its group's records; benchmark against main's clamp
- The clamp's charge per group walks the group's own records (one, for a
  record clamped alone) instead of all 64 slots.
- The host-list tests read the debug layer's messages after closing the
  list and before the submission, which moves them to the log (review).
- The benchmark lives in its own file and records five cases: what main
  records, one record at a time and in windows of 32; what this tree
  records, both ways; and windows with the new barriers but main's clamp,
  to tell the two changes apart. main's clamp is kept in the benchmark to
  measure against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:06:29 +01:00
Vyacheslav VenglovskyandClaude Opus 5.5 5311e74c6e GPU: the indirect clamp charges the budget once per thread group
The clamp charged the list's budget record by record: an atomic read and
a compare-and-swap loop per record on one word, every thread of a window
racing for it, so a group of n records took n rounds and about n*n/2
atomics. The word is CPU-visible memory (zeroed on the CPU at
submission), so on a card of its own each of them crosses the bus. On an
RTX 5070 Ti the benchmark's windows of 32 took 46-50 ms for 3,200 draws
where draws clamped one at a time took 19 ms (#220).

Now the records' costs go to group-shared memory, one thread charges
their sum with one compare-and-swap (retried only if another group got
there first), simulating the same saturation record by record in lane
order, and every thread reads whether its record fitted. The mesh
diagnostics (largest group count asked, groups asked in all) are summed
in the group and added once. What a record costs and when it runs empty
are unchanged; which records of a group fit is now their lane order
instead of the order the GPU served the race.

Test: a group with 300 left of the budget keeps its first draw (100),
empties the second (250, which takes the rest) and the ones after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:59:58 +01:00
Vyacheslav VenglovskyandClaude Opus 5.5 41e30d260d GPU tests: a benchmark of the indirect scratch buffer's barriers
A frame's worth (3,200) of one-record indirect draws of our own, clamped
one at a time and in windows of 32, recorded with the old barriers (back
to the common state after every execution) and the new ones, timed with
GPU timestamps around the list. Ignored by default; any machine with a
GPU runs it in seconds, no title files needed:

cargo test -p victory-gpu --release --lib indirect::bench -- --ignored --nocapture

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:47:12 +01:00
Vyacheslav VenglovskyandClaude Opus 5.5 2136b81420 GPU: the indirect scratch buffer stays readable between executions
Every indirect execution was followed by a move of the list's clamped
arguments back to the common state, and the next clamp moved them from
common to unordered access. Drivers may treat a barrier into or out of
the common state as a full wait, so even the window path
(VICTORY_INDIRECT_WINDOW=1), whose draws skip the clamp, still recorded
one barrier between every two draws.

The list now remembers that its scratch buffer was left readable as
indirect arguments: executions read it with no barrier of their own, the
next clamp moves it straight back to unordered access, and it returns to
common once, when the list closes or a bigger buffer replaces it. The
waits for earlier shader writes around the clamp are unchanged.

Tests: two windows of executions with no barrier between them, on WARP
and through a host list; the tracked state across clamps, growth and
reset; the existing clamp tests follow the new states. With
VICTORY_D3D12_DEBUG=1 in a diagnostics build, the host-list tests also
check that the debug layer reports nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 23:34:30 +01:00
fxcelessandClaude Fable 5.2 43ebd22d7d Put the parked lane-mask change (#11) back
The previous commit took it out; that was not wanted. The tree is again as
it was before that commit.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 17:00:18 -05:00
fxcelessandClaude Fable 5.2 149217c8d3 Take the parked lane-mask change (#11) back out for now
Its programs translate and run, but on the test machine the lighting gain
could not be shown, it costs about 40 ms of GPU time per frame, and the
picture is being re-checked one change at a time from a known-good tree.
It may come back once that is settled.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 16:59:43 -05:00
local 204047cb5c Merge PR 45 2026-11-24 15:43:53 -06:00
local 78b1b826c8 Merge PR 42 2026-11-24 15:43:53 -06:00
local 17b8f7a661 Merge PR 38 2026-11-24 15:43:53 -06:00
local 78c07b5dca Merge PR 23 2026-11-24 15:43:53 -06:00
localandClaude Opus 5.5 e878a2dd17 Pipeline workers follow the CPU; one pad that never disconnects
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 15:43:53 -06:00
local a3809d60ac Merge PR 52 2026-11-24 15:30:10 -06:00
local d0f3fee60d Merge PR 40 2026-11-24 15:30:10 -06:00
local c79740ecb8 Merge PR 25 2026-11-24 15:30:10 -06:00
local 2208ebdf5f Merge PR 9 2026-11-24 15:30:10 -06:00
local a20bc61afe Merge PR 58 2026-11-24 15:30:09 -06:00
local 2b6b7af66f Merge PR 51 2026-11-24 15:30:09 -06:00
local 922df97fea Merge PR 24 2026-11-24 15:30:09 -06:00
fever308 dfe94c875e gpu: share video_memory query in heap_textures and lower 16 GB cutoff to 12 GiB 2026-11-24 15:08:01 -06:00
fever308 cf9d5f174a gpu: lower 16 GB VRAM budget cutoff to 12 GiB and saturate env override shifts 2026-11-24 15:07:05 -06:00
SlopComp 676c4dc672 Textures: guarded textures are hashed at every check while they may change behind the guard
The guard on view memory sees no write made through another view of the
same pages; such a change was found only by the hash every eighth frame.
The boot logo video and the loading animation write their textures that
way every frame (a ring of three): each showed up to eight frames late
and in turns, so the presented picture cycled through three, a new one
every eight frames, and flickered. The six-star screen of the first
seconds changed before the hash ever caught it.

A guarded texture is now hashed at every check for its first 64 frames,
and for 64 frames after each change the guard missed; textures that stay
unchanged go back to every eighth frame.
VICTORY_TEXTURE_HOT=0: every eighth frame only, as before.
2026-11-24 14:59:18 -06:00
jaschinski97-ops a12b78b84c Skip first-half use tracking when no interpolation is present 2026-11-24 21:58:36 +01:00
jaschinski97-ops cad2f292b9 Shaders: retain live interpolation first halves 2026-11-24 21:57:30 +01:00
pgm1207 83b37dfcf9 GPU: no blending on integer render targets in host pipelines
The console ignores blending on integer render targets and the title
leaves it on (the world has a mesh pipeline blending into an R8_UINT
target). D3D12 does not allow it: vkd3d-proton refuses such a pipeline
with E_INVALIDARG and its draws are lost. The host pipeline now turns
blending off on integer targets; with one description for all targets,
each target gets its own copy so the others keep theirs.
2026-11-24 21:53:48 +01:00
fever308 79bf8e78db gpu: scale texture VRAM floor and per-frame staging budget from VRAM 2026-11-24 14:53:05 -06:00
fever308 9de50d2a0e gpu: auto-scale card buffer limits from local VRAM budget 2026-11-24 14:49:10 -06:00
Noname0202 5d297a21f6 Shaders: use makeDouble.f64 overload and DXIL ShaderFlags bit 2 for DOUBLES 2026-11-24 21:47:24 +01:00
jaschinski97-ops 7c9f7d9c0c Shaders: lower row permutations on wave32 hosts 2026-11-24 21:45:58 +01:00
spacede b647cc7107 GPU: parallelize copy refreshes on multicore hosts 2026-11-24 21:45:38 +01:00
spacede a6b9b79c3f GPU: document adaptive copy refresh 2026-11-24 21:45:29 +01:00
fxcelessandClaude Fable 5.2 29f9e89df6 The game is no longer named in the tree
Comments, documents and descriptions now say "the title". No code changes.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 15:45:05 -05:00
cxccxcandClaude Opus 5.5 57fcf21b80 Shaders: restore parked lane-mask pairs a few instructions apart; relative VGPR reads keep parked lanes (#11)
The console compiler parks a wave64 lane mask in two lanes of a spare VGPR
and may restore the halves with other instructions between the two
v_readlane_b32. The pair restore now looks ahead in the block (nothing between
may touch the second register, write the first, or save into the lanes), so
the mask comes back as a mask. This lets indirect_light_probes
CS_IrradianceCache_Shade / ShadeSecondary translate: they were dropped every
frame, leaving the irradiance cache unlit and everything in shadow black.

An M0-relative read (v_movrels_b32) names every VGPR from its base up, which
marked the parking VGPR as an ordinary one and turned unspilling off for the
whole program. Relative reads no longer count there (relative writes still
do). billboard_nobump CS_RaytracingResolve_a56bfb9c translates with it.

translate: VICTORY_TRANSLATE_ONLY=<hash prefixes> limits a run to those
containers; VICTORY_HOST_MAX_WAVE=32 translates as on a 32-lane host, so
--pipelines matches what the runtime creates on NVIDIA.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-24 15:35:04 -05:00
oddiums 8013dd54cf Fix mesh pipeline test on unsupported GPUs (#14) 2026-11-24 15:35:00 -05:00
Noname0202 b5f681d29f Shaders: lower immediate samplers chosen by uniform control flow 2026-11-24 21:23:58 +01:00
NuraadGit f4c1e12bef GPU: constant buffer views of at most 64 KiB
The host removes the device for a constant buffer view of more than 65,536
bytes. The title's view heap holds larger sizes in slots it does not use,
and the size went to the host as it was.
2026-11-24 15:22:26 -05:00
fxcelessandClaude Fable 5.2 d7823e8a38 Shader clean-up passes; a test that needs a card skips without one
- Clean-up passes over each translated module (VICTORY_SHADER_OPT bits: dead
  code, folding, reuse, branch facts, loads within a block, wave64 first-lane
  exchange), part of the shader cache key. About 43 % fewer host instructions
  over the pack; about 20 ms less GPU time per frame on the test machine.
- translate: a census of the emitted code.
- Checked with plain game runs of this tree on the test machine.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 15:13:27 -05:00
warmooff-ops a693932416 hle/gameinput: increase reading history from 32 to 256 for low-FPS frames 2026-11-24 21:12:31 +01:00
Noname0202 881c2ccb90 Shaders: model v_add_f64 whole-wave sums and s_mov_b32 copies 2026-11-24 20:39:19 +01:00
fxcelessandClaude Fable 5.2 df7b68f167 Shader tests: recognise the software adapter from the device's own adapter
Hosted runners list a display stub first, so the default device there is the
software adapter; the tests that need a real card now skip it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 14:32:07 -05:00