Commit Graph
698 Commits
Author SHA1 Message Date
trustno1-coder 3f60eeee0b Merge pull request #29 from Ahyildiz/fix/ambient-probe-garbage
Ambient: drop violet probe garbage before the raise (purple blotch on lit paper)
2026-11-27 01:45:58 -08:00
trustno1-coder dc6dc87098 Merge pull request #28 from wike1701/fix/dynamic-slot-heap-identity
GPU: release dynamic descriptor slots only to the host heap that allocated them
2026-11-27 01:45:53 -08:00
trustno1-coder 7c04c61735 Merge pull request #24 from CuteBooty/fix/raw-view-clamp
fix(gpu): raw buffer views stay inside their buffer (VICTORY_RAW_VIEW_CLAMP)
2026-11-27 01:32:00 -08:00
trustno1-coder b98279b65e Merge pull request #22 from Indy2l/perf/helper-priority
perf(cores): run the submitting thread's helpers at its priority
2026-11-27 01:31:55 -08:00
trustno1-coder 1a94d3ad55 Merge pull request #26 from CuteBooty/feat/skip-bink
feat(hle): skip the title's Bink movies on request (VICTORY_SKIP_BINK, off by default)
2026-11-27 01:31:50 -08:00
AhyildizandClaude Opus 5.5 826ba150c8 Ambient: drop violet probe garbage before the raise (purple blotch on lit paper)
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]>
2026-11-27 12:28:57 +03:00
wike1701 47747d6236 GPU: release dynamic descriptor slots only to the host heap that allocated them
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.
2026-11-27 10:04:21 +01:00
Indy2landClaude Opus 5.5 80c70b719f perf(cores): run the submitting thread's helpers at its priority
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]>
2026-11-27 09:44:12 +01:00
CuteBootyandClaude Fable 5.2 e31f474068 feat(hle): skip the title's Bink movies on request (VICTORY_SKIP_BINK, off by default)
VICTORY_SKIP_BINK=1 skips the movies that play once (logos, the intro);
=all skips the looping ones too. Unset, nothing changes: no import is
rebound. The title's own Bink DLL still opens each movie; the exports a
player loop calls on an open movie (BinkWait, BinkDoFrame*, BinkNextFrame,
BinkGoto, BinkShouldSkip, BinkClose) are bound to wrappers that put a
skipped movie on its last frame, so the title's own end-of-movie check ends
it at once.

Wiring for this tree (run.rs): SkipMovies wraps WithTitleDlls at startup,
so the executable's and its DLLs' imports go through it, with the
FidelityFX Interpose on top (it only looks at its own DLL and is unchanged);
and it wraps the resolver LateDlls binds DLLs the title loads later with.

Original author: C-GDev (fxceless/victory-fork pull request 613, 75fe122c;
the idea is from XCL pull request #1053, the code was written anew for
VIctory's loader). Ported by hand from CuteBooty/victory-8gb.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-27 00:56:49 -07:00
CuteBootyandClaude Fable 5.2 aec85efb10 fix(gpu): raw buffer views stay inside their buffer (VICTORY_RAW_VIEW_CLAMP, on; =0 restores)
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]>
2026-11-27 00:56:48 -07:00
fxcelessandClaude Fable 5.2 6726920a80 fix(formats): BC7 rotation only in modes 4 and 5 (BCPack)
BCPack blocks of modes 0-3, 6 and 7 with nonzero control bits 4:3 swapped
channel precisions and dropped the p-bit; only modes 4 and 5 have a BC7
rotation field. Always on (no switch), with a test.

Original author: fxceless (fxceless/victory-fork main 06702fe8, after
upstream VIctory pull request #3111). Carried in CuteBooty/victory-8gb;
applied here without conflicts.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-27 00:49:16 -07:00
Blitzball996 025abd3dc8 Input: PS5 pads (DualSense, DualSense Edge) read from HID, over USB or Bluetooth
XInput is read first; HID pads take the slots XInput leaves free (VICTORY_DUALSENSE: 0 off, 1 both, unset auto). dualsense.rs is taken unchanged; Host reads XInput in xinput() and keeps the HID owner of each slot; victory-hle gets Win32_Devices_DeviceAndDriverInstallation and Win32_Devices_HumanInterfaceDevice. The mouse capture (#17) and F1 menu paths are unchanged.

Source: LooperSalty/AnyXboxX third_party/victory crates/victory-hle/src/modules/gameinput/dualsense.rs
2026-11-27 14:43:53 +08:00
trustno1-coderandClaude Opus 5.5 06afe633e6 Window and input from #17: asked for, off by default, in the F1 menu
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]>
2026-11-26 21:53:38 -08:00
trustno1-coder c8212dfe92 Merge pull request #17 from superboynick: window and input (fullscreen, English IME, mouse capture) 2026-11-26 21:49:45 -08:00
trustno1-coderandClaude Fable 5.2 48ad7859fb victory play: the program alone, beside the title, is all there is to start
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]>
2026-11-26 21:28:35 -08:00
trustno1-coderandClaude Fable 5.2 35c156087e Open water without dark blocks; the F3 stats panel in every build
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]>
2026-11-26 20:39:26 -08:00
superboynick 4a0c8ea373 Window and input: fullscreen, English input method, and a mouse capture that leaves the pointer alone
Three switches, each on by default, each 0 restoring the behaviour before it: VICTORY_FULLSCREEN (borderless, VICTORY_FULLSCREEN_RES for another size), VICTORY_IME_ENGLISH (the window's input context to en-US), and VICTORY_MOUSE_CAPTURE (clip to the client area and hide the pointer, release on focus loss).

Capture also fixes a mistake in the mouse device merged as #9: it warped the pointer back to the centre after every sample, which pins the absolute position the title reads and makes the camera look frozen. Warping is now VICTORY_MOUSE_WARP, off by default; with it on the delta is taken from the centre.

Measured on an RTX 5070 Ti Laptop (12 GB): window 0,0-1920,1080 with a client area of the same size and GetClipCursor returning it. cargo build --release and --profile diag pass, cargo test -p victory-hle: 162 passed, 2 ignored.

Written with an AI assistant.
2026-11-27 12:12:12 +08:00
trustno1-coderandClaude Fable 5.2 22c6be2e76 F1 settings menu, frame generation 2x-6x live, no frame rate cap, FPS line
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]>
2026-11-26 19:41:59 -08:00
readmet3xt-labandClaude Opus 5.5 9f6fb7790d Reflections stand-in: opaque surfaces only; the alpha layer with VICTORY_AMBIENT_SPECULAR_ALPHA=1
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]>
2026-11-27 02:45:11 +05:30
readmet3xt-labandClaude Opus 5.5 9b91d2782c Reflections stand-in: the depth is the picture's, twice the rays' image each way
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]>
2026-11-27 02:15:51 +05:30
local 376f9832d6 Renderer port 1: know the 32-bit heap by the kind the title really asks with
Run port1-2: nothing was arranged and the heap was still scattered. The
title reserves it with kind 0x42000 (reserve, 0x40000), without the
64 KiB page bits, so it was not taken for a placeholder and was never
recorded. Any 32-bit reservation without commit is recorded now; the
test reserves the way the title does. A warning says once why pages
mapped there are left where they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 9c23e8dd40cac6fb4a2aa8c804587e7c2e2a5853)
2026-11-27 02:08:02 +05:30
local 35c57d666e Renderer port 1: the 32-bit heap's pages get their section's slices in address order
Run port1-1: the title maps the five pieces of its 185 MB heap in another
order than their addresses, so the heap was views of one section in a
scattered order ("not one stretch of a section: Scattered") and nothing
was placed. With VICTORY_PORT_CONSTANTS=1 xmem now gives the page numbers
mapped into a 32-bit graphics reservation the slices at their offset in
it, when the reservation is all one section and both slices are fresh
(never mapped or written: no commit bit), which the title cannot observe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 4b82f6c259d7a693e0e30eaaafc4c5a54b77d9e8)
2026-11-27 02:07:51 +05:30
localandClaude Opus 5.5 9075710d14 Renderer port 1: the title's 32-bit graphics heap used in place (VICTORY_PORT_CONSTANTS=1, off by default)
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]>
2026-11-27 02:07:40 +05:30
readmet3xt-labandClaude Opus 5.5 bda6e597da Light stand-ins: placed texture views resolved; the stencil check reads the view's plane, not its levels
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]>
2026-11-27 02:06:55 +05:30
readmet3xt-labandClaude Opus 5.5 d226814d91 Light stand-ins: never a stencil plane as the depth; a miss program's tables logged when its image or depth is not found
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]>
2026-11-27 02:00:11 +05:30
readmet3xt-labandClaude Opus 5.5 f89b79db0c Reflections stand-in: the rays' image and depth found by kind where a miss variant binds them elsewhere
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]>
2026-11-27 01:51:40 +05:30
readmet3xt-labandClaude Opus 5.5 f1edd66379 Merge agent/submit: submitting thread's work (time split in release, host lists reused, a submission's batch kept, spread work wakes only the threads it needs; on) and heap-record switches VICTORY_HEAP_SYNC_FIRST, VICTORY_SYNC_IN_PLACE, VICTORY_SPANS_QUICK, VICTORY_SYNC_FINE, VICTORY_HEAP_SYNC_AT_SUBMIT (off; the last three ported from Belobug/VIctory-Belobug-AMD 15ab94e, a284ca7, 673be0e+a609a2f)
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]>
2026-11-27 01:28:17 +05:30
readmet3xt-labandClaude Opus 5.5 ff18de231c Merge agent/reflect: A stand-in for reflections without rays (VICTORY_AMBIENT_SPECULAR=<share>[,<sky>], off by default)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:26:46 +05:30
readmet3xt-labandClaude Opus 5.5 ac7a591601 Merge agent/haze2: Pixel programs keep the console's early depth test (VICTORY_EARLY_DEPTH=1, off by default)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:26:46 +05:30
readmet3xt-labandClaude Opus 5.5 2db59d4813 A stand-in for reflections without rays (VICTORY_AMBIENT_SPECULAR=<share>[,<sky>], off by default)
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]>
2026-11-27 01:26:46 +05:30
readmet3xt-labandClaude Opus 5.5 41b4a056d6 Pixel programs keep the console's early depth test (VICTORY_EARLY_DEPTH=1, off by default)
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]>
2026-11-27 01:25:28 +05:30
readmet3xt-labandClaude Opus 5.5 fa08ad6808 Merge agent/belo: frame rate switch ported from Belobug/VIctory-Belobug-AMD 49cb83b, 08b88b8 (VICTORY_FRAME_INTERVAL_MS, the title's own 30 fps setting patched to match; off by default)
Only run so far (y-fr60-a) ran from a cold shader-cache path: not yet measured fairly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 01:25:21 +05:30
readmet3xt-labandClaude Opus 5.5 2ff3e4a3a0 Merge agent/texqueue-ports: texture queue lock work (marks, batched tells, split lines; on), VICTORY_TABLED_REREAD and VICTORY_QUEUE_HOST_TEXTURES (off); ports of Belobug/VIctory-Belobug-AMD c278f0d, 4cd2d13+91018a5, 5d6bd84 (VICTORY_POOL_SMALL, VICTORY_SHOW_NEW_LATER, VICTORY_PRELUDE_UPLOADS; off)
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]>
2026-11-27 01:25:20 +05:30
readmet3xt-labandClaude Opus 5.5 d2e24b3bc3 VICTORY_HEAP_SYNC_AT_SUBMIT=1: the heaps' records asked for at the title's submit
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]>
2026-11-27 01:11:03 +05:30
readmet3xt-labandClaude Opus 5.5 96dfd9bb89 VICTORY_SPANS_QUICK=1, VICTORY_SYNC_FINE=1: the heaps' records' round spared the spans' lock, in finer jobs
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]>
2026-11-27 01:11:03 +05:30
readmet3xt-labandClaude Opus 5.5 769fe52887 VICTORY_SYNC_IN_PLACE=1: the heaps' records read where they are and compared as read
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]>
2026-11-27 01:11:02 +05:30
readmet3xt-labandClaude Opus 5.5 66f7e545e3 VICTORY_HEAP_SYNC_FIRST=1: a submission's round of the heaps' records begun as it takes the lock
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]>
2026-11-27 01:11:02 +05:30
readmet3xt-labandClaude Opus 5.5 8c1fa5d578 Spread work wakes only as many kept threads as there are jobs for them
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]>
2026-11-27 01:11:02 +05:30
readmet3xt-labandClaude Opus 5.5 19720fee01 A submission's batch kept for the next one; one walk for the spans asked and looked at
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]>
2026-11-27 01:11:02 +05:30
readmet3xt-labandClaude Opus 5.5 a7b86676e7 New host lists for the title's lists left open for its next reset
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]>
2026-11-27 01:11:02 +05:30
readmet3xt-labandClaude Opus 5.5 ed252ec962 The submitting thread's time split on the frame line in release builds too
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]>
2026-11-27 01:11:02 +05:30
readmet3xt-labandClaude Opus 5.5 91df493ead VICTORY_PRELUDE_UPLOADS=1: title textures uploaded on the list's prelude, decided at submission after the check (off)
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]>
2026-11-27 01:08:54 +05:30
readmet3xt-labandClaude Opus 5.5 ee3fb5201a VICTORY_SHOW_NEW_LATER=1: slots show a texture made while earlier lists run only once those ran (off)
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]>
2026-11-27 01:08:54 +05:30
readmet3xt-labandClaude Opus 5.5 185bc4cc84 VICTORY_POOL_SMALL=0: pooled textures at 64 KiB multiples (off); diagnostics: a pooled texture read past its piece is said
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]>
2026-11-27 01:08:54 +05:30
local 45f6250378 Frame rate switch: the timers' shortest step follows the rate too (+0x2241fd0)
Run fps-1 (our clock at 16.667 ms, the title left at 30): the menus ran at
16.7 ms until the title's own limiter came up at 30 s (then 33.3 ms), and
meanwhile five of its seven timers stepped 33.3 ms a frame: game time ran
at twice the wall clock. The timer update (+0x2226040) takes the real time
since the last frame but at least 1/rate (+0x6849844), and that rate comes
from +0x2241fd0, a third read of the same setting. It now returns the rate
asked for (1000 for no limit), the original bytes checked first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 08b88b8266c2d0294d483d29b15534872ebc7da9)
2026-11-27 01:08:53 +05:30
localandClaude Opus 5.5 bacb402091 Frame rate switch: VICTORY_FRAME_INTERVAL_MS (our clock) and the title's own 30 fps setting patched to match (off by default)
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]>
2026-11-27 01:08:53 +05:30
readmet3xt-labandClaude Opus 5.5 13dca45ac6 Texture pass: a slot shown after its upload or flipped uses the view read at its turn's start
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]>
2026-11-27 01:03:43 +05:30
readmet3xt-labandClaude Opus 5.5 5dda41ddff VICTORY_QUEUE_HOST_TEXTURES=0: records of textures the host writes are not queued for the texture pass (off)
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]>
2026-11-27 01:03:43 +05:30
readmet3xt-labandClaude Opus 5.5 8625c3a00b VICTORY_TABLED_REREAD=1: a table read takes out a slot written after its frame's first read (off)
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]>
2026-11-27 01:03:43 +05:30
readmet3xt-labandClaude Opus 5.5 abf1020d25 Texture pass: tells the queue a batch at a time, takes what it knows of a slot with the slots due
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]>
2026-11-27 01:03:43 +05:30