The probes' resolve can leave magenta/violet leftovers from other memory in
the light image. The raise pass caps what it keeps by luminance only, which
weights blue at 0.07, so a blue-heavy leftover passes the cap and shows as a
saturated purple-blue glow on bright surfaces (a sheet of music on the wall
in the prison cell cutscene, Series S, DLSS off, RTX 5080).
VIctory-Belobug-AMD drops magenta leftovers here (ambient.rs, "Filter
magenta garbage probes"); that line is ported, plus one for the bluer kind
(blue over 2.5x green and over red) that the first leaves as a faint violet.
Sky light (green above 0.4x blue) and sunsets (low blue) are not touched.
Checked with VICTORY_CAPTURE frames of the same cutscene: the glow is gone
in two runs; frame time unchanged (~35 ms median, 25-27 fps). Turning off
VICTORY_AMBIENT_SPECULAR, VICTORY_AMBIENT_AIR or all VICTORY_AMBIENT*
does not remove it (it is the title's leftover, unbounded with the raise off).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port of fxceless/victory-fork#1324 (commit 52ac4ec, GPL-3.0).
HostHeap::release previously matched only the title heap's pointer address. When a title releases a shader-visible heap before lists referencing it are reset, and a new heap is allocated at the same address, resetting the older list freed dynamic slots belonging to the new heap. On NVIDIA (where VICTORY_DYNAMIC_SLOTS=524288 is active), two live command lists could then overwrite each other's descriptors.
Each HostHeap now gets a monotonic identity (NEXT_ID) recorded alongside dynamic slot ranges in draw::State::dynamic and checked in HostHeap::release.
Tested with VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --lib --features diagnostics descriptor:: (50 passed, 0 failed), including dynamic_slots_are_given_back_only_to_the_heap_that_took_them.
The submitting thread runs above normal, but the threads it waits for
(the wide pool, the landing pools, heap records, the heap pass beside
the lists) ran at normal priority, level with the title's threads and
the list translators. On a six-core CPU they were often not running
while it waited. VICTORY_HELPER_PRIORITY (on unless 0, VICTORY_AB can
flip it) raises them to above normal.
A/B in one run on an i5-12400F with an RTX 3060 (run10, Series S at
540p, off / on): 8.6 / 9.6 fps, refreshes 23.1 / 17.6 ms a frame,
waiting for heap records 6.2 / 2.5 ms, card idle behind the submitting
thread 24.7 / 13.2 ms.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
raw_at / raw_uav_at: a range past the buffer's end is shortened to the
whole dwords that fit; an unaligned start, or one with no whole dword left,
becomes a null view. The meter line counts the cuts (past end, shortened,
sub-dword, unaligned) for SRVs and UAVs. On by default;
VICTORY_RAW_VIEW_CLAMP=0 gives the old descriptors.
Original author: lichenlang89 (fxceless/victory-fork pull request 1266,
dd5e8c9e). Ported by hand from CuteBooty/victory-8gb, same code and tests;
the counters go into this tree's meter line in host.rs.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Fullscreen, the English keyboard and the mouse capture now run only when
asked for (VICTORY_FULLSCREEN=1, VICTORY_MOUSE_CAPTURE=1,
VICTORY_IME_ENGLISH=1), so a start that sets nothing keeps the window and
input as before. The F1 menu has the three of them (FULLSCREEN (NO BORDER),
MOUSE CAPTURE, ENGLISH KEYBOARD); a change applies at the next start.
Checked: victory-hle, victory and the menu tests, with the three unset and
with all three set to 1.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Started with no command (a double click) or as `victory play [exe]`, the
program finds game_scarlett_master.exe beside itself and starts it with the
settings scripts\play-foxhound.ps1 gives it, built in (apps/victory/src/play.rs):
the same switch table, what the F1 menu saved over it, DLSS and frame
generation made ready where NVIDIA's files are, the frame rate cap, and
`--set NAME=VALUE` for anything else. Nothing is written beside the program
or into the title's folder: the menu's settings file, a log for every start
(play-<utc>-<pid>.log, the newest ten kept) and NVIDIA's files are under
%LOCALAPPDATA%\victory, where the caches and saves already are.
NVIDIA's DLSS and frame generation files stay NVIDIA's and are not part of
the program: a first start without them asks once whether to fetch them from
NVIDIA's GitHub, and `victory get-dlss` does it later (the fetcher script,
embedded, with a new -To).
victory-core logging: VICTORY_LOG_FILE adds a plain-text log file.
README: the quick start is the release's exe (download, put beside the
title, double click); building it yourself is kept below.
Checked on an RTX 5070: no title beside it (a clear error), a file of that
name (found, Streamline loaded), get-dlss (66.6 MB in 38 s, files identical
to the SDK's), two muted runs of the title from a folder of the program's own
(25-28 fps in the opening rooms, right picture, nothing written beside it),
and a start from the title's folder by the user.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Water: on hosts of 32-lane waves the water's two tiled light programs
(water_shading:CS_TransmissionVolumetrics_Tiled 5dc3b25986622949 and
_Tiled_LocalLights 6f225b641c5b0708) translate in the wave-wide form only,
and in that form leave whole tiles of open water dark (around boats, along
shores, under bridges) at about 15 ms of the card a frame. They are left out
there (pipeline/make.rs); VICTORY_WATER_LIGHT=1, or WATER LIGHT in the F1
menu, runs them as before. Runs on a copy of a save on the first boat ride,
RTX 5070, Series X 1440p DLSS Quality: 25 fps with the blocks before, 30 fps
without them after; the water is darker and bluer without that light.
fxceless/victory-fork's README of 2026-11-27 names the same two programs and
form.
Stats panel: host/panel.rs is built without the diagnostics feature too (the
recording time is counted in diagnostics builds only), has a frame generation
line, and is switched by F3 or by STATS PANEL (F3) in the menu, live. The FPS
line at the top is hidden while the panel shows.
README: both, and where the panel is.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
On readmet3xt-lab/foxhound 02fc18a, which becomes this fork's base.
- host/menu.rs: the F1 settings menu, in every build (it was in the
diagnostics build only): DLSS mode and model, frame generation, frame
rate cap, console profile, picture size, the light estimates and the
main speed switches. Saved to victory-settings.txt, applied by the
launcher at the next start; "save and restart" from the menu. The title
gets no keyboard while it is shown (gameinput.rs).
- host/font.rs: the dot letters, moved out of the diagnostics panel so
that the menu has them in every build.
- streamline.rs: VICTORY_FRAMEGEN_X=2..6, the frames shown for each one
rendered (no more than the state says this card generates); 0: ready
but off. The amount and off/on change while the title runs
(set_framegen, from the menu). Result 39, "warning: out of VRAM", is
taken as set: asked again at every present it showed no generated
frame at all (1,828 times in one run on a full 12 GB card).
- The frame rate at the top left of the picture while the menu is closed:
frames rendered a second, and with frame generation those shown
(VICTORY_FPS_LINE=0: not). The window's caption says both too.
- scripts/play-foxhound.ps1: applies what the menu saved; -FrameGenX;
-Fps defaults to 1000 (no cap: VICTORY_FRAME_INTERVAL_US=1000); frame
generation is made ready at every start with Streamline so that the
menu can switch it (-NoFrameGenReady: not), with a share of the card's
memory held back for it (VICTORY_TEXTURE_ROOM_PERCENT 80 on, 86 ready);
NVIDIA's files are looked for in nvidia-sdk\ here; builds the layer when
it is not built. scripts/play-nvidia.ps1 is the same launcher under
this fork's old name.
- Get-NVIDIA-DLSS.cmd / scripts/get-nvidia-sdks.ps1: fetch the eight
NVIDIA files that are loaded (about 70 MB) out of NVIDIA's Streamline
release into nvidia-sdk\ (git-ignored). They are NVIDIA's, under
NVIDIA's licences, and are not part of this repository.
- README for this fork; foxhound's own is kept as docs/README-foxhound.md.
Measured on an RTX 5070 (Series X, native 2560x1440, DLSS Quality,
opening rooms): mostly 26-30 frames a second rendered; in Streamline's
own check 2x, 4x and 6x show exactly 2, 4 and 6 frames for each one
rendered.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Play session 2026-11-27 (open water, the stand-in running every frame once its tables were found): dark ragged
patches lay on the water around a boat, following it. The alpha layer's rays are of transparent surfaces
(glass, foam, wakes), but the depth the stand-in reads is the opaque one behind them: on water, the bottom. The
normal and the reflected direction made of it are wrong and the estimate dark. The alpha layer is now left as
the title has it (sky light), as water already was; VICTORY_AMBIENT_SPECULAR_ALPHA=1 puts it back for interiors.
Counted with water on the 10-s line.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run final-4 (2026-11-27 02:11): with placed views resolved the miss program's tables were found, but the stand-in
was still left out ("another image", format 26): the depth taken failed the size check. The depth must now be
twice the rays' image each way (1706x960 for 853x480) and 32-bit, at the usual place or found among the tables.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's routine at image+0x1e86440 reserves 185 MB of graphics memory
below 4 GiB, splits it into five pieces, takes all their physical pages
in one XMemAllocatePhysicalPages and maps them in order: one stretch of
one section. Its 174 MB buffer at 0x34e10000 (the ring of constants, and
what the skinning passes write through one view of all of it) had a host
copy in the card's memory, ~17 MB a frame sent up in ~600 pieces, shader
writes fetched back and compared, and ~6,000 constant fills a frame.
With the switch the stretch is mapped once more at an address of ours and
opened as a host heap there (OpenExistingHeapFromAddress1); title buffers
and windows in it are buffers placed in that heap, the existing in-place
form of a host copy: nothing tracked, sent up, fetched back or compared.
The title's own views stay free to change; when it maps other pages
there the region is forgotten. A line on the frame-rate report counts
the CPU fills and buffer copies of ours that still read or write it.
Replay (play-1125-0127, heap in the PC's memory): the title's own work
+~3 ms on the card; the 30 ms added there are our compare passes, which
do not run over memory in place.
Ported from Belobug/VIctory-Belobug-AMD 86dc109 (author: local); conflict with heap_marks in host.rs kept both.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run final-3 (2026-11-27 02:03): the reflections stand-in still never ran; the new line named the miss program
06bb6e728c7c99bf with its depth (0,1000) and most textures unresolved ("-"): those are views of textures the
title placed in its memory (View::Placed), which the lookup took for nothing. They are resolved through
placed_texture now, as the draw path does. The stencil check of 296ae68 read word 5 of the view description as
the plane; the union of D3D12_SHADER_RESOURCE_VIEW_DESC starts at word 4, so word 5 is the levels and the plane is
word 6: every one-level 2D view counted as a stencil plane (final-3 logged the diffuse stand-in's depth place
(0,464) as one, and the reflections' cube maps). Fixed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The helper that read capture haze2 found the diffuse stand-in's depth place (0,464), after the
_ReflectiveCaustics variant 34fb51b8a0312e82, naming the stencil plane of the scene depth #6481: the estimate then
put every point far away with its normal to the camera (a likely part of the flat floors). A view of a stencil
plane (formats X32_TYPELESS_G8X24_UINT, X24_TYPELESS_G8_UINT, or a 2D view of plane 1) is not taken as depth any
more: another depth view of the program's tables of the image's size is (logged once).
For the reflections stand-in, which runs final-1 and final-2 show running in one 10-s window only ("other
tables" ~50 times a second): once per miss program whose rays' image or depth is not found, an info line lists
what its tables hold (kind, place, size, format, stencil), so the next run names them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run final-1 (2026-11-27 01:44, VICTORY_AMBIENT_SPECULAR=1): the stand-in ran in one 10-second window only (27
frames, 56 dispatches); 416 dispatches of CS_RayMiss were left as the title had them, the log saying "other
tables": variants of the miss program bind the rays' image and the depth at other places of their tables than
06bb6e728c7c99bf's (1,104) and (0,1000). Where the usual place has nothing, the first table entry of that kind
that fits is taken: a 2D R11G11B10 image; a 2D 32-bit depth (typeless or D32, with or without stencil) at least
the image's size and at most four times its width.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The helper was stopped before its final report (user asked for all work in the main branch); its branch was
clean and on a906dcc. Built and tested at this merge; not yet measured in the game.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Without the structure builder every reflection ray the screen-space march leaves misses, and CS_RayMiss
(06bb6e728c7c99bf) writes the sky's light into the rays' texture (#38965, 853x480 R11G11B10, capture
C:\dev\captures\haze2): mean RGB (6.7, 10.9, 18.9) against (0.72, 0.44, 0.50) for the lit scene in the same
units, 100-1000x the room it should show and blue (the user's "reflections show a bright colour"; eyes glowing
blue-white, blue blotches on floors). Not a cleared or stale texture, and the cube maps are the sky's.
With the switch, right after each CS_RayMiss of opaque surfaces and of the alpha layer (not water: its first
root constant is 2), a pass of ours reflects the view direction about the normal made from the depth CS_RayMiss
itself reads (table (0,1000): #46202, a 1706x960 D32 target drawn in list 167 of the frame, before the trace)
and writes share x the light stand-in's directional estimate along it (ambient.rs, from
CS_CacheScreenSpaceRadiance), mixed with <sky> of the title's colour and never brighter than the estimate;
sky pixels (depth at the far plane) keep the title's value. CS_ResolveScreenSpace then writes its own hits
over it, so screen-space reflections stay. Expected cost under 0.15 ms a frame at 1706x960 (three dispatches).
A line every 10 s says it ran.
Written by a helper; built and tested at the merge into local/drive. A side finding to check: the diffuse
stand-in's depth slot (ambient::DEPTH, (0,464)) may name the stencil plane of #6481 after the
_ReflectiveCaustics variant 34fb51b8a0312e82.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A console pixel program whose DB_SHADER_CONTROL has DEPTH_BEFORE_SHADER
(bit 12, HLSL's [earlydepthstencil]) is translated with DXIL's
ForceEarlyDepthStencil flag when VICTORY_EARLY_DEPTH=1. The translator read
DB_SHADER_CONTROL but never used it, so every such program ran with the late
test on the host wherever it writes unordered views or discards, and its
writes to unordered views landed for pixels the depth test then rejected.
What that broke (capture C:\dev\captures\haze2, a character's head in front
of a window): the transparent pass (list 247; pixel programs
629743ca412296d4, 8ba01719b71d1d35, 5436c45060d74ebe and others,
DB_SHADER_CONTROL 0x1450) keeps the nearest transparent depth and its
velocity with 64-bit atomics in texture 46225 (R32G32, 1706x960); draw
271:34 (pixel 00ae3e9b98a0ae26, depth test ALWAYS, depth write on) writes
that depth into the scene depth 6481 and that velocity into the motion
vectors 38269 wherever it holds one. The glass, behind the head, wrote
there too: at the head's pixels in front of it the scene depth that the
heat-haze and in-scattering pass 731a39171b568298 (279:303) reads holds the
glass's (0.176, 0.85 m, for the head's 0.39, 0.38 m) and the motion vectors
hold the glass's velocity (-24, +31 where the head's own is +43, +35).
13.7% of that frame's transparent texels lie behind the opaque depth. The
haze pass picks heat haze (beyond 20 m) and in-scattering (beyond 137 m
there) by each pixel's distance, in 16x16 tiles: where the false depth is
far, it works on character outlines (expected cause of the blocks on hair,
not yet confirmed in a run).
The switch joins the shader cache's key only while it is on, so the default
translation and its cache entries stay as they were. Counted at the shader
cache's log line: programs given the early test, left late (switch off),
left late as they write depth or stencil. Tests: the decision, and a pixel
program translated with and without the switch (dxil.dll validates it).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Chain z1 (from the main path): A (new defaults) gameplay 33.9 ms p95 34.7, cutscene 38.8 ms p95 55; B (VICTORY_QUEUE_MARKS=0 VICTORY_QUEUE_BATCH=0, the old behaviour) gameplay 39.5 ms p95 54, cutscene 40.4 ms; C (TABLED_REREAD=1) 37.2 / 40.2 ms; D (QUEUE_HOST_TEXTURES=0) 36.4 / 41.8 ms.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported from Belobug/VIctory-Belobug-AMD 673be0e and a609a2f (renderer
port 7, its heaps' records part; the journal in 64 parts, which shares
the switch VICTORY_PORT_JOURNAL there, is not taken). There the lane
waited 4.5-5.2 ms a frame for the heaps' records and port 7 took 2.4 ms
off it. Here the submitting thread waited 2.7-5.8 ms a frame for them
(release run 233354).
A round of the heap-sync thread is asked for when the title submits
(Lane::push, round_after), so it runs while the submission waits in the
line (12-15 are in it when one is added), and the submitting thread waits
for that round (begin_sync_heaps_after), or for a later one if a wait of
its queue that was met in memory went since (the queue's floor in the
line), or a step of ours wrote, or may have written, a heap's title
memory while preparing an earlier submission (heap_marks::prep_wrote:
buffer copies into a heap, copies at their place, our own steps). Added
here: a submission that waited for flights to land begins a round of its
own after the wait, as without the switch. With the switch off nothing
is marked, asked or counted. VICTORY_HEAP_SYNC_FIRST applies only to a
submission without a mark.
Not behaviour-neutral in timing: a record the title writes for a
submission after submitting it (or after a wait behind which the
submission stands was met) is left to a later round, as the console's
card could miss it too. Off by default. The frame line "the heaps'
records asked for at the title's submit" gives the wait per frame, the
rounds asked at a submit, the preparings that found theirs asked earlier
or had to ask, and those that wrote a heap's memory. Tests: the round
given begins after the call (heap_marks), and the line's marks with
waits and parts taken along (queue::behind).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported from Belobug/VIctory-Belobug-AMD a284ca7 (its per-job timing and
timeline phases are left out; both switches are on by default there and
off here).
VICTORY_SPANS_QUICK=1: a slot written with no placed texture view leaves
the heap's spans of placed views (and their lock) alone when the slot is
not in them (HostHeap::spanned, a bit per slot that may be there). Every
record the round of the heaps' records mirrors went by that one lock,
from its six threads, with the title's threads and the texture passes:
there, 4 of the 16 ms a frame the submitting thread waited for the round
were its threads waiting on that lock (run city4). What is done is the
same: forgetting a slot that is not there does nothing.
VICTORY_SYNC_FINE=1: the round gives its threads 2 pages and 64 records a
job instead of 8 and 256: a round for a submission finds a dozen pages,
which were two jobs on two of six threads while the submission waited.
Neither changes what is mirrored. Off by default. The frame line "writes
of view slots per frame (VICTORY_SPANS_QUICK=1)" counts writes that left
the spans alone and those under their lock, and the job size; the heaps'
records line's "ms waited for" shows the gain.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported from Belobug/VIctory-Belobug-AMD 15ab94e (and the test's type from
8822ed4; that commit's turning it on by default is not taken).
The round of the heaps' records (descriptor::sync_heaps) read each changed
page through the kernel into a copy, then compared the copy with the
records last seen: two passes over every page. With the switch each
record of 32 bytes is read in place once by the fault-safe copy code
(safecopy::changed, AVX2), compared with the one last seen, and put over
it where it differs; a page the title unmaps meanwhile fails the read as
the kernel's read failed, the records before it taken as read. Measured
there: copy 7.4 and compare 5.3 ms a frame of six threads for 35 MB. Here
the round's reading and comparing was 2.6-3.1 ms a frame (release run
233354), and the submitting thread waits 2.7-5.8 ms a frame for rounds.
Changes nothing of what is mirrored (the same records found changed);
reads title memory in place instead of through the kernel. Off by
default. With it on, the frame line "the heaps' records read where they
are" counts pages and those not all there; the heaps' records line's
"reading and comparing" and "ms waited for" show the gain.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The round that mirrors descriptor records the title copied into its
heaps as bytes runs on a thread of its own, begun after the submission
planned its steps done on the card and looked at flights, and waited for
at the end of the preparing. That wait was 2.7-5.8 ms a frame of the
submitting thread in release run 233354 (heaps' records line, "ms waited
for"), 5% of its samples in profile-y-prof60 (SyncedHeaps' drop), while
the planning ahead of the round's start took 2-4 ms a frame.
With the switch a submission sent ahead begins the round as soon as it
holds the submission lock, so it runs beside that planning too. A
submission that waits for flights to land (settle or relay wait) begins
another round after the wait, as the round began there saw what they
landed; the first is then not waited for.
Not behaviour-neutral in timing: the round reads the heaps' pages earlier
by the planning's time. A record the title writes for a submission after
submitting it is left to the next round (the console's card could miss
it as well). Off by default. The frame line "the heaps' records begun as
a submission took the lock" counts the rounds begun first and those begun
again; the heaps' records line's "ms waited for" shows the gain.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
shadow::wide woke every kept thread (4 on 16 hardware threads) for each
call, however few its jobs: a submission's refresh_front with 2 copies to
refresh woke 4 threads, 3 of which found nothing and slept again. Waking
is a system call per thread on the calling thread
(NtAlertThreadByThreadIdEx, 2.4% of the submitting thread's samples in
profile-y-prof60, 1.3% under shadow::wide), and the threads woken for
nothing take processor time from the others on a machine where ready
threads already wait to run ("woken, not running yet" 1.4-6.1 ms of the
frame's chain in timeline tl.170).
Now one thread is woken for each job beyond the one the caller takes,
all of them only when there are jobs for all. A thread busy meanwhile
looks at the queue before it sleeps, and the caller takes every job
nobody took, as before, so no job waits for a thread.
Behaviour-neutral: the same jobs run, on the same threads. On by default,
no switch.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every submission (28 a frame) made its Batch anew: the table of pending
refreshes by copy, the staging buffers seen (with the standard hasher),
the copies refreshed ahead; and three walks over its steps each built a
hash table of the copies from nothing: the spans of the one write-watch
asking, the spans of copies shaders may be writing (stale_under_flights),
and refresh_front's copies. In profile-y-prof60 hash tables growing and
inserting under Host::submit were 2.4% of the submitting thread
(reserve_rehash and HashMap::insert), heap allocation and freeing more.
Now the Batch is kept per thread, emptied with its room, for the next
submission. The per-copy spans of all refreshes are found in one walk
(Batch::copy_spans) and serve the asking (the copies asked ahead, as
before), the stale check behind flights (the copies with writes pending,
as before) and refresh_front, which takes the copies' references from
them instead of a table of its own. The staging buffers seen use the
address hash.
Behaviour-neutral: the same ranges are asked about (in another order;
the asking sorts them), the same spans are looked at in the same order,
the same refreshes are made. On by default, no switch.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
At every submission each of the title's lists gets a new host list, from
the pool of landed lists (reset when they landed) or newly made: open and
empty. It was closed at once on the submitting thread, so that the
title's next call on its list, a reset, found it closed, and that reset
then reset allocator and list once more. About 200 empty closes a frame
on the submitting thread (HostList::close under list::detach, 3% of its
samples in profile-y-prof60, about 1 ms a frame) and 200 needless resets
on the threads that translate lists.
Now the new host list is left open and marked with its title calls and
epoch; the title's reset finds it so and skips the D3D12 reset (the rest
of the reset, scratch memory, states, steps, is done as before). If the
title submits the list again without a reset, the host list is closed
when it is taken to run, as before. If anything was recorded into it
before the reset (its title calls or epoch moved), it is closed and
reset as before.
Behaviour-neutral: the lists that run on the card are the same (these are
empty either way). On by default; VICTORY_FRESH_OPEN=0 closes them at
once as before. The frame line "new host lists for the title's lists
left open per frame" counts them, the resets that had nothing to undo and
those closed after all.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The split of a submission's preparing (write watch, title bytes under
flights' writes, the lists' steps and their refreshes, card copies, the
waits for the heaps' records, sending) was counted in diagnostics builds
only. It is now counted in every build, some forty clock reads a
submission, and logged every second as "preparing per frame, the
submitting thread: N ms in its submissions: ...", with the time after
each sending (the flight noted, landed lists reset and given back). The
line of the thread that does the line says what it spent taking
translated lists out of the line (new host lists closed for the title's
lists), which is outside its "worked" time. Diagnostics builds print the
same line in place of their old first split line; their other split
lines are as they were.
Behaviour-neutral: counting and logging only.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported from Belobug/VIctory-Belobug-AMD 5d6bd84 ("Upload title textures in
submission prelude to fix frame-order & flickering"), where it is the only
way. A list records the upload of a title texture it samples only if the
staging buffer was changed when the list was recorded; the check at
submission may then find the memory changed and detile it, and only the
next list that samples the texture uploads that: a frame late when every
list of the frame was recorded before the check (a video's ring of buffers
shows an older picture, a texture streamed in its last one). A candidate of
the flicker at scene loads (analysis 6.12).
With the switch, `texture::upload_from` records nothing in the list: it
leaves a `PreludeUpload` (staging buffer, host copy, levels on demand) with
the list, and its `Step::Texture` as before, so the checks run where they
ran. At submission, after the list's steps, the staging buffers left pending
are refreshed (`Batch::refresh_textures`), and each texture whose host copy
was never uploaded or whose staging buffer was detiled since its last upload
is claimed (`claim_upload`; once per change, whichever lists of the
submission sample it) and copied on the list's prelude (`HostList::prelude`):
aliasing barrier for a pooled texture's first upload, to the copy
destination state and from there to the state the list starts with. What
the list's own upload did after the copy (a host copy grown, levels on
demand given memory, what the host copy holds) is done at the claim.
Kept as before: bakes (they record their copies whatever the check finds)
and movie planes. Left out of the port: the texture store's prefill (this
tree has none), the fork's refreshes before every copy and run step (here
`title_written` flushes the textures due already), the fork's change of
`Step::Texture`'s payload (the upload is held beside it instead, so the steps'
other readers, `card_steps` and `place`, are untouched), and its panel
change (unrelated).
Off by default (not behaviour-neutral: when textures are uploaded changes).
Tests (from the fork): a claim per change, in the same submission; a ring of
three buffers never shows an older picture.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported from Belobug/VIctory-Belobug-AMD 4cd2d13 and 91018a5, where it is on
by default. Every device loss with the texture pool in that fork's report
(n08, n11, n15, steps-ab2, start-3, a user's play-1125-2107 without ray
tracing) was a page fault at the first byte of a texture in a block made
that millisecond, its title slot changed "at once" (`mirror`) while lists
sent before read that slot by index; VICTORY_SHOW_AFTER covers only some
paths (a draw's table, the texture pass's own uploads). We run the pool.
With the switch, `HostHeap::mirror` holds a slot whose new view shows a
pooled texture made while a submission begun before it may still run
(`pool::begun_before`: the submissions begun when it was made, noted in
`pool::made_now`) on what it showed, or the neutral texture if that cannot
stand for it (`keep_shown`), and flips it when every such submission has
finished (`FLIPS`, `texture_slots_flip`); a slot held back is held once, not
again at each draw or pass that reads it (`NEW_PENDING`, 91018a5). A line
says how many slots were held back since the start (with the switch on).
Also an A/B switch in diag builds (VICTORY_AB).
Off by default (not behaviour-neutral: a slot shows its new texture one or
more submissions later); with it off, `made_now` notes nothing more than
before and nothing else changes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ported from Belobug/VIctory-Belobug-AMD c278f0d. That fork places pooled
textures of 64 KiB and less at 64 KiB multiples by default (4 KiB multiples
only with VICTORY_POOL_SMALL=1): its two device losses with the pool on the
night of 2026-11-25 faulted in 256x256 block-compressed textures with 7
levels placed at a 4 KiB multiple that is no 64 KiB one, whose descriptor
base lay 0xa000 into the piece and whose first level ended 0x2000 past it,
read by the card the moment the slot was made. Not proven to be the cause.
Here the switch keeps its name and meaning, with our default: unset or 1,
4 KiB multiples where the host allows it, as before; VICTORY_POOL_SMALL=0,
64 KiB multiples (at most 60 KiB more card memory per small texture). Also
an A/B switch in diag builds (VICTORY_AB). Diag builds with the address book
say loudly when a pooled texture's first level lies past the end of its
piece (`where_the_card_reads`, `book::address`), and where the first levels
of the first 40 lie.
The fork's test of a placed texture's reference to its heap is left out
(a measurement of the host; the fork weakened it in 4cd2d13).
Off by default: changes where pooled textures lie and how much card memory
they take.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title asks for 33,333 us (SetFrameIntervalX) because its graphics
settings hold a frame rate of 30 (settings +0x210): +0x1e0fb30 and
+0x22434a0 turn it into a frame time (+0x98f84ac), +0x247ab10 picks the
interval from it and the display's 60/120 Hz (a 120 Hz mode alone changes
nothing at 30), and +0x120530 is a QueryPerformanceCounter limiter of its
own at the same rate.
VICTORY_FRAME_INTERVAL_MS=<ms> (16.667, 8.333, 0 = no wait): frame.rs ticks
at that interval whatever the title sets; the loader makes the two loads of
the setting "mov eax, rate; nop" (rate = 1000/ms rounded, 0 = the title's
own "no limit"), with the original bytes checked. VICTORY_TITLE_FPS=<n>|off
overrides the rate or leaves the title alone. Diagnostics:
VICTORY_TIMER_LOG=1 logs the title's timers once a second and frame pacing
bands every 5 s.
Ported from Belobug/VIctory-Belobug-AMD 49cb83b (author: local); the descriptor-site module of renderer port 2 left out. Our VICTORY_FRAME_INTERVAL_US (our clock alone) still works; VICTORY_FRAME_INTERVAL_MS is read first.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pass reads the view a slot holds at the start of the slot's turn (under
the views table's read lock: the record, the view by its number, a copy of
it). For a slot shown after its upload (VICTORY_SHOW_AFTER=1, in the
launcher) or flipped from an earlier view of the same texture, it read the
same record and view again a few microseconds later to make the host
texture and its upload. It uses the first read now. Other threads waited
86-383 ms per 5 s of a cutscene for the views table's lock
(coolfox-20261126-233017).
Behaviour-neutral: the record may change between two reads, and using the
first is as if the second had come that much earlier; a write of the slot
meanwhile queues it again, as before. Slots made at once (the other path)
are unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A slot's record of a texture object the host renders to or writes (a
target, depth or unordered access texture) is queued for the pass over
textures picked by index like any texture. The pass takes such a slot,
finds nothing to bring up to date (it makes and uploads nothing for it) and
takes it out; the title writes such views into its tables' slots every
frame, so they come back, each time a take of the queue's lock, a place
among the slots due and a few microseconds of the pass (58,978 of 90,699
slots taken in 5 s of a cutscene found nothing to do,
coolfox-20261126-233017 18:02:23; 18ff932 says how many were such views).
With the switch, such a record takes the slot out of the queue as a buffer
view's does (`note_buffer`; with the queue's marks, without its lock when it
is not queued). Counted since the start in the lock line.
Off by default (not behaviour-neutral, though the pass did nothing for these
slots): fewer slots are due, so a pass reaches others sooner, the catch-up
budget (VICTORY_TEXTURE_CATCHUP, started by the count due; off in the
launcher) starts less often, and a bake's pass is asked for less often (it
runs when the queue's write count changed).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A slot draws read through a table leaves the queue of textures picked by
index at its first table read of a frame only (`tabled_in`, once per slot
and frame; and the draws of a recording tell of a record once,
`Listed::tabled`). The title rewrites tables' slots while it records: a
slot written after that read is queued due `TABLED_GRACE` (8) frames on, the
draws that read it later in the same frame leave it there, and the pass
takes it 8 frames later and finds it uploaded by those draws or nothing to
do: 17,000-58,000 slots in 5 s of a cutscene (coolfox-20261126-223059,
analysis 6.6; "read through tables" and much of "nothing to bring up to
date" in the pass's split line).
With the switch, such a later read takes the slot out when the queue's marks
(b5b7806) say it holds it, a lock-free look (without the marks it does
nothing: every read would take the lock), and the recording's gate lets a
slot the queue holds through, so the draw also makes the title's slot in
place as at a first read (`mirror_after`). Counted in the lock line: slots
taken out by a table read after the first of their frame, since the start.
Off by default (not behaviour-neutral): a shader that picks such a slot by
index then sees what the draw made of it at once, not what the pass makes 8
frames later; that lateness is a candidate of the flicker at scene loads
(analysis 6.12).
Test: written after its frame's first read, a slot waits for its grace
frames; a later read takes it out with the switch only.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pass over textures picked by index took the queue's lock once or twice
for every slot it took: to ask what is known of the slot (a texture uploaded
whole, waiting for a look again) and to tell what came of it. In 5 s of a
cutscene it took 90,000-250,000 slots, and its "telling the queue" was
143-400 ms, about all of it waiting for the lock (152-355 ms by the pass;
coolfox-20261126-233017 18:02:18-18:02:23).
- What it found of a slot (done, uploaded in part, uploaded whole and looked
at again, nothing to upload now, held for room) is told 16 slots at a time
under one take of the lock (`HostHeap::texture_slots_told`), the rest when
the pass ends, on every way out. A slot's entry is told of a few slots'
work later, as it would be if the pass's thread were held up for that
long; what is told of a write the queue no longer holds is dropped as
before (`TextureQueue::same`).
- What the queue knows of a slot waiting for a look again is read while the
slots due are taken, in the same take of the lock
(`HostHeap::texture_slots_due_known`), and used if the queue's marks
(b5b7806) say it still holds the write handed out; else it is asked as
before.
Behaviour-neutral: the queue ends as it would with each slot told at its
turn (test), only some microseconds later. On by default;
`VICTORY_QUEUE_BATCH=0` tells and asks each slot at its turn, as before.
The lock line (18ff932) counts the lock taken by the pass apart.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every slot record a recording thread, the heaps' records thread or a draw
makes is noted in the queue of textures picked by index under its one lock
(`HostHeap::queue_texture`), and so is every first table read of a slot in a
frame (`tabled_in`) and every slot a newer view makes stale. Most of these
change nothing: a buffer view, a sampler or a null taken out of a queue that
does not hold the slot; a slot a draw or the pass made from the record the
queue holds already (`seen`, kept as it is); a table read of a slot not
queued. Other threads waited 33-44 s for the lock in a run of 150 s
(coolfox-20261126-232343, -233017), up to 3.3 s in 5 s of a cutscene.
The queue now marks, per title slot, the write of the entry it holds (0:
none; `QueueMarks`, set by the queue itself under its lock). These three
places read the mark first and do not take the lock when it says nothing
would change. Behaviour-neutral: a mark read while the queue changes it
says what the queue held just before or just after, as if the lock had been
taken a moment earlier or later, which any of these threads may always do;
writes (not `seen`) always take the lock. Counted as "not taken" by place
in the lock line (18ff932). On by default; `VICTORY_QUEUE_MARKS=0` takes the
lock every time, as before (for comparing).
Tests: the queue marks what it holds through writes, makes, looks, uploads
in part, memory made due and removals; notes that change nothing leave the
queue (and its marks) as they were.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The split line of 7d8d56a found, per run of ~150 s, 3.8-5.2 s of the pass
and 33-44 s of other threads waiting for the lock of the queue of textures
picked by index, and 5.0-7.0 s in "slots shown after their upload, flipped
or made at once" (coolfox-20261126-232343, -233017). Two more 5-second lines
say where:
- the queue's lock by place (`descriptor::queue_site`: the pass asking of or
telling of a slot, taking the slots due, making slots due, noting a slot's
record, table reads, stale views, else): the times it was taken, the waits,
how long the places that hold it for many slots held it (the slots due,
slots made due, stale views), and the times it was not taken (none yet);
- the pass's parts: slots made at once, shown after their upload and
flipped (time and count); the slots with nothing to bring up to date by
why (views of textures the host writes, no texture, the host's own
texture) and how many of them the pass made at once; the work before the
loops (slots made due, views made again and flips, taking the slots due).
A lock taken is counted by one relaxed add under it; hold times are timed
only at the places that hold it for many slots. Nothing else changes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With VICTORY_FRAMEGEN=1 and presents through Streamline's swap chain:
"DLSS Frame Generation, time per frame: the presenting thread N ms
before the present call, N ms in it (the longest N ms), N ms after it;
of those N ms in the latency markers and N ms asking frame generation's
state; an upscaling recorded in N ms (N ms of it waiting for the lock it
shares with the present); the copy of the colour without the interface
recorded in N ms". Counting and logging only; nothing is timed without
frame generation.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Series X the title blends its interface target over the frame itself:
one triangle (vertex 0602c2384acbb3b2, pixel a78d088fa55aa495), the last
draw into the texture it presents. With VICTORY_FRAMEGEN=1 the target is
copied into a texture of ours in front of that draw, at its place in the
title's list, and the present tags the copy as kBufferTypeHUDLessColor
(VICTORY_FRAMEGEN_HUDLESS=0: not). Log: the first copy, each other
pipeline that draws into a presented texture, and counts every ten
frame-rate lines.
Found reading the in-game path:
- Frame generation's constants get the camera's planes in order (the
title names the far plane first; the projection took 10000 for the
near plane of an endless range). DLSS Super Resolution's are as before.
- With Streamline's swap chain the system's Alt+Enter is not taken.
- Video memory is logged before the first present with frame generation
on and 240 presents later.
upscaler-check: a stand-in colour without the interface is tagged with
--present; with a device the check ends with frame generation off, the
swap chain let go and slShutdown (VICTORY_CHECK_TEARDOWN=0: not): the
exit code is 0, where the process failed fast at its exit before
(0xC0000409, shown as 9). VICTORY_STREAMLINE_PRESENT=1 (off): with DLSS
and no frame generation our swap chain is Streamline's proxy of it, which
ends "presentCommon() was not observed" (the check runs it with
--present: 120 upscalings and presents).
With VICTORY_FRAMEGEN off and the new switches unset the title runs as
before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_SOFT_VIEWS=1 (pool: the title's XMemMapPhysicalPages views alone;
copies: those of CopyPageMappingsBatchX alone): a view is noted in the
runtime's books and told to the GPU side as mapped, its addresses are one
placeholder of their own, and the host maps nothing. Each view of the host's
was a MapViewOfFile3 (45 us) and later an UnmapViewOfFile2 (93 us), both
behind a lock of the kernel's that the guards' protection changes take too:
445,503 maps (20.1 s) and 349,175 unmaps (32.6 s) in 143 s of run stream2,
359,969 mapping calls 23.8 s, 3,294 page-mapping copies 33.7 s, one of them
467 ms of a 608 ms frame (timeline tl.120).
Who gets the bytes of such a view, and how:
- DirectStorage writes pages by number through the section's own view, and
page-mapping copies read the pool from the books: as before.
- The GPU side's reads of title memory (host::read, read_sparse) take them
from the pages through the section's view (xmem::soft_read); a texture
with such views is read through a copy, not in place; texture::committed
takes such views for committed.
- The guards keep such a view in their books (watch::protect_here,
protect_alias): no VirtualProtect, no question to the host. A write the
runtime tells of, or one through another view of the page, opens it as
before.
- Any touch of the memory itself (the title's CPU, a direct read of ours)
faults; the GPU side's handler has the runtime map the view and the access
is made again; the guards then open it and every other view of its page
(title_memory_made_real). Our writes through the kernel, announced kernel
writes, and the title's XMemVirtualQuery, XMemVirtualAlloc, VirtualFree
and (with the switch) VirtualQuery and VirtualProtect ask first.
Why VICTORY_LAZY_VIEWS=1 ran at 2 fps (run xw-lazy, 2.4 to 3.4 GB of copies
a frame): a view guarded together with a lazy view of the same page was
never clean, because the host refuses to protect a placeholder
(protect_alias), so it was copied again at every asking; and every guarded
range made its lazy views real. Both are what the books replace here. Also
for both switches: a view is known as lazy before the GPU side is told of
it (a refresh in between noted the block absent), and its pages are
committed when it is noted (the GPU side writes them through its own view
of the section).
Counted: the streaming log's M line gets twelve more fields with either
switch (noted, let go untouched, made real; noted by mapping calls, by
copies; made real by a fault of the title's code, of other code, asked for
by the GPU side, by a call of the title's; reads served from the pages,
their KiB; such views now), and with VICTORY_SOFT_VIEWS the log has a line
of the same every 10 s, with the last faulting address and code.
Tests: xmem and host views_in_the_books_alone_are_read_from_their_pages, watch
a_view_in_the_books_alone_is_guarded_there. Not run in the game yet.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The texture pass's question whether a staged texture's memory is all there
is still put to Windows for textures made at an address the title mapped
(the console's usual placed textures; a question per 256 pages). The
runtime's views of physical pages answer it where they cover the memory, as
they already answer `mapped_bytes` for placed views: one look, under a
microsecond where Windows took 3 us (350 KB), 135 us (22 MB) and 647 us (22 MB,
1 MB there) (look_costs on this PC). Windows is asked only where no view
lies. `VICTORY_MAPPED_BY_VIEWS=0` asks Windows, as for `mapped_bytes`;
`VICTORY_STAGED_ASK_ALL=1` still asks Windows of every texture.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The census counted a slot uploaded whole and waiting for its looks again
(RECHECK_FRAMES 4, 12, 40, 120, 400 frames: in the queue up to 576 frames
after its upload) as "waiting for their memory", and its old write as "the
oldest". In coolfox-20261126-223059 at 17:02:04 the queue line said 19,277
waiting for their memory when the looks that had found memory not there
numbered 1,700 in the whole run (17:01:45: 6,842 vs 104; 17:01:59: 19,023 vs
471): nine in ten or more of them were uploaded textures waiting for a look
again, not streaming. They are counted apart now ("uploaded whole and waiting
to be looked at again"), and "the oldest" is of slots not uploaded yet.
A new 5-second line says how late first uploads are: slots served for the
first time at their first look, with the frames they had been due before the
pass took them (the pass's own lateness: its time cap), and slots served
after their memory was found not there, with the frames since their write
(streaming: mapping that came late).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`texture::staged(_, ask)` asked Windows whether every page of the texture's
memory is there (QueryWorkingSetEx per 256 pages, and a one-byte read of each
page not in the working set) for every texture object the pass took: 20,000 to
57,000 every 5 seconds, most of them slots read through tables, which the pass
only marks done. A whole run found 66 not all there. The pass's unattributed
time followed their count: rest = 400 ms + 12.7 us x tabled slots per 5 s over
the run's lines (coolfox-20261126-223059, e.g. 17:02:57 57,760 -> 1,136 ms,
17:03:58 17,786 -> 629 ms). Measured here (pass_costs): 18-111 us for 1-16 MB
resident, 0.9-15 ms when the pages had been trimmed.
Only a resource made at an address the title mapped can lose its memory while
it lives; a committed resource's memory and a heap's are allocated and zeroed
whole when made. So the question is asked of those alone
(`resource::at_title_address`); `VICTORY_STAGED_ASK_ALL=1` asks of every
texture, as before. Expected: the cutscene's 846 ms "rest" per 5 s drops by
about 13 us x the tabled slots (400-700 ms), gameplay's ~690 ms by ~250 ms.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pass over textures picked by index logged 846 of 1,408 ms (cutscene,
coolfox-20261126-223059) as "the rest". A second line now splits it:
telling the queue what came of each slot, reading the slots' records,
fingerprints after uploads and same-looks, handing first uploads to the
copy queue ahead, slots shown after their upload / flipped / made at once,
asking whether a staged texture's memory is all there, other checks; the
waits for the queue's and the views table's locks (by the pass and by other
threads, counted only when the lock was held: try_lock first); the work
before the loops (not in "all"); passes by kind (frame, early, bake) with
their time and how many stopped at their time or bytes; and the slots taken
by outcome.
The existing parts are summed in nanoseconds now: in microseconds each short
call lost what it took below the next whole one.
The pass reads the slot's view once for its placed and object checks (it
read it twice).
pass_costs (ignored test, a measurement): on this PC asking whether 1/4/16
MB of resident memory is all there takes 18/23/111 us, 0.9-15 ms when the
pages were trimmed from the working set; a fingerprint 3-7 us.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With VICTORY_WC_NO_BACK=1 for every write-combined copy, cutscenes on the
4070 SUPER went near black (run xd-wcnoback): small results the title reads
back came back stale. 3,245 write-combined copies, median 4 KB, 82 of 1 MB
or more, 7 of 16 MB or more (largest 90 MB). Leaving only copies of 1 MB or
more on the card keeps the image (fixed frames equal to the plain run) and
the saving: with DLSS Quality, gameplay 38.3 -> 33.3 ms, cutscene median
47.3 -> 36.3 ms, p95 205 -> 142 ms, title's busiest thread 57 -> 47% of a
core (runs xd-base-b, xd-wc1m; 16 MB: 35.3 ms, xd-wc16m).
Co-Authored-By: Claude Opus 5.5 <[email protected]>